/* =========================================================
   Magnifire Outreach — Design System
   Brand: Ink #0A0908 · Ember #E1331B · Fire #FF6A1A · Gold #FFB454 · Paper #F7F2EA
   ========================================================= */

:root {
    /* Brand tokens */
    --ink:     #0A0908;
    --ember:   #E1331B;
    --fire:    #FF6A1A;
    --gold:    #FFB454;
    --paper:   #F7F2EA;

    /* Light theme (default) */
    --bg:            #F7F2EA;
    --bg-elev:       #FFFFFF;
    --bg-elev-2:     #FFFFFF;
    --bg-subtle:     #EFE8DC;
    --surface:       #FFFFFF;
    --surface-hover: #FBF7EF;

    --border:        rgba(10, 9, 8, 0.08);
    --border-strong: rgba(10, 9, 8, 0.16);
    --border-focus:  rgba(225, 51, 27, 0.45);

    --text:          #0A0908;
    --text-muted:    #6B6258;
    --text-subtle:   #908779;
    --text-inverse:  #FFFFFF;

    --accent:        #E1331B;
    --accent-hover:  #FF6A1A;
    --accent-soft:   rgba(225, 51, 27, 0.10);
    --accent-soft-2: rgba(255, 106, 26, 0.14);

    --success:       #2C8A4A;
    --success-soft:  rgba(44, 138, 74, 0.10);
    --warning:       #B8761A;
    --warning-soft:  rgba(255, 180, 84, 0.18);
    --danger:        #C4321A;
    --danger-soft:   rgba(196, 50, 26, 0.10);
    --info:          #2C5C8A;
    --info-soft:     rgba(44, 92, 138, 0.10);

    --shadow-sm: 0 1px 2px rgba(10, 9, 8, 0.04);
    --shadow:    0 4px 14px rgba(10, 9, 8, 0.06), 0 1px 2px rgba(10,9,8,0.04);
    --shadow-lg: 0 24px 48px -12px rgba(10, 9, 8, 0.12), 0 2px 4px rgba(10,9,8,0.04);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --gradient-ember: linear-gradient(135deg, #E1331B 0%, #FF6A1A 50%, #FFB454 100%);
    --gradient-ember-soft: linear-gradient(135deg, rgba(225, 51, 27, 0.08) 0%, rgba(255, 180, 84, 0.10) 100%);

    --sidebar-w: 248px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 64px;

    --t-fast: 120ms cubic-bezier(.4,0,.2,1);
    --t:      200ms cubic-bezier(.4,0,.2,1);
    --t-slow: 320ms cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
    --bg:            #0A0908;
    --bg-elev:       #15110F;
    --bg-elev-2:     #1C1714;
    --bg-subtle:     #110E0C;
    --surface:       #15110F;
    --surface-hover: #1C1714;

    --border:        rgba(247, 242, 234, 0.08);
    --border-strong: rgba(247, 242, 234, 0.16);
    --border-focus:  rgba(255, 106, 26, 0.55);

    --text:          #F7F2EA;
    --text-muted:    #A8A095;
    --text-subtle:   #7A7268;
    --text-inverse:  #0A0908;

    --accent:        #FF6A1A;
    --accent-hover:  #FFB454;
    --accent-soft:   rgba(255, 106, 26, 0.14);
    --accent-soft-2: rgba(255, 180, 84, 0.18);

    --success:       #4DB672;
    --success-soft:  rgba(77, 182, 114, 0.14);
    --warning:       #FFB454;
    --warning-soft:  rgba(255, 180, 84, 0.16);
    --danger:        #FF6A4A;
    --danger-soft:   rgba(255, 106, 74, 0.14);
    --info:          #6FA0D9;
    --info-soft:     rgba(111, 160, 217, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 4px 14px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0,0,0,0.3);

    --gradient-ember-soft: linear-gradient(135deg, rgba(255, 106, 26, 0.10) 0%, rgba(255, 180, 84, 0.08) 100%);
}

/* ====== Reset / base ====== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--t), color var(--t);
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent-soft-2); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ====== App shell ====== */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns var(--t);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ====== Sidebar ====== */
.sidebar {
    background: var(--ink);
    color: rgba(247, 242, 234, 0.92);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid rgba(247, 242, 234, 0.06);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid rgba(247, 242, 234, 0.06);
    margin-bottom: 8px;
}
.sidebar-brand img {
    height: 38px;
    width: auto;
    flex-shrink: 0;
}
.sidebar-brand .full { display: block; }
.sidebar-brand .mark { display: none; height: 36px; }
.app.collapsed .sidebar-brand .full { display: none; }
.app.collapsed .sidebar-brand .mark { display: block; }

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    margin-top: 8px;
}
.sidebar nav .section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(247, 242, 234, 0.4);
    padding: 14px 12px 6px;
    font-weight: 600;
}
.app.collapsed .section-label { opacity: 0; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(247, 242, 234, 0.78);
    font-weight: 500;
    font-size: 13.5px;
    border: 1px solid transparent;
    transition: all var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar nav a .label { transition: opacity var(--t-fast); }
.app.collapsed .sidebar nav a .label { opacity: 0; }

.sidebar nav a:hover {
    background: rgba(247, 242, 234, 0.05);
    color: #fff;
    border-color: rgba(255, 106, 26, 0.2);
}
.sidebar nav a.active {
    background: rgba(255, 106, 26, 0.12);
    color: #fff;
    border-color: rgba(255, 106, 26, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 180, 84, 0.08);
}
.sidebar nav a.active svg { color: var(--gold); }

.sidebar-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(247, 242, 234, 0.06);
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: rgba(247, 242, 234, 0.78);
    font-size: 12.5px;
    transition: background var(--t-fast);
}
.sidebar-user:hover { background: rgba(247,242,234,0.05); color: #fff; }
.sidebar-user .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-ember);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.sidebar-user .meta { line-height: 1.25; min-width: 0; flex: 1; }
.sidebar-user .meta .name { color: #fff; font-weight: 600; }
.sidebar-user .meta .email { color: rgba(247,242,234,0.5); font-size: 11.5px; }
.app.collapsed .sidebar-user .meta { display: none; }

/* ====== Main area ====== */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1.page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.015em;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

.icon-btn {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--t-fast);
}
.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(225, 51, 27, 0.18);
}
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .sun, .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }
[data-theme="dark"]  .theme-toggle .sun  { display: block; }
:root:not([data-theme]) .theme-toggle .moon { display: block; }

