/*
 * cGES design layer — brings the mobile app's look to the web admin.
 *
 * Loaded after the theme stylesheets. Colors come from the tokens injected by
 * App\Support\BrandTheme (resources/views/layouts/admin.blade.php), so whatever theme the
 * company picks in Settings, the same shapes, spacing, gradient and states follow it.
 * Mirrors cges-app/src/constants/theme.js and color.js.
 */

/* ─── Tokens ───────────────────────────────────────────────────────────────── */
:root {
    /* Fallbacks if the layout did not inject theme tokens. */
    --cg-primary: #557DF4;
    --cg-primary-rgb: 85, 125, 244;
    --cg-primary-mid: #4A6FE6;
    --cg-primary-dark: #3F64D8;
    --cg-primary-deep: #3A5BD0;
    --cg-hero: linear-gradient(160deg, var(--cg-primary) 0%, var(--cg-primary-mid) 55%, var(--cg-primary-deep) 100%);

    --cg-bg: #F5F7FC;
    --cg-surface: #FFFFFF;
    --cg-surface-muted: #F8FAFE;
    --cg-ink: #1E2538;
    --cg-ink-2: #55637A;
    --cg-ink-3: #7A879C;
    --cg-border: #E8EDF9;
    --cg-divider: #EEF2FA;
    --cg-input-border: #E3E9F7;

    --cg-radius-sm: 8px;
    --cg-radius-md: 12px;
    --cg-radius-lg: 14px;
    --cg-radius-xl: 18px;
    --cg-shadow-sm: 0 2px 4px rgba(var(--cg-primary-rgb), 0.06);
    --cg-shadow-md: 0 6px 16px rgba(var(--cg-primary-rgb), 0.12);
    --cg-shadow-lg: 0 10px 28px rgba(30, 37, 56, 0.08);

    --cg-good: #15803D;   --cg-good-bg: #DCFCE7;
    --cg-warn: #B45309;   --cg-warn-bg: #FEF3C7;
    --cg-info: #1D4ED8;   --cg-info-bg: #DBEAFE;
    --cg-bad: #B91C1C;    --cg-bad-bg: #FEE2E2;
}

html[data-cg-theme="dark"] {
    --cg-bg: #0F172A;
    --cg-surface: #1E293B;
    --cg-surface-muted: #172033;
    --cg-ink: #E2E8F0;
    --cg-ink-2: #CBD5E1;
    --cg-ink-3: #94A3B8;
    --cg-border: rgba(148, 163, 184, 0.18);
    --cg-divider: rgba(148, 163, 184, 0.12);
    --cg-input-border: rgba(148, 163, 184, 0.25);
    --cg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --cg-shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
    --cg-shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* ─── Canvas ───────────────────────────────────────────────────────────────── */
body {
    background: var(--cg-bg) !important;
    color: var(--cg-ink);
    -webkit-font-smoothing: antialiased;
}
.dash-container {
    background: transparent;
}

/* ─── Page header band (same as the app's hero) ───────────────────────────── */
.dash-content > .page-header {
    position: relative;
    overflow: hidden;
    background: var(--cg-hero);
    border-radius: var(--cg-radius-xl);
    padding: 22px 24px;
    margin-bottom: 24px;
    box-shadow: var(--cg-shadow-md);
    isolation: isolate;
}
/* Decorative orbs, as on the app hero */
.dash-content > .page-header::before,
.dash-content > .page-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}
.dash-content > .page-header::before {
    width: 260px;
    height: 260px;
    top: -120px;
    right: -60px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: -90px 60px 0 -70px rgba(255, 255, 255, 0.14);
}
.dash-content > .page-header::after {
    width: 200px;
    height: 200px;
    bottom: -120px;
    left: -60px;
    background: rgba(56, 189, 248, 0.2);
}
.dash-content > .page-header .page-header-title h4,
.dash-content > .page-header h4 {
    color: #FFFFFF !important;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.dash-content > .page-header .breadcrumb {
    margin: 0;
}
.dash-content > .page-header .breadcrumb-item,
.dash-content > .page-header .breadcrumb-item a,
.dash-content > .page-header .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.82) !important;
    font-weight: 500;
}
.dash-content > .page-header .breadcrumb-item.active {
    color: #FFFFFF !important;
    font-weight: 600;
}
/* Actions on the band read as glass / white buttons */
.dash-content > .page-header .btn-primary,
.dash-content > .page-header .btn-light-primary {
    background: #FFFFFF !important;
    border-color: #FFFFFF !important;
    color: var(--cg-primary-dark) !important;
    box-shadow: 0 2px 6px rgba(11, 27, 77, 0.12);
}
.dash-content > .page-header .btn-primary:hover,
.dash-content > .page-header .btn-light-primary:hover {
    background: rgba(255, 255, 255, 0.92) !important;
}
.dash-content > .page-header .btn-light,
.dash-content > .page-header .btn-secondary,
.dash-content > .page-header .btn-info,
.dash-content > .page-header .btn-success,
.dash-content > .page-header .btn-warning {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #FFFFFF !important;
}
.dash-content > .page-header .btn-danger {
    box-shadow: 0 2px 6px rgba(11, 27, 77, 0.12);
}
.dash-content > .page-header .form-control,
.dash-content > .page-header .form-select {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: transparent;
}

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--cg-surface);
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-xl);
    box-shadow: var(--cg-shadow-sm);
}
.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--cg-divider);
    padding: 16px 20px;
}
.card .card-header h5,
.card .card-header .h5 {
    font-weight: 700;
    color: var(--cg-ink);
    letter-spacing: -0.01em;
}
.card .card-footer {
    background: transparent;
    border-top: 1px solid var(--cg-divider);
}
.card .card-header:first-child { border-radius: var(--cg-radius-xl) var(--cg-radius-xl) 0 0; }
.card .card-footer:last-child { border-radius: 0 0 var(--cg-radius-xl) var(--cg-radius-xl); }

