/* ═══════════════════════════════════════════════════════════════
   VOIPSERVICE 247 — Makeover v3 (Inter + neutral + amber accent)
   ═══════════════════════════════════════════════════════════════ */

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

:root {
    /* ── Accent (muted amber, used SPARINGLY) ── */
    --gold:        #ad7f3c;
    --gold-rich:   #c08f43;
    --gold-light:  #d8a960;
    --gold-pale:   #fbf7ed;
    --gold-glow:   rgba(173,127,60,0.10);
    --gold-border: rgba(173,127,60,0.25);

    /* ── Navbar / dark surfaces ── */
    --navy:     #0f172a;   /* slate-900 */
    --navy-mid: #1e293b;   /* slate-800 */

    /* ── Backgrounds ── */
    --bg:        #f6f7f9;   /* app canvas */
    --surface:   #ffffff;   /* cards */
    --panel:     #ffffff;   /* side panels */
    --panel-alt: #f3f4f6;   /* subtle row hover */

    /* ── Borders ── */
    --border:       #e5e7eb; /* zinc-200 */
    --border-mid:   #d4d4d8; /* zinc-300 */
    --border-heavy: #a1a1aa; /* zinc-400 */

    /* ── Text ── */
    --ink:    #0f172a;   /* slate-900 */
    --ink-dim:#334155;   /* slate-700 */
    --muted:  #64748b;   /* slate-500 */

    /* ── Status ── */
    --success:      #15803d;
    --success-pale: #ecfdf5;
    --danger:       #b91c1c;
    --danger-pale:  #fef2f2;
    --warning:      #b45309;
    --warning-pale: #fffbeb;
    --info:         #1d4ed8;
    --info-pale:    #eff6ff;

    /* ── Shape + shadow ── */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
    --shadow:    0 2px 4px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.06);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.08), 0 20px 48px rgba(15,23,42,0.12);

    /* ── Typography ── */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
}

/* ── Dark mode ── */
[data-theme="dark"] {
    --gold-pale:   #1f1a10;
    --gold-glow:   rgba(216,169,96,0.14);
    --gold-border: rgba(216,169,96,0.32);

    --navy:     #0a0a0a;
    --navy-mid: #18181b;

    --bg:        #09090b;   /* zinc-950 canvas */
    --surface:   #111113;   /* cards */
    --panel:     #111113;
    --panel-alt: #18181b;

    --border:       #27272a;
    --border-mid:   #3f3f46;
    --border-heavy: #52525b;

    --ink:    #fafafa;
    --ink-dim:#d4d4d8;
    --muted:  #a1a1aa;

    --success-pale: #052e1a;
    --danger-pale:  #2a0a0a;
    --warning-pale: #2a1e05;
    --info-pale:    #0a1630;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
    --shadow:    0 2px 4px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 20px 48px rgba(0,0,0,0.6);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.4px;
    margin: 0;
}

/* ── Scrollbars ── */
* { scrollbar-width: thin; scrollbar-color: var(--border-heavy) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-heavy); border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════ */
.app-navbar {
    height: 46px;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff;
}
.nav-brand .gold { color: var(--gold-light); }

.nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-pill {
    background: rgba(255,255,255,0.1);
    color: var(--gold-light);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--gold-border);
}

.pair-badge {
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.nav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL — 3-panel layout
   ═══════════════════════════════════════════════════════════════ */
.app-shell {
    display: flex;
    height: calc(100vh - 46px);
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--panel);
}

.panel-left {
    width: 230px;
    min-width: 230px;
    border-right: 1px solid var(--border);
}

