/* ─────────────────────────────────────────────────────────────────────
   Inflow Reports — design system
   Aesthetic: Stripe-like clarity. Single sans family (DM Sans), restrained
   weight-based hierarchy, no italics. Inflow brand palette: navy primary,
   coral & olive accents, frost/white surfaces.
   ───────────────────────────────────────────────────────────────────── */

:root {
    /* surface */
    --paper:        #fdfdfe;
    --paper-alt:    #f8f9fe;
    --surface:      #ffffff;
    --surface-alt:  #f8f9fe;
    --rule:         #e6e8ee;
    --rule-soft:    #f0f1f5;
    --rule-strong:  #d3d6df;

    /* text */
    --ink:          #0a111d;
    --ink-mid:      #282d54;
    --ink-soft:     #5f6369;
    --ink-faint:    #9ca0a6;

    /* brand & accents */
    --accent:       #282d54;     /* Inflow deep navy */
    --accent-hover: #1c2042;
    --accent-soft:  #eaecf3;
    --accent-tint:  #f5f6fa;
    --coral:        #f2654a;     /* Inflow coral */
    --coral-soft:   #fde9e3;
    --lavender:     #59619a;     /* Inflow lavender / link */
    --lavender-soft:#eaecf6;
    --olive:        #65782f;     /* Inflow olive */
    --olive-soft:   #eef2dc;

    /* semantic */
    --success:      #65782f;
    --success-soft: #eef2dc;
    --danger:       #c4362a;
    --danger-soft:  #fbe5e2;
    --info:         #59619a;
    --info-soft:    #eaecf6;
    --warning:      #b87a14;
    --warning-soft: #f8ead0;

    /* type */
    --font-body:  "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-mono:  "JetBrains Mono", "SFMono-Regular", "Consolas", monospace;

    --fs-xs:   12px;
    --fs-sm:   13px;
    --fs-base: 14px;
    --fs-md:   16px;
    --fs-lg:   18px;
    --fs-xl:   22px;
    --fs-2xl:  28px;
    --fs-3xl:  36px;
    --fs-disp: 48px;

    --lh-tight:   1.15;
    --lh-snug:    1.3;
    --lh-normal:  1.5;
    --lh-relaxed: 1.65;

    /* space (4px base) */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

    --r-sm:   4px;
    --r-md:   6px;
    --r-lg:   10px;
    --r-pill: 999px;

    --shadow-1: 0 1px 1px rgba(10, 17, 29, 0.04);
    --shadow-2: 0 1px 1px rgba(10, 17, 29, 0.04), 0 4px 10px -2px rgba(10, 17, 29, 0.06);
    --shadow-pop: 0 24px 48px -16px rgba(10, 17, 29, 0.18), 0 2px 6px rgba(10, 17, 29, 0.05);

    --tx-fast:  120ms cubic-bezier(.4,.0,.2,1);
    --tx-base:  180ms cubic-bezier(.4,.0,.2,1);

    --container: 1180px;
}

/* ── reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--lavender);
    text-decoration: none;
    transition: color var(--tx-fast);
}
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink); color: var(--paper);
    padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
}
.skip-link:focus { left: var(--s-3); top: var(--s-3); }

/* ── layout ────────────────────────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s-5);
}
main.container { padding-top: var(--s-6); padding-bottom: var(--s-9); }

/* ── topbar ────────────────────────────────────────────────────────── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
    min-height: 56px;
}
.brand {
    display: inline-flex; align-items: center; gap: var(--s-3);
    color: var(--ink);
    line-height: 1;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-logo { width: 84px; height: auto; display: block; }
.brand-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    border-left: 1px solid var(--rule);
    padding-left: var(--s-3);
    line-height: 1;
}
.brand--centered { justify-content: center; }

.nav {
    display: flex; gap: var(--s-5);
    flex: 1;
    margin-left: var(--s-3);
}
.nav a {
    color: var(--ink-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color var(--tx-fast), border-color var(--tx-fast);
    text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.user-menu { position: relative; }
.user-pill {
    display: inline-flex; align-items: center; gap: var(--s-2);
    padding: 4px 10px;
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    background: var(--surface-alt);
    font-size: var(--fs-sm);
    color: var(--ink-mid);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--tx-fast), border-color var(--tx-fast), color var(--tx-fast);
}
.user-pill:hover {
    background: var(--accent-soft);
    border-color: var(--rule-strong);
    color: var(--ink);
    text-decoration: none;
}
.user-pill[aria-expanded="true"] {
    background: var(--accent-soft);
    border-color: var(--rule-strong);
    color: var(--ink);
}
.user-pill .dot {
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: var(--r-pill);
}
.user-pill-email { line-height: 1; }
.user-pill-chevron {
    opacity: 0.6;
    transition: transform var(--tx-fast);
}
.user-pill[aria-expanded="true"] .user-pill-chevron { transform: rotate(180deg); opacity: 1; }

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    padding: 4px;
    z-index: 60;
    animation: menuFadeIn 120ms ease-out;
}
.user-menu-dropdown[hidden] { display: none; }
.user-menu-form { margin: 0; padding: 0; }
.user-menu-item {
    display: flex; align-items: center; gap: var(--s-3);
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--tx-fast), color var(--tx-fast);
}
.user-menu-item:hover, .user-menu-item:focus-visible {
    background: var(--surface-alt);
    color: var(--accent);
    text-decoration: none;
    outline: none;
}
.user-menu-item svg { color: var(--ink-soft); flex-shrink: 0; }
.user-menu-item:hover svg, .user-menu-item:focus-visible svg { color: var(--accent); }
.user-menu-divider {
    height: 1px;
    background: var(--rule-soft);
    margin: 4px 0;
}
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── page header ───────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-5);
    flex-wrap: wrap;
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--rule);
}
.page-header__heading { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-header__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.page-header__title {
    font-weight: 600;
    font-size: clamp(24px, 3vw, var(--fs-2xl));
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.page-header__sub {
    color: var(--ink-soft);
    font-size: var(--fs-sm);
    display: flex; flex-wrap: wrap; gap: var(--s-2);
    align-items: center;
}
.page-header__sub > * + *::before {
    content: "·";
    color: var(--ink-faint);
    margin-right: var(--s-2);
}
.page-header__actions { display: flex; gap: var(--s-3); align-items: center; }

/* breadcrumbs */
.breadcrumb {
    display: flex; align-items: center; gap: var(--s-2);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    margin-bottom: var(--s-3);
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb svg { width: 12px; height: 12px; opacity: 0.55; }

/* ── alerts ────────────────────────────────────────────────────────── */
.alert {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    margin-bottom: var(--s-4);
    font-size: var(--fs-sm);
    display: flex; gap: var(--s-3);
    align-items: flex-start;
    border: 1px solid;
}
.alert::before {
    content: "";
    width: 3px; align-self: stretch; border-radius: 3px;
    flex-shrink: 0;
}
.alert-error   { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(196,54,42,0.2); }
.alert-error::before   { background: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(101,120,47,0.25); }
.alert-success::before { background: var(--success); }
.alert-notice  { background: var(--info-soft);    color: var(--info);    border-color: rgba(89,97,154,0.25); }
.alert-notice::before  { background: var(--info); }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: var(--s-2);
    padding: 8px 14px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1;
    transition: background var(--tx-fast), border-color var(--tx-fast), box-shadow var(--tx-fast);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-1);
}
.btn:hover { background: var(--surface-alt); border-color: var(--ink-faint); text-decoration: none; }
.btn:active { box-shadow: none; }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
    background: var(--accent); color: #ffffff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-ghost { background: transparent; border-color: var(--rule); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-alt); }

