:root {
    --bg: #e7eaee;
    --panel: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --primary: #1e5e89;
    --primary-2: #2779aa;
    --accent: #e59017;
    --dark: #263441;
    --dark-2: #1e2933;
    --border: #c8d0d8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --info: #2563eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, .18);
    --radius: 3px;
    --sidebar-bg: #293845;
    --sidebar-header: #202d37;
    --sidebar-text: #e8eef1;
    --sidebar-muted: #aebbc4;
    --sidebar-border: #17222a;
    --nav-active: #1e5e89;
    --button-bg: #1e5e89;
    --button-hover: #174c70;
    --button-text: #ffffff;
    --table-head: #3b4e5d;
    --table-head-text: #ffffff;
    --row-alt: #f4f7f9;
    --row-hover: #eaf3f8;
    --surface-soft: #f3f6f8;
    --surface-raised: #f9fafb;
    --input-bg: #ffffff;
}

.progress-track {
    height: 10px;
    overflow: hidden;
    background: var(--border);
    border-radius: 999px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width .3s ease;
}

body.theme-dark {
    --bg: #24120b;
    --panel: #3a2015;
    --text: #ffd84d;
    --muted: #f2c96d;
    --primary: #f2b632;
    --primary-2: #ce8618;
    --accent: #fff0a3;
    --dark: #2a130b;
    --dark-2: #180a05;
    --border: #8c552e;
    --shadow: 0 18px 40px rgba(31, 19, 13, .55);
    --sidebar-bg: #32170d;
    --sidebar-header: #1f0d07;
    --sidebar-text: #ffd84d;
    --sidebar-muted: #edbd5a;
    --sidebar-border: #75401f;
    --nav-active: #8f481d;
    --button-bg: #f2b632;
    --button-hover: #ffd45e;
    --button-text: #2b1509;
    --table-head: #5b2b16;
    --table-head-text: #ffe47a;
    --row-alt: #432519;
    --row-hover: #54301e;
    --surface-soft: #432519;
    --surface-raised: #2d170f;
    --input-bg: #321a11;
}

body.theme-midnight {
    --bg: #020b1d;
    --panel: #071a35;
    --text: #f8fafc;
    --muted: #c8d8ee;
    --primary: #2589d8;
    --primary-2: #125a9d;
    --accent: #41c7b5;
    --dark: #041329;
    --dark-2: #020a18;
    --border: #25527f;
    --shadow: 0 18px 44px rgba(1, 8, 24, .74);
    --sidebar-bg: #020d2c;
    --sidebar-header: #01071b;
    --sidebar-text: #ffffff;
    --sidebar-muted: #b9d4ff;
    --sidebar-border: #164d91;
    --nav-active: #125a9d;
    --button-bg: #146fbd;
    --button-hover: #2589d8;
    --button-text: #ffffff;
    --table-head: #082c65;
    --table-head-text: #ffffff;
    --row-alt: #09204b;
    --row-hover: #0d2d64;
    --surface-soft: #09204b;
    --surface-raised: #04142d;
    --input-bg: #06162f;
}

body.theme-light {
    --bg: #f8fafc;
    --panel: #f0fdfa;
    --text: #0f172a;
    --muted: #475569;
    --primary: #14b8a6;
    --primary-2: #0ea5e9;
    --accent: #f97316;
    --border: #dbe7f4;
    --shadow: 0 12px 26px rgba(15, 23, 42, .08);
    --sidebar-bg: #0f5e65;
    --sidebar-header: #09474d;
    --sidebar-text: #ffffff;
    --sidebar-muted: #c7f5ef;
    --sidebar-border: #073b40;
    --nav-active: #0d9488;
    --button-bg: #0f8f87;
    --button-hover: #0b726c;
    --button-text: #ffffff;
    --table-head: #116970;
    --table-head-text: #ffffff;
    --row-alt: #f0fdfa;
    --row-hover: #ccfbf1;
    --surface-soft: #e2f8f5;
    --surface-raised: #ecfeff;
    --input-bg: #f8fffe;
}

body.theme-forest {
    --bg: #edf4ef;
    --panel: #f3faf5;
    --text: #173126;
    --muted: #587065;
    --primary: #23734b;
    --primary-2: #17563a;
    --accent: #d49335;
    --dark: #163a2b;
    --dark-2: #0e291e;
    --border: #b9d0c1;
    --sidebar-bg: #173b2b;
    --sidebar-header: #0d291d;
    --sidebar-text: #f1fff6;
    --sidebar-muted: #b9ddc7;
    --sidebar-border: #0a2117;
    --nav-active: #2d8157;
    --button-bg: #23734b;
    --button-hover: #17563a;
    --button-text: #ffffff;
    --table-head: #285c43;
    --table-head-text: #ffffff;
    --row-alt: #f0f7f2;
    --row-hover: #dceee2;
    --surface-soft: #e3f0e7;
    --surface-raised: #e8f4eb;
    --input-bg: #f8fcf9;
}

body.theme-graphite {
    --bg: #e8eaed;
    --panel: #f1f2f3;
    --text: #20252b;
    --muted: #626b75;
    --primary: #485461;
    --primary-2: #2f3740;
    --accent: #d18633;
    --dark: #282e35;
    --dark-2: #1d2228;
    --border: #bbc1c7;
    --sidebar-bg: #2b3137;
    --sidebar-header: #1c2024;
    --sidebar-text: #ffffff;
    --sidebar-muted: #c4cbd1;
    --sidebar-border: #15191c;
    --nav-active: #586674;
    --button-bg: #485461;
    --button-hover: #2f3740;
    --button-text: #ffffff;
    --table-head: #3a434c;
    --table-head-text: #ffffff;
    --row-alt: #f0f1f2;
    --row-hover: #dfe3e6;
    --surface-soft: #e2e5e7;
    --surface-raised: #eceeef;
    --input-bg: #f7f8f8;
}

body.theme-sunrise {
    --bg: #fff4e8;
    --panel: #fff8f1;
    --text: #42251b;
    --muted: #7c6258;
    --primary: #c34f35;
    --primary-2: #923423;
    --accent: #e39a24;
    --dark: #633528;
    --dark-2: #43241c;
    --border: #e3c5b4;
    --sidebar-bg: #6d3425;
    --sidebar-header: #492116;
    --sidebar-text: #fff8f2;
    --sidebar-muted: #f4c9b5;
    --sidebar-border: #35160e;
    --nav-active: #bd4d34;
    --button-bg: #c34f35;
    --button-hover: #923423;
    --button-text: #ffffff;
    --table-head: #87412e;
    --table-head-text: #ffffff;
    --row-alt: #fff8f1;
    --row-hover: #ffe7d2;
    --surface-soft: #ffead8;
    --surface-raised: #fff1e4;
    --input-bg: #fffaf5;
}

body.theme-red,
body.theme-red-bold {
    --bg: #fff1f2;
    --panel: #fff5f6;
    --text: #3f0b12;
    --muted: #8a3b45;
    --primary: #c51f36;
    --primary-2: #8f1023;
    --accent: #f59e0b;
    --border: #efb5bd;
    --sidebar-bg: #700f20;
    --sidebar-header: #4b0915;
    --sidebar-text: #ffffff;
    --sidebar-muted: #ffc5cd;
    --sidebar-border: #390610;
    --nav-active: #c51f36;
    --button-bg: #c51f36;
    --button-hover: #8f1023;
    --button-text: #ffffff;
    --table-head: #8f1023;
    --table-head-text: #ffffff;
    --row-alt: #fff5f6;
    --row-hover: #ffe1e5;
    --surface-soft: #ffe5e8;
    --surface-raised: #ffedef;
    --input-bg: #fff9fa;
}

body.theme-bold {
    --bg: #eef2f6;
    --panel: #f3f7f9;
    --text: #17202a;
    --muted: #4e5d6b;
    --primary: #245b78;
    --primary-2: #173e55;
    --accent: #d88719;
    --border: #b8c6d0;
    --sidebar-bg: #233b4a;
    --sidebar-header: #172933;
    --sidebar-text: #ffffff;
    --sidebar-muted: #c8d8e1;
    --sidebar-border: #101e25;
    --nav-active: #327da5;
    --button-bg: #245b78;
    --button-hover: #173e55;
    --button-text: #ffffff;
    --table-head: #294f65;
    --table-head-text: #ffffff;
    --row-alt: #f3f7f9;
    --row-hover: #dfedf4;
    --surface-soft: #e5eef3;
    --surface-raised: #edf4f7;
    --input-bg: #f8fbfc;
}

