@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   THEME SYSTEM - 5 Curated Themes
   Aurora (Default, teal/bright) | Classic (Navy/Indigo) | Midnight (Dark) | Ember (Warm Dark) | Rose (Wine/Rose)
   ========================================================================== */

:root, [data-theme="aurora"] {
    --sidebar-w: 232px;
    --brand: #0d9488;
    --brand-dark: #0f766e;
    --brand-rgb: 13, 148, 136;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;
    --sidebar-border: #e2e8f0;
    --sidebar-active-bg: #ecfdf5;
    --sidebar-active-text: #0f766e;
    --topbar-bg: #ffffff;
    --table-hover: #f8fafc;
    --input-bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

[data-theme="classic"] {
    --sidebar-w: 232px;
    --brand: #6366f1;
    --brand-dark: #4f46e5;
    --brand-rgb: 99, 102, 241;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-active-bg: rgba(99, 102, 241, 0.18);
    --sidebar-active-text: #ffffff;
    --topbar-bg: #ffffff;
    --table-hover: #f8fafc;
    --input-bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="midnight"] {
    --sidebar-w: 232px;
    --brand: #6366f1;
    --brand-dark: #4f46e5;
    --brand-rgb: 99, 102, 241;
    --bg: #0b0f19;
    --card-bg: #111827;
    --border: rgba(255, 255, 255, 0.09);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #111827;
    --sidebar-text: #94a3b8;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(99, 102, 241, 0.22);
    --sidebar-active-text: #ffffff;
    --topbar-bg: #111827;
    --table-hover: rgba(255, 255, 255, 0.03);
    --input-bg: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="ember"] {
    --sidebar-w: 232px;
    --brand: #f59e0b;
    --brand-dark: #d97706;
    --brand-rgb: 245, 158, 11;
    --bg: #181210;
    --card-bg: #231b17;
    --border: rgba(255, 255, 255, 0.09);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --text: #fef3c7;
    --text-muted: #d97706;
    --sidebar-bg: #1f1612;
    --sidebar-text: #d97706;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(245, 158, 11, 0.2);
    --sidebar-active-text: #ffffff;
    --topbar-bg: #1f1612;
    --table-hover: rgba(255, 255, 255, 0.03);
    --input-bg: #2b201a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="rose"] {
    --sidebar-w: 232px;
    --brand: #f43f5e;
    --brand-dark: #e11d48;
    --brand-rgb: 244, 63, 94;
    --bg: #fff1f2;
    --card-bg: #ffffff;
    --border: #ffe4e6;
    --border-subtle: #fff1f2;
    --text: #1e293b;
    --text-muted: #9f1239;
    --sidebar-bg: #4c0519;
    --sidebar-text: #fecdd3;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(244, 63, 94, 0.25);
    --sidebar-active-text: #ffffff;
    --topbar-bg: #ffffff;
    --table-hover: #fff1f2;
    --input-bg: #fff1f2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(244, 63, 94, 0.08);
}

/* Saturated Icon-Chip Palette */
:root {
    --chip-blue: #3b82f6;
    --chip-indigo: #6366f1;
    --chip-green: #10b981;
    --chip-emerald: #059669;
    --chip-teal: #14b8a6;
    --chip-amber: #f59e0b;
    --chip-orange: #f97316;
    --chip-red: #ef4444;
    --chip-rose: #f43f5e;
    --chip-pink: #ec4899;
    --chip-purple: #8b5cf6;
    --chip-brown: #b45309;
    --chip-slate: #64748b;
}

.chip-blue    { background: var(--chip-blue) !important; color: #fff !important; }
.chip-indigo  { background: var(--chip-indigo) !important; color: #fff !important; }
.chip-green   { background: var(--chip-green) !important; color: #fff !important; }
.chip-emerald { background: var(--chip-emerald) !important; color: #fff !important; }
.chip-teal    { background: var(--chip-teal) !important; color: #fff !important; }
.chip-amber   { background: var(--chip-amber) !important; color: #fff !important; }
.chip-orange  { background: var(--chip-orange) !important; color: #fff !important; }
.chip-red     { background: var(--chip-red) !important; color: #fff !important; }
.chip-rose    { background: var(--chip-rose) !important; color: #fff !important; }
.chip-pink    { background: var(--chip-pink) !important; color: #fff !important; }
.chip-purple  { background: var(--chip-purple) !important; color: #fff !important; }
.chip-brown   { background: var(--chip-brown) !important; color: #fff !important; }
.chip-slate   { background: var(--chip-slate) !important; color: #fff !important; }

/* Base Reset & Typography */
* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* Dark Theme Overrides for Form Inputs & Bootstrap elements */
[data-theme="midnight"] .form-control,
[data-theme="midnight"] .form-select,
[data-theme="ember"] .form-control,
[data-theme="ember"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="midnight"] .form-control:focus,
[data-theme="midnight"] .form-select:focus,
[data-theme="ember"] .form-control:focus,
[data-theme="ember"] .form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-rgb), 0.25);
}

[data-theme="midnight"] .table,
[data-theme="ember"] .table {
    color: var(--text);
}

/* ---------- Login ---------- */
.login-body {
    background: linear-gradient(135deg, #4f46e5 0%, #0b0f19 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    border: 1px solid var(--border);
}
.login-brand { font-size: 1.6rem; font-weight: 800; color: var(--brand); margin-bottom: .25rem; }
.login-sub { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .88rem; }

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

.app-sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1030;
    border-right: 1px solid var(--sidebar-border);
    transition: transform .2s ease;
}
.sidebar-brand {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    padding: .9rem 1rem;
    display: flex; align-items: center; gap: .65rem;
    border-bottom: 1px solid var(--sidebar-border);
    line-height: 1.15;
}
[data-theme="classic"] .sidebar-brand,
[data-theme="midnight"] .sidebar-brand,
[data-theme="ember"] .sidebar-brand,
[data-theme="rose"] .sidebar-brand { color: #fff; }

.sidebar-brand .brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.sidebar-brand small { display: block; font-size: .65rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }

.sidebar-nav { flex: 1; padding: .5rem .55rem 1rem; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(100,116,139,.25); border-radius: 3px; }

.sidebar-section-label {
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
    color: #94a3b8; padding: .85rem .7rem .3rem;
    display: flex; align-items: center; gap: .35rem;
}
[data-theme="rose"] .sidebar-section-label { color: #fda4af; }
[data-theme="ember"] .sidebar-section-label { color: #d97706; }

.sidebar-nav a {
    display: flex; align-items: center; gap: .6rem;
    padding: .38rem .55rem;
    border-radius: 9px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .845rem;
    font-weight: 500;
    margin-bottom: 2px;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-icon-chip {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; color: #fff; background: var(--chip-slate);
}
.sidebar-nav a:hover { background: rgba(var(--brand-rgb), .08); color: var(--sidebar-active-text); }
.sidebar-nav a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .22);
}
.nav-badge {
    margin-left: auto; background: var(--brand); color: #fff;
    font-size: .64rem; font-weight: 700; border-radius: 999px;
    min-width: 20px; height: 18px; padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
}

.sidebar-footer { padding: .75rem .9rem; border-top: 1px solid var(--sidebar-border); }
.user-chip { display: flex; align-items: center; gap: .55rem; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-name { font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.15; }
[data-theme="classic"] .user-name,
[data-theme="midnight"] .user-name,
[data-theme="ember"] .user-name,
[data-theme="rose"] .user-name { color: #fff; }
.user-role { font-size: .68rem; color: var(--text-muted); text-transform: capitalize; }
.sidebar-footer-actions { margin-left: auto; display: flex; gap: .35rem; }
.sidebar-footer-actions a, .sidebar-footer-actions button {
    background: none; border: none; color: var(--text-muted); font-size: .95rem; padding: 2px;
}
.sidebar-footer-actions a:hover, .sidebar-footer-actions button:hover { color: var(--brand); }

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.app-topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    padding: .55rem 1.25rem;
    display: flex; align-items: center; gap: .6rem;
    position: sticky; top: 0; z-index: 1020;
}
.topbar-crumb { font-size: .92rem; font-weight: 600; color: var(--text); }
.topbar-search-wrap { margin-left: auto; position: relative; }
.topbar-search-wrap i {
    position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: .82rem; pointer-events: none;
}
.topbar-search {
    width: 230px; border: 1px solid var(--border); border-radius: 999px;
    padding: .34rem .8rem .34rem 2rem; font-size: .82rem; background: var(--input-bg);
    color: var(--text);
}
.topbar-search:focus { outline: none; border-color: var(--brand); background: var(--card-bg); }
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.topbar-icon-btn {
    width: 33px; height: 33px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; border: none; position: relative; font-size: .88rem;
    text-decoration: none; background: var(--chip-slate);
}
.topbar-icon-btn:hover { color: #fff; filter: brightness(.92); }
.topbar-icon-btn .tb-badge {
    position: absolute; top: -3px; right: -3px;
    background: #ef4444; color: #fff; font-size: .6rem; font-weight: 700;
    border-radius: 50%; min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
    border: 1.5px solid var(--topbar-bg);
}
.topbar-pill {
    display: inline-flex; align-items: center; gap: .32rem;
    border-radius: 8px; padding: .3rem .65rem; font-size: .78rem; font-weight: 600;
    background: var(--card-bg); text-decoration: none;
}
.topbar-pill.break { border: 1px solid #fed7aa; color: #ea580c; }
.topbar-pill.break:hover { background: #fff7ed; color: #ea580c; }
.topbar-pill.logout { border: 1px solid #fecaca; color: #dc2626; }
.topbar-pill.logout:hover { background: #fef2f2; color: #dc2626; }

.app-content { padding: 1.15rem 1.25rem; }

/* ---------- Page Header ---------- */
.page-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; }
.page-head .nav-icon-chip { width: 30px; height: 30px; border-radius: 8px; font-size: .9rem; }
.page-title { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--text); }
.page-count {
    background: #1e293b; color: #fff; font-size: .66rem; font-weight: 700;
    border-radius: 5px; padding: .1rem .35rem; vertical-align: middle; margin-left: .35rem;
}
.page-sub { color: var(--text-muted); font-size: .82rem; margin-bottom: 1rem; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

/* ---------- Cards & Panels ---------- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .9rem 1.05rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; margin-top: .1rem; color: var(--text); }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: #fff;
    background: var(--brand);
}

.kpi-tile {
    border-radius: 12px; padding: .85rem 1.05rem; color: #fff;
    display: flex; align-items: center; gap: .75rem; height: 100%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.kpi-tile .kpi-icon {
    width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.22);
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.kpi-tile .kpi-value { font-size: 1.5rem; font-weight: 800; line-height: 1.05; }
.kpi-tile .kpi-label { font-size: .72rem; opacity: .92; }

.kpi-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-green  { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-red    { background: linear-gradient(135deg, #ef4444, #dc2626); }
.kpi-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.kpi-amber  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-teal   { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.kpi-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.kpi-slate  { background: linear-gradient(135deg, #64748b, #475569); }

.panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}
.panel-title { font-weight: 700; margin-bottom: .85rem; font-size: .95rem; color: var(--text); }
.panel-sub { font-size: .78rem; color: var(--text-muted); margin-top: -.6rem; margin-bottom: .85rem; }

/* Filter Toolbar */
.toolbar {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: .6rem .75rem; margin-bottom: .85rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    box-shadow: var(--shadow-sm);
}
.toolbar .form-control, .toolbar .form-select { font-size: .82rem; }
.btn-filter { background: #334155; color: #fff; border: none; font-size: .8rem; font-weight: 600; padding: .34rem .9rem; border-radius: 7px; }
.btn-filter:hover { background: #1e293b; color: #fff; }
.btn-starred { background: var(--card-bg); border: 1px solid var(--border); color: #b45309; font-size: .8rem; font-weight: 600; padding: .34rem .8rem; border-radius: 7px; }
.btn-starred.on, .btn-starred:hover { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.btn-clear { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; padding: .34rem .8rem; border-radius: 7px; text-decoration: none; }

/* Table Modern */
.table-modern { margin-bottom: 0; color: var(--text); }
.table-modern thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); border-bottom: 2px solid var(--border); font-weight: 700;
}
.table-modern td { vertical-align: middle; font-size: .84rem; border-bottom: 1px solid var(--border); }
.table-modern thead th { white-space: nowrap; }
.table-modern tbody tr:hover { background: var(--table-hover); }
.row-star { color: #cbd5e1; font-size: .85rem; border: none; background: none; }
.row-star.on { color: #f59e0b; }

/* Status Pills */
.badge-status {
    font-size: .68rem; font-weight: 700; padding: .3em .65em; border-radius: 999px;
    letter-spacing: .03em; text-transform: uppercase; display: inline-block; white-space: nowrap;
}
.st-new, .st-blue        { background: #dbeafe; color: #1d4ed8; }
.st-assigned, .st-indigo   { background: #e0e7ff; color: #4338ca; }
.st-contacted, .st-cyan    { background: #cffafe; color: #0e7490; }
.st-callback, .st-orange   { background: #ffedd5; color: #c2410c; }
.st-interested, .st-green  { background: #d1fae5; color: #047857; }
.st-ftd, .st-amber         { background: #fef3c7; color: #92400e; }
.st-noanswer, .st-slate    { background: #f1f5f9; color: #475569; }
.st-notint                 { background: #e2e8f0; color: #334155; }
.st-wrong                  { background: #f1f5f9; color: #64748b; }
.st-duplicate              { background: #f1f5f9; color: #64748b; }
.st-trash, .st-red         { background: #fee2e2; color: #b91c1c; }
.st-purple                 { background: #ede9fe; color: #6d28d9; }
.st-teal                   { background: #ccfbf1; color: #0f766e; }
.st-pink                   { background: #fce7f3; color: #be185d; }
.st-rose                   { background: #ffe4e6; color: #be123c; }

[data-theme="midnight"] .st-new, [data-theme="midnight"] .st-blue        { background: rgba(59,130,246,.2); color: #93c5fd; }
[data-theme="midnight"] .st-assigned, [data-theme="midnight"] .st-indigo { background: rgba(99,102,241,.2); color: #c7d2fe; }
[data-theme="midnight"] .st-contacted, [data-theme="midnight"] .st-cyan  { background: rgba(6,182,212,.2); color: #67e8f9; }
[data-theme="midnight"] .st-callback, [data-theme="midnight"] .st-orange { background: rgba(249,115,22,.2); color: #fdba74; }
[data-theme="midnight"] .st-interested, [data-theme="midnight"] .st-green{ background: rgba(16,185,129,.2); color: #6ee7b7; }
[data-theme="midnight"] .st-ftd, [data-theme="midnight"] .st-amber       { background: rgba(245,158,11,.2); color: #fde68a; }
[data-theme="midnight"] .st-noanswer, [data-theme="midnight"] .st-slate  { background: rgba(100,116,139,.25); color: #cbd5e1; }
[data-theme="midnight"] .st-trash, [data-theme="midnight"] .st-red       { background: rgba(239,68,68,.2); color: #fca5a5; }
[data-theme="midnight"] .st-purple                                       { background: rgba(168,85,247,.2); color: #d8b4fe; }
[data-theme="midnight"] .st-teal                                         { background: rgba(20,184,166,.2); color: #5eead4; }
[data-theme="midnight"] .st-pink                                         { background: rgba(236,72,153,.2); color: #f9a8d4; }
[data-theme="midnight"] .st-rose                                         { background: rgba(244,63,94,.2); color: #fda4af; }
/* Quick Inline Status Dropdown */
.inline-status-dropdown { position: relative; display: inline-block; }
.status-dropdown-btn {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.status-dropdown-btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.status-dropdown-btn:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}
.status-dropdown-btn::after {
    display: inline-block;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
    opacity: 0.6;
    margin-left: 1px;
}
.status-dropdown-menu {
    min-width: 170px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg, #fff);
    padding: 0.35rem 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1050;
}
.status-option-item {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s ease;
}
.status-option-item:hover {
    background: var(--bg);
    color: var(--brand);
}
.status-option-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand);
    font-weight: 700;
}
.status-dropdown-btn.status-updating {
    opacity: 0.6;
    pointer-events: none;
}

.callback-pill {
    background: #fee2e2; color: #b91c1c; font-size: .68rem; font-weight: 700;
    border-radius: 6px; padding: .18rem .45rem; white-space: nowrap;
    display: inline-flex; align-items: center; gap: .25rem;
}
.callback-pill.future { background: #fef3c7; color: #92400e; }

.presence-pill {
    font-size: .66rem; font-weight: 700; border-radius: 999px; padding: .18rem .55rem;
    display: inline-flex; align-items: center; gap: .3rem;
}
.presence-pill.online { background: #14b8a6; color: #fff; }
.presence-pill.offline { background: #334155; color: #cbd5e1; }
.presence-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.row-action {
    width: 30px; height: 30px; border-radius: 8px; border: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8rem; text-decoration: none; color: #fff;
    cursor: pointer;
}
.row-action.call { background: #10b981; }
.row-action.call:hover { background: #059669; color: #fff; }
.row-action.note { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.row-action.note:hover { background: #e0e7ff; color: #4f46e5; }
.row-action.whatsapp { background: #25d366; }
.row-action.whatsapp:hover { background: #128c7e; color: #fff; }

/* Timeline */
.timeline { position: relative; max-height: 520px; overflow-y: auto; padding-left: 0.25rem; }
.timeline-item { display: flex; gap: 0.75rem; position: relative; padding-bottom: 1.1rem; }
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px; top: 32px; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-icon {
    flex: 0 0 32px; height: 32px; width: 32px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    z-index: 1;
}
.timeline-body { flex: 1; min-width: 0; padding-top: 0.35rem; }

/* Kanban Board */
.kanban-board { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.kanban-column {
    flex: 0 0 260px; display: flex; flex-direction: column;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
    max-height: calc(100vh - 220px);
}
.kanban-column-header { color: #fff; font-weight: 700; font-size: 0.85rem; padding: 0.6rem 0.85rem; border-radius: 14px 14px 0 0; }
.kanban-column-body { flex: 1; overflow-y: auto; padding: 0.6rem; min-height: 80px; }
.kanban-column-body.kanban-dragover { background: rgba(0, 0, 0, 0.04); }
.kanban-card {
    background: var(--bg, #fff); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.6rem 0.7rem; margin-bottom: 0.6rem; cursor: grab;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card-name { font-weight: 600; font-size: 0.9rem; text-decoration: none; color: inherit; }

/* Mini Calendar (Callbacks) */
.mini-calendar { width: 100%; border-collapse: separate; border-spacing: 4px; }
.mini-calendar th { font-size: .7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; text-align: center; padding-bottom: .4rem; }
.mini-calendar td { padding: 0; text-align: center; }
.mini-calendar .cal-day {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; aspect-ratio: 1; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent; font-size: .85rem; color: var(--text); text-decoration: none;
    background: var(--card-bg); transition: all 0.15s ease; position: relative;
}
.mini-calendar .cal-day:hover { background: var(--bg); border-color: var(--border); }
.mini-calendar .cal-day.today { border-color: var(--brand); font-weight: 800; }
.mini-calendar .cal-day.selected { background: var(--brand); color: #fff; font-weight: 800; }
.mini-calendar .cal-day .cal-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 2px; }
.mini-calendar .cal-day .cal-dot.past { background: #ef4444; }
.mini-calendar .cal-day .cal-dot.upcoming { background: var(--brand); }
.mini-calendar .cal-day.selected .cal-dot { background: #fff; }

.mini-calendar .cal-badge {
    position: absolute; top: 2px; right: 2px;
    font-size: .6rem; font-weight: 800; color: #fff;
    min-width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.mini-calendar .cal-badge.upcoming { background: #10b981; }
.mini-calendar .cal-badge.past { background: #ef4444; }

.callback-row {
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: .6rem;
    background: var(--card-bg); box-shadow: var(--shadow-sm);
}
.callback-time { font-weight: 800; font-size: .95rem; min-width: 52px; color: var(--text); }

/* Sticky Notes */
.sticky-note {
    border-radius: 12px; padding: .9rem 1rem; min-height: 120px;
    border: 1px solid var(--border); position: relative; display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.sticky-note .note-title { font-weight: 700; font-size: .88rem; margin-bottom: .35rem; }
.sticky-note .note-body { font-size: .82rem; color: #3b3f4a; flex: 1; white-space: pre-wrap; }
.sticky-note .note-meta { font-size: .68rem; color: var(--text-muted); margin-top: .5rem; }
.sticky-note.color-yellow { background: #fef9c3; color: #713f12; }
.sticky-note.color-green  { background: #dcfce7; color: #14532d; }
.sticky-note.color-blue   { background: #dbeafe; color: #1e3a8a; }
.sticky-note.color-pink   { background: #fce7f3; color: #831843; }
.sticky-note.color-purple { background: #ede9fe; color: #581c87; }
.sticky-note.color-white  { background: var(--card-bg); color: var(--text); }
.sticky-note-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.sticky-note-delete-form { position: absolute; top: .5rem; right: .5rem; }
.sticky-note-delete {
    border: none; background: rgba(0,0,0,.06); color: #4b5563; width: 22px; height: 22px;
    border-radius: 50%; font-size: .65rem; line-height: 1; cursor: pointer;
}
.sticky-note-delete:hover { background: rgba(0,0,0,.14); }

/* Softphone Widget */
.softphone {
    position: fixed; bottom: 22px; right: 96px; z-index: 1085;
    width: 300px; background: var(--card-bg); border-radius: 16px; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.25); border: 1px solid var(--border);
    display: none;
}
.softphone.open { display: block; }
.softphone-header {
    background: var(--brand); color: #fff; padding: .75rem 1rem;
    display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .9rem;
}
.softphone-header button { background: none; border: none; color: #fff; cursor: pointer; }
.softphone-body { padding: 1rem; text-align: center; }
.softphone-status { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.softphone-status.ringing, .softphone-status.connected { color: var(--brand); font-weight: 700; }
.softphone-number-display { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; min-height: 1.4em; }
.softphone-dial-input { width: 100%; text-align: center; margin-bottom: .6rem; }
.softphone-actions { display: flex; gap: .5rem; justify-content: center; }
.softphone-btn {
    width: 52px; height: 52px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff;
    cursor: pointer;
}
.softphone-btn.call { background: #22c55e; }
.softphone-btn.hangup { background: #ef4444; }
.softphone-btn.mute { background: var(--text-muted); }
.softphone-fab {
    position: fixed; bottom: 22px; right: 96px; z-index: 1080;
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--brand); color: #fff; border: none; font-size: 1.3rem;
    box-shadow: 0 8px 24px rgba(var(--brand-rgb), .4);
    cursor: pointer;
}
.softphone-disposition { padding: 1rem; }
.softphone-disposition .disp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.softphone-disposition button { font-size: .74rem; padding: .4rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
@media (max-width: 480px) {
    .softphone, .softphone-fab { right: 12px; }
}

/* Chat Widget */
.chat-bubble {
    position: fixed; bottom: 22px; right: 22px; z-index: 1080;
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; box-shadow: 0 8px 24px rgba(var(--brand-rgb),.4);
    border: none; cursor: pointer;
}
.chat-bubble .chat-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700;
    border-radius: 50%; min-width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.chat-panel {
    position: fixed; bottom: 92px; right: 22px; z-index: 1080;
    width: 340px; height: 460px;
    background: var(--card-bg); border-radius: 14px; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.22);
    display: none; flex-direction: column;
    border: 1px solid var(--border);
}
.chat-panel.open { display: flex; }
.chat-panel-header {
    background: var(--sidebar-bg); color: #fff; padding: .8rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
}
.chat-panel-header .back-btn { background: none; border: none; color: #fff; display: none; cursor: pointer; }
.chat-panel-header.in-conversation .back-btn { display: inline-block; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-contact {
    display: flex; align-items: center; gap: .6rem;
    padding: .65rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border);
}
.chat-contact:hover { background: var(--table-hover); }
.chat-contact .dot { width: 9px; height: 9px; border-radius: 50%; background: #c7c9d6; flex-shrink: 0; }
.chat-contact .dot.online { background: #22c55e; }
.chat-contact .name { font-size: .87rem; font-weight: 600; color: var(--text); }
.chat-contact .last-msg { font-size: .75rem; color: var(--text-muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact .unread { margin-left: auto; background: var(--brand); color: #fff; font-size: .68rem; border-radius: 10px; padding: 1px 7px; }

.chat-messages { flex: 1; overflow-y: auto; padding: .75rem; display: none; flex-direction: column; gap: .4rem; }
.chat-messages.open { display: flex; }
.chat-msg { max-width: 78%; padding: .45rem .7rem; border-radius: 12px; font-size: .85rem; line-height: 1.3; }
.chat-msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.theirs { align-self: flex-start; background: var(--input-bg); color: var(--text); border-bottom-left-radius: 3px; border: 1px solid var(--border); }
.chat-msg .time { display: block; font-size: .65rem; opacity: .7; margin-top: 2px; }

.chat-input-row { display: none; padding: .6rem; border-top: 1px solid var(--border); gap: .4rem; }
.chat-input-row.open { display: flex; }
.chat-input-row input { flex: 1; }

@media (max-width: 480px) {
    .chat-panel { width: calc(100vw - 24px); right: 12px; }
    .chat-bubble { right: 12px; }
}

/* vTiger-style Compact Pagination */
.vt-pagination-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
.vt-page-info {
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}
.vt-page-info strong, .vt-page-info .fw-bold, .vt-page-info .fw-semibold {
    color: var(--text, #1e293b);
}
.vt-btn-group {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    background: var(--card-bg, #ffffff);
    overflow: visible;
}
.btn-vt-nav {
    background: var(--card-bg, #ffffff);
    border: none;
    border-right: 1px solid var(--border, #e2e8f0);
    color: var(--text, #475569);
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
    min-width: 28px;
    height: 28px;
}
.btn-vt-nav:last-child {
    border-right: none;
}
.btn-vt-nav:hover:not(.disabled) {
    background: var(--bg, #f1f5f9);
    color: var(--brand, #2563eb);
}
.btn-vt-nav.disabled, .btn-vt-nav:disabled {
    color: var(--text-muted, #cbd5e1);
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--card-bg, #ffffff);
}
.btn-vt-nav.vt-dots-btn::after {
    display: none !important;
}
.btn-vt-nav.vt-dots-btn {
    font-weight: 800;
    letter-spacing: -1px;
}
.vt-jump-popup {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1060;
}
.vt-jump-input {
    border: 1px solid var(--border, #cbd5e1);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 4px;
}
.vt-jump-input:focus {
    border-color: var(--brand, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.vt-go-btn {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.04em;
    border-radius: 4px !important;
}
.vt-go-btn:hover {
    background-color: #15803d !important;
    border-color: #15803d !important;
}
[data-theme="midnight"] .vt-btn-group {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="midnight"] .btn-vt-nav {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="midnight"] .btn-vt-nav:hover:not(.disabled) {
    background: #334155;
    color: #60a5fa;
}
[data-theme="midnight"] .btn-vt-nav.disabled {
    color: #475569;
    background: #1e293b;
}
[data-theme="midnight"] .vt-jump-popup {
    background: #1e293b;
    border-color: #334155;
}

/* ==========================================================================
   MASS ACTIONS (Mass Edit, Mass Delete, Mass Assign, Mass Comment)
   ========================================================================== */
.mass-action-bar {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
    animation: fadeInSlideDown 0.2s ease-out;
}
@keyframes fadeInSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.mass-action-btn {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.mass-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem 1.25rem;
}
.mass-field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}
.mass-field-row:hover {
    border-color: var(--brand, #0d9488);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.mass-field-row.active {
    border-color: var(--brand, #0d9488);
    background-color: rgba(13, 148, 136, 0.08);
}
.mass-field-toggle {
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin: 0 !important;
    cursor: pointer;
    border: 2px solid #64748b !important;
    border-radius: 5px !important;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.mass-field-toggle:checked {
    background-color: var(--brand, #0d9488) !important;
    border-color: var(--brand, #0d9488) !important;
}
.mass-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    margin-bottom: 0;
    min-width: 110px;
    cursor: pointer;
    user-select: none;
}
.mass-field-control {
    flex: 1;
}
.mass-field-control .form-control,
.mass-field-control .form-select {
    cursor: pointer;
    border-color: var(--border, #cbd5e1);
}
.mass-select-banner {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
}
.mass-modal-banner {
    background: var(--border-subtle, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
}
.modal-custom {
    background: var(--card-bg, #ffffff) !important;
    color: var(--text, #1e293b) !important;
    border-radius: 12px !important;
}
.modal-custom .modal-header,
.modal-custom .modal-footer {
    border-color: var(--border, #e2e8f0) !important;
}
[data-theme="midnight"] .mass-field-row {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="midnight"] .mass-field-row.active {
    border-color: var(--brand, #6366f1);
    background-color: rgba(99, 102, 241, 0.12);
}
[data-theme="midnight"] .mass-select-banner,
[data-theme="midnight"] .mass-modal-banner {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="midnight"] .modal-custom {
    background: #111827 !important;
    color: #f8fafc !important;
}
[data-theme="midnight"] .modal-custom .modal-header,
[data-theme="midnight"] .modal-custom .modal-footer {
    border-color: rgba(255, 255, 255, 0.08) !important;
}