.btn-sm { padding: 4px 10px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn-link {
    background: none; border: none; padding: 0;
    color: var(--ink-soft); font-size: var(--fs-sm);
    cursor: pointer;
}
.btn-link:hover { color: var(--ink); text-decoration: underline; }

/* ── forms ─────────────────────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field > span,
.form-field > label > span,
.field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"],
select, textarea {
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    padding: 8px 12px;
    font-size: var(--fs-sm);
    color: var(--ink);
    transition: border-color var(--tx-fast), box-shadow var(--tx-fast);
    min-width: 0;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
select { cursor: pointer; padding-right: var(--s-6); appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%235f6369' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }

.filters-row {
    display: flex; flex-wrap: wrap; gap: var(--s-3);
    align-items: end;
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-5);
    box-shadow: var(--shadow-1);
}
.filters-row label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }

/* ── KPI grid ──────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--s-3);
    margin: 0 0 var(--s-6);
}
.kpi-card {
    position: relative;
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    transition: border-color var(--tx-fast), box-shadow var(--tx-fast);
}
.kpi-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: var(--s-2);
}
.kpi-value {
    font-weight: 600;
    font-size: var(--fs-2xl);
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums lining-nums;
}
.kpi-sub {
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* featured KPI — first card spans wider on overview */
.kpi-grid--with-feature {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    grid-auto-rows: minmax(120px, auto);
}
.kpi-grid--with-feature .kpi-card:first-child {
    grid-row: span 2;
    background: var(--surface);
    border-color: var(--rule);
    box-shadow: var(--shadow-2);
    padding: var(--s-5);
    display: flex; flex-direction: column; justify-content: space-between;
}
.kpi-grid--with-feature .kpi-card:first-child .kpi-value {
    font-size: clamp(36px, 4.5vw, var(--fs-disp));
    margin-top: var(--s-2);
}
.kpi-grid--with-feature .kpi-card:first-child .kpi-sub {
    font-size: var(--fs-sm);
    margin-top: var(--s-3);
    border-top: 1px solid var(--rule-soft);
    padding-top: var(--s-3);
}
@media (max-width: 900px) {
    .kpi-grid--with-feature { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid--with-feature .kpi-card:first-child { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 540px) {
    .kpi-grid, .kpi-grid--with-feature { grid-template-columns: 1fr; }
    .kpi-grid--with-feature .kpi-card:first-child { grid-column: auto; }
}

/* ── cards / sections ──────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: var(--s-5);
    overflow: hidden;
}
.card__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--rule-soft);
}
.card__title {
    font-weight: 600;
    font-size: var(--fs-md);
    letter-spacing: -0.005em;
    color: var(--ink);
}
.card__sub { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 2px; }
.card__body { padding: var(--s-5); }
.card__body--flush { padding: 0; }

.card-header-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s-4);
    margin: var(--s-6) 0 var(--s-3);
}
.card-header-row h2 {
    font-weight: 600;
    font-size: var(--fs-lg);
    letter-spacing: -0.01em;
    color: var(--ink);
}

/* ── tables ────────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    margin-bottom: var(--s-5);
}
.table-scroll { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}
.data-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--surface-alt);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--rule);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 12px var(--s-4);
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink);
    vertical-align: middle;
}
.data-table tbody tr:hover td { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
    padding: var(--s-3) var(--s-4);
    background: var(--surface-alt);
    border-top: 1.5px solid var(--rule);
    color: var(--ink);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums lining-nums;
}
.data-table tfoot td strong { font-weight: 600; color: var(--ink); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.data-table .num strong { font-weight: 600; }

.data-table th.is-sortable {
    cursor: pointer; user-select: none;
    transition: color var(--tx-fast);
}
.data-table th.is-sortable:hover { color: var(--ink); }
.data-table th.is-sortable .sort-arrow {
    display: inline-block; width: 10px; opacity: 0.35;
    margin-left: 4px;
    transition: opacity var(--tx-fast), transform var(--tx-fast);
}
.data-table th.is-sortable[aria-sort="ascending"]  .sort-arrow { opacity: 1; transform: rotate(180deg); color: var(--accent); }
.data-table th.is-sortable[aria-sort="descending"] .sort-arrow { opacity: 1; color: var(--accent); }

.row-link { color: var(--ink); font-weight: 500; }
.row-link:hover { color: var(--accent); }

.cell-stack { display: flex; flex-direction: column; gap: 1px; }
.cell-meta { color: var(--ink-soft); font-size: var(--fs-xs); }

/* ── badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: var(--rule-soft);
    color: var(--ink-mid);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    line-height: 1.5;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px; height: 6px; border-radius: var(--r-pill);
    background: var(--ink-soft);
    flex-shrink: 0;
}
.badge--success    { background: var(--success-soft);  color: var(--success); }
.badge--success::before    { background: var(--success); }
.badge--danger     { background: var(--danger-soft);   color: var(--danger); }
.badge--danger::before     { background: var(--danger); }
.badge--info       { background: var(--info-soft);     color: var(--info); }
.badge--info::before       { background: var(--info); }
.badge--warning    { background: var(--warning-soft);  color: var(--warning); }
.badge--warning::before    { background: var(--warning); }
.badge--neutral    { background: var(--rule-soft); }

.badge--plain {
    background: transparent;
    border-color: var(--rule);
    color: var(--ink-mid);
}
.badge--plain::before { display: none; }

/* ── chart ─────────────────────────────────────────────────────────── */
.chart-card { padding: var(--s-5) var(--s-5) var(--s-4); }
.chart-meta {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: var(--s-4);
    gap: var(--s-3); flex-wrap: wrap;
}
.chart-stat { display: flex; flex-direction: column; gap: 2px; }
.chart-stat__label {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-soft);
}
.chart-stat__value {
    font-weight: 600;
    font-size: var(--fs-xl);
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums lining-nums;
}
.chart-canvas-wrap {
    position: relative;
    height: 300px;
}

/* ── disclaimer bar ────────────────────────────────────────────────── */
.disclaimer-bar {
    background: var(--surface-alt);
    border-bottom: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: var(--fs-xs);
    text-align: center;
    padding: 7px var(--s-5);
    line-height: 1.4;
}

/* ── tabs ──────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: var(--s-1);
    border-bottom: 1px solid var(--rule);
    margin-bottom: var(--s-5);
    overflow-x: auto;
}
.tab {
    padding: 10px var(--s-4);
    color: var(--ink-soft);
    font-size: var(--fs-sm);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
    transition: color var(--tx-fast), border-color var(--tx-fast);
    white-space: nowrap;
}
.tab:hover {
    color: var(--ink);
    text-decoration: none;
    border-bottom-color: var(--rule-strong);
}
.tab[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

/* ── empty state ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--s-7) var(--s-5);
    color: var(--ink-soft);
}
.empty-state__icon {
    width: 44px; height: 44px;
    border: 1px dashed var(--rule-strong);
    border-radius: var(--r-pill);
    margin: 0 auto var(--s-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-faint);
}
.empty-state__title {
    font-weight: 600;
    font-size: var(--fs-md);
    color: var(--ink);
    margin-bottom: 4px;
}

/* ── login (centered card) ─────────────────────────────────────────── */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-7) var(--s-4);
}
.login-card {
    width: 100%; max-width: 400px;
    display: flex; flex-direction: column; gap: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    padding: var(--s-7) var(--s-6);
}
.login-card .brand { margin-bottom: var(--s-3); }
.login-card h1 {
    font-weight: 600;
    font-size: var(--fs-xl);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 4px;
    text-align: center;
}
.login-card .lead {
    color: var(--ink-soft); font-size: var(--fs-sm);
    margin-bottom: var(--s-3);
    text-align: center;
}
.login-form { display: flex; flex-direction: column; gap: var(--s-3); }
.login-form label { display: flex; flex-direction: column; gap: 6px; }
.login-form label > span {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink-soft);
}
.login-form .btn { justify-content: center; padding: 10px var(--s-4); margin-top: var(--s-2); }