body.theme-ocean {
    --bg: #e9f7fb;
    --panel: #f5fcff;
    --text: #103544;
    --muted: #557783;
    --primary: #087e8b;
    --primary-2: #055e6c;
    --accent: #e08735;
    --border: #b9dae2;
    --sidebar-bg: #063c4a;
    --sidebar-header: #032d38;
    --sidebar-text: #ecfbff;
    --sidebar-muted: #aad4dd;
    --sidebar-border: #022630;
    --nav-active: #087e8b;
    --button-bg: #087e8b;
    --button-hover: #055e6c;
    --button-text: #ffffff;
    --table-head: #0b5966;
    --table-head-text: #ffffff;
    --row-alt: #f0fbfe;
    --row-hover: #d7f3f8;
    --surface-soft: #daf1f6;
    --surface-raised: #effaff;
    --input-bg: #fbfeff;
}

body.theme-plum {
    --bg: #f7f1f8;
    --panel: #fcf8fd;
    --text: #371a3e;
    --muted: #775e7d;
    --primary: #7b3f8c;
    --primary-2: #572665;
    --accent: #c68832;
    --border: #dfc8e4;
    --sidebar-bg: #3e1d4b;
    --sidebar-header: #2d1237;
    --sidebar-text: #fff7ff;
    --sidebar-muted: #e8c9ed;
    --sidebar-border: #230d2b;
    --nav-active: #7b3f8c;
    --button-bg: #7b3f8c;
    --button-hover: #572665;
    --button-text: #ffffff;
    --table-head: #663374;
    --table-head-text: #ffffff;
    --row-alt: #fbf5fc;
    --row-hover: #f1e3f4;
    --surface-soft: #f1e4f3;
    --surface-raised: #faf3fb;
    --input-bg: #fffbff;
}

body.theme-rose {
    --bg: #fff2f4;
    --panel: #fff9fa;
    --text: #481b28;
    --muted: #8b5b67;
    --primary: #b83b5e;
    --primary-2: #842541;
    --accent: #b9862c;
    --border: #efc5d0;
    --sidebar-bg: #5d1e32;
    --sidebar-header: #421222;
    --sidebar-text: #fff7f8;
    --sidebar-muted: #f2becd;
    --sidebar-border: #320b18;
    --nav-active: #b83b5e;
    --button-bg: #b83b5e;
    --button-hover: #842541;
    --button-text: #ffffff;
    --table-head: #8f2f4a;
    --table-head-text: #ffffff;
    --row-alt: #fff7f8;
    --row-hover: #ffe4ea;
    --surface-soft: #ffe6ec;
    --surface-raised: #fff1f4;
    --input-bg: #fffafb;
}

body.theme-slate {
    --bg: #edf0f4;
    --panel: #f8f9fb;
    --text: #202a35;
    --muted: #687683;
    --primary: #47657b;
    --primary-2: #304a60;
    --accent: #ba8036;
    --border: #c9d2db;
    --sidebar-bg: #293744;
    --sidebar-header: #1d2832;
    --sidebar-text: #f5f8fa;
    --sidebar-muted: #b9c7d2;
    --sidebar-border: #15202a;
    --nav-active: #47657b;
    --button-bg: #47657b;
    --button-hover: #304a60;
    --button-text: #ffffff;
    --table-head: #3a5265;
    --table-head-text: #ffffff;
    --row-alt: #f4f6f8;
    --row-hover: #e0e7ed;
    --surface-soft: #e2e8ed;
    --surface-raised: #f0f3f6;
    --input-bg: #fcfdfe;
}

body.theme-aqua {
    --bg: #e7fbfc;
    --panel: #f8feff;
    --text: #103942;
    --muted: #54808a;
    --primary: #0499ae;
    --primary-2: #05758a;
    --accent: #d18b22;
    --border: #b9e3e8;
    --sidebar-bg: #075161;
    --sidebar-header: #033d4a;
    --sidebar-text: #f0feff;
    --sidebar-muted: #b7e6eb;
    --sidebar-border: #02313b;
    --nav-active: #0499ae;
    --button-bg: #0499ae;
    --button-hover: #05758a;
    --button-text: #ffffff;
    --table-head: #087889;
    --table-head-text: #ffffff;
    --row-alt: #f0fcfd;
    --row-hover: #d6f5f7;
    --surface-soft: #d9f4f5;
    --surface-raised: #eefcfd;
    --input-bg: #fbffff;
}

body.theme-teal {
    --bg: #eaf5f2;
    --panel: #f8fcfb;
    --text: #143934;
    --muted: #57756f;
    --primary: #087a70;
    --primary-2: #075850;
    --accent: #cc8a28;
    --border: #bcd8d1;
    --sidebar-bg: #124941;
    --sidebar-header: #0b3731;
    --sidebar-text: #f1fffb;
    --sidebar-muted: #b9ddd4;
    --sidebar-border: #072a25;
    --nav-active: #087a70;
    --button-bg: #087a70;
    --button-hover: #075850;
    --button-text: #ffffff;
    --table-head: #17675f;
    --table-head-text: #ffffff;
    --row-alt: #f0f8f6;
    --row-hover: #dcefe9;
    --surface-soft: #dcefe9;
    --surface-raised: #eff9f6;
    --input-bg: #fbfffd;
}

body.theme-electric {
    --bg: #000000;
    --panel: rgba(8, 16, 10, .62);
    --text: #c8ffb0;
    --muted: #73a66b;
    --primary: #39ff14;
    --primary-2: #12b800;
    --accent: #b6ff00;
    --dark: #020702;
    --dark-2: #000000;
    --border: rgba(57, 255, 20, .28);
    --sidebar-bg: rgba(0, 7, 1, .88);
    --sidebar-header: #000000;
    --sidebar-text: #d5ffc7;
    --sidebar-muted: #73c46a;
    --sidebar-border: rgba(57, 255, 20, .24);
    --nav-active: rgba(57, 255, 20, .16);
    --button-bg: rgba(57, 255, 20, .16);
    --button-hover: rgba(57, 255, 20, .28);
    --button-text: #b6ff00;
    --table-head: rgba(57, 255, 20, .12);
    --table-head-text: #d5ffc7;
    --row-alt: rgba(57, 255, 20, .035);
    --row-hover: rgba(57, 255, 20, .11);
    --surface-soft: rgba(57, 255, 20, .06);
    --surface-raised: rgba(7, 18, 8, .72);
    --input-bg: rgba(0, 0, 0, .58);
    --shadow: 0 20px 60px rgba(0, 0, 0, .78), 0 0 26px rgba(57, 255, 20, .08);
}

body.theme-electric {
    background-color: #000;
    background-image: radial-gradient(circle at 50% -20%, rgba(57, 255, 20, .08), transparent 32rem),
                      linear-gradient(rgba(57, 255, 20, .018) 1px, transparent 1px);
    background-size: auto, 100% 4px;
    background-attachment: fixed;
    color: var(--text);
    text-shadow: 0 0 8px rgba(57, 255, 20, .18);
}