/* Stat avatars in dashboard cards */
.theme-avtar {
    border-radius: var(--cg-radius-md) !important;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    border-radius: var(--cg-radius-md);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:active {
    transform: scale(0.985);
}
.btn-sm {
    border-radius: 10px;
}
.btn-primary {
    box-shadow: 0 6px 14px rgba(var(--cg-primary-rgb), 0.24);
}
.btn-primary:hover,
.btn-primary:focus {
    box-shadow: 0 8px 18px rgba(var(--cg-primary-rgb), 0.3);
}
.btn-light {
    background: var(--cg-surface-muted);
    border-color: var(--cg-border);
    color: var(--cg-ink-2);
}
.btn:focus-visible {
    outline: 3px solid rgba(var(--cg-primary-rgb), 0.35);
    outline-offset: 2px;
}

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.choices__inner {
    border-radius: var(--cg-radius-md) !important;
    border-color: var(--cg-input-border) !important;
    background-color: var(--cg-surface);
    color: var(--cg-ink);
    min-height: 42px;
}
.form-control-sm,
.form-select-sm {
    min-height: 34px;
    border-radius: 10px !important;
}
textarea.form-control {
    min-height: auto;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--cg-primary) !important;
    box-shadow: 0 0 0 4px rgba(var(--cg-primary-rgb), 0.14) !important;
}
.form-label {
    font-weight: 600;
    color: var(--cg-ink-2);
    font-size: 0.82rem;
}
.form-check-input:checked {
    background-color: var(--cg-primary);
    border-color: var(--cg-primary);
}

/* ─── Tables ───────────────────────────────────────────────────────────────── */
.table > :not(caption) > * > * {
    border-bottom-color: var(--cg-divider);
}
.table thead th,
.dataTable-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cg-ink-3);
    background: var(--cg-surface-muted);
    border-bottom: 1px solid var(--cg-border);
    white-space: nowrap;
}
.table tbody tr {
    transition: background-color 0.12s ease;
}
.table-hover tbody tr:hover,
.dataTable-table tbody tr:hover {
    background: var(--cg-primary-soft);
}
.dataTable-top,
.dataTable-bottom {
    padding: 14px 20px;
}
.dataTable-pagination a {
    border-radius: 9px !important;
}
.dataTable-pagination .active a {
    background: var(--cg-primary) !important;
    color: #FFFFFF !important;
}