main.content {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ====== Page header ====== */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; font-weight: 700; }
.page-head .lede { color: var(--text-muted); margin: 0; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; }

/* ====== Cards ====== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t), border-color var(--t);
}
.card:hover { box-shadow: var(--shadow); }
.card h2 { font-size: 14px; margin: 0 0 14px; font-weight: 600; letter-spacing: 0.005em; }
.card .card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.card .card-head h2 { margin: 0; }

/* ====== Forms ====== */
label {
    display: block;
    font-weight: 500;
    margin: 14px 0 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    letter-spacing: 0.005em;
}
input[type=text], input[type=email], input[type=password], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    background: var(--bg-elev);
    color: var(--text);
    transition: all var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
input:hover, select:hover, textarea:hover { border-color: var(--text-subtle); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--border-focus);
}
textarea {
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 12.5px;
    min-height: 200px;
    line-height: 1.55;
    resize: vertical;
}
input[type=file] { padding: 8px; cursor: pointer; }
.help { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.help code {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
}

/* ====== Buttons ====== */
.btn, button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    letter-spacing: 0.005em;
    transition: all var(--t-fast);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}
.btn:hover, button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn:active, button:active { transform: translateY(0); }
.btn:focus-visible, button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--border-focus);
}
.btn svg { width: 16px; height: 16px; }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(196, 50, 26, 0.3);
    box-shadow: none;
}
.btn-danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ====== Chips / Badges ====== */
.chip, .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    transition: all var(--t-fast);
    line-height: 1.4;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.9;
}
.badge-sent, .badge-success, .badge-done, .badge-open {
    color: var(--success);
    border-color: rgba(44, 138, 74, 0.35);
    background: var(--success-soft);
}
.badge-failed, .badge-error, .badge-closed {
    color: var(--danger);
    border-color: rgba(196, 50, 26, 0.35);
    background: var(--danger-soft);
}
.badge-pending, .badge-queued, .badge-paused {
    color: var(--warning);
    border-color: rgba(184, 118, 26, 0.35);
    background: var(--warning-soft);
}
.badge-sending, .badge-running {
    color: var(--info);
    border-color: rgba(44, 92, 138, 0.35);
    background: var(--info-soft);
}
.badge-sending::before, .badge-running::before {
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ====== Tables ====== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
th {
    background: var(--bg-subtle);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-hover); }

td.right, th.right { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ====== Flash / Toast ====== */
.flash {
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-weight: 500;
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid transparent;
}
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }
.flash-ok  { background: var(--success-soft); color: var(--success); border-color: rgba(44, 138, 74, 0.25); }
.flash-err { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(196, 50, 26, 0.25); }

/* ====== KPI grid ====== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    overflow: hidden;
    transition: all var(--t);
}
.kpi::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--gradient-ember-soft);
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
}
.kpi:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.kpi:hover::after { opacity: 1; }
.kpi-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
    position: relative; z-index: 1;
}
.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.kpi-icon {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-num {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
    position: relative; z-index: 1;
}
.kpi-meta {
    font-size: 12px;
    color: var(--text-muted);
    position: relative; z-index: 1;
}

/* ====== Layout helpers ====== */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.col-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.cluster { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 980px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .col-2 { grid-template-columns: 1fr; }
}

/* ====== Progress bar ====== */
.progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 999px;
    overflow: hidden;
}
.progress > span {
    display: block; height: 100%;
    background: var(--gradient-ember);
    border-radius: inherit;
    transition: width var(--t-slow);
}
.progress-row {
    display: flex; align-items: center; gap: 10px;
    min-width: 130px;
}
.progress-row .progress { flex: 1; }
.progress-row .pct {
    font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums;
    min-width: 36px; text-align: right; font-weight: 600;
}