body.theme-electric .panel,
body.theme-electric .stat-card,
body.theme-electric .visual-panel,
body.theme-electric .kpi-card {
    background: var(--panel);
    border-color: var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

body.theme-electric .topbar,
body.theme-electric .sidebar,
body.theme-electric input,
body.theme-electric select,
body.theme-electric textarea,
body.theme-electric .alert {
    background: rgba(0, 0, 0, .58);
    border-color: var(--border);
    color: var(--text);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.theme-electric a,
body.theme-electric h1,
body.theme-electric h2,
body.theme-electric h3,
body.theme-electric strong {
    color: var(--primary);
}

body.theme-electric .btn:not(.danger) {
    box-shadow: 0 0 16px rgba(57, 255, 20, .2);
    border-color: rgba(57, 255, 20, .5);
}

body.theme-electric .badge-success,
body.theme-electric .vbar-fill {
    background: var(--accent);
    color: #071b13;
    box-shadow: 0 0 12px rgba(183, 255, 57, .34);
}

body.theme-electric .table-wrap {
    border-color: var(--border);
}

body.theme-electric .badge,
body.theme-electric .user-chip {
    background: rgba(57, 255, 20, .1);
    border-color: rgba(57, 255, 20, .35);
    color: var(--accent);
}

body.theme-electric .lead-search-strip {
    background: rgba(0, 0, 0, .78);
    border-color: var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

body.theme-electric .saved-search-item {
    background: rgba(57, 255, 20, .07);
    border-color: rgba(57, 255, 20, .32);
}

body.theme-electric .saved-search-item a,
body.theme-electric .active-search-summary,
body.theme-electric .saved-searches strong {
    color: var(--text);
}

body.theme-electric .save-search-form input {
    background: rgba(0, 0, 0, .72);
    border-color: var(--border);
    color: var(--text);
}

body.theme-midnight .lead-search-strip {
    background: var(--panel);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

body.theme-midnight .saved-search-item {
    background: var(--surface-raised);
    border-color: var(--border);
}

body.theme-midnight .saved-search-item a,
body.theme-midnight .active-search-summary,
body.theme-midnight .saved-searches strong {
    color: var(--text);
}

body.theme-midnight .save-search-form input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

body.theme-dark,
body.theme-bold,
body.theme-red-bold {
    font-weight: 700;
}

/* Standard themes. */
/* Light - white / light gray, general business use. */
body.theme-standard-light,
body.theme-system {
    --bg: #f3f5f7;
    --panel: #ffffff;
    --text: #1b2430;
    --muted: #64748b;
    --primary: #1e5e89;
    --primary-2: #2779aa;
    --accent: #c2760f;
    --dark: #263441;
    --dark-2: #1e2933;
    --border: #d8dee5;
    --shadow: 0 1px 3px rgba(16, 24, 40, .12);
    --sidebar-bg: #273445;
    --sidebar-header: #1d2835;
    --sidebar-text: #eef2f6;
    --sidebar-muted: #aab6c4;
    --sidebar-border: #16202b;
    --nav-active: #1e5e89;
    --button-bg: #1e5e89;
    --button-hover: #174c70;
    --button-text: #ffffff;
    --table-head: #3b4e5d;
    --table-head-text: #ffffff;
    --row-alt: #f7f9fb;
    --row-hover: #eaf1f7;
    --surface-soft: #f1f4f7;
    --surface-raised: #fafbfc;
    --input-bg: #ffffff;
}

/* Dark - dark gray / near black, low-light environments. */
body.theme-standard-dark {
    --bg: #14181d;
    --panel: #1c2128;
    --text: #e6edf3;
    --muted: #9aa5b1;
    --primary: #4b9fd5;
    --primary-2: #2f7cb0;
    --accent: #e0a34a;
    --dark: #10141a;
    --dark-2: #0b0e12;
    --border: #2f3742;
    --shadow: 0 2px 8px rgba(0, 0, 0, .55);
    --sidebar-bg: #11151a;
    --sidebar-header: #0b0e12;
    --sidebar-text: #e6edf3;
    --sidebar-muted: #97a3b0;
    --sidebar-border: #262d36;
    --nav-active: #23405a;
    --button-bg: #2f7cb0;
    --button-hover: #3f92c8;
    --button-text: #ffffff;
    --table-head: #232a33;
    --table-head-text: #e6edf3;
    --row-alt: #1f242b;
    --row-hover: #262d36;
    --surface-soft: #1f242b;
    --surface-raised: #222831;
    --input-bg: #161b22;
}

/* Solarized Light - warm beige, reduced eye strain. */
body.theme-solarized-light {
    --bg: #eee8d5;
    --panel: #fdf6e3;
    --text: #073642;
    --muted: #657b83;
    --primary: #268bd2;
    --primary-2: #1f6f9f;
    --accent: #b58900;
    --dark: #073642;
    --dark-2: #002b36;
    --border: #ded7bf;
    --shadow: 0 1px 3px rgba(88, 110, 117, .22);
    --sidebar-bg: #073642;
    --sidebar-header: #002b36;
    --sidebar-text: #eee8d5;
    --sidebar-muted: #93a1a1;
    --sidebar-border: #002b36;
    --nav-active: #268bd2;
    --button-bg: #268bd2;
    --button-hover: #1f6f9f;
    --button-text: #fdf6e3;
    --table-head: #586e75;
    --table-head-text: #fdf6e3;
    --row-alt: #f7f1de;
    --row-hover: #eae3cb;
    --surface-soft: #f2ecd9;
    --surface-raised: #fdf6e3;
    --input-bg: #fdf6e3;
}

/* Solarized Dark - dark blue-gray, developer/technical users. */
body.theme-solarized-dark {
    --bg: #002b36;
    --panel: #073642;
    --text: #eee8d5;
    --muted: #93a1a1;
    --primary: #2aa198;
    --primary-2: #268bd2;
    --accent: #b58900;
    --dark: #00212b;
    --dark-2: #001a21;
    --border: #12505f;
    --shadow: 0 2px 8px rgba(0, 12, 16, .6);
    --sidebar-bg: #00212b;
    --sidebar-header: #001a21;
    --sidebar-text: #eee8d5;
    --sidebar-muted: #93a1a1;
    --sidebar-border: #0d3f4b;
    --nav-active: #0f4a58;
    --button-bg: #268bd2;
    --button-hover: #2aa198;
    --button-text: #002b36;
    --table-head: #0a4451;
    --table-head-text: #eee8d5;
    --row-alt: #063340;
    --row-hover: #0a4451;
    --surface-soft: #063340;
    --surface-raised: #073642;
    --input-bg: #00212b;
}

/* High Contrast - strong black/white, accessibility. */
body.theme-high-contrast {
    --bg: #000000;
    --panel: #000000;
    --text: #ffffff;
    --muted: #e8e8e8;
    --primary: #ffff00;
    --primary-2: #00ffff;
    --accent: #ffff00;
    --dark: #000000;
    --dark-2: #000000;
    --border: #ffffff;
    --shadow: none;
    --sidebar-bg: #000000;
    --sidebar-header: #000000;
    --sidebar-text: #ffffff;
    --sidebar-muted: #ffffff;
    --sidebar-border: #ffffff;
    --nav-active: #ffff00;
    --button-bg: #ffff00;
    --button-hover: #ffffff;
    --button-text: #000000;
    --table-head: #000000;
    --table-head-text: #ffff00;
    --row-alt: #000000;
    --row-hover: #1f1f1f;
    --surface-soft: #000000;
    --surface-raised: #000000;
    --input-bg: #000000;
}

/* System - follows the operating system preference. */
@media (prefers-color-scheme: dark) {
    body.theme-system {
        --bg: #14181d;
        --panel: #1c2128;
        --text: #e6edf3;
        --muted: #9aa5b1;
        --primary: #4b9fd5;
        --primary-2: #2f7cb0;
        --accent: #e0a34a;
        --dark: #10141a;
        --dark-2: #0b0e12;
        --border: #2f3742;
        --shadow: 0 2px 8px rgba(0, 0, 0, .55);
        --sidebar-bg: #11151a;
        --sidebar-header: #0b0e12;
        --sidebar-text: #e6edf3;
        --sidebar-muted: #97a3b0;
        --sidebar-border: #262d36;
        --nav-active: #23405a;
        --button-bg: #2f7cb0;
        --button-hover: #3f92c8;
        --button-text: #ffffff;
        --table-head: #232a33;
        --table-head-text: #e6edf3;
        --row-alt: #1f242b;
        --row-hover: #262d36;
        --surface-soft: #1f242b;
        --surface-raised: #222831;
        --input-bg: #161b22;
    }
}

body.theme-standard-dark,
body.theme-solarized-dark,
body.theme-high-contrast {
    color-scheme: dark;
}

body.theme-standard-dark :is(input, select, textarea, .btn.ghost, code, .lead-search-strip, .saved-search-item, .save-search-form input),
body.theme-solarized-dark :is(input, select, textarea, .btn.ghost, code, .lead-search-strip, .saved-search-item, .save-search-form input),
body.theme-high-contrast :is(input, select, textarea, .btn.ghost, code, .lead-search-strip, .saved-search-item, .save-search-form input) {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

body.theme-standard-dark :is(.saved-search-item a, .active-search-summary, .saved-searches strong),
body.theme-solarized-dark :is(.saved-search-item a, .active-search-summary, .saved-searches strong),
body.theme-high-contrast :is(.saved-search-item a, .active-search-summary, .saved-searches strong) {
    color: var(--text);
}

@media (prefers-color-scheme: dark) {
    body.theme-system {
        color-scheme: dark;
    }

    body.theme-system :is(input, select, textarea, .btn.ghost, code, .lead-search-strip, .saved-search-item, .save-search-form input) {
        background: var(--input-bg);
        border-color: var(--border);
        color: var(--text);
    }

    body.theme-system :is(.saved-search-item a, .active-search-summary, .saved-searches strong) {
        color: var(--text);
    }
}

body.theme-high-contrast :is(.panel, .table-wrap, .stat-card, .kpi-card, .visual-panel, input, select, textarea, .btn, .badge) {
    border: 1px solid var(--border);
}

body.theme-high-contrast .btn {
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: none;
}

body.theme-high-contrast :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Tahoma, Verdana, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

code {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px 7px;
    color: #334155;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 13px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(15, 118, 110, .22);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.ghost {
    background: #fff;
    color: var(--primary);
    box-shadow: none;
}

.btn.full {
    width: 100%;
}

.btn.danger,
.danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.btn-sm {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 285px;
    height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(17, 24, 39, .98)),
        url('../images/crm-bg.svg');
    background-size: cover;
    background-position: center;
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 0%, rgba(20, 184, 166, .26), transparent 38%);
    pointer-events: none;
}

.sidebar > * {
    position: relative;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 16px 34px rgba(20, 184, 166, .28);
}

.company-logo-preview {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.brand {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .4px;
}

.brand-block span {
    font-size: 12px;
    color: #cbd5e1;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: #cbd5e1;
    font-weight: 700;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

.side-widget {
    margin-top: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(15, 118, 110, .28), rgba(20, 184, 166, .12));
    color: #e2e8f0;
}

.side-widget p {
    margin-bottom: 0;
    color: #cbd5e1;
}

.main {
    flex: 1;
    padding: 24px;
}

.topbar {
    min-height: 76px;
    margin-bottom: 24px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.topbar h3,
.topbar p {
    margin: 0;
}

.topbar p {
    color: var(--muted);
    font-size: 13px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.user-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #047857;
    font-weight: 800;
}

.logout {
    color: var(--danger);
    font-weight: 800;
}

.messages {
    margin-bottom: 16px;
}

.alert {
    margin: 8px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
}

.alert.success {
    background: #ecfdf5;
    color: #047857;
}

.alert.danger {
    background: #fef2f2;
    color: #b91c1c;
}

.alert.warning {
    background: #fffbeb;
    color: #b45309;
}

.page-head,
.dashboard-header,
.panel-head,
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.page-head h1,
.dashboard-header h1,
.page-header h1,
.panel h1,
.panel h2 {
    margin-top: 0;
}

.panel,
.feature-card,
.stat-card,
.kpi-card,
.visual-panel {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.panel {
    margin-bottom: 18px;
    overflow: auto;
}

.panel::before {
    content: "";
    display: block;
    height: 4px;
    margin: -22px -22px 18px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
}

.premium-hero,
.dashboard-hero,
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    overflow: hidden;
    border-radius: 32px;
    padding: 36px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(15, 118, 110, .84) 55%, rgba(20, 184, 166, .78)),
        url('../images/crm-bg.svg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.premium-hero::after,
.dashboard-hero::after,
.hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
}

.hero-copy,
.hero-content,
.hero-card,
.premium-hero img {
    position: relative;
    z-index: 1;
}

.premium-hero h1,
.hero h1 {
    margin: 10px 0;
    font-size: 40px;
    line-height: 1.08;
}

.premium-hero p,
.hero p {
    color: #d1fae5;
    font-size: 16px;
}

.premium-hero img,
.dashboard-hero img {
    width: 310px;
    max-width: 36%;
    filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .25));
}

.hero-logo {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    padding: 8px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
}

.pill {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .17);
    border: 1px solid rgba(255, 255, 255, .24);
    font-weight: 800;
    font-size: 12px;
}

.kpi-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
    gap: 18px;
    margin: 22px 0;
}

.manager-performance-group + .manager-performance-group {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.manager-performance-group h3 {
    margin: 0 0 8px;
}

.manager-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 12px;
    color: var(--muted);
}

.manager-summary strong {
    color: var(--text);
}

.manager-performance-table {
    min-width: 760px;
}

.kpi-card,
.stat-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::after,
.stat-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 115px;
    height: 115px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(245, 158, 11, .10));
}