/* ── misc ──────────────────────────────────────────────────────────── */
.muted { color: var(--ink-soft); }
.cta-row { display: flex; gap: var(--s-3); margin-top: var(--s-3); flex-wrap: wrap; }
.inline-form { display: flex; gap: var(--s-3); align-items: end; }
.inline-form label { display: flex; flex-direction: column; gap: 6px; }
.inline-form label > span {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink-soft);
}

.section-title {
    font-weight: 600;
    font-size: var(--fs-lg);
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: var(--s-7) 0 var(--s-3);
}

.raw-dump {
    background: var(--ink);
    color: #e6e8ee;
    padding: var(--s-4);
    border-radius: var(--r-md);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    line-height: 1.5;
}

/* page-load reveal — subtle Stripe-y fade */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
    .reveal > * { opacity: 0; animation: fadeIn 360ms ease-out forwards; }
    .reveal > *:nth-child(1) { animation-delay:  0ms; }
    .reveal > *:nth-child(2) { animation-delay: 40ms; }
    .reveal > *:nth-child(3) { animation-delay: 80ms; }
    .reveal > *:nth-child(4) { animation-delay: 120ms; }
    .reveal > *:nth-child(5) { animation-delay: 160ms; }
    .reveal > *:nth-child(6) { animation-delay: 200ms; }
    .reveal > *:nth-child(7) { animation-delay: 240ms; }
    .reveal > *:nth-child(8) { animation-delay: 280ms; }
}

@media print {
    body { background: white; }
    .topbar, .filters-row, .btn, .cta-row { display: none !important; }
    .card, .table-wrap, .kpi-card { box-shadow: none; border-color: #ccc; }
}