/* ─── Badges & pills ───────────────────────────────────────────────────────── */
.badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.38em 0.75em;
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
/*
 * Root size: 120% = 19.2px at the browser default (was 16px). Every rem-based size — text,
 * buttons, inputs, spacing and the tokens below — grows together, so the scale stays in
 * proportion. A percentage (not px) keeps respecting the user's browser font setting.
 * Resulting sizes: body ≈ 16.8px, secondary ≈ 15.6px, captions ≈ 14.4px, page titles ≈ 28.8px.
 */
html { font-size: 120%; }

/*
 * Two typefaces (loaded in the layouts):
 *  - Inter: body, tables, forms, navigation. Legible at small sizes, tabular figures for data.
 *  - Plus Jakarta Sans: headings, page titles and headline numbers.
 * Noto Sans Bengali follows each stack so Bangla names render in a matching face
 * (Google Fonts serves it by unicode-range, so it only downloads when Bangla text appears).
 */
:root {
    --cg-font-display: "Plus Jakarta Sans", "Inter", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-font-sans-serif: "Inter", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 0.875rem;      /* 14px base */
    --bs-body-line-height: 1.55;
    --cg-text-xs: 0.75rem;              /* 12px  captions, table headers */
    --cg-text-sm: 0.8125rem;            /* 13px  secondary text */
    --cg-text-md: 0.875rem;             /* 14px  body, nav */
    --cg-text-lg: 1rem;                 /* 16px  card titles */
    --cg-text-xl: 1.25rem;              /* 20px  section titles */
    --cg-text-2xl: 1.5rem;              /* 24px  page titles */
}
body {
    font-family: var(--bs-font-sans-serif);
    font-size: var(--bs-body-font-size);
    line-height: var(--bs-body-line-height);
    font-feature-settings: "cv11", "ss01", "ss03";
    text-rendering: optimizeLegibility;
}
h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.625rem; }
h3, .h3 { font-size: 1.375rem; }
h4, .h4 { font-size: var(--cg-text-xl); }
h5, .h5 { font-size: var(--cg-text-lg); }
h6, .h6 { font-size: var(--cg-text-md); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--cg-font-display);
    color: var(--cg-ink);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
/* Headline numbers on dashboards read best in the display face, with even digit widths. */
.att-kpi-value, .dk-kpi-value, .lv-balance-value, .lv-stat-value, .dk-today-value,
.dash-info-card h3, .stats h3, .card h3.mb-0, .card .h3 {
    font-family: var(--cg-font-display);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.modal-title, .card .card-header h5, .card .card-header .h5 { font-family: var(--cg-font-display); }
.text-muted { color: var(--cg-ink-3) !important; }
small, .small { font-size: var(--cg-text-sm); }
.table, .dataTable-table { font-size: var(--cg-text-sm); font-variant-numeric: tabular-nums; }
.dash-content > .page-header .page-header-title h4,
.dash-content > .page-header h4 { font-size: var(--cg-text-2xl); }
.notifier-container, .daterangepicker, .select2-container, .choices { font-family: var(--bs-font-sans-serif); }

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
html body .dash-sidebar,
html body .dash-sidebar.light-sidebar,
html body .dash-sidebar.light-sidebar.transprent-bg {
    background: var(--cg-surface) !important;
    border-right: 1px solid var(--cg-border);
    box-shadow: none !important;
}
[dir="rtl"] html body .dash-sidebar { border-right: 0; border-left: 1px solid var(--cg-border); }

/* Brand */
html body .dash-sidebar .m-header {
    height: 64px;
    padding: 0 20px;
    border-bottom: 1px solid var(--cg-divider);
}
html body .dash-sidebar .m-header .b-brand { display: flex; align-items: center; height: 100%; }
html body .dash-sidebar .m-header .logo-lg {
    height: auto !important;       /* overrides the inline 80px */
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
}

/* Scroll area */
html body .dash-sidebar .navbar-content {
    padding: 12px 12px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--cg-primary-rgb), 0.18) transparent;
}
html body .dash-sidebar .navbar-content::-webkit-scrollbar { width: 6px; }
html body .dash-sidebar .navbar-content::-webkit-scrollbar-thumb { background: rgba(var(--cg-primary-rgb), 0.18); border-radius: 3px; }