.panel-center {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.panel-right {
    width: 240px;
    min-width: 240px;
    border-left: 1px solid var(--border);
}

/* ── Role-based layout overrides ── */
body.role-dialer .panel-left  { width: 180px; min-width: 180px; }
body.role-dialer .panel-center { display: none !important; }
body.role-dialer .panel-right  { flex: 1 1 auto; width: auto; min-width: 0; }

body.role-handler .panel-right { width: 230px; min-width: 230px; }
body.role-admin .panel-left    { width: 240px; min-width: 240px; }
body.role-admin .panel-right   { width: 250px; min-width: 250px; }

/* ═══════════════════════════════════════════════════════════════
   SECTION — shared panel section component
   ═══════════════════════════════════════════════════════════════ */
.section {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.section-grow {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section-label {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-actions {
    display: flex;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn-icon {
    background: none;
    border: 1px solid var(--border-mid);
    color: var(--muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }

.btn-sm {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-rich));
    color: #fff;
}
.btn-gold:hover { opacity: 0.9; }

.btn-navy {
    background: var(--navy);
    color: #fff;
}
.btn-green {
    background: #1a7f37;
    color: #fff;
}
.solo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    font-size: 0.72rem;
    color: #cfd4df;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}
.solo-toggle input { margin: 0; cursor: pointer; accent-color: var(--gold); }
.btn-green:hover { opacity: 0.9; }
.pv-actions-secondary { margin-top: 4px; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-mid);
    color: var(--ink-dim);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   LISTS (case list, phone list)
   ═══════════════════════════════════════════════════════════════ */
.list-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.list-item {
    display: block;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.12s;
}
.list-item:hover { background: var(--gold-glow); }
.list-item.active {
    background: var(--navy);
    color: #fff;
}

.list-item-name {
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item.active .list-item-sub { color: rgba(255,255,255,0.6); }

/* ═══════════════════════════════════════════════════════════════
   PHONE VIEWER
   ═══════════════════════════════════════════════════════════════ */
.phone-viewer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    margin-top: 6px;
}

.pv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.pv-name { font-weight: 600; font-size: 0.78rem; color: var(--ink-dim); }
.pv-index { font-size: 0.7rem; color: var(--muted); }

.pv-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 8px;
}
.pv-bar {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.2s;
    width: 0%;
}

.pv-number {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    color: var(--navy);
    padding: 4px 0 8px;
    letter-spacing: 1px;
}
.pv-lead-info {
    font-size: 0.72rem;
    color: #444;
    text-align: center;
    padding: 2px 6px 8px;
    line-height: 1.35;
}
.pv-lead-info strong { color: var(--navy); font-weight: 600; }
.pv-lead-src {
    display: inline-block;
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.pv-touched {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #1a7f37;
    background: #dafbe1;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 8px;
}

/* ── Lead Viewer (full page) ────────────────────────────── */
.lead-viewer {
    padding: 24px 32px;
    max-width: 920px;
    margin: 0 auto;
    font-family: inherit;
}
body.no-right-panel .lead-viewer { margin: 0; max-width: none; }
body.no-right-panel .panel-center > * { max-width: none; }
.lv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.lv-list { font-size: 0.95rem; font-weight: 600; color: var(--navy); }
.lv-index { color: var(--gold); font-weight: 700; margin-left: 8px; }
.lv-progress {
    margin-top: 6px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    width: 260px;
    overflow: hidden;
}
.lv-progress-bar { height: 100%; background: var(--gold); transition: width 0.3s; }
.lv-progress-text { font-size: 0.72rem; color: #888; margin-top: 4px; }

.lv-body { padding: 0; }
.lv-name {
    font-family: var(--font-sans);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}
.lv-age { color: #666; font-size: 1.2rem; font-weight: 400; }
.lv-phone-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 16px 0 28px;
    padding: 16px 20px;
    background: #fff9e6;
    border-radius: 8px;
    border: 1px solid #e6d280;
}
.lv-phone {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--navy);
    flex: 1;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.lv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.lv-field {
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.lv-field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}
.lv-field > div { font-size: 1rem; color: var(--navy); font-weight: 500; }
.lv-field input {
    width: 100%;
    padding: 6px 8px;
    font-size: 1rem;
    color: var(--navy);
    font-weight: 500;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
}
.lv-field input:focus {
    outline: none;
    border-color: var(--gold, #c8a24b);
    box-shadow: 0 0 0 2px rgba(200, 162, 75, 0.15);
}
.lv-field label small { font-weight: 400; text-transform: none; letter-spacing: 0; color: #aaa; }

.lv-name-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}
.lv-edit-name {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--navy);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 4px 0;
}
.lv-edit-name:hover { border-bottom-color: #eee; }
.lv-edit-name:focus { outline: none; border-bottom-color: var(--gold, #c8a24b); }

.lv-save-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -16px 0 20px 0;
}
.lv-save-status { font-size: 0.85rem; color: #666; }

.lv-section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 10px;
}

/* Full lead details panel (shown after "Answered") */
.ld-panel {
    margin-top: 28px;
    padding: 20px;
    background: #fffbee;
    border: 2px solid var(--gold, #c8a24b);
    border-radius: 10px;
}
.ld-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8dfb8;
}
.ld-title {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy, #0c1428);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ld-title small { font-weight: 400; color: #888; letter-spacing: 0.5px; }
.ld-actions { display: flex; gap: 8px; }
.ld-loading, .ld-empty { padding: 20px; text-align: center; color: #888; font-style: italic; }
.ld-empty-inline { color: #aaa; font-style: italic; font-size: 0.85rem; }

.ld-source-card {
    background: #fff;
    border: 1px solid #e8dfb8;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.ld-source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eee;
}
.ld-source-site {
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold, #b08a2a);
    font-size: 0.85rem;
}
.ld-source-date { font-size: 0.75rem; color: #999; }

.ld-field-grid, .ld-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.ld-field {
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 5px;
    border: 1px solid #eee;
}
.ld-field label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.7px;
    margin-bottom: 3px;
}
.ld-field > div {
    font-size: 0.88rem;
    color: var(--navy, #0c1428);
    word-break: break-word;
}
.ld-extra-title {
    margin: 14px 0 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
}
.lv-dispo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 28px;
}
.dispo-btn {
    padding: 14px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.15s;
}
.dispo-btn:hover { opacity: 0.88; }
.dispo-vm   { background: #6366f1; }
.dispo-ans  { background: #16a34a; }
.dispo-wn   { background: #b91c1c; }
.dispo-na   { background: #8b5cf6; }
.dispo-disc { background: #334155; }
.dispo-busy { background: #d97706; }
.dispo-cb   { background: #0369a1; }
.dispo-skip { background: #64748b; }

.lv-actions-bottom {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.lv-actions-bottom button {
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.pv-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.pv-actions .btn-sm { flex: 1; text-align: center; }

/* ═══════════════════════════════════════════════════════════════
   SEARCH INPUT
   ═══════════════════════════════════════════════════════════════ */
.search-input {
    width: 100px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: inherit;
    background: var(--surface);
    outline: none;
}
.search-input:focus { border-color: var(--gold); width: 130px; }

/* ═══════════════════════════════════════════════════════════════
   CASE DETAIL (center panel)
   ═══════════════════════════════════════════════════════════════ */
.case-detail {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: none;
}

.case-detail.visible { display: block; }

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

.case-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 600;
}

.case-phone {
    font-size: 0.82rem;
    color: var(--muted);
}

.case-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.case-section-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.field-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.field-row label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 0;
    flex-shrink: 0;
}

.field-row .form-control,
.field-row .form-select {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-color: var(--border);
    background: var(--panel);
}

/* Save bar */
.case-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 0;
}

/* ── Actions Checklist ── */
.action-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.78rem;
}
.action-item input[type="checkbox"] { accent-color: var(--gold); }
.action-item.done { text-decoration: line-through; color: var(--muted); }

/* ── Reminders ── */
.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
}
.reminder-time { color: var(--info); font-weight: 600; }
.reminder-done { color: var(--success); }

/* ── Notes Feed ── */
.note-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.note-meta {
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 2px;
}
.note-meta strong { color: var(--ink-dim); }
.note-text { font-size: 0.78rem; }

.note-input-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.note-input-row input {
    flex: 1;
    font-size: 0.78rem;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.empty-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.4; }
.empty-text { font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   PAIRING SECTION
   ═══════════════════════════════════════════════════════════════ */
.pairing-section { border-top: 3px solid var(--gold); }

.pairing-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pairing-row select { flex: 1; }

.pairing-status {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 4px;
}

.admin-toggle {
    margin-bottom: 6px;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--ink-dim);
    cursor: pointer;
}
.toggle-label input { accent-color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════
   LIVE CALL PANEL
   ═══════════════════════════════════════════════════════════════ */
.live-call-section { border-top: 3px solid var(--success); }

.live-call-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    min-height: 60px;
}

.live-idle {
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
    padding: 12px 0;
}

.live-field {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
}
.live-field:last-child { border-bottom: none; }
.live-label { color: var(--muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; }
.live-value { font-weight: 500; text-align: right; }

.live-number {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    color: var(--navy);
    padding: 6px 0;
    letter-spacing: 1px;
}

.live-status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.live-status-dialing   { background: var(--warning-pale); color: var(--warning); }
.live-status-active    { background: var(--success-pale); color: var(--success); }
.live-status-idle      { background: var(--panel-alt); color: var(--muted); }

/* ── Admin Live Feed ── */
.live-feed-scroll {
    max-height: 180px;
    overflow-y: auto;
}

.live-channel {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}
.live-channel-name { font-weight: 600; color: var(--ink-dim); }
.live-channel-number { font-family: var(--font-sans); font-weight: 500; }
.live-channel-time { font-size: 0.65rem; color: var(--muted); }
.live-channel.stale { opacity: 0.5; }

.badge-count {
    background: var(--gold);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-family: var(--font-sans);
}

/* ═══════════════════════════════════════════════════════════════
   DISPOSITIONS
   ═══════════════════════════════════════════════════════════════ */
.disp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

body.role-dialer .disp-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

.disp-btn {
    padding: 5px 4px;
    font-size: 0.66rem;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: #fff;
    text-transform: uppercase;
    transition: opacity 0.12s, transform 0.08s;
}
.disp-btn:hover { opacity: 0.88; }
.disp-btn:active { transform: scale(0.96); }

.disp-vm   { background: #6366f1; }
.disp-ans  { background: var(--success); }
.disp-wrong{ background: var(--danger); }
.disp-na   { background: #7c3aed; }
.disp-disc { background: #475569; }
.disp-emb  { background: #ea580c; }
.disp-cb   { background: var(--info); }
.disp-busy { background: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   CHAT
   ═══════════════════════════════════════════════════════════════ */
.chat-section {
    border-bottom: none;
}

.chat-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 60px;
    padding: 4px 0;
}

.chat-msg {
    padding: 3px 0;
    font-size: 0.75rem;
}
.chat-sender {
    font-weight: 600;
    color: var(--ink-dim);
    font-size: 0.68rem;
}
.chat-sender.admin { color: var(--gold); }
.chat-sender.handler { color: var(--info); }
.chat-sender.dialer { color: var(--success); }
.chat-time {
    font-size: 0.6rem;
    color: var(--muted);
    margin-left: 4px;
}
.chat-text { color: var(--ink); }

.chat-input-row {
    display: flex;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    min-width: 0;
}
.chat-input-row .btn-sm { flex-shrink: 0; white-space: nowrap; padding: 5px 10px; }

.chat-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    outline: none;
}
.chat-input:focus { border-color: var(--gold); }

.chat-filter {
    width: auto;
    min-width: 60px;
    font-size: 0.68rem;
    padding: 0 4px;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ═══════════════════════════════════════════════════════════════ */
.dashboard {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
}

.dash-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--ink);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}
.kpi-card.navy::before  { background: var(--navy); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.amber::before { background: var(--warning); }
.kpi-card.red::before   { background: var(--danger); }

.kpi-value {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}
.kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}

/* Charts row */
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.chart-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 8px;
}

.mini-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.72rem;
}
.mini-bar-label { width: 70px; text-align: right; color: var(--ink-dim); font-weight: 500; }
.mini-bar-track { flex: 1; height: 14px; background: var(--panel-alt); border-radius: 3px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.3s; }
.mini-bar-count { width: 30px; text-align: right; font-weight: 600; color: var(--ink); }

/* Team activity table */
.activity-table {
    width: 100%;
    font-size: 0.72rem;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.activity-table th {
    background: var(--navy);
    color: #fff;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 6px 8px;
    text-align: left;
}
.activity-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
}
.activity-table tr:hover td { background: var(--gold-glow); }

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-open    { background: var(--success-pale); color: var(--success); }
.badge-closed  { background: var(--danger-pale); color: var(--danger); }
.badge-handler { background: var(--info-pale); color: var(--info); }
.badge-dialer  { background: var(--gold-pale); color: var(--gold); }
.badge-admin   { background: rgba(12,20,40,0.08); color: var(--navy); }

/* ═══════════════════════════════════════════════════════════════
   TOASTS (top-right, card style with progress bar)
   ═══════════════════════════════════════════════════════════════ */
#toastContainer {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 280px;
    max-height: 40vh;
    overflow: hidden;
    pointer-events: none;
}

.app-toast {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(30,20,8,0.14);
    overflow: hidden;
    animation: toastSlideIn 0.24s cubic-bezier(0.22,1,0.36,1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}

.toast-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 12px;
}

.toast-icon-wrap {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--gold-glow);
    color: var(--gold);
}

.toast-text {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
    padding-top: 2px;
    flex: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 2px; width: 100%;
    background: var(--gold);
    transform-origin: left;
    animation: toastDrain 3.2s linear forwards;
}

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon-wrap { background: rgba(14,92,58,0.10); color: var(--success); }
.toast-success .toast-progress { background: var(--success); }

.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon-wrap { background: rgba(136,0,20,0.10); color: var(--danger); }
.toast-error .toast-progress { background: var(--danger); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon-wrap { background: rgba(184,108,0,0.10); color: var(--warning); }
.toast-warning .toast-progress { background: var(--warning); }

.toast-info { border-left-color: var(--navy); }
.toast-info .toast-icon-wrap { background: rgba(12,20,40,0.08); color: var(--navy); }
.toast-info .toast-progress { background: var(--navy-mid); }

.toast-out { opacity: 0; transform: translateX(16px); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastDrain {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   FORMS (Bootstrap overrides)
   ═══════════════════════════════════════════════════════════════ */
.form-control-sm, .form-select-sm {
    font-size: 0.8rem;
    border-color: var(--border);
    border-radius: var(--radius-sm);
}
.form-control-sm:focus, .form-select-sm:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-glow);
}

.form-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Modal overrides ── */
.modal-header {
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
}
.modal-header .modal-title {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}
.modal-header .btn-close { filter: invert(1); }
.modal-content { border-radius: var(--radius); border: none; }
.modal-footer { padding: 8px 16px; }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.text-muted { color: var(--muted) !important; }
.text-gold  { color: var(--gold) !important; }
.text-navy  { color: var(--navy) !important; }
.fw-600     { font-weight: 600; }
.gap-4      { gap: 4px; }
.mt-1       { margin-top: 4px; }
.mt-2       { margin-top: 8px; }
.mb-1       { margin-bottom: 4px; }
.mb-2       { margin-bottom: 8px; }
.mb-3       { margin-bottom: 12px; }
.w-100      { width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Half-screen & narrow windows
   ═══════════════════════════════════════════════════════════════ */

/* ── Half-screen (~960px and below) ── */
@media (max-width: 960px) {
    /* Shrink all panels */
    .panel-left     { width: 200px !important; min-width: 200px !important; }
    .panel-right    { width: 210px !important; min-width: 210px !important; }
    body.role-dialer .panel-left { width: 160px !important; min-width: 160px !important; }
    body.role-admin .panel-left  { width: 210px !important; min-width: 210px !important; }
    body.role-admin .panel-right { width: 220px !important; min-width: 220px !important; }

    /* Tighten spacing */
    .section { padding: 6px 8px; }
    .case-detail { padding: 10px; }
    .case-section { padding: 8px 10px; margin-bottom: 8px; }
    .dashboard { padding: 10px; }

    /* Smaller KPI grid */
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .kpi-value { font-size: 1.2rem; }
    .chart-row { grid-template-columns: 1fr; }

    /* Dialer: 2-col disposition at smaller sizes */
    body.role-dialer .disp-grid { grid-template-columns: 1fr 1fr; }

    /* Compact list items */
    .list-item { padding: 5px 8px; }
    .list-item-name { font-size: 0.75rem; }
    .list-item-sub { font-size: 0.65rem; }

    /* Compact phone viewer */
    .pv-number { font-size: 1.1rem; }
    .pv-actions .btn-sm { font-size: 0.65rem; padding: 3px 6px; }

    /* Compact navbar */
    .nav-brand { font-size: 0.95rem; letter-spacing: 1px; }
    .role-pill { font-size: 0.62rem; padding: 2px 7px; }
    .pair-badge { font-size: 0.62rem; }

    /* Compact search */
    .search-input { width: 70px; }
    .search-input:focus { width: 100px; }

    /* Live call tighter */
    .live-number { font-size: 1rem; }
    .live-field { font-size: 0.72rem; }
}

/* ── Narrow half-screen (~720px) ── */
@media (max-width: 720px) {
    .panel-left     { width: 160px !important; min-width: 160px !important; }
    .panel-right    { width: 180px !important; min-width: 180px !important; }
    body.role-dialer .panel-left { width: 130px !important; min-width: 130px !important; }
    body.role-admin .panel-left  { width: 170px !important; min-width: 170px !important; }
    body.role-admin .panel-right { width: 185px !important; min-width: 185px !important; }

    .section-label { font-size: 0.65rem; }
    .disp-btn { padding: 4px 2px; font-size: 0.6rem; }
    .disp-grid { gap: 3px; }
    body.role-dialer .disp-grid { grid-template-columns: 1fr 1fr; }

    .chat-msg { font-size: 0.7rem; }
    .chat-sender { font-size: 0.62rem; }
    .chat-input { font-size: 0.72rem; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }
    .kpi-value { font-size: 1rem; }
    .kpi-label { font-size: 0.58rem; }

    .activity-table { font-size: 0.65rem; }
    .activity-table th { font-size: 0.6rem; padding: 4px 5px; }
    .activity-table td { padding: 3px 5px; }

    /* Hide lower-priority columns */
    .activity-table th:nth-child(n+6),
    .activity-table td:nth-child(n+6) { display: none; }

    .pairing-row { flex-direction: column; gap: 4px; }

    .pv-actions { flex-wrap: wrap; }
    .pv-actions .btn-sm { flex: 0 0 calc(50% - 2px); font-size: 0.62rem; }
}

/* ── Very narrow (~540px — small split or tablet) ── */
@media (max-width: 540px) {
    /* Stack: hide left panel, right panel takes full width */
    .panel-left { display: none !important; }
    .panel-center { display: none !important; }
    .panel-right {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.role-handler .panel-left { display: flex !important; width: 100% !important; min-width: 0 !important; }
    body.role-handler .panel-right { display: none !important; }
    body.role-handler .panel-center { display: none !important; }

    .app-navbar { padding: 0 8px; }
    .nav-brand { font-size: 0.85rem; }
    .role-pill { font-size: 0.58rem; }
    .pair-badge { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MAKEOVER v3 — polish overrides (applied late in cascade)
   ═══════════════════════════════════════════════════════════════ */

/* ── Typography: tone down uppercase + heavy letter-spacing ── */
.nav-brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: none;
}
.nav-brand .gold { color: var(--gold-light); font-weight: 600; }

.role-pill {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.68rem;
}

.section-label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-dim);
    padding: 4px 0 8px;
    border-bottom: none;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.01em;
    font-weight: 600;
}

/* ── Navbar refinement ── */
.app-navbar {
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
}
.app-navbar .nav-brand { color: var(--ink); }
.app-navbar .nav-brand .gold { color: var(--gold); }
.app-shell { height: calc(100vh - 52px); }

.role-pill {
    background: var(--gold-pale);
    color: var(--gold);
    border: 1px solid var(--gold-border);
}

.pair-badge { color: var(--muted); }

.nav-btn {
    color: var(--ink-dim);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-btn:hover {
    color: var(--ink);
    border-color: var(--border-mid);
    background: var(--panel-alt);
}
.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
}
.nav-icon-btn i { width: 16px; height: 16px; stroke-width: 2; }
.solo-toggle {
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.78rem;
    font-weight: 500;
}
.solo-toggle input { accent-color: var(--gold); }

/* ── Buttons: flatter, modern ── */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    border: 1px solid transparent;
    line-height: 1.2;
}
.btn-gold {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
}
.btn-gold:hover {
    background: var(--gold-rich);
    border-color: var(--gold-rich);
    opacity: 1;
}
.btn-navy {
    background: var(--ink);
    color: var(--surface);
    border-color: var(--ink);
}
.btn-navy:hover { opacity: 0.88; }

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    color: var(--ink-dim);
}
.btn-outline:hover {
    border-color: var(--ink-dim);
    color: var(--ink);
    background: var(--panel-alt);
}
.btn-icon {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    transition: all 0.15s;
}
.btn-icon:hover {
    border-color: var(--ink-dim);
    color: var(--ink);
    background: var(--panel-alt);
}

/* ── Focus rings ── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

/* ── Panels ── */
.panel-left, .panel-right { background: var(--surface); }
.panel-center { background: var(--bg); }
.panel-left { border-right: 1px solid var(--border); }
.panel-right { border-left: 1px solid var(--border); }

/* ── Section containers ── */
.section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

/* ── Lists ── */
.list-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.list-item:hover { background: var(--panel-alt); }
.list-item.active {
    background: var(--gold-pale);
    border-left: 3px solid var(--gold);
    padding-left: 11px;
}

/* ── Activity tables ── */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.activity-table thead th {
    background: var(--panel-alt);
    color: var(--muted);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.activity-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}
.activity-table tbody tr:hover td { background: var(--panel-alt); }
.activity-table tbody tr:last-child td { border-bottom: none; }

/* ── KPI cards ── */
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: none;
    transition: all 0.15s;
}
.kpi-card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-sm); }
.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.kpi-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 6px;
    font-weight: 500;
}
.kpi-card.navy .kpi-value { color: var(--info); }
.kpi-card.amber .kpi-value { color: var(--gold); }
.kpi-card.green .kpi-value { color: var(--success); }
.kpi-card.red .kpi-value { color: var(--danger); }

/* ── Chart cards ── */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: none;
}
.chart-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.88rem;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.mini-bar-fill { background: var(--gold); }

/* ── Case section card ── */
.case-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

/* ── Inputs ── */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=search], select, textarea, .form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}

/* ── Role badges ── */
.badge-admin   { background: var(--gold-pale); color: var(--gold); border: 1px solid var(--gold-border); }
.badge-handler { background: var(--info-pale); color: var(--info); border: 1px solid var(--info); }
.badge-dialer  { background: var(--success-pale); color: var(--success); border: 1px solid var(--success); }
.badge-customer{ background: var(--panel-alt); color: var(--muted); border: 1px solid var(--border); }
[class^="badge-"], [class*=" badge-"] {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
}

/* ── Dashboard title ── */
.dash-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
    padding: 16px 0 14px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-heavy); }

/* ── Dark-mode surface tweaks ── */
[data-theme="dark"] .app-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .btn-gold { color: #0a0a0a; }
[data-theme="dark"] .role-pill {
    background: rgba(216,169,96,0.14);
    color: var(--gold-light);
}
[data-theme="dark"] .modal-content {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
}
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer {
    border-color: var(--border);
}
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
    background: var(--panel-alt);
    color: var(--ink);
    border-color: var(--border-mid);
}
[data-theme="dark"] .btn-outline { background: transparent; }

/* ═══════════════════════════════════════════════════════════════
   MAKEOVER v4 — real structural shift: card panels, modern topbar
   ═══════════════════════════════════════════════════════════════ */

/* ── TOPBAR (rebuilt) ── */
.app-navbar {
    height: 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr minmax(0,520px) 1fr;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.brand-logo {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-rich));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-logo i { width: 16px; height: 16px; stroke-width: 2.2; }
.nav-brand { font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

.nav-center { display: flex; justify-content: center; }
.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    width: 100%;
    max-width: 480px;
    transition: all 0.15s;
}
.nav-search:focus-within { border-color: var(--gold); background: var(--surface); box-shadow: 0 0 0 3px var(--gold-glow); }
.nav-search i { width: 15px; height: 15px; flex-shrink: 0; }
.nav-search input {
    border: none !important;
    background: transparent !important;
    font-size: 0.82rem;
    color: var(--ink);
    flex: 1;
    min-width: 0;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.nav-search kbd {
    font-size: 0.68rem;
    padding: 2px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-weight: 500;
}
.nav-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* ── Avatar + user menu ── */
.nav-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    position: relative;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.15s;
}
.nav-avatar:hover { box-shadow: 0 0 0 3px var(--gold-glow); }
.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 200;
    cursor: default;
    color: var(--ink);
    font-weight: 400;
}
.user-menu.open { display: block; }
.user-menu-head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    text-align: left;
}
.user-menu-name { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.user-menu-email { font-size: 0.74rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.user-menu-item {
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--ink-dim);
    font-size: 0.83rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.user-menu-item:hover { background: var(--panel-alt); color: var(--ink); }
.user-menu-item i { width: 15px; height: 15px; color: var(--muted); }

.app-shell { height: calc(100vh - 60px); }

/* ── SHELL: panels as floating cards ── */
.app-shell {
    padding: 16px;
    gap: 16px;
    background: var(--bg);
}
.panel {
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-left, .panel-right { border-right: 1px solid var(--border) !important; border-left: 1px solid var(--border) !important; }
.panel-center { background: var(--surface) !important; }

/* ── SECTIONS: generous padding, icon + title layout ── */
.section { padding: 16px 18px; }
.section:last-child { border-bottom: none; }
.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 0 10px;
}
.section-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink);
    text-transform: none;
    letter-spacing: -0.005em;
    font-weight: 600;
    font-size: 0.82rem;
}
.section-title i { width: 14px; height: 14px; color: var(--muted); stroke-width: 2; }
.section-actions { display: flex; gap: 4px; }
.btn-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
}
.btn-icon i { width: 14px; height: 14px; stroke-width: 2; }
.btn-icon:hover { color: var(--gold); border-color: var(--gold-border); background: var(--gold-pale); }

/* ── LIST ITEMS: spacier, softer ── */
.list-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 2px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--panel-alt); }
.list-item.active {
    background: var(--gold-pale);
    border-left: 2px solid var(--gold);
    padding-left: 10px;
}
.list-scroll { padding: 4px 0; }