.kpi-icon,
.stat-icon,
.quick-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 22px;
    box-shadow: 0 12px 28px rgba(15, 118, 110, .22);
}

.stat-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
}

.kpi-card span,
.stat-card span {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: .05em;
}

.kpi-card strong,
.stat-card strong,
.stat-card h3 {
    display: block;
    margin: 6px 0;
    font-size: 32px;
    color: var(--text);
}

.quick-widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.quick-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.quick-widget b {
    display: block;
}

.quick-widget span {
    color: var(--muted);
    font-size: 12px;
}

.grid-2,
.widget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-card {
    max-width: 1180px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, 1fr);
}

.form-group.full-width,
.form-actions.full-width,
.full-width,
.form-grid textarea {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-weight: 800;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .10);
}

form [aria-invalid="true"] {
    border-color: var(--danger, #b42318);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .12);
}

.field-validation-error,
.lead-validation-error {
    display: block;
    margin-top: 5px;
    color: var(--danger, #b42318);
    font-size: 12px;
    font-weight: 700;
}

.field-validation-error[hidden],
.lead-validation-error[hidden] {
    display: none;
}

.field-required {
    color: var(--danger, #b42318);
    font-weight: 900;
}

.field-optional {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

textarea {
    min-height: 110px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.check,
.chips label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
}

input[type="checkbox"] {
    appearance: none;
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 3px;
    background: var(--input-bg);
    cursor: pointer;
}

input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
}

input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 4px;
    height: 8px;
    margin: 1px 0 0 4px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.bulkbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.lead-transfer-bar {
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
}

.lead-transfer-bar strong,
.lead-transfer-bar select,
.lead-transfer-bar .btn {
    min-width: 0;
}

.lead-transfer-bar select {
    width: 100%;
    text-overflow: ellipsis;
}

.table-wrap,
.table-responsive {
    overflow-x: auto;
}

table,
.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    color: var(--text);
}

th,
td,
.modern-table th,
.modern-table td {
    padding: 13px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

th,
.modern-table th {
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #f8fafc;
}

tbody tr:hover {
    background: var(--row-hover);
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #ccfbf1;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info,
.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.employee-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
}

.employee-code {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.lead-search-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: #fff;
}

.saved-searches,
.saved-search-item,
.save-search-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.saved-search-item {
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.saved-search-item form {
    margin: 0;
}

.saved-search-item button {
    width: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
}

.active-search-summary {
    color: var(--text);
    font-size: 13px;
}

.save-search-form input {
    width: 180px;
    padding: 8px 10px;
}

.lead-position {
    align-self: center;
    font-weight: 800;
    white-space: nowrap;
}

.lead-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
    gap: 18px;
    align-items: start;
}

.lead-edit-activity {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 18px;
    border-left: 1px solid var(--border);
}

.lead-edit-activity h3 {
    margin: 0;
}

.lead-nav-arrow {
    width: 38px;
    min-width: 38px;
    padding-inline: 0;
    text-align: center;
}

.product-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.product-checklist .check {
    margin: 0;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.visual-panel {
    background: #fff url('../images/widget-pattern.svg') no-repeat right top;
    background-size: 420px;
}

.progress-pill {
    height: 10px;
    margin-top: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-pill i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: 999px;
}

.public-page {
    background: #08111f;
}

.public-page .hero {
    min-height: 70vh;
    border-radius: 0;
    padding: 70px 8%;
}

.hero-content {
    max-width: 720px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.hero-card {
    padding: 25px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .24);
}

.hero-card img {
    width: 430px;
    max-width: 40vw;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.public-features {
    padding: 44px 8%;
    background: #f4f7fb;
}

.login-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 26px;
    background:
        linear-gradient(135deg, rgba(5, 8, 22, .86), rgba(15, 23, 42, .90)),
        url('../images/crm-bg.svg');
    background-size: cover;
    background-position: center;
}

.login-layout {
    width: min(460px, 100%);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 32px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(16px);
    box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
}

.login-card {
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 42px;
    background: rgba(255, 255, 255, .96);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand .hero-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
}

.login-brand .brand {
    margin: 0;
}

.login-card h2 {
    margin: 0 0 10px;
    font-size: 30px;
}

.error-page {
    min-height: 62vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-content {
    max-width: 680px;
}

.error-code {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 1000px) {
    .kpi-grid,
    .stats-grid,
    .quick-widget-grid,
    .feature-grid,
    .grid-2,
    .widget-grid,
    .form-grid,
    .form-grid.two,
    .login-layout {
        grid-template-columns: 1fr;
    }

    .premium-hero img,
    .dashboard-hero img,
    .hero-card {
        display: none;
    }

    .form-group.full-width,
    .form-actions.full-width,
    .full-width,
    .form-grid textarea {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: auto;
        height: auto;
    }

    .main {
        padding: 14px;
    }

    .topbar,
    .page-head,
    .dashboard-header,
    .panel-head,
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .premium-hero,
    .hero {
        padding: 26px;
        border-radius: 24px;
    }

    .premium-hero h1,
    .hero h1 {
        font-size: 30px;
    }

    .hero-logo {
        width: 58px;
        height: 58px;
    }
}


/* ======================================
   FINAL BRANDING, LOGO AND FOOTER FIXES
   ====================================== */

.brand-block{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:12px;
    min-height:58px;
}

.logo-img{
    height:54px;
    width:auto;
    max-width:190px;
    object-fit:contain;
    display:block;
    border-radius:0;
    background:transparent;
    padding:0;
    box-shadow:none;
    flex-shrink:0;
}

.hero-logo{
    height:78px;
    width:auto;
    max-width:280px;
    object-fit:contain;
    border-radius:0;
    background:transparent;
    padding:0;
    box-shadow:none;
}

.crm-footer{
    margin-top:30px;
    padding:16px 22px;
    border:1px solid var(--border);
    border-radius:22px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    background:rgba(255,255,255,.88);
    backdrop-filter:blur(16px);
    box-shadow:0 14px 40px rgba(15,23,42,.06);
}

.footer-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.footer-logo{
    height:30px;
    width:auto;
    max-width:120px;
    object-fit:contain;
    display:block;
}

.footer-left strong{
    display:block;
    color:#0f172a;
    font-size:14px;
    line-height:1.1;
}

.footer-left span{
    color:#64748b;
    font-size:12px;
}

.footer-right{
    color:#64748b;
    font-size:13px;
    text-align:right;
}

.footer-right strong{
    color:var(--primary);
    font-weight:800;
}

@media(max-width:768px){
    .crm-footer{
        flex-direction:column;
        text-align:center;
    }

    .footer-right{
        text-align:center;
    }

    .logo-img{
        max-width:170px;
    }
}

/* Compact operations-console treatment, aligned with the legacy CRM workspace. */
.app-shell {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr);
    background: var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: 100vh;
    padding: 0;
    gap: 0;
    color: var(--sidebar-text);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar::before {
    display: none;
}

.brand-block {
    min-height: 76px;
    padding: 12px 16px;
    gap: 10px;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--sidebar-header);
}

.logo-img {
    width: 42px;
    height: 42px;
    max-width: 42px;
    object-fit: contain;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-name span {
    display: block;
    margin-top: 2px;
    color: var(--sidebar-muted);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
}

.side-nav {
    display: block;
    padding: 10px 0;
}

.sidebar-mobile-search {
    padding: 2px 10px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-mobile-search label {
    margin-bottom: 5px;
    color: var(--sidebar-muted);
    font-size: 11px;
    font-weight: 700;
}

.sidebar-mobile-search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
}

.sidebar-mobile-search input {
    min-width: 0;
    height: 32px;
    padding: 6px 8px;
    border: 1px solid var(--sidebar-border);
    border-radius: 2px 0 0 2px;
    font-size: 11px;
}

.sidebar-mobile-search button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--sidebar-border);
    border-left: 0;
    border-radius: 0 2px 2px 0;
    color: var(--sidebar-text);
    background: var(--nav-active);
    cursor: pointer;
}

.side-nav a {
    display: block;
    margin: 0;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    border-radius: 0;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 400;
}

.side-nav a:hover,
.side-nav .nav-settings {
    background: var(--nav-active);
    color: var(--sidebar-text);
}

.sidebar-callbacks {
    margin: auto 10px 10px;
    border: 1px solid var(--sidebar-border);
    background: var(--sidebar-header);
}

.sidebar-callbacks h2 {
    margin: 0;
    padding: 9px 10px;
    border-bottom: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-callbacks a {
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: var(--sidebar-text);
    font-size: 11px;
}

.sidebar-callbacks a:hover {
    background: var(--nav-active);
}

.sidebar-callbacks a span {
    display: block;
    margin-top: 3px;
    color: var(--sidebar-muted);
    font-size: 10px;
}

.sidebar-callbacks .sidebar-callback-all {
    border-bottom: 0;
    color: var(--sidebar-text);
    font-weight: 700;
}

.main {
    min-width: 0;
    padding: 0 18px 24px;
}

.topbar {
    min-height: 58px;
    margin: 0 -18px 20px;
    padding: 10px 18px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface-raised);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    backdrop-filter: none;
}

.topbar h3 {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.topbar p {
    margin-top: 2px;
    font-size: 11px;
}

.top-actions {
    gap: 10px;
    font-size: 12px;
}

.system-settings-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}

.system-settings-icon:hover {
    filter: brightness(1.08);
}

.notification-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
}

.notification-button:hover {
    filter: brightness(1.08);
}

.chat-launcher {
    position: relative;
}

.chat-launcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 110;
    width: 240px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-raised);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.chat-launcher-menu button,
.chat-launcher-menu a {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 3px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.chat-launcher-menu button:hover,
.chat-launcher-menu a:hover {
    background: var(--surface-soft);
}

.chat-launcher-menu p {
    padding: 8px 9px;
    margin: 0;
}

.chat-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
}

.chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.chat-emoji-picker {
    position: absolute;
    right: 54px;
    bottom: calc(100% + 6px);
    z-index: 5;
    width: 220px;
    padding: 7px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-raised);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

.chat-emoji-picker[hidden] {
    display: none;
}

.chat-emoji-picker button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.chat-emoji-picker button:hover {
    background: var(--surface-soft);
}

.broadcast-marquee-track {
    font-size: var(--broadcast-font-size, 13px);
}

.broadcast-font-control {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.broadcast-font-control label {
    margin: 0;
}

.broadcast-font-control input {
    width: min(280px, 45vw);
}

.user-avatar:is(img) {
    object-fit: cover;
}

.floating-calculator {
    position: fixed;
    right: 92px;
    bottom: 18px;
    z-index: 86;
    width: min(680px, calc(100vw - 24px));
    height: min(610px, calc(100vh - 24px));
    min-width: 360px;
    min-height: 360px;
    overflow: hidden;
    resize: both;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .35);
}

.floating-calculator-header {
    height: 44px;
    padding: 0 10px 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--sidebar-header);
    color: var(--sidebar-text);
    cursor: move;
}