/* Top-level items */
html body .dash-sidebar .dash-navbar > .dash-item { margin: 2px 0; }
html body:not(.minimenu) .dash-sidebar .dash-link { margin: 0; }
html body .dash-sidebar .dash-navbar > .dash-item > .dash-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 6px 10px !important;
    border-radius: 10px;
    color: var(--cg-ink-2) !important;
    font-size: var(--cg-text-md);
    font-weight: 500;
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body .dash-sidebar .dash-link .dash-mtext::after { display: none; }
html body .dash-sidebar .dash-micon {
    width: 30px;
    height: 30px;
    margin: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0;
}
html body .dash-sidebar .dash-micon i {
    font-size: 1.125rem;
    color: var(--cg-ink-3) !important;
    transition: color 0.15s ease;
}
html body .dash-sidebar .dash-arrow { color: var(--cg-ink-3); transition: transform 0.2s ease; }
html body .dash-sidebar .dash-arrow svg { width: 15px; height: 15px; }
html body .dash-sidebar .dash-hasmenu.dash-trigger > .dash-link .dash-arrow { transform: rotate(90deg); }

/* Hover */
html body .dash-sidebar .dash-navbar > .dash-item:hover > .dash-link,
html body .dash-sidebar .dash-navbar > .dash-item:focus-within > .dash-link {
    background: var(--cg-surface-muted) !important;
    color: var(--cg-ink) !important;
}
html body .dash-sidebar .dash-navbar > .dash-item:hover > .dash-link .dash-micon i { color: var(--cg-ink-2) !important; }

/* Active: soft tint, brand text and icon, left indicator */
html body .dash-sidebar .dash-navbar > .dash-item.active > .dash-link,
html body .dash-sidebar .dash-navbar > .dash-item.dash-trigger > .dash-link {
    background: var(--cg-primary-soft) !important;
    color: var(--cg-primary-dark) !important;
    font-weight: 600;
}
html body .dash-sidebar .dash-navbar > .dash-item.active > .dash-link .dash-micon i,
html body .dash-sidebar .dash-navbar > .dash-item.dash-trigger > .dash-link .dash-micon i {
    color: var(--cg-primary) !important;
}
html body .dash-sidebar .dash-navbar > .dash-item.active > .dash-link::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--cg-primary);
}
[dir="rtl"] html body .dash-sidebar .dash-navbar > .dash-item.active > .dash-link::before { left: auto; right: -12px; border-radius: 3px 0 0 3px; }

/* Submenu: indented under a guide line */
html body .dash-sidebar .dash-submenu {
    position: relative;
    margin: 2px 0 6px 25px;
    padding: 2px 0 2px 12px;
    border-left: 1px solid var(--cg-border);
    background: transparent !important;
}
[dir="rtl"] html body .dash-sidebar .dash-submenu { margin: 2px 25px 6px 0; padding: 2px 12px 2px 0; border-left: 0; border-right: 1px solid var(--cg-border); }
html body .dash-sidebar .dash-submenu .dash-item::before { display: none !important; }
html body .dash-sidebar .dash-submenu .dash-link {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px !important;
    margin: 1px 0;
    border-radius: 8px;
    color: var(--cg-ink-2) !important;
    font-size: var(--cg-text-sm);
    font-weight: 500;
    background: transparent !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body .dash-sidebar .dash-submenu .dash-item:hover > .dash-link {
    background: var(--cg-surface-muted) !important;
    color: var(--cg-ink) !important;
}
html body .dash-sidebar .dash-submenu .dash-item.active > .dash-link {
    color: var(--cg-primary-dark) !important;
    background: var(--cg-primary-soft) !important;
    font-weight: 600;
}
html body .dash-sidebar .dash-submenu .dash-item.active > .dash-link::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 3px;
    background: var(--cg-primary);
}
html body .dash-sidebar .dash-submenu .dash-item { position: relative; }
html body .dash-sidebar .dash-submenu .dash-submenu { margin-left: 8px; }

/* Collapsed sidebar (minimenu): keep icon-only items centred */
html body.minimenu .dash-sidebar .dash-navbar > .dash-item > .dash-link { justify-content: center; padding: 6px !important; }
html body.minimenu .dash-sidebar .dash-submenu {
    margin: 0;
    padding: 6px;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    background: var(--cg-surface) !important;
    box-shadow: var(--cg-shadow-lg);
}

/* ─── Sidebar width ────────────────────────────────────────────────────────── */
/*
 * One token for the sidebar width. The theme hard-codes 255px in ten places (sidebar, header
 * offset, content margin, footer, sticky headers, mobile off-canvas); all follow this now.
 * 300px fits the longest labels ("Notification Template") on one line at the 120% root size.
 */