/* ── SEARCH INPUTS inside section headers ── */
.section-label .search-input {
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    max-width: 140px;
    color: var(--ink);
}

/* ── Badge count pill (client base) ── */
.badge-count {
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ── Center panel: content gets proper padding via wrapper rules in existing CSS;
   here we just ensure the panel itself has no extra chrome. ── */
.panel-center { padding: 0; }

/* ── Dashboard spacing ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

/* ── Dark mode: sharpen navbar look ── */
[data-theme="dark"] .app-navbar { background: var(--surface); border-bottom-color: var(--border); }
[data-theme="dark"] .nav-search { background: var(--panel-alt); }
[data-theme="dark"] .nav-search kbd { background: var(--surface); }
[data-theme="dark"] .nav-avatar { background: var(--gold); color: #0a0a0a; }

/* ── Responsive: hide search on narrower ── */
@media (max-width: 900px) {
    .nav-center { display: none; }
    .app-navbar { grid-template-columns: 1fr auto; }
}

/* ═══════════════════════════════════════════════════════════════
   MAKEOVER v4.1 — MODALS (Bootstrap override)
   ═══════════════════════════════════════════════════════════════ */
.modal-backdrop.show { opacity: 0.55; }
[data-theme="dark"] .modal-backdrop.show { opacity: 0.7; }

.modal-content {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    align-items: center;
}
.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    text-transform: none;
}
.modal-body {
    padding: 22px;
    color: var(--ink);
    font-size: 0.88rem;
}
.modal-body label,
.modal-body .form-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ink-dim);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 6px;
    display: block;
}
.modal-body .form-control,
.modal-body .form-select,
.modal-body input[type=text],
.modal-body input[type=email],
.modal-body input[type=password],
.modal-body input[type=number],
.modal-body input[type=tel],
.modal-body textarea {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.88rem;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    outline: none;
}
.modal-body .form-group,
.modal-body .mb-3 { margin-bottom: 14px; }

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--panel-alt);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.modal-footer .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.modal-footer .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}
.modal-footer .btn-primary:hover { background: var(--gold-rich); border-color: var(--gold-rich); }
.modal-footer .btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border-mid);
    color: var(--ink-dim);
}
.modal-footer .btn-secondary:hover { border-color: var(--ink-dim); color: var(--ink); background: var(--panel-alt); }
.modal-footer .btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* Bootstrap's default close X: make it match */
.btn-close {
    width: 28px; height: 28px;
    border-radius: 6px;
    background-color: transparent;
    background-position: center;
    opacity: 0.55;
    transition: all 0.15s;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
}
.btn-close:hover { opacity: 1; background-color: var(--panel-alt); border-color: var(--border); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

/* Larger modals: scraper etc */
.modal-xl .modal-content { border-radius: 16px; }
.modal-lg .modal-content, .modal-xl .modal-content { min-height: 300px; }

/* Nav tabs inside modals (scraper uses them) */
.modal .nav-tabs {
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.modal .nav-tabs .nav-link {
    color: var(--muted);
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    font-size: 0.86rem;
    padding: 10px 14px;
    background: transparent;
}
.modal .nav-tabs .nav-link:hover { color: var(--ink); }
.modal .nav-tabs .nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: transparent;
}

/* Tables inside modals (scraper jobs, results) */
.modal .table {
    font-size: 0.82rem;
    color: var(--ink);
}
.modal .table thead th {
    background: var(--panel-alt);
    color: var(--muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-transform: none;
    font-size: 0.72rem;
}
.modal .table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.modal .table tbody tr:hover td { background: var(--panel-alt); }

/* ═══════════════════════════════════════════════════════════════
   MAKEOVER v4.2 — EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
#emptyState, .empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px !important;
    text-align: center;
    color: var(--muted);
}
.empty-state-icon {
    width: 72px; height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--gold-pale), var(--panel-alt));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--gold);
}
.empty-state-icon i { width: 36px; height: 36px; stroke-width: 1.5; }
.empty-state-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.empty-state-desc {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 380px;
    line-height: 1.55;
    margin-bottom: 22px;
}
.empty-state-hints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    max-width: 620px;
    width: 100%;
    margin-top: 8px;
}
.empty-hint {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
    display: flex;
    align-items: start;
    gap: 10px;
    transition: all 0.15s;
    cursor: pointer;
    color: var(--ink);
    text-decoration: none;
}
.empty-hint:hover { border-color: var(--gold); background: var(--gold-pale); color: var(--ink); }
.empty-hint i { width: 16px; height: 16px; color: var(--gold); margin-top: 2px; flex-shrink: 0; }
.empty-hint strong { font-size: 0.82rem; font-weight: 600; display: block; margin-bottom: 2px; }
.empty-hint span { font-size: 0.74rem; color: var(--muted); line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════════
   MAKEOVER v4.3 — GLOBAL SEARCH (⌘K)
   ═══════════════════════════════════════════════════════════════ */
.cmdk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    z-index: 1050;
}
.cmdk-overlay.open { display: flex; }
[data-theme="dark"] .cmdk-overlay { background: rgba(0,0,0,0.6); }
.cmdk-panel {
    width: 640px;
    max-width: calc(100% - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.cmdk-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.cmdk-input-row i { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.cmdk-input-row input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-size: 1rem;
    color: var(--ink);
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-family: var(--font-sans);
}
.cmdk-input-row kbd {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-family: var(--font-mono);
}
.cmdk-results { max-height: 440px; overflow-y: auto; padding: 6px; }
.cmdk-group-label {
    padding: 10px 12px 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cmdk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink);
    font-size: 0.87rem;
}
.cmdk-item:hover, .cmdk-item.active {
    background: var(--gold-pale);
}
.cmdk-item i { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.cmdk-item.active i { color: var(--gold); }
.cmdk-item-main { flex: 1; min-width: 0; }
.cmdk-item-title { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub { font-size: 0.74rem; color: var(--muted); margin-top: 1px; }
.cmdk-item-kind {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: var(--panel-alt);
    border-radius: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    flex-shrink: 0;
}
.cmdk-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
}
.cmdk-footer {
    display: flex;
    gap: 16px;
    padding: 8px 18px;
    border-top: 1px solid var(--border);
    background: var(--panel-alt);
    font-size: 0.7rem;
    color: var(--muted);
}
.cmdk-footer kbd {
    font-size: 0.65rem;
    padding: 1px 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-right: 4px;
}

/* ─── Subscription banner ──────────────────────────── */
.sub-banner {
    padding: 10px 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    background: #fdf7e4;
    color: #6a5210;
}
.sub-banner.warn { background: #fef0c8; color: #8a6410; }
.sub-banner.danger { background: #fef0f0; color: #8a1010; border-bottom-color: #f5b8b8; }
.sub-banner a, .sub-banner .banner-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
}
.sub-banner .banner-dismiss {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0 4px;
    font-size: 1rem;
}
.sub-banner .banner-dismiss:hover { opacity: 1; }
[data-theme="dark"] .sub-banner { background: rgba(176,138,42,0.12); color: #e5c77e; border-bottom-color: rgba(176,138,42,0.3); }
[data-theme="dark"] .sub-banner.warn { background: rgba(176,138,42,0.2); color: #f5cf7a; }
[data-theme="dark"] .sub-banner.danger { background: rgba(136,16,20,0.18); color: #ff9797; border-bottom-color: rgba(136,16,20,0.4); }

/* ─── Lead viewer compact overrides (v11) ──────────────────
   Tightens everything so dispositions fit without scrolling. */
.lead-viewer { padding: 14px 20px; max-width: 820px; }
.lv-header { padding-bottom: 10px; margin-bottom: 14px; }
.lv-list { font-size: 0.85rem; }
.lv-progress { margin-top: 4px; height: 3px; width: 220px; }
.lv-progress-text { font-size: 0.68rem; margin-top: 2px; }

.lv-name, .lv-edit-name { font-size: 1.35rem; font-weight: 600; }
.lv-age { font-size: 0.92rem; }
.lv-name-row { margin-bottom: 10px; gap: 10px; }

.lv-phone-row {
    margin: 8px 0 14px;
    padding: 10px 14px;
    gap: 12px;
}
.lv-phone { font-size: 1.4rem; letter-spacing: 1px; }
.btn-lg { padding: 8px 16px; font-size: 0.88rem; }

.lv-grid { gap: 8px; margin-bottom: 14px; }
.lv-field { padding: 7px 10px; }
.lv-field label { font-size: 0.64rem; letter-spacing: 0.5px; margin-bottom: 2px; }
.lv-field > div { font-size: 0.88rem; }
.lv-field input { padding: 4px 6px; font-size: 0.88rem; }

.lv-save-row { margin: -8px 0 12px 0; }
.lv-save-status { font-size: 0.76rem; }

.lv-section-label { font-size: 0.72rem; letter-spacing: 0.6px; margin-bottom: 6px; }

.lv-dispo-grid { gap: 6px; margin-bottom: 14px; }
.dispo-btn { padding: 9px 6px; font-size: 0.76rem; letter-spacing: 0.3px; }

.lv-actions-bottom { padding-top: 12px; gap: 8px; }
.lv-actions-bottom button { padding: 8px 14px; font-size: 0.85rem; }

/* Lead-details panel (appears after Answered) — match new scale */
.ld-panel { margin-top: 14px; padding: 12px 14px; }
.ld-header { margin-bottom: 10px; padding-bottom: 8px; }
.ld-title { font-size: 0.95rem; letter-spacing: 0.6px; }
.ld-source-card { padding: 10px 12px; margin-bottom: 8px; }
.ld-field { padding: 6px 8px; }
.ld-field label { font-size: 0.6rem; }
.ld-field > div { font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   Case detail view v2 (v12)
   ═══════════════════════════════════════════════════════════════ */
.case-v2 {
    padding: 0 0 72px 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Hero ── */
.case-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}
.case-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.case-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-rich) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(173,127,60,0.25);
}
.case-hero-meta { min-width: 0; flex: 1; }
.case-hero-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 6px;
}
.case-hero-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
}
.case-id {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--ink-dim);
}
.case-dot { color: var(--border-mid); }
.case-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: capitalize;
    border: 1px solid transparent;
}
.case-status-open { background: var(--info-pale); color: var(--info); border-color: rgba(29,78,216,0.2); }
.case-status-closed { background: var(--success-pale); color: var(--success); border-color: rgba(21,128,61,0.2); }
.case-status-pending { background: var(--warning-pale); color: var(--warning); border-color: rgba(180,83,9,0.2); }
.case-dispo-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--gold-pale);
    color: var(--gold);
    border: 1px solid var(--gold-border);
    text-transform: capitalize;
}
.case-hero-right { display: flex; gap: 6px; flex-shrink: 0; }
.case-hero-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.case-hero-icon:hover {
    background: var(--panel-alt);
    color: var(--ink);
    border-color: var(--border-mid);
}
.case-hero-icon i { width: 16px; height: 16px; }