.floating-calculator-header strong,
.floating-calculator-header div,
.floating-calculator-header a,
.floating-calculator-header button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.floating-calculator-header a,
.floating-calculator-header button {
    padding: 5px;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.floating-calculator iframe {
    width: 100%;
    height: calc(100% - 44px);
    border: 0;
}

.calculator-window-body {
    height: 100vh;
    min-height: 0;
    background: var(--panel);
    overflow-y: auto;
}

.calculator-window-shell {
    padding: 10px;
    box-sizing: border-box;
}

.calculator-window-rows {
    display: grid;
    gap: 6px;
}

.calculator-window-rows fieldset {
    margin: 0;
    padding: 7px;
    display: grid;
    grid-template-columns: 2fr 1fr repeat(3, 1fr);
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.calculator-window-rows legend {
    padding: 0 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.calculator-window-rows label {
    min-width: 0;
    margin: 0;
}

.calculator-window-rows label span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.calculator-window-rows input,
.calculator-window-rows select {
    min-width: 0;
    padding: 7px;
    font-size: 11px;
}

.calculator-window-result {
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.calculator-window-result article {
    padding: 8px 2px;
    border-bottom: 1px solid var(--border);
}

.calculator-window-result h3 {
    margin: 0 0 6px;
    font-size: 12px;
}

.calculator-window-result h3 span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.calculator-window-result dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.calculator-window-result dl div {
    min-width: 0;
}

.calculator-window-result dt {
    color: var(--muted);
    font-size: 9px;
}

.calculator-window-result dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    font-size: 11px;
    font-weight: 700;
}

.calculator-window-result p {
    margin: 0;
    padding: 7px 2px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.calculator-window-net {
    font-size: 15px;
}

@media (max-width: 560px) {
    .calculator-window-rows fieldset {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calculator-window-scrip {
        grid-column: 1 / -1;
    }

    .calculator-window-result dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bulk-per-page {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bulk-per-page select {
    width: auto;
    min-width: 76px;
}

.lead-status-quick-form {
    display: inline-flex;
    margin: 0;
}

.lead-status-quick-form select {
    width: auto;
    min-width: 130px;
    padding: 9px 30px 9px 10px;
}

.callback-time-error {
    margin: -4px 0 0;
    color: var(--danger, #b42318);
    font-size: 12px;
    font-weight: 700;
}

.future-followup-error {
    margin-top: 5px;
    display: block;
    color: var(--danger, #b42318);
    font-size: 12px;
    font-weight: 700;
}

.future-followup-error[hidden] {
    display: none;
}

.callback-time-selects {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
    align-items: center;
    gap: 7px;
}

.callback-time-selects span {
    font-weight: 800;
}

.lead-quick-actions {
    position: relative;
    display: inline-block;
}

.lead-quick-actions summary {
    list-style: none;
    cursor: pointer;
}

.lead-quick-actions summary::-webkit-details-marker {
    display: none;
}

.lead-quick-actions > div {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    width: 160px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-raised);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.lead-quick-actions > div a {
    display: block;
    padding: 8px;
    border-radius: 3px;
    color: var(--text);
    text-decoration: none;
}

.lead-quick-actions > div a:hover {
    background: var(--surface-soft);
}

.assignment-notifications-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 120;
    width: min(380px, 100vw);
    height: 100vh;
    padding: 0 14px 14px;
    border-left: 1px solid var(--border);
    background: var(--panel);
    box-shadow: -14px 0 36px rgba(0, 0, 0, .24);
    overflow-y: auto;
}

.assignment-notifications-panel[hidden] {
    display: none;
}

.assignment-notifications-panel header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.assignment-notifications-panel header button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.assignment-notifications-list {
    margin: 10px 0;
}

.assignment-notifications-list a {
    padding: 11px 4px;
    display: block;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.assignment-notifications-list span {
    margin-top: 4px;
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.floating-chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    width: min(460px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 24px));
    min-width: 320px;
    min-height: 300px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 36px);
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .35);
    overflow: hidden;
    resize: both;
}

.floating-chat-header {
    height: 42px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--sidebar-header);
    color: var(--sidebar-text);
    cursor: move;
    user-select: none;
}

.floating-chat-header div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.floating-chat-header button,
.floating-chat-popout {
    border: 1px solid var(--sidebar-border);
    border-radius: 3px;
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    padding: 6px 8px;
}

.floating-chat iframe {
    width: 100%;
    height: calc(100% - 42px);
    border: 0;
    background: var(--panel);
}

.chat-window-body {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    background: var(--panel);
}

.chat-window-shell {
    height: 100%;
    min-height: 0;
    padding: 10px;
}

.chat-window-group {
    height: 100%;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.chat-window-meta {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-window-group .chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-window-group .chat-form {
    flex: 0 0 auto;
}

.chat-window-empty {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.user-chip {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--surface-soft);
    color: var(--text);
    font-weight: 700;
}

.profile-summary {
    position: relative;
}

.profile-summary .user-chip {
    cursor: pointer;
    font-family: inherit;
}

.ip-lock-form {
    display: inline;
}

.ip-lock {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}

.ip-lock.is-locked {
    border-color: var(--primary);
    background: var(--row-hover);
}

.trusted-ip-label {
    color: var(--muted);
    font-size: 10px;
}

.last-login {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    width: max-content;
    min-width: 190px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .16);
    color: var(--text);
    font-size: 11px;
}

.last-login strong,
.last-login span {
    display: block;
}

.last-login span {
    margin-top: 3px;
}

.account-menu-form {
    margin: 0 0 7px;
}

.account-menu-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.account-menu-link {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--button-bg);
    color: var(--button-text);
    text-align: center;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.account-menu-link:hover {
    background: var(--button-hover);
}

.account-menu-muted {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 11px;
}

.logout-link {
    border-color: #9d302d;
    background: #b63d38;
    color: #fff;
}

.column-picker-table {
    max-width: 760px;
}

.column-picker-table th:first-child,
.column-picker-table td:first-child {
    width: 72px;
    text-align: center;
}

.page-head,
.dashboard-header,
.panel-head,
.page-header {
    min-height: 38px;
    margin: 0 0 12px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border);
}

.page-head h1,
.dashboard-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.panel,
.feature-card,
.stat-card,
.kpi-card,
.visual-panel,
.control-panel {
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.panel,
.visual-panel,
.control-panel {
    padding: 14px;
}

.kpi-grid,
.stats-grid {
    gap: 10px;
    margin-bottom: 14px;
}

.kpi-card,
.stat-card {
    min-height: 72px;
    padding: 12px;
}

.kpi-card strong,
.stat-card h3 {
    color: var(--primary);
    font-size: 19px;
}

.kpi-icon,
.stat-icon,
.quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 16px;
}

.btn {
    min-height: 30px;
    padding: 7px 11px;
    border: 1px solid var(--button-hover);
    border-radius: 2px;
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: none;
    font-size: 12px;
    font-weight: 700;
}

.btn:hover {
    transform: none;
    background: var(--button-hover);
    color: var(--button-text);
}

.btn-sm {
    min-height: 26px;
    padding: 5px 8px;
    border-radius: 2px;
    font-size: 11px;
}

.btn.danger,
.danger {
    border-color: #9d302d;
    background: #b63d38;
}

.nav-disabled {
    cursor: not-allowed;
    opacity: .45;
}

input,
select,
textarea {
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
}

textarea {
    min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 24%, transparent);
    border-color: var(--primary);
}

.modern-table {
    font-size: 12px;
    border: 1px solid var(--border);
}

.modern-table thead th {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--table-head);
    color: var(--table-head-text);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.modern-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.modern-table tbody tr:nth-child(even) {
    background: var(--row-alt);
}

.modern-table tbody tr:hover {
    background: var(--row-hover);
}

.badge,
.chip {
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 700;
}

.form-grid {
    gap: 12px;
}

.bulkbar {
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.sales-bulkbar {
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.sales-bulkbar select,
.sales-bulkbar .btn {
    flex: 1 1 140px;
    min-width: 0;
    white-space: nowrap;
}

.sales-bulkbar .btn {
    flex: 0 1 110px;
}

.sales-list-summary {
    margin: 0 0 10px;
}

.performance-view-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.performance-view-form {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
}

.performance-view-form label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .performance-view-controls {
        flex-wrap: wrap;
    }
}

.bulk-lead-controls {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.bulk-lead-controls select {
    width: auto;
    min-width: 130px;
}

.lead-list-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    white-space: nowrap;
}

.lead-list-controls .bulk-per-page {
    margin: 0;
}

@media (max-width: 900px) {
    .lead-list-controls {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.control-panel h2 {
    margin: -14px -14px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 15px;
}

.control-panel p {
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.control-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.dashboard-chart .chart-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 2fr auto;
    align-items: center;
    gap: 9px;
    margin: 14px 0;
    font-size: 12px;
}

.chart-track {
    height: 14px;
    overflow: hidden;
    border: 1px solid #c5d0d7;
    background: #edf1f4;
}

.chart-track i {
    display: block;
    min-width: 2px;
    height: 100%;
    background: #2779aa;
}

.kpi-clickable {
    cursor: pointer;
}

.kpi-clickable:hover,
.kpi-clickable:focus-visible {
    border-color: #2779aa;
    outline: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 32, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-box {
    background: var(--panel-bg, #fff);
    border: 1px solid #c5d0d7;
    max-width: 640px;
    width: 92%;
    max-height: 82vh;
    overflow: auto;
    padding: 16px 20px 20px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-close {
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.vertical-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    min-height: 220px;
    padding: 8px 4px 0;
    overflow-x: auto;
}

.vbar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 56px;
    height: 100%;
}

.vbar-value {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.vbar-track {
    width: 30px;
    height: 160px;
    display: flex;
    align-items: flex-end;
    background: #edf1f4;
    border: 1px solid #c5d0d7;
}

.vbar-fill {
    width: 100%;
    min-height: 2px;
    background: #2779aa;
}

.vbar-label {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    max-width: 72px;
}

.compensation-panel {
    margin-top: 14px;
}

.compensation-toggle {
    border: 0;
    background: transparent;
    color: #1e5e89;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}

.compensation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.compensation-grid div {
    padding: 10px;
    border: 1px solid #cbd4da;
    background: #f5f8fa;
}

.compensation-grid span,
.compensation-grid strong {
    display: block;
}

.compensation-grid span {
    color: #607380;
    font-size: 11px;
}

.compensation-grid strong {
    margin-top: 5px;
    color: #1e5e89;
    font-size: 15px;
}

.incentive-settings {
    margin-top: 14px;
}

.incentive-settings h2 {
    margin: 0;
    color: #293845;
    font-size: 15px;
}

.inline-action {
    display: inline-flex;
    gap: 4px;
    margin-top: 5px;
}

.order-totals {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0;
    margin: 12px 0 16px;
    border: 1px solid #b7c1c8;
    background: #f1f4f6;
}

.order-totals span {
    min-width: 145px;
    padding: 8px 10px;
    border-right: 1px solid #c8d0d8;
    color: #526370;
    font-size: 11px;
}

.order-totals strong {
    float: right;
    color: #263441;
}

.order-totals .order-grand-total {
    border-right: 0;
    background: #dcebf4;
    color: #1e5e89;
    font-weight: 700;
}

.lead-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid #d8dee3;
}

.lead-details div {
    display: grid;
    grid-template-columns: 115px minmax(0, 1fr);
    min-height: 32px;
    border-bottom: 1px solid #d8dee3;
}

.lead-details div:nth-child(odd) {
    border-right: 1px solid #d8dee3;
}

.lead-details dt,
.lead-details dd {
    margin: 0;
    padding: 8px;
    font-size: 12px;
}

.lead-details dt {
    background: #f3f6f8;
    color: #435563;
    font-weight: 700;
}

.lead-details dd {
    overflow-wrap: anywhere;
}

.lead-description {
    margin-top: 14px;
}

.lead-description h3 {
    margin: -14px -14px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #b7c1c8;
    background: #f1f4f6;
    color: #293845;
    font-size: 15px;
}

.lead-description p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .side-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
    }

    .side-nav a {
        flex: 1 1 130px;
        border-right: 1px solid rgba(255, 255, 255, .07);
    }

    .sidebar-callbacks {
        margin: 0 10px 10px;
    }

    .main {
        padding: 0 10px 18px;
    }

    .topbar {
        margin: 0 -10px 14px;
        padding: 10px;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .compensation-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-chart .chart-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .lead-details {
        grid-template-columns: 1fr;
    }

    .lead-details div:nth-child(odd) {
        border-right: 0;
    }

    .lead-edit-layout {
        grid-template-columns: 1fr;
    }

    .lead-edit-activity {
        grid-template-columns: 1fr;
        padding: 16px 0 0;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .product-checklist {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.floating-notepad {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 85;
    width: min(560px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 24px));
    min-width: 340px;
    min-height: 360px;
    overflow: hidden;
    resize: both;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .35);
}

.floating-notepad-header {
    height: 44px;
    padding: 0 10px 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--sidebar-header);
    color: var(--sidebar-text);
    cursor: move;
    user-select: none;
}

.floating-notepad-header strong,
.floating-notepad-header div,
.floating-notepad-header a,
.floating-notepad-header button {
    display: inline-flex;
    align-items: center;
}

.floating-notepad-header strong,
.floating-notepad-header div {
    gap: 8px;
}

.floating-notepad-header svg {
    width: 17px;
    height: 17px;
}

.floating-notepad-header a,
.floating-notepad-header button {
    width: 30px;
    height: 30px;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.floating-notepad-header a:hover,
.floating-notepad-header button:hover {
    background: rgba(255, 255, 255, .12);
}

.floating-notepad iframe {
    width: 100%;
    height: calc(100% - 44px);
    border: 0;
    background: var(--panel);
}

.notepad-window-body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--panel);
}

.notepad-window-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
}

.notepad-window-tabs {
    padding: 8px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--surface-soft);
}

.notepad-window-tabs a {
    display: block;
    overflow: hidden;
    margin-bottom: 4px;
    padding: 8px 9px;
    border-radius: 4px;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notepad-window-tabs a:hover,
.notepad-window-tabs a.is-active {
    background: var(--row-hover);
    color: var(--primary);
}

.notepad-window-tabs .notepad-new-note {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    font-weight: 700;
}

.notepad-window-form {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) auto;
    gap: 10px;
    padding: 12px;
}

.notepad-window-form textarea {
    min-height: 180px;
    resize: none;
}

.notepad-window-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.notepad-window-actions .check {
    margin-right: auto;
}

@media (max-width: 600px) {
    .topbar-title > div:last-child {
        inset: 8px;
        width: auto;
        height: calc(100vh - 16px);
        min-width: 0;
        min-height: 0;
        resize: none;
    }

    .notepad-window-shell {
        grid-template-columns: 110px minmax(0, 1fr);
    }
}

/* Unified workspace UI */
:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #172b4d;
    --muted: #626f86;
    --primary: #0c66e4;
    --primary-2: #0055cc;
    --border: #dcdfe4;
    --sidebar-bg: #172b4d;
    --sidebar-header: #13233f;
    --sidebar-text: #f7f8f9;
    --sidebar-muted: #b6c2cf;
    --sidebar-border: #2c3e5d;
    --nav-active: #0c66e4;
    --button-bg: #0c66e4;
    --button-hover: #0055cc;
    --button-text: #ffffff;
    --table-head: #f1f2f4;
    --table-head-text: #44546f;
    --row-alt: #fafbfc;
    --row-hover: #e9f2ff;
    --surface-soft: #f1f2f4;
    --surface-raised: #ffffff;
    --input-bg: #ffffff;
    --shadow: 0 1px 2px rgba(9, 30, 66, .08), 0 2px 6px rgba(9, 30, 66, .06);
    --radius: 6px;
}

body {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font-family: inherit;
    letter-spacing: 0;
}

.app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #44546f transparent;
}

.brand-block {
    min-height: 64px;
    padding: 10px 16px;
}

.logo-img {
    width: 36px;
    height: 36px;
    max-width: 36px;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
}

.side-nav {
    padding: 12px 8px;
}

.nav-section-label {
    display: block;
    padding: 14px 10px 6px;
    color: var(--sidebar-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.side-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 40px;
    margin: 2px 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 5px;
    color: var(--sidebar-muted);
    font-size: 13px;
    font-weight: 500;
}

.side-nav .nav-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.side-nav .nav-item span {
    min-width: 0;
    flex: 1;
}

.side-nav .nav-item:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
}

.side-nav .nav-item.is-active {
    background: var(--nav-active);
    color: #fff;
    font-weight: 600;
}

.nav-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 10px;
    text-align: center;
}

.sidebar-mobile-search {
    padding: 4px 4px 12px;
    border: 0;
}

.sidebar-mobile-search label {
    padding-left: 6px;
    font-weight: 500;
}

.sidebar-mobile-search-control {
    grid-template-columns: minmax(0, 1fr) 36px;
}

.sidebar-mobile-search input,
.sidebar-mobile-search button {
    height: 36px;
}

.sidebar-mobile-search input {
    padding: 7px 10px;
    border-radius: 5px 0 0 5px;
}

.sidebar-mobile-search button {
    width: 36px;
    border-radius: 0 5px 5px 0;
}

.sidebar-mobile-search button svg {
    width: 16px;
    height: 16px;
}

.main {
    padding: 0 24px 32px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 64px;
    margin: 0 -24px 24px;
    padding: 10px 24px;
    box-shadow: 0 1px 0 rgba(9, 30, 66, .12);
}

.topbar h3 {
    font-size: 16px;
    font-weight: 600;
}

.topbar p {
    font-size: 12px;
}

.top-actions {
    gap: 10px;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.today-counters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
}

.notification-button,
.system-settings-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

.top-counter {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 1px 1px rgba(9, 30, 66, .05);
}

.notification-button:hover,
.system-settings-icon:hover,
.top-counter:hover {
    background: var(--surface-soft);
    color: var(--primary);
    filter: none;
}

.notification-button svg,
.system-settings-icon svg,
.top-counter svg {
    width: 19px;
    height: 19px;
}

.top-counter svg {
    flex: 0 0 19px;
    color: var(--primary);
}

.top-counter-label {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.top-counter-value {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e9f2ff;
    color: #0055cc;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.license-badge-warning .top-counter-value {
    background: #fff3cd;
    color: #8a6500;
}

.license-badge-danger {
    border-color: #e0a3a3;
}

.license-badge-danger .top-counter-value {
    background: #fde2e2;
    color: #a31414;
}

.license-badge {
    position: relative;
}

.notification-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--panel);
    border-radius: 9px;
    background: #c9372c;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.theme-form {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-popover {
    position: absolute;
    z-index: 50;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(9, 30, 66, .18);
}

.theme-popover label {
    margin: 0 0 7px;
    color: var(--text);
    font-size: 11px;
    text-transform: uppercase;
}

.theme-popover select {
    width: 100%;
    min-height: 260px;
    padding: 3px;
    border-color: var(--border);
    background: var(--input-bg);
}

.theme-popover option {
    padding: 7px 8px;
    border-radius: 3px;
}

.theme-popover optgroup {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.user-chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
}

.user-chip:hover {
    background: var(--surface-soft);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #1f845a;
    color: #fff;
    font-weight: 700;
}

.user-identity {
    display: grid;
    min-width: 92px;
    text-align: left;
}

.user-identity strong {
    overflow: hidden;
    max-width: 150px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-identity small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.user-chip > svg {
    width: 14px;
    height: 14px;
}

.last-login {
    min-width: 250px;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(9, 30, 66, .18);
}

.page-head,
.dashboard-header,
.panel-head,
.page-header {
    min-height: 44px;
    margin-bottom: 16px;
    padding-bottom: 10px;
}

.page-head h1,
.dashboard-header h1 {
    font-size: 22px;
    font-weight: 600;
}

.panel,
.visual-panel,
.control-panel,
.kpi-card,
.stat-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel::before {
    display: none;
}

.btn {
    min-height: 34px;
    gap: 7px;
    padding: 7px 12px;
    border-color: var(--button-bg);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-sm {
    min-height: 30px;
    padding: 5px 9px;
}

input,
select,
textarea {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}

label {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.modern-table {
    border: 0;
    font-size: 13px;
}

.modern-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    background: var(--table-head);
    color: var(--table-head-text);
    font-size: 10px;
    letter-spacing: .04em;
}

.modern-table td {
    padding: 10px 12px;
}

.modern-table tbody tr {
    transition: background-color .12s;
}

.kpi-grid,
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.kpi-card,
.stat-card {
    min-height: 100px;
    padding: 16px;
}

.kpi-card::after,
.stat-card::after {
    display: none;
}

.kpi-icon,
.stat-icon,
.quick-icon {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    box-shadow: none;
}

.kpi-icon svg,
.stat-icon svg,
.quick-icon svg {
    width: 19px;
    height: 19px;
}

.kpi-card span,
.stat-card span {
    margin-top: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
}

.kpi-card strong,
.stat-card h3 {
    font-size: 24px;
    font-weight: 600;
}

.alert {
    border-radius: 4px;
}

.badge,
.chip {
    border-radius: 10px;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 208px minmax(0, 1fr);
    }

    .topbar > div:first-child {
        display: none;
    }

    .topbar {
        justify-content: flex-end;
    }

    .user-identity,
    .theme-label {
        display: none;
    }

    .top-counter-label {
        display: none;
    }

    .top-counter {
        gap: 5px;
        padding-inline: 8px;
    }
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .brand-block {
        min-height: 56px;
    }

    .side-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 8px;
    }

    .sidebar-mobile-search,
    .nav-section-label {
        grid-column: 1 / -1;
    }

    .side-nav .nav-item {
        border: 0;
    }

    .main {
        padding: 0 12px 24px;
    }

    .topbar {
        position: static;
        min-height: 56px;
        margin: 0 -12px 18px;
        padding: 8px 12px;
    }

    .theme-form select {
        width: 82px;
    }

    .today-counters {
        gap: 4px;
        margin-right: 0;
    }

    .page-head,
    .dashboard-header,
    .panel-head,
    .page-header {
        align-items: stretch;
    }

    .action-buttons {
        width: 100%;
    }
}

@media (min-width: 1001px) {
    .superadmin-kpi-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 10px;
    }

    .superadmin-kpi-grid .kpi-card {
        min-width: 0;
        padding: 12px;
    }

    .superadmin-kpi-grid .kpi-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .superadmin-kpi-grid .kpi-card span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
    }

    .superadmin-kpi-grid .kpi-card strong {
        font-size: 21px;
    }
}