:root { --cg-sidebar-w: 300px; --cg-sidebar-mini: 70px; }

html body .dash-sidebar,
html body .dash-sidebar.light-sidebar { width: var(--cg-sidebar-w); }
html body .dash-sidebar .main-logo,
html body .dash-sidebar .m-header {
    min-width: 0;
    min-height: 64px;
    max-height: 64px;
    justify-content: flex-start;
}

@media (min-width: 1025px) {
    html body .dash-header,
    html body .dash-header:not(.transprent-bg) { left: var(--cg-sidebar-w); }
    html body .dash-container,
    html body .dash-header:not(.transprent-bg):not(.dash-mob-header) ~ .dash-container { margin-left: var(--cg-sidebar-w); }
    html body .dash-footer { margin-left: var(--cg-sidebar-w); width: calc(100% - var(--cg-sidebar-w)); }
    html body .sticky-action.sticky .card-header { left: calc(var(--cg-sidebar-w) + 30px); }

    /* Collapsed (icon-only) sidebar */
    html body.minimenu .dash-sidebar { width: var(--cg-sidebar-mini); }
    html body.minimenu .dash-header,
    html body.minimenu .dash-header:not(.transprent-bg) { left: var(--cg-sidebar-mini); }
    html body.minimenu .dash-container,
    html body.minimenu .dash-header:not(.transprent-bg):not(.dash-mob-header) ~ .dash-container { margin-left: var(--cg-sidebar-mini); }
}

/* Mobile: off-canvas drawer, never wider than most of the screen */
@media (max-width: 1024px) {
    html body .dash-sidebar,
    html body .dash-sidebar.light-sidebar {
        width: min(var(--cg-sidebar-w), 86vw);
        left: calc(-1 * min(var(--cg-sidebar-w), 86vw));
    }
    html body .dash-sidebar.mob-sidebar-active,
    html body .dash-sidebar.light-sidebar.mob-sidebar-active { left: 0; box-shadow: var(--cg-shadow-lg) !important; }
    html body .dash-container { margin-left: 0; }
}

/* ─── Top bar ──────────────────────────────────────────────────────────────── */
html body .dash-header,
html body .dash-header.transprent-bg {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.86) !important;
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--cg-border);
    box-shadow: none !important;
    color: var(--cg-ink-2);
}
html[data-cg-theme="dark"] body .dash-header { background: rgba(30, 41, 59, 0.86) !important; }
html body .dash-header .header-wrapper { padding: 0 24px; min-height: 64px; align-items: center; }
html body .dash-header .dash-h-item { min-height: 64px; display: flex; align-items: center; }
html body .dash-header .list-unstyled { display: flex; align-items: center; gap: 4px; margin: 0; }