/* ====== Empty state ====== */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty .icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid; place-items: center;
    margin: 0 auto 16px;
}
.empty .icon svg { width: 24px; height: 24px; }
.empty h3 { color: var(--text); font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.empty p  { margin: 0 0 16px; font-size: 13px; }

/* ====== Login page ====== */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
}
.login-form-side {
    display: flex; align-items: center; justify-content: center;
    padding: 48px 32px;
}
.login-form-wrap {
    width: 100%;
    max-width: 380px;
}
.login-form-wrap .brand-stack {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 32px;
    height: 48px;
}
.login-form-wrap .brand-stack img { height: 48px; width: auto; }
.logo-on-light, .logo-on-dark { display: none; }
[data-theme="light"] .logo-on-light { display: block; }
[data-theme="dark"]  .logo-on-dark  { display: block; }
:root:not([data-theme]) .logo-on-dark { display: block; }
.login-form-wrap h1 {
    font-size: 26px; margin: 0 0 6px;
    letter-spacing: -0.025em; font-weight: 700;
}
.login-form-wrap .lede {
    font-size: 14px; color: var(--text-muted); margin: 0 0 28px;
}
.login-form-wrap form { display: flex; flex-direction: column; gap: 4px; }
.login-form-wrap form button { margin-top: 18px; padding: 11px 16px; font-size: 14px; justify-content: center; }
.login-form-wrap .legal {
    margin-top: 32px; padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-subtle);
    text-align: center;
}

.login-hero {
    background: var(--ink);
    color: var(--paper);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-hero::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 30%, rgba(225, 51, 27, 0.5) 0%, transparent 38%),
        radial-gradient(circle at 75% 70%, rgba(255, 180, 84, 0.35) 0%, transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(255, 106, 26, 0.4) 0%, transparent 45%);
    filter: blur(40px);
    pointer-events: none;
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero img.logo { height: 64px; width: auto; opacity: 1; align-self: flex-start; }
.login-hero h2 {
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin: 0 0 20px;
    max-width: 560px;
    white-space: nowrap;
}
@media (max-width: 1180px) {
    .login-hero h2 { white-space: normal; font-size: 36px; }
}
.login-hero h2 .accent {
    background: linear-gradient(120deg, var(--fire) 0%, var(--gold) 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.login-hero p {
    font-size: 15px;
    color: rgba(247, 242, 234, 0.7);
    line-height: 1.6;
    margin: 0;
    max-width: 440px;
}
.login-hero .meta-strip {
    display: flex; gap: 28px; font-size: 12px;
    color: rgba(247, 242, 234, 0.5);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.login-hero .meta-strip span { display: flex; align-items: center; gap: 6px; }
.login-hero .meta-strip span::before {
    content: ''; width: 6px; height: 6px;
    background: var(--fire); border-radius: 50%;
}

@media (max-width: 880px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}

/* ====== Misc utilities ====== */
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12.5px; }

.preview {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 320px;
    overflow: auto;
    color: var(--text);
    line-height: 1.55;
}

.kbd {
    display: inline-block; padding: 1px 6px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
    font-size: 11px;
    background: var(--bg-elev);
    color: var(--text-muted);
    line-height: 1.4;
}

.divider {
    height: 1px; background: var(--border);
    margin: 18px 0; border: 0;
}

/* ====== Mobile drawer scrim ====== */
.scrim {
    position: fixed; inset: 0;
    background: rgba(10, 9, 8, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t);
    z-index: 40;
}
.app.drawer-open .scrim { opacity: 1; pointer-events: auto; }

/* ====== Small responsive ====== */
@media (max-width: 720px) {
    .app { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh; width: 260px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform var(--t);
        box-shadow: var(--shadow-lg);
    }
    .app.drawer-open .sidebar { transform: translateX(0); }
    .app:not(.drawer-open) .sidebar { transform: translateX(-100%); }

    .topbar { padding: 0 14px; gap: 8px; }
    .topbar h1.page-title { font-size: 16px; }
    .topbar-right .btn-primary,
    .topbar-right .btn:not(.icon-btn):not(.btn-secondary):not(.btn-ghost) { display: none; }

    main.content { padding: 16px; }
    .page-head { gap: 8px; margin-bottom: 16px; }
    .page-head h1 { font-size: 22px; }

    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi { padding: 14px 14px; }
    .kpi-head { gap: 6px; margin-bottom: 8px; }
    .kpi-label { font-size: 10px; letter-spacing: 0.06em; line-height: 1.25; }
    .kpi-icon { width: 26px; height: 26px; }
    .kpi-icon svg { width: 13px; height: 13px; }
    .kpi-num { font-size: 22px; }
    .kpi-meta { font-size: 11px; }

    .table-wrap { overflow-x: auto; }
    table { min-width: 560px; }

    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}