/* ── Quick chip strip ── */
.case-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.case-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--ink-dim);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    max-width: 100%;
}
.case-chip:hover {
    border-color: var(--gold-border);
    background: var(--gold-pale);
    color: var(--gold);
}
.case-chip i { width: 13px; height: 13px; flex-shrink: 0; }
.case-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}
.case-chip-static { cursor: default; }
.case-chip-static:hover { border-color: var(--border); background: var(--surface); color: var(--ink-dim); }
.case-chip-warn { background: var(--warning-pale); color: var(--warning); border-color: rgba(180,83,9,0.2); }
.case-chip-warn:hover { background: var(--warning-pale); color: var(--warning); border-color: rgba(180,83,9,0.35); }
.case-chip-info { background: var(--info-pale); color: var(--info); border-color: rgba(29,78,216,0.2); }
.case-chip-info:hover { background: var(--info-pale); color: var(--info); border-color: rgba(29,78,216,0.35); }

/* ── 2-col grid ── */
.case-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 14px;
    margin-bottom: 14px;
}
.case-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

@media (max-width: 960px) {
    .case-grid { grid-template-columns: 1fr; }
}

/* ── Card ── */
.case-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.case-card + .case-card { margin-top: 0; }
.case-card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}
.case-card-title i { width: 14px; height: 14px; color: var(--gold); }