/* Icon buttons */
html body .dash-header .dash-head-link {
    position: relative;
    min-width: 38px;
    height: 38px;
    margin: 0 !important;
    padding: 0 10px;
    justify-content: center;
    border-radius: 10px;
    color: var(--cg-ink-2) !important;
    font-size: var(--cg-text-md);
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body .dash-header .dash-head-link:hover,
html body .dash-header .dash-head-link[aria-expanded="true"] {
    background: var(--cg-surface-muted);
    color: var(--cg-ink) !important;
}
html body .dash-header .dash-head-link > i {
    font-size: 1.1875rem;
    color: inherit !important;
}
html body .dash-header .dash-head-link .drp-arrow { font-size: 14px; margin-left: 4px; color: var(--cg-ink-3) !important; }
html body .dash-header .dash-head-link .drp-text { margin-left: 6px; color: var(--cg-ink-2) !important; }

/* Unread badge: compact pill on the icon corner */
html body .dash-header .dash-head-link .dash-h-badge {
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    border: 2px solid var(--cg-surface);
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

/* Profile chip */
html body .dash-header .drp-company > .dash-head-link {
    height: 44px;
    padding: 0 10px 0 4px;
    border: 1px solid var(--cg-border);
    border-radius: 999px;
    background: var(--cg-surface);
    gap: 8px;
}
html body .dash-header .drp-company > .dash-head-link:hover { border-color: rgba(var(--cg-primary-rgb), 0.35); background: var(--cg-surface); }
html body .dash-header .drp-company .theme-avtar {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    overflow: hidden;
    background: var(--cg-primary-soft) !important;
}
html body .dash-header .drp-company .theme-avtar img {
    border: 0 !important;
    border-radius: 50% !important;
    object-fit: cover;
}
html body .dash-header .drp-company .hide-mob {
    margin-left: 0 !important;
    color: var(--cg-ink) !important;
    font-weight: 600;
    font-size: var(--cg-text-sm);
    white-space: nowrap;
}
/* Exit impersonation stays a real button */
html body .dash-header .drp-company > .btn { height: 36px; display: inline-flex; align-items: center; gap: 6px; }

/* Header dropdowns */
html body .dash-header .dash-h-dropdown {
    min-width: 220px;
    margin-top: 6px !important;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    box-shadow: var(--cg-shadow-lg);
    padding: 6px;
}
html body .dash-header .dash-h-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: var(--cg-text-sm);
    font-weight: 500;
    color: var(--cg-ink-2);
}
html body .dash-header .dash-h-dropdown .dropdown-item i { font-size: 1.0625rem; color: var(--cg-ink-3); }
html body .dash-header .dash-h-dropdown .dropdown-item:hover { background: var(--cg-primary-soft); color: var(--cg-primary-dark); }
html body .dash-header .dash-h-dropdown .dropdown-item:hover i { color: var(--cg-primary); }
html body .dash-header .noti-header { padding: 10px 10px 8px; border-bottom: 1px solid var(--cg-divider); display: flex; justify-content: space-between; align-items: center; }
html body .dash-header .noti-header h5 { font-size: var(--cg-text-md); }

/* Mobile hamburger */
html body .dash-header .hamburger-inner,
html body .dash-header .hamburger-inner::before,
html body .dash-header .hamburger-inner::after { background-color: var(--cg-ink-2) !important; }

/* The bar is 64px (theme assumed 70px): keep content and the sidebar scroll area aligned to it. */
html body .dash-container { top: 64px; min-height: calc(100vh - 64px); }
@media (min-width: 1025px) {
    html body .dash-sidebar .navbar-content,
    html body .dash-sidebar.light-sidebar .navbar-content { height: calc(100vh - 64px) !important; }
    html body .dash-header:not(.transprent-bg):not(.dash-mob-header) ~ .dash-container .dash-content { padding-top: 24px; }
}
@media (max-width: 575.98px) {
    html body .dash-header .header-wrapper { padding: 0 12px; }
    html body .dash-header .drp-company > .dash-head-link { padding: 0 4px; border: 0; }
}

/* ─── Modals & dropdowns ───────────────────────────────────────────────────── */
.modal-content {
    border: 0;
    border-radius: var(--cg-radius-xl);
    box-shadow: var(--cg-shadow-lg);
    overflow: hidden;
}
.modal-header {
    border-bottom: 1px solid var(--cg-divider);
}
.modal-header .modal-title {
    font-weight: 700;
    color: var(--cg-ink);
}
.modal-footer {
    border-top: 1px solid var(--cg-divider);
}
.dropdown-menu {
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    box-shadow: var(--cg-shadow-lg);
    padding: 6px;
}
.dropdown-item {
    border-radius: 9px;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--cg-primary-soft);
    color: var(--cg-primary-dark);
}

/* ─── Nav tabs & pills ─────────────────────────────────────────────────────── */
.nav-pills .nav-link {
    border-radius: 10px;
    font-weight: 600;
}
.nav-pills .nav-link.active {
    background: var(--cg-primary);
    box-shadow: 0 4px 10px rgba(var(--cg-primary-rgb), 0.24);
}

/* ─── Alerts / toasts ──────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--cg-radius-lg);
    border: 0;
}

/* ─── Settings: brand swatch in the theme picker ──────────────────────────── */
.themes-color-change[data-value="theme-cges"] {
    background: linear-gradient(160deg, #557DF4 0%, #4A6FE6 55%, #3A5BD0 100%) !important;
    position: relative;
}

/* ─── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .btn, .table tbody tr { transition: none; }
    .btn:active { transform: none; }
}

/* ─── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .dash-content > .page-header {
        padding: 18px;
        border-radius: var(--cg-radius-lg);
    }
}