/* Modern operations workspace
body {
    font-family: "IBM Plex Sans", sans-serif;
    background:
        linear-gradient(90deg, rgba(14, 116, 144, .035) 1px, transparent 1px),
        linear-gradient(rgba(14, 116, 144, .035) 1px, transparent 1px),
        #f5f8f7;
    background-size: 28px 28px;
}

.app-shell {
    grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
    padding: 16px 12px;
    background: #102b32;
    border-right: 0;
}

.brand-block {
    min-height: 68px;
    padding: 10px 12px 18px;
    border-bottom: 1px solid rgba(218, 247, 239, .14);
    background: transparent;
}

.logo-img {
    width: 44px;
    height: 44px;
    max-width: 44px;
    padding: 5px;
    border-radius: 10px;
    background: #e4f4ed;
}

.brand-name {
    color: #f6fbf8;
    font-size: 18px;
    font-weight: 700;
}

.brand-name span {
    color: #9fc4bb;
    letter-spacing: .06em;
}

.side-nav {
    display: grid;
    gap: 3px;
    padding: 16px 0 0;
}

.nav-section-label {
    padding: 8px 12px 6px;
    color: #8bb6ab;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
}

.side-nav .nav-item {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    color: #c9e0d9;
    font-size: 13px;
    font-weight: 500;
}

.side-nav .nav-item:hover {
    background: rgba(222, 245, 236, .09);
    color: #ffffff;
}

.side-nav .nav-item.is-active {
    background: #e0f2eb;
    color: #124b45;
    font-weight: 700;
}

.side-nav .nav-item svg {
    width: 18px;
    height: 18px;
}

.nav-count {
    margin-left: auto;
    background: rgba(255, 255, 255, .16);
}

.side-nav .nav-item.is-active .nav-count {
    background: #b7ddd1;
    color: #124b45;
}

.sidebar-mobile-search {
    padding: 2px 4px 14px;
    border: 0;
}

.sidebar-mobile-search input {
    border: 1px solid rgba(204, 235, 224, .22);
    border-radius: 6px 0 0 6px;
    background: rgba(255, 255, 255, .1);
    color: #ffffff;
}

.sidebar-mobile-search button {
    border-radius: 0 6px 6px 0;
    background: #2d9d82;
}

.sidebar-callbacks {
    margin: auto 4px 0;
    border: 1px solid rgba(200, 236, 223, .15);
    border-radius: 7px;
    background: rgba(255, 255, 255, .05);
}

.sidebar-callbacks h2,
.sidebar-callbacks a {
    border-color: rgba(200, 236, 223, .12);
}

.main {
    padding: 0 32px 36px;
}

.topbar {
    min-height: 76px;
    margin: 0 -32px 30px;
    padding: 13px 32px;
    border-bottom: 1px solid #dce7e2;
    background: rgba(250, 253, 251, .92);
    box-shadow: 0 4px 18px rgba(23, 55, 48, .05);
    backdrop-filter: blur(16px);
}

.topbar h3 {
    color: #13352f;
    font-size: 17px;
    font-weight: 700;
}

.topbar p {
    color: #648078;
}

.page-head,
.dashboard-header,
.panel-head,
.page-header {
    min-height: 48px;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.page-head h1,
.dashboard-header h1 {
    color: #12342e;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0;
}

.btn {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #19725f;
    border-radius: 5px;
    background: #19725f;
    box-shadow: none;
    color: #ffffff;
    font-weight: 600;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn:hover {
    transform: none;
    border-color: #0f5949;
    background: #0f5949;
    box-shadow: 0 4px 12px rgba(15, 89, 73, .18);
}

.btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
}

.panel,
.visual-panel,
.control-panel,
.kpi-card,
.stat-card {
    border: 1px solid #dbe6e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 3px 13px rgba(26, 61, 53, .055);
}

.panel,
.visual-panel,
.control-panel {
    padding: 22px;
}

.control-panel:hover,
.kpi-card:hover,
.stat-card:hover {
    border-color: #b9d8cc;
    box-shadow: 0 8px 20px rgba(26, 61, 53, .08);
}

.kpi-grid,
.stats-grid {
    gap: 14px;
    margin: 20px 0;
}

.kpi-card,
.stat-card {
    min-height: 126px;
    padding: 18px;
}

.kpi-icon,
.stat-icon,
.quick-icon {
    border-radius: 7px;
    background: #e4f3ec;
    box-shadow: none;
    color: #19725f;
}

.kpi-card span,
.stat-card span {
    color: #70857e;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .065em;
}

.kpi-card strong,
.stat-card h3 {
    color: #133c33;
    font-size: 27px;
    font-weight: 700;
}

label {
    color: #35564d;
    font-weight: 600;
}

input,
select,
textarea {
    border-color: #cbdad4;
    border-radius: 5px;
    background: #fdfefd;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #9bbcaf;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #19725f;
    box-shadow: 0 0 0 3px rgba(25, 114, 95, .14);
}

.lead-search-strip,
.bulkbar {
    padding: 12px;
    border: 1px solid #dbe6e1;
    border-radius: 7px;
    background: #f9fcfa;
}

.bulkbar {
    gap: 10px;
}

.company-branding-settings {
    width: 100%;
}

.company-branding-settings .bulkbar {
    margin-bottom: 0;
}

.table-wrap {
    border: 1px solid #dbe6e1;
    border-radius: 7px;
}

.modern-table {
    font-size: 13px;
}

.modern-table thead th {
    padding: 11px 13px;
    border-bottom: 1px solid #cddcd6;
    background: #edf5f1;
    color: #45645b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
}

.modern-table td {
    padding: 12px 13px;
    border-bottom-color: #e5eeea;
}

.modern-table tbody tr:nth-child(even) {
    background: #fbfdfc;
}

.modern-table tbody tr:hover {
    background: #eff8f4;
}

.badge,
.chip {
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
}

.user-avatar {
    background: #19725f;
}

.notification-button,
.system-settings-icon {
    color: #45645b;
}

.notification-button:hover,
.system-settings-icon:hover,
.top-counter:hover {
    background: #eaf4ef;
    color: #19725f;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 216px minmax(0, 1fr);
    }

    .main {
        padding-inline: 20px;
    }

    .topbar {
        margin-inline: -20px;
        padding-inline: 20px;
    }
}

@media (max-width: 768px) {
    body {
        background-size: 22px 22px;
    }

    .sidebar {
        padding: 8px;
    }

    .brand-block {
        padding: 8px 10px 12px;
    }

    .main {
        padding: 0 12px 24px;
    }

    .topbar {
        margin-inline: -12px;
        padding-inline: 12px;
    }

    .page-head h1,
    .dashboard-header h1 {
        font-size: 23px;
    }

    .panel,
    .visual-panel,
    .control-panel {
        padding: 16px;
    }
}
*/