/* ── Field grid inside cards ── */
.case-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.case-field-grid label,
.case-legacy-note {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--muted);
    text-transform: uppercase;
}
.case-field-grid label.full-row { grid-column: 1 / -1; }
.case-field-grid input,
.case-field-grid select,
.case-legacy-note textarea {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
}
.case-legacy-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* ── Activity ── */
.note-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.note-input-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.85rem;
}
.note-input-row input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.case-notes-feed { display: flex; flex-direction: column; gap: 10px; }
.note-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
}
.note-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--panel-alt);
    color: var(--ink-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.note-body { flex: 1; min-width: 0; }
.note-meta {
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 2px;
}
.note-meta strong { color: var(--ink-dim); margin-right: 6px; }
.note-text { font-size: 0.85rem; color: var(--ink); line-height: 1.45; }

/* ── Empty inline state ── */
.case-empty-inline {
    padding: 14px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
    background: var(--panel-alt);
    border-radius: var(--radius);
}

/* ── Sticky save bar ── */
.case-save-sticky {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 14px;
}
.case-save-status {
    margin-right: auto;
    font-size: 0.76rem;
    color: var(--muted);
}
.case-save-status.dirty { color: var(--warning); font-weight: 600; }
.case-save-status.saved { color: var(--success); font-weight: 600; }

/* ── Dark mode ── */
[data-theme="dark"] .case-hero,
[data-theme="dark"] .case-card,
[data-theme="dark"] .case-chip,
[data-theme="dark"] .case-hero-icon { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .case-hero-icon:hover { background: var(--panel-alt); }
[data-theme="dark"] .case-save-sticky { background: rgba(30,30,30,0.92); }
[data-theme="dark"] .note-input-row input { background: var(--panel-alt); }
[data-theme="dark"] .case-empty-inline { background: var(--panel-alt); }

/* ═══════════════════════════════════════════════════════════════
   Admin dashboard — billing strip + reveals KPI (v12)
   ═══════════════════════════════════════════════════════════════ */
.admin-billing-strip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin: 0 0 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.admin-billing-strip.warn { border-left-color: var(--warning); background: var(--warning-pale); }
.admin-billing-strip.danger { border-left-color: var(--danger); background: var(--danger-pale); }
.admin-billing-strip .abs-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}
.admin-billing-strip .abs-plan {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    text-transform: capitalize;
}
.admin-billing-strip .abs-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.admin-billing-strip .abs-ctx {
    font-size: 0.82rem;
    color: var(--muted);
}
.admin-billing-strip .abs-middle {
    margin-left: auto;
    text-align: right;
    font-size: 0.88rem;
    color: var(--ink);
}
.admin-billing-strip .abs-middle strong { font-size: 1rem; font-weight: 700; }
.admin-billing-strip .abs-middle small { color: var(--muted); font-weight: 500; }
.admin-billing-strip .abs-sub {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 2px;
}
.admin-billing-strip .abs-right { display: flex; align-items: center; }
.admin-billing-strip .abs-right .btn-gold {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 640px) {
    .admin-billing-strip .abs-middle { margin-left: 0; text-align: left; width: 100%; }
}

.kpi-card.gold::before { background: var(--gold); }
.kpi-card.gold .kpi-value { color: var(--gold); }
[data-theme="dark"] .admin-billing-strip.warn,
[data-theme="dark"] .admin-billing-strip.danger { color: var(--ink); }
