@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =====================================================================
   LeadsWorld design system
   Type scale: 12 / 13 / 14 / 16 / 20 / 24   Spacing: 4px grid
   Radius: 6 / 8 / 12   Icons: 16 (inline) / 18 (nav) / 20 (tiles)
   ===================================================================== */
:root {
    /* surfaces */
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --surface-3: #f1f3f9;
    --border: #e6e9f2;
    --border-strong: #d4d9e5;

    /* ink */
    --text: #0f172a;
    --text-2: #334155;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* brand */
    --primary: #1A77F0;
    --primary-hover: #1463CF;
    --primary-tint: #EAF3FE;
    --primary-soft: #BBD7FB;
    --brand-gradient: linear-gradient(135deg, #4B9BFF 0%, #1A77F0 55%, #0B5BD3 100%);

    /* accent hues (identity only, e.g. tiles and avatars) */
    --indigo: #1A77F0;  --indigo-tint: #EAF3FE;
    --violet: #7c3aed;  --violet-tint: #f5f3ff;
    --sky: #0284c7;     --sky-tint: #e0f2fe;
    --teal: #0d9488;    --teal-tint: #ccfbf1;
    --emerald: #059669; --emerald-tint: #d1fae5;
    --amber: #d97706;   --amber-tint: #fef3c7;
    --orange: #ea580c;  --orange-tint: #ffedd5;
    --rose: #e11d48;    --rose-tint: #ffe4e6;

    /* status (reserved: always paired with an icon or label) */
    --success: #16a34a; --success-tint: #ecfdf3; --success-border: #bbf7d0;
    --warning: #d97706; --warning-tint: #fffbeb; --warning-border: #fde68a;
    --danger: #dc2626;  --danger-tint: #fef2f2;  --danger-border: #fecaca;
    --info: #0284c7;    --info-tint: #f0f9ff;    --info-border: #bae6fd;

    /* chart categorical order (validated CVD-safe palette, fixed order) */
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --series-5: #e87ba4;

    /* sidebar */
    --side-bg: #07142B;
    --side-bg-2: #0B1D3D;
    --side-text: #94a3b8;
    --side-text-strong: #e2e8f0;
    --side-muted: #5A7299;
    --side-hover: rgba(148, 163, 184, 0.08);
    --side-active: rgba(26, 119, 240, 0.22);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.25);
    --sidebar-w: 256px;
    --topbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Inter", -apple-system, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
    font-feature-settings: "cv11", "ss01";
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 16px; line-height: 1.4; }
h3 { font-size: 14px; line-height: 1.4; }
p { color: var(--text-muted); margin: 4px 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }

/* =====================================================================
   App shell
   ===================================================================== */
.app-shell {
    display: flex; min-height: 100vh;
    /* keeps the dark rail continuous below the sticky sidebar on long pages */
    background: linear-gradient(90deg, var(--side-bg-2) var(--sidebar-w), var(--bg) var(--sidebar-w));
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 32px 48px; width: 100%; max-width: 1440px; }

/* ---------- Sidebar (dark) ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text);
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #1B2F55 transparent;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 20px;
    color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.brand-logo {
    width: 32px; height: 32px; border-radius: var(--radius);
    background: var(--brand-gradient);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 119, 240, 0.4);
    flex-shrink: 0;
}
.brand-sub { display: block; font-size: 12px; font-weight: 500; color: var(--side-muted); letter-spacing: 0; line-height: 1.2; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; }
.sidebar .nav-section {
    margin: 20px 0 8px; padding: 0 12px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--side-muted);
}
.sidebar .nav-section:first-child { margin-top: 0; }
.sidebar nav a {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; margin-bottom: 4px;
    border-radius: var(--radius);
    color: var(--side-text);
    font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar nav a .icon { width: 18px; height: 18px; opacity: .85; }
.sidebar nav a:hover { background: var(--side-hover); color: var(--side-text-strong); }
.sidebar nav a.active { background: var(--side-active); color: #fff; }
.sidebar nav a.active .icon { opacity: 1; color: #8EC1FF; }
.sidebar nav a.active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--brand-gradient);
}
.nav-count {
    margin-left: auto; min-width: 20px; padding: 0 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
    background: #f59e0b; color: #1c1917;
}
.side-card {
    margin: 16px 4px 12px; padding: 16px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(26, 119, 240, 0.22), rgba(56, 189, 248, 0.14));
    border: 1px solid rgba(142, 193, 255, 0.18);
    color: var(--side-text-strong);
}
.side-card .side-card-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.side-card p { color: var(--side-text); font-size: 12px; margin: 4px 0 12px; }
.side-card .meter { height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.2); overflow: hidden; }
.side-card .meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4B9BFF, #38BDF8); }
.side-card .btn { width: 100%; margin-top: 12px; background: #fff; color: var(--text); box-shadow: none; }
.side-card .btn:hover { background: #EAF3FE; color: var(--text); }
.sidebar .logout-row { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, 0.12); }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 8px 12px 12px; }
.sidebar-user .meta { min-width: 0; }
.sidebar-user .name { color: var(--side-text-strong); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .email { color: var(--side-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-faint); }
.crumbs strong { color: var(--text); font-weight: 600; }
.crumbs .icon { color: var(--border-strong); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.top-search { position: relative; width: 280px; }
.top-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.top-search input { padding-left: 36px; background: var(--surface-2); border-color: var(--border); height: 36px; box-shadow: none; }
.top-search input:focus { background: var(--surface); }
.icon-btn {
    position: relative; width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius); background: transparent; color: var(--text-muted);
    border: 1px solid transparent; box-shadow: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn .dot-count {
    position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--rose); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600;
    border: 2px solid #fff; box-sizing: content-box;
}
.menu-toggle { display: none; }
.top-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); padding: 0 12px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

/* ---------- Dropdown menu ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; transition: background .15s; }
.user-chip:hover, .dropdown[open] > .user-chip { background: var(--surface-3); }
.user-chip .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-chip .icon { color: var(--text-faint); }
.menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
    min-width: 224px; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: pop .12s ease-out;
}
.menu-head { padding: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { font-size: 12px; color: var(--text-faint); }
.menu a, .menu button {
    display: flex; width: 100%; height: auto; align-items: center; gap: 12px; padding: 8px 12px;
    border-radius: var(--radius-sm); background: transparent; border: 0; box-shadow: none;
    color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; justify-content: flex-start; line-height: 1.4;
}
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--text); }
.menu .danger-item { color: var(--danger); }
.menu .danger-item:hover { background: var(--danger-tint); color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu form { margin: 0; }
.menu.is-up { top: auto; bottom: calc(100% + 8px); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Page structure
   ===================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }

.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(600px 240px at 90% -20%, rgba(56, 189, 248, 0.55), transparent 60%),
        radial-gradient(500px 260px at 10% 120%, rgba(14, 165, 233, 0.45), transparent 60%),
        linear-gradient(120deg, #0B2A5B 0%, #1463CF 50%, #1A77F0 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 24px;
    box-shadow: 0 12px 32px -12px rgba(26, 119, 240, 0.55);
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, 0.82); max-width: 560px; font-size: 14px; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.hero .btn.light { background: #fff; color: var(--primary); }
.hero .btn.light:hover { background: #EAF3FE; color: var(--primary-hover); }
.hero .btn.ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.28); box-shadow: none; }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.hero-pill .live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25); }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { min-width: 120px; }
.hero-stat .label { font-size: 12px; color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.hero-stat .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Cards
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card-head .sub { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.card-head .link { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-title { display: flex; align-items: center; gap: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 20px 24px 0; }
.card.flush .toolbar { padding: 0 24px 16px; }
.card-foot { padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.dash-grid > .card, .dash-grid .pricing-grid { margin-bottom: 0; }
.dash-grid .pricing-grid { padding-top: 0; }
.dash-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-grid.side-form { grid-template-columns: minmax(0, 1fr) 360px; }
.dash-grid > * { min-width: 0; }
.stack > .card:last-child { margin-bottom: 0; }

/* =====================================================================
   Stat tiles
   ===================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-tile {
    position: relative; overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.stat-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone, var(--indigo)); opacity: .9; }
.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-tile .stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.stat-tile .stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-tile .stat-value small { font-size: 14px; color: var(--text-faint); font-weight: 500; }
.stat-tile .stat-sub { font-size: 12px; color: var(--text-faint); margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stat-icon {
    width: 40px; height: 40px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: #fff; background: var(--tone, var(--indigo));
    box-shadow: 0 6px 14px -4px var(--tone-shadow, rgba(26, 119, 240, 0.45));
}
.stat-icon .icon { width: 20px; height: 20px; }
.stat-tile .sparkline { display: block; width: 100%; height: 36px; margin-top: 12px; }

.tone-indigo  { --tone: linear-gradient(135deg, #4B9BFF, #1A77F0); --tone-solid: var(--indigo);  --tone-tint: var(--indigo-tint);  --tone-shadow: rgba(26, 119, 240, 0.45); }
.tone-violet  { --tone: linear-gradient(135deg, #a78bfa, #7c3aed); --tone-solid: var(--violet);  --tone-tint: var(--violet-tint);  --tone-shadow: rgba(124, 58, 237, 0.45); }
.tone-sky     { --tone: linear-gradient(135deg, #38bdf8, #0284c7); --tone-solid: var(--sky);     --tone-tint: var(--sky-tint);     --tone-shadow: rgba(2, 132, 199, 0.45); }
.tone-teal    { --tone: linear-gradient(135deg, #2dd4bf, #0d9488); --tone-solid: var(--teal);    --tone-tint: var(--teal-tint);    --tone-shadow: rgba(13, 148, 136, 0.45); }
.tone-emerald { --tone: linear-gradient(135deg, #34d399, #059669); --tone-solid: var(--emerald); --tone-tint: var(--emerald-tint); --tone-shadow: rgba(5, 150, 105, 0.45); }
.tone-amber   { --tone: linear-gradient(135deg, #fbbf24, #d97706); --tone-solid: var(--amber);   --tone-tint: var(--amber-tint);   --tone-shadow: rgba(217, 119, 6, 0.45); }
.tone-orange  { --tone: linear-gradient(135deg, #fb923c, #ea580c); --tone-solid: var(--orange);  --tone-tint: var(--orange-tint);  --tone-shadow: rgba(234, 88, 12, 0.45); }
.tone-rose    { --tone: linear-gradient(135deg, #fb7185, #e11d48); --tone-solid: var(--rose);    --tone-tint: var(--rose-tint);    --tone-shadow: rgba(225, 29, 72, 0.45); }
.sparkline.tone-indigo { color: var(--indigo); } .sparkline.tone-violet { color: var(--violet); }
.sparkline.tone-sky { color: var(--sky); } .sparkline.tone-teal { color: var(--teal); }
.sparkline.tone-emerald { color: var(--emerald); } .sparkline.tone-amber { color: var(--amber); }
.sparkline.tone-orange { color: var(--orange); } .sparkline.tone-rose { color: var(--rose); }

.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 0 8px; border-radius: 999px; line-height: 20px; }
.delta .icon { width: 12px; height: 12px; }
.delta.up { color: #047857; background: var(--success-tint); }
.delta.down { color: #b91c1c; background: var(--danger-tint); }
.delta.flat { color: var(--text-muted); background: var(--surface-3); }
.delta-sub { color: var(--text-faint); font-size: 12px; }

/* Soft tinted icon chip */
.icon-dot {
    width: 36px; height: 36px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: var(--tone-tint, var(--primary-tint)); color: var(--tone-solid, var(--primary));
}
.icon-dot .icon { width: 18px; height: 18px; }

/* =====================================================================
   Charts
   ===================================================================== */
.chart-tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-3); border-radius: var(--radius); }
.chart-tabs button {
    height: 28px; background: transparent; color: var(--text-muted); box-shadow: none; border: 0;
    padding: 0 12px; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
}
.chart-tabs button:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); }
.chart-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }
.chart-summary { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.chart-summary strong { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chart-summary span { font-size: 13px; color: var(--text-faint); }
.area-chart { position: relative; width: 100%; }
.area-chart .chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.area-chart .grid-line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.area-chart .axis-label { fill: var(--text-faint); font-size: 12px; font-family: inherit; }
.area-chart .series-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area-chart .crosshair { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.area-chart .marker { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-tip {
    position: absolute; top: 0; pointer-events: none; z-index: 5;
    background: var(--text); color: #fff; border-radius: var(--radius); padding: 8px 12px;
    font-size: 12px; box-shadow: var(--shadow-md); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px));
}
.chart-tip .tip-date { display: block; color: #cbd5e1; }
.chart-tip strong { font-size: 14px; }

/* Horizontal bar list (magnitude / share) */
.bar-list { display: flex; flex-direction: column; gap: 16px; }
.bar-row .bar-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.bar-row .bar-top .name { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-2); min-width: 0; }
.bar-row .bar-top .name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-top .val { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .bar-top .val strong { color: var(--text); font-weight: 600; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 132px; height: 132px; flex-shrink: 0; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut svg circle { transition: stroke-width .15s; }
.donut svg circle[data-seg]:hover { stroke-width: 16; }
.donut .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut .donut-center strong { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
.donut .donut-center span { font-size: 12px; color: var(--text-faint); }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.legend-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-list li .grow { flex: 1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-list li strong { font-variant-numeric: tabular-nums; }
.legend-list li .faint { font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* Quota ring */
.ring-wrap { display: flex; align-items: center; gap: 24px; }
.ring {
    --pct: 0; --ring-color: var(--primary);
    width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--surface-3) 0);
    display: flex; align-items: center; justify-content: center;
}
.ring .ring-inner { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .ring-inner strong { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
.ring .ring-inner span { font-size: 12px; color: var(--text-faint); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Lists, activity feed, quick actions
   ===================================================================== */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: none; padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .end { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed li { position: relative; display: flex; gap: 12px; padding-bottom: 20px; }
.feed li:last-child { padding-bottom: 0; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--surface-3); border-radius: 2px; }
.feed .icon-dot { width: 36px; height: 36px; border-radius: 50%; }
.feed .feed-body { flex: 1; min-width: 0; padding-top: 4px; }
.feed .feed-text { font-size: 13px; color: var(--text-2); }
.feed .feed-text strong { color: var(--text); font-weight: 600; }
.feed .feed-time { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-action {
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px;
    border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-weight: 600; font-size: 13px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick-action:hover { color: var(--text); border-color: var(--primary-soft); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.quick-action .sub { display: block; font-weight: 400; font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th {
    color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--surface-2); white-space: nowrap;
}
td { color: var(--text-2); }
td strong { color: var(--text); font-weight: 600; }
tr:hover td { background: #F7FAFF; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 24px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 24px; }
.card.flush table tr:last-child td { border-bottom: none; }
.card.flush table th { border-top: 1px solid var(--border); }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-user .meta { min-width: 0; }
.cell-user .meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-user .sub { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meter { display: flex; align-items: center; gap: 8px; min-width: 128px; }
.mini-meter .bar-track { flex: 1; height: 6px; }
.mini-meter span { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--radius); flex-wrap: wrap; }
.seg button, .seg a {
    height: 28px; background: transparent; color: var(--text-muted); border: 0; box-shadow: none;
    padding: 0 12px; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; gap: 8px;
}
.seg button:hover, .seg a:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }
.seg .active { background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow-xs); font-weight: 600; }
.seg .count { font-size: 12px; color: var(--text-faint); font-weight: 500; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.input-icon input { padding-left: 36px; }

/* =====================================================================
   Badges
   ===================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 22px; text-transform: capitalize; white-space: nowrap;
    border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-tint); color: #15803d; border-color: var(--success-border); }
.badge-danger { background: var(--danger-tint); color: #b91c1c; border-color: var(--danger-border); }
.badge-warning { background: var(--warning-tint); color: #b45309; border-color: var(--warning-border); }
.badge-info { background: var(--info-tint); color: #0369a1; border-color: var(--info-border); }
.badge-neutral { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-brand { background: var(--primary-tint); color: var(--primary); border-color: var(--primary-soft); }
.badge-brand::before, .badge.no-dot::before { display: none; }

/* =====================================================================
   Avatars
   ===================================================================== */
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 50%;
    font-weight: 600; font-size: 12px; letter-spacing: 0.02em;
    color: #fff; background: var(--tone, var(--brand-gradient));
}
.avatar-sm { width: 24px; height: 24px; font-size: 12px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* =====================================================================
   Forms
   ===================================================================== */
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
input, select, textarea {
    width: 100%; height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text);
    font-family: inherit;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
textarea { height: auto; min-height: 96px; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
input::placeholder { color: var(--text-faint); }
input:hover, select:hover, textarea:hover { border-color: #b9c1d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26, 119, 240, 0.15); }
input[type="file"] { height: auto; padding: 8px; }
.field { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: end; }
.grid .field { margin-bottom: 0; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
    padding: 32px 24px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
    margin: 0; font-weight: 500;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-tint); }
.dropzone .icon-dot { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); }
.dropzone .icon-dot .icon { width: 24px; height: 24px; }
.dropzone strong { font-size: 14px; color: var(--text); }
.dropzone span { font-size: 13px; color: var(--text-faint); font-weight: 400; }
.dropzone .file-name { color: var(--primary); font-weight: 600; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* =====================================================================
   Buttons
   ===================================================================== */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    background: var(--primary); color: #fff;
    border: 1px solid transparent; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; font-family: inherit; line-height: 1;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(26, 119, 240, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--primary-hover); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); color: var(--text); border-color: #b9c1d3; }
button.ghost, .btn.ghost { background: transparent; color: var(--text-muted); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-3); color: var(--text); }
button.danger, .btn.danger { background: var(--danger); box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3); }
button.danger:hover, .btn.danger:hover { background: #b91c1c; }
button.success, .btn.success { background: var(--success); }
button.success:hover, .btn.success:hover { background: #15803d; }
button.gradient, .btn.gradient { background: var(--brand-gradient); box-shadow: 0 6px 16px -6px rgba(26, 119, 240, 0.6); }
button.gradient:hover, .btn.gradient:hover { filter: brightness(1.05); }
button.small, .btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
button.icon-only, .btn.icon-only { width: 32px; padding: 0; }
button.block, .btn.block { width: 100%; }
button .icon, .btn .icon { width: 16px; height: 16px; }
.is-busy { position: relative; color: transparent !important; }
.is-busy > * { visibility: hidden; }
.is-busy::after {
    content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
.secondary.is-busy::after { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Inline alerts (banners inside the page)
   ===================================================================== */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: var(--radius-lg); margin-bottom: 24px; border: 1px solid; }
.alert > .icon { width: 20px; height: 20px; margin-top: 2px; }
.alert .grow { flex: 1; min-width: 0; }
.alert strong { display: block; font-size: 14px; font-weight: 600; }
.alert p { margin: 2px 0 0; font-size: 13px; }
.alert .btn { align-self: center; }
.alert.warning { background: var(--warning-tint); border-color: var(--warning-border); color: #92400e; }
.alert.warning p { color: #a16207; }
.alert.danger { background: var(--danger-tint); border-color: var(--danger-border); color: #991b1b; }
.alert.danger p { color: #b91c1c; }
.alert.info { background: var(--info-tint); border-color: var(--info-border); color: #075985; }
.alert.info p { color: #0369a1; }
.alert.success { background: var(--success-tint); border-color: var(--success-border); color: #166534; }
.alert.success p { color: #15803d; }

/* Server flash messages are turned into toasts by app.js; this is the no-JS fallback. */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; font-weight: 500; border: 1px solid transparent; }
.flash.error { background: var(--danger-tint); color: #991b1b; border-color: var(--danger-border); }
.flash.info { background: var(--info-tint); color: #075985; border-color: var(--info-border); }
.flash.success { background: var(--success-tint); color: #166534; border-color: var(--success-border); }
.flash.warning { background: var(--warning-tint); color: #92400e; border-color: var(--warning-border); }

/* =====================================================================
   Toasts
   ===================================================================== */
.toast-stack {
    position: fixed; top: calc(var(--topbar-h) + 12px); right: 24px; z-index: 1000;
    display: flex; flex-direction: column; gap: 12px; width: 380px; max-width: calc(100vw - 32px);
    pointer-events: none;
}
.toast {
    pointer-events: auto; position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 24px)); opacity: 0;
    transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .25s;
}
.toast.show { transform: none; opacity: 1; }
.toast.hide { transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform .25s ease-in, opacity .25s; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--t-color); }
.toast .t-icon {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--t-tint); color: var(--t-color);
}
.toast .t-icon .icon { width: 18px; height: 18px; }
.toast .t-body { flex: 1; min-width: 0; padding-top: 4px; }
.toast .t-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.toast .t-msg { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.toast .t-close {
    width: 24px; height: 24px; padding: 0; margin: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-faint); box-shadow: none; border: 0; flex-shrink: 0;
}
.toast .t-close:hover { background: var(--surface-3); color: var(--text); }
.toast .t-close .icon { width: 16px; height: 16px; }
.toast .t-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--t-color); opacity: .35; width: 100%; transform-origin: left; }
.toast.success { --t-color: var(--success); --t-tint: var(--success-tint); }
.toast.error   { --t-color: var(--danger);  --t-tint: var(--danger-tint); }
.toast.warning { --t-color: var(--warning); --t-tint: var(--warning-tint); }
.toast.info    { --t-color: var(--info);    --t-tint: var(--info-tint); }

/* =====================================================================
   Modal (confirm dialogs + forms)
   ===================================================================== */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px);
    animation: fade .15s ease-out;
}
.modal {
    width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease-out;
}
.modal-body { padding: 24px; display: flex; gap: 16px; }
.modal-body .icon-dot { width: 44px; height: 44px; border-radius: 50%; }
.modal-body .icon-dot .icon { width: 20px; height: 20px; }
.modal-body h2 { margin-bottom: 4px; }
.modal-body p { margin: 0 0 16px; font-size: 14px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body .grow { flex: 1; min-width: 0; }
.modal-foot { padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal .field:last-child { margin-bottom: 0; }
.modal-danger .icon-dot { background: var(--danger-tint); color: var(--danger); }
.modal-warning .icon-dot { background: var(--warning-tint); color: var(--warning); }
.modal-info .icon-dot { background: var(--primary-tint); color: var(--primary); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   Pricing cards
   ===================================================================== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-bottom: 24px; align-items: stretch; padding-top: 12px; }
.price-card {
    position: relative; display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.price-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.price-card.featured { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--brand-gradient) border-box; box-shadow: 0 16px 32px -16px rgba(124, 58, 237, 0.45); }
.price-card .ribbon { position: absolute; top: -12px; left: 24px; padding: 0 12px; border-radius: 999px; background: var(--brand-gradient); color: #fff; font-size: 12px; font-weight: 600; line-height: 24px; }
.price-card.current .ribbon { background: var(--success); }
.price-card .plan-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.price-card .price { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.price-card .price small { font-size: 14px; font-weight: 500; color: var(--text-faint); letter-spacing: 0; }
.price-card .features { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.price-card .features li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.price-card .features .icon { color: var(--success); }
.price-card.current { border-color: var(--success-border); }
.price-card.inactive { opacity: .72; }
.price-card .plan-meta { display: flex; gap: 16px; padding-top: 16px; margin-top: auto; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-faint); }
.price-card .plan-meta strong { display: block; font-size: 16px; color: var(--text); }

/* =====================================================================
   Auth screens (split layout)
   ===================================================================== */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside {
    position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background:
        radial-gradient(700px 400px at 100% 0%, rgba(56, 189, 248, 0.45), transparent 60%),
        radial-gradient(600px 400px at 0% 100%, rgba(14, 165, 233, 0.4), transparent 60%),
        linear-gradient(140deg, #061532 0%, #0B3A82 50%, #1A77F0 100%);
}
.auth-aside::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px); background-size: 24px 24px;
    mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.auth-aside h1 { color: #fff; font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; max-width: 480px; }
.auth-aside p { color: rgba(255, 255, 255, 0.78); font-size: 16px; max-width: 440px; margin-top: 12px; }
.auth-points { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 16px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.auth-points .icon-dot { background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); }
.auth-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.auth-stats div strong { display: block; font-size: 24px; letter-spacing: -0.02em; }
.auth-stats div span { font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 24px; margin-bottom: 4px; }
.auth-form > p { margin-bottom: 32px; }
.auth-form .foot { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-muted); }
.auth-form .divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-faint); font-size: 12px; }
.auth-form .divider::before, .auth-form .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; margin-bottom: 32px; }

/* Legacy centered auth layout */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #DCEBFE 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 400px; }
.brand-mark { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 700; font-size: 16px; margin-bottom: 24px; }

/* =====================================================================
   Pagination / empty / misc
   ===================================================================== */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager .btn.small { min-width: 32px; padding: 0 8px; }
.pager .gap { color: var(--text-faint); padding: 0 4px; line-height: 32px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-tint); color: var(--primary);
    box-shadow: 0 0 0 8px rgba(234, 243, 254, 0.7);
}
.empty-state .empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { font-size: 16px; margin-bottom: 4px; }
.empty-state p { max-width: 360px; margin: 0 auto 20px; font-size: 13px; }
.empty-state p:last-child { margin-bottom: 0; }

.progress-track { background: var(--surface-3); border-radius: 999px; height: 8px; overflow: hidden; margin: 8px 0 4px; }
.progress-fill { background: var(--primary); height: 100%; border-radius: 999px; }

/* AJAX top loading bar + region dimming */
.ajax-loader {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1100;
    background: var(--brand-gradient); box-shadow: 0 0 8px rgba(26, 119, 240, 0.6);
    opacity: 0; transition: width .25s ease, opacity .3s ease;
}
.is-loading .ajax-loader { opacity: 1; width: 80%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
.is-loading [data-live-region] { opacity: .55; transition: opacity .15s; pointer-events: none; }
.content { animation: fade .2s ease-out; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1200px) {
    .dash-grid, .dash-grid.side-form, .dash-grid.even { grid-template-columns: 1fr; }
    .top-search { width: 220px; }
}
@media (max-width: 960px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-mobile-brand { display: flex; }
}
@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; height: 100vh;
        transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    .app-shell { background: var(--bg); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 50; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .top-search, .top-divider, .user-chip .user-name, .user-chip > .icon, .date-chip { display: none; }
    .content { padding: 20px 16px 40px; }
    .page-head p, .hint { overflow-wrap: anywhere; }
    .header-actions { flex-direction: column; align-items: stretch; }
    .list .title, .list .sub { white-space: normal; overflow: visible; text-overflow: unset; }
    .stat-grid { grid-template-columns: 1fr; }
    .hero { padding: 24px 20px; }
    .ring-wrap, .donut-wrap { flex-direction: column; align-items: stretch; }
    .ring, .donut { margin: 0 auto; }
    .toast-stack { top: auto; bottom: 16px; }
}

/* ---------- Lead-list catalogue ---------- */
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 24px; margin-bottom: 24px; }
.lead-card {
    --accent: var(--indigo);
    position: relative; display: flex; flex-direction: column; gap: 16px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s, border-color .2s;
}
/* The actions menu hangs off the footer. While it is open the card must not clip it. */
.lead-card:has(details.dropdown[open]) { overflow: visible; z-index: 30; transform: none; }
.lead-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); opacity: .85; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.lead-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.lead-card.inactive { opacity: .7; }
.lead-card.tone-indigo { --accent: var(--indigo); } .lead-card.tone-violet { --accent: var(--violet); }
.lead-card.tone-sky { --accent: var(--sky); } .lead-card.tone-teal { --accent: var(--teal); }
.lead-card.tone-amber { --accent: var(--amber); } .lead-card.tone-rose { --accent: var(--rose); }
.lead-card.tone-emerald { --accent: var(--emerald); } .lead-card.tone-orange { --accent: var(--orange); }
.lc-head { display: flex; align-items: flex-start; gap: 14px; }
.lc-head .icon-dot { flex: none; width: 44px; height: 44px; border-radius: 12px; }
.lc-title { min-width: 0; }
.lc-title h3 { font-size: 17px; line-height: 1.3; margin: 6px 0 0; letter-spacing: -0.01em; }
.lc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; background: var(--primary-tint); color: var(--primary); }
.lc-tag.muted { background: var(--surface-3); color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.lc-tag.warn { background: var(--warning-tint); color: #b45309; }
.lc-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; }
.lc-count strong { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.lc-count span { font-size: 15px; font-weight: 600; color: var(--text-2); }
.lc-count em { flex-basis: 100%; font-style: normal; font-size: 12px; color: var(--text-faint); }
.lc-desc { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-reach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.lc-reach-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 8px; row-gap: 6px; font-size: 12px; }
.lc-reach-icon { display: inline-flex; color: var(--accent); }
.lc-reach-label { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-reach-item b { font-size: 13px; font-variant-numeric: tabular-nums; }
.lc-reach-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.lc-reach-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.lc-top { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }
.lc-top-label { flex: none; color: var(--text-faint); min-width: 92px; }
.lc-top-values { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); font-weight: 500; }
.lc-top-values small { color: var(--text-faint); font-weight: 400; font-size: 11px; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; margin-top: auto; border-top: 1px solid var(--border); }
.lc-updated { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.filter-grid .field { margin-bottom: 0; }
.range-pair { display: flex; gap: 8px; }
.range-pair input { min-width: 0; }
.cell-clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Searchable dropdown (dataset filters) ---------- */
.combo { position: relative; }
.combo-input { width: 100%; padding-right: 58px; text-overflow: ellipsis; cursor: pointer; }
.combo.has-value .combo-input { font-weight: 600; color: var(--primary); border-color: var(--primary-soft); background: var(--primary-tint); }
.combo-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; display: inline-flex; }
.combo-clear {
    position: absolute; right: 32px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.combo-clear:hover { background: var(--surface-3); color: var(--text); }
.combo-panel {
    position: absolute; left: 0; top: calc(100% + 4px); z-index: 40;
    min-width: 100%; width: max-content; max-width: min(420px, 90vw); max-height: 288px; overflow-y: auto; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.combo-panel.is-loading { opacity: .6; }
.combo-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); cursor: pointer; }
.combo-item .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-item .n { flex: none; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.combo-item:hover, .combo-item.active { background: var(--surface-3); color: var(--text); }
.combo-item.selected .v { font-weight: 600; color: var(--primary); }
.combo-item.combo-any, .combo-item.combo-like { color: var(--primary); font-weight: 500; }
.combo-note { padding: 10px; font-size: 12px; color: var(--text-faint); }

/* Checkbox / radio lists (plan lead lists, dataset grants) */
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; margin: 0 0 6px; cursor: pointer; }
.check-row input { width: auto; margin: 0; }
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-top: 4px; }
.check-list .check-row:last-child { margin-bottom: 0; }
.grant-chip { display: inline-block; margin: 4px 4px 0 0; }
.grant-chip .badge { gap: 4px; }
.chip-x { all: unset; cursor: pointer; display: inline-flex; opacity: .6; }
.chip-x:hover { opacity: 1; }
.header-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.header-pills .chip { background: var(--primary-tint); color: var(--primary); }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }

/* Loading overlay over the region being reloaded (main content or a results
   card); the sidebar and top bar stay usable. Added by app.js. */
.region-busy { position: relative; }
.region-loader {
    position: absolute; inset: 0; z-index: 20; border-radius: inherit;
    background: rgba(255, 255, 255, 0.62); backdrop-filter: blur(1.5px);
    animation: fade .15s ease-out;
}
.region-loader-box {
    position: sticky; top: 38vh; margin: 64px auto; width: max-content;
    display: flex; align-items: center; gap: 12px; padding: 12px 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
    box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
    font-size: 13px; font-weight: 600; color: var(--text-2, #334155);
}
.region-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2.5px solid var(--primary-tint, #e0edff); border-top-color: var(--primary);
    animation: spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .region-spinner { animation-duration: 2s; } }

/* =====================================================================
   Dataset page: header, filter bar, results
   ===================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 12px; }
.ds-back:hover { color: var(--primary); }

.ds-hero {
    --accent: var(--indigo);
    position: relative; overflow: hidden; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.ds-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.ds-hero.tone-indigo { --accent: var(--indigo); } .ds-hero.tone-violet { --accent: var(--violet); }
.ds-hero.tone-sky { --accent: var(--sky); } .ds-hero.tone-teal { --accent: var(--teal); }
.ds-hero.tone-amber { --accent: var(--amber); } .ds-hero.tone-rose { --accent: var(--rose); }
.ds-hero.tone-emerald { --accent: var(--emerald); } .ds-hero.tone-orange { --accent: var(--orange); }
.ds-hero-top { display: flex; align-items: flex-start; gap: 16px; padding: 24px 24px 20px; }
.ds-hero-top > .icon-dot { flex: none; width: 52px; height: 52px; border-radius: 14px; }
.ds-hero-top > .icon-dot .icon { width: 22px; height: 22px; }
.ds-hero-text { flex: 1; min-width: 0; }
.ds-hero-text h1 { font-size: 24px; line-height: 1.25; margin: 6px 0 0; letter-spacing: -0.02em; }
.ds-desc { margin: 6px 0 0; font-size: 13px; line-height: 1.55; max-width: 760px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ds-plan { flex: none; min-width: 180px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.ds-plan-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.ds-plan-value { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.ds-plan-value strong { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ds-plan-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.ds-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--border); background: var(--surface-2); }
.ds-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 24px; border-right: 1px solid var(--border); min-width: 0; }
.ds-stat:last-child { border-right: 0; }
.ds-stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-stat-label .icon { color: var(--accent); flex: none; }
.ds-stat strong { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ds-stat strong.ds-stat-sm { font-size: 15px; font-weight: 600; letter-spacing: 0; line-height: 1.6; }
.ds-stat em { font-style: normal; font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-stat-bar { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 4px; }
.ds-stat-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.ds-filters { margin-bottom: 16px; padding: 16px 24px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.ds-filters-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; }
.ds-filters-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.ds-filters-title .icon { color: var(--primary); }
.ds-filter-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.ds-field { flex: 1 1 200px; max-width: 280px; min-width: 0; }
.ds-field.wide { flex-basis: 240px; }
.ds-field > label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.ds-field.ds-toggles { flex: 0 1 auto; max-width: none; }
.range-pair { align-items: center; }
.range-sep { color: var(--text-faint); }
.toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-chip { margin: 0; cursor: pointer; font-weight: 500; }
.toggle-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.toggle-chip span {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13px; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.toggle-chip span .icon { color: var(--text-faint); }
.toggle-chip:hover span { border-color: #b9c1d3; background: var(--surface-2); }
.toggle-chip input:checked + span { background: var(--primary-tint); border-color: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toggle-chip input:checked + span .icon { color: var(--primary); }
.toggle-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.ds-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; }
.ds-count-num { font-size: 15px; color: var(--text-muted); }
.ds-count-num strong { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-right: 2px; }
.ds-split { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ds-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds-pill.new { background: var(--success-tint); color: #15803d; }
.ds-pill.new i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ds-pill.owned { background: var(--surface-3); color: var(--text-muted); }
.ds-pill.big { height: 36px; padding: 0 14px; font-size: 13px; }
.ds-download { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ds-download button { height: 44px; padding: 0 20px; font-size: 14px; }
.ds-download-note { font-size: 12px; color: var(--text-faint); }
.ds-active { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 24px 16px; }
.ds-active-label { font-size: 12px; color: var(--text-faint); margin-right: 2px; }
.ds-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 12px; border-radius: 999px;
    background: var(--primary-tint); border: 1px solid var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600;
}
.ds-chip span { font-weight: 500; color: var(--text-muted); }
.ds-chip .icon { opacity: .6; }
.ds-chip:hover { border-color: var(--primary); color: var(--primary-hover); }
.ds-chip:hover .icon { opacity: 1; }
.ds-clear { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.ds-clear:hover { color: var(--danger); }
.ds-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 24px 16px; padding: 10px 14px; border-radius: var(--radius); background: var(--info-tint); border: 1px solid var(--info-border); color: #0c4a6e; font-size: 13px; line-height: 1.5; }
.ds-note .icon { flex: none; margin-top: 2px; color: #0369a1; }

/* Table: row numbers, masked contacts, and a shadow on whichever edge can scroll */
.ds-table-wrap {
    background:
        linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left center / 40px 100% no-repeat local,
        linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right center / 40px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0)) left center / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0)) right center / 12px 100% no-repeat scroll;
}
.ds-table th, .ds-table td { padding-top: 11px; padding-bottom: 11px; white-space: nowrap; }
.ds-table tbody tr:hover td { background: #F2F7FF; }
.ds-table td.ds-rownum, .ds-table th.ds-rownum { width: 1%; color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; padding-right: 8px; }
.card.flush .ds-table th.ds-rownum, .card.flush .ds-table td.ds-rownum { padding-left: 24px; }
.ds-empty { color: var(--border-strong); }
.ds-masked { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-muted); }
.ds-masked .icon { color: var(--text-faint); flex: none; }

@media (max-width: 860px) {
    .ds-hero-top { flex-wrap: wrap; padding: 20px 16px 16px; }
    .ds-hero-top > .icon-dot { width: 44px; height: 44px; }
    .ds-hero-text { flex-basis: calc(100% - 60px); }
    .ds-hero-text h1 { font-size: 20px; }
    .ds-plan { flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; }
    .ds-plan-value { margin-top: 0; }
    .ds-plan-value strong { font-size: 16px; }
    .ds-plan-sub { flex-basis: 100%; }
    .ds-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-stat { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .ds-stat:nth-child(2n) { border-right: 0; }
    .ds-stat strong { font-size: 17px; }
    .ds-filters { padding: 14px 16px 16px; }
    .ds-field { flex-basis: 100%; max-width: none; }
    .ds-results-head { padding: 16px; }
    .ds-count-num strong { font-size: 22px; }
    .ds-download { align-items: stretch; width: 100%; }
    .ds-download-note { text-align: center; }
    .ds-active { padding: 0 16px 14px; }
    .ds-note { margin: 0 16px 14px; }
}

/* Download quantity: number box joined to the download button */
.ds-qty-row { display: flex; align-items: stretch; }
.ds-qty { display: flex; align-items: center; margin: 0; height: 44px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--surface); padding-left: 12px; font-weight: 500; }
.ds-qty span { font-size: 12px; color: var(--text-muted); }
.ds-qty input { width: 104px; height: 100%; border: 0; box-shadow: none; background: transparent; font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; padding: 0 12px 0 8px; }
.ds-qty input:focus { box-shadow: none; }
.ds-qty:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26, 119, 240, 0.15); }
.ds-qty input:invalid { color: var(--danger); }
.ds-qty-row button { border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 860px) {
    .ds-qty { flex: 1; }
    .ds-qty input { flex: 1; width: auto; }
}

/* Collections (parent datasets) and their sub-dataset cards */
.section-label { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.collection-card { background: linear-gradient(180deg, var(--primary-tint) 0, var(--surface) 120px); border-color: var(--primary-soft); }
.collection-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.collection-preview li { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.collection-preview li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-preview li b { font-variant-numeric: tabular-nums; color: var(--text); }
.collection-preview li.more { color: var(--text-faint); font-size: 12px; }
.lc-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-fields span { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; }
.lc-fields span.more { background: transparent; color: var(--text-faint); }

.pricing-grid.solo { grid-template-columns: minmax(280px, 440px); justify-content: center; }
.price-was { font-size: 13px; color: var(--text-faint); margin-bottom: 2px; }
.price-was s { color: var(--text-muted); }
.save-pill {
    display: inline-flex; align-items: center; gap: 6px; width: fit-content;
    margin-top: 10px; padding: 2px 10px; border-radius: 999px;
    background: var(--amber-tint); color: #b45309; font-size: 12px; font-weight: 600;
}

/* =====================================================================
   Public sales page
   ===================================================================== */
body.sales { background: var(--bg); overflow-x: hidden; }
.sales-wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.sales-bar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    height: 64px; padding: 0 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.sales-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; }
.sales-brand:hover { color: var(--text); }
.sales-nav { display: flex; align-items: center; gap: 18px; }
.sales-nav a:not(.btn) { color: var(--text-2); font-weight: 600; font-size: 14px; }
.sales-short { display: none; }
.sales-nav a:not(.btn):hover { color: var(--primary); }

.sales-hero {
    position: relative; overflow: hidden; color: #fff;
    padding: 56px 0 64px;
    background:
        radial-gradient(680px 380px at 100% -10%, rgba(56, 189, 248, 0.45), transparent 60%),
        radial-gradient(520px 360px at 0% 110%, rgba(14, 165, 233, 0.35), transparent 58%),
        linear-gradient(145deg, #061532 0%, #0B3A82 52%, #1A77F0 100%);
}
.sales-hero-bg {
    position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 30% 40%, #000, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 72%);
}
.sales-hero::after {
    content: ""; position: absolute; width: 280px; height: 280px; right: -80px; bottom: -90px; border-radius: 50%;
    background: rgba(56, 189, 248, 0.28); filter: blur(8px); animation: sales-drift 12s ease-in-out infinite;
    pointer-events: none;
}
.sales-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 36px; align-items: center; }
.sales h1 { color: #fff; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; max-width: 640px; }
.sales-lead { color: rgba(255, 255, 255, 0.82); font-size: 17px; line-height: 1.55; max-width: 540px; margin: 14px 0 0; }
.sales-offer {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
    max-width: 100%; margin-bottom: 16px; padding: 5px 12px 5px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 13px; font-weight: 600; line-height: 1.35;
}
.sales-pulse {
    width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; flex: none;
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    animation: sales-ping 1.8s ease-out infinite;
}
.sales-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sales-hero-note { margin: 12px 0 0; max-width: 520px; color: rgba(255, 255, 255, 0.72); font-size: 13px; font-weight: 600; line-height: 1.45; }
.sales-cta-main { height: 48px; padding: 0 18px; font-size: 15px; }
.sales-hero .btn.secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); box-shadow: none; }
.sales-hero .btn.secondary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.sales-promises { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; padding: 0; margin: 22px 0 0; }
.sales-promises li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.92); }

.sales-stage { position: relative; min-height: 360px; }
.sales-sample {
    position: absolute; top: -6px; left: 8px; z-index: 2;
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}
.sales-float {
    position: absolute; display: flex; align-items: center; gap: 12px;
    width: min(340px, 100%); padding: 14px 14px;
    background: rgba(255, 255, 255, 0.97); color: var(--text);
    border-radius: 16px; box-shadow: var(--shadow-lg);
    animation: sales-float 5.5s ease-in-out infinite;
}
.sales-float > div { min-width: 0; }
.sales-float strong { display: block; font-size: 14px; }
.sales-float div > span { display: block; color: var(--text-muted); font-size: 12px; }
.sales-float b { display: block; margin-top: 2px; font-size: 13px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-float em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--emerald); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sales-float.a { top: 18px; right: 12px; }
.sales-float.b { top: 138px; left: 0; animation-delay: .7s; }
.sales-float.c { top: 258px; right: 20px; animation-delay: 1.3s; }

.sales-stats { background: #fff; border-bottom: 1px solid var(--border); }
.sales-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 26px 0; }
.sales-stat-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sales-stat-grid strong { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
.sales-stat-grid > div > span:last-child { color: var(--text-muted); font-size: 13px; }

.sales-marquee { overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 14px 0; }
.sales-track { display: flex; width: max-content; animation: sales-marquee 140s linear infinite; }
.sales-set { display: flex; gap: 10px; padding-right: 10px; }
.sales-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
    border-radius: 999px; background: #fff; border: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.sales-chip .icon { color: var(--primary); }
.sales-marquee:hover .sales-track { animation-play-state: paused; }

.sales-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.sales-cat {
    display: block; min-width: 0; padding: 10px 12px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    box-shadow: var(--shadow-xs); transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.sales-cat:hover {
    color: var(--text); border-color: var(--primary-soft); background: var(--primary-tint);
    box-shadow: var(--shadow-sm); transform: translateY(-1px);
}
.sales-cat-foot {
    margin-top: 20px; padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(180deg, #f3f8ff 0%, #fff 70%);
    border: 1px solid #93c5fd; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.sales-cat-foot strong { display: block; font-size: 15px; }
.sales-cat-foot p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); max-width: 520px; }
.sales-cat-foot .btn { flex: none; }

.sales-section { padding: 72px 0; scroll-margin-top: 80px; }
.sales-section-tight { padding-top: 8px; }
.sales-head { max-width: 660px; margin-bottom: 28px; }
.sales-head h2, .sales-band h2, .sales-close h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.025em; }
.sales-head p { font-size: 16px; margin-top: 8px; }
.sales-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sales-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sales-card {
    background: #fff; border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.sales-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.sales-card h3 { font-size: 16px; margin: 14px 0 6px; }
.sales-card p { margin: 0; font-size: 14px; }
.sales-card .icon-dot { width: 42px; height: 42px; border-radius: 12px; }
.sales-compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.sales-compare article {
    background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px;
    box-shadow: var(--shadow-xs); display: flex; flex-direction: column; min-width: 0;
}
.sales-compare h3 { margin: 12px 0 0; font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.sales-compare .is-offer {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #f3f8ff 0%, #fff 46%);
    box-shadow: var(--shadow-md);
}
.sales-compare .sales-ticks { margin-bottom: 18px; }
.sales-compare .is-plain .sales-ticks .icon { color: var(--text-faint); }
.sales-compare .btn { margin-top: auto; }

.sales-band {
    color: #fff; padding: 72px 0; scroll-margin-top: 80px;
    background:
        radial-gradient(500px 240px at 90% 20%, rgba(56, 189, 248, 0.25), transparent 60%),
        linear-gradient(160deg, #07142B 0%, #0B2A5B 70%, #1463CF 140%);
}
.sales-band h2, .sales-band strong { color: #fff; }
.sales-band p { color: rgba(255, 255, 255, 0.78); }
.sales-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: 40px; align-items: center; }
.sales-ticks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sales-ticks li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 14px; }
.sales-ticks .icon { color: var(--success); margin-top: 2px; flex: none; }
.sales-band .sales-ticks li { color: rgba(255, 255, 255, 0.92); }
.sales-band .sales-ticks .icon { color: #86efac; }
.sales-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.sales-steps li { display: flex; gap: 14px; align-items: flex-start; }
.sales-steps li > span {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.24);
    font-weight: 700;
}
.sales-steps p { margin: 4px 0 0; font-size: 14px; }

.sales-price {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center;
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--brand-gradient) border-box;
    border: 2px solid transparent; border-radius: 20px; padding: 28px;
    box-shadow: 0 24px 48px -28px rgba(26, 119, 240, 0.55);
}
.sales-kicker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary);
}
.sales-was { margin-top: 12px; color: var(--text-faint); font-size: 14px; }
.sales-was s { color: var(--text-muted); font-size: 16px; }
.sales-amount { font-size: clamp(46px, 6vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: 4px; }
.sales-amount small { font-size: 18px; font-weight: 600; color: var(--text-faint); letter-spacing: 0; }
.sales-price-copy > p { font-size: 15px; margin: 14px 0 18px; }
.sales-fine { display: flex; align-items: center; gap: 6px; font-size: 12px !important; margin: 12px 0 0 !important; }
.sales-shine { position: relative; overflow: hidden; }
.sales-shine::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.75), transparent 80%);
    transform: translateX(-120%);
    animation: sales-shine 2.8s ease-in-out infinite;
}

.sales-faq { display: flex; flex-direction: column; gap: 10px; }
.sales-faq details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.sales-faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    cursor: pointer; font-weight: 600; color: var(--text); list-style: none;
}
.sales-faq summary::-webkit-details-marker { display: none; }
.sales-faq summary .icon { color: var(--text-faint); transition: transform .2s ease; }
.sales-faq details[open] summary .icon { transform: rotate(180deg); }
.sales-faq details p { margin: 10px 0 0; }
#included, #pricing, #questions { scroll-margin-top: 80px; }

.sales-close {
    text-align: center; color: #fff; padding: 72px 0;
    background:
        radial-gradient(520px 200px at 50% 0%, rgba(56, 189, 248, 0.4), transparent 70%),
        linear-gradient(165deg, #0B2A5B, #1A77F0);
}
.sales-close h2 { color: #fff; }
.sales-close p { color: rgba(255, 255, 255, 0.84); font-size: 16px; max-width: 540px; margin: 10px auto 22px; }
.sales-close .btn { background: #fff; color: var(--primary); height: 48px; padding: 0 18px; }
.sales-close .btn:hover { background: #eaf3fe; color: var(--primary-hover); }

.sales-foot { padding: 22px 0 32px; }
.sales-foot .sales-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 13px; }
.sales-foot a { color: var(--text-muted); }
.sales-foot a:hover { color: var(--primary); }
.sales-dock { display: none; }

.sales-rise { animation: sales-rise .7s ease both; }
.sales-grid .sales-rise:nth-child(2), .sales-stat-grid .sales-rise:nth-child(2) { animation-delay: .06s; }
.sales-grid .sales-rise:nth-child(3), .sales-stat-grid .sales-rise:nth-child(3) { animation-delay: .12s; }
.sales-grid .sales-rise:nth-child(4), .sales-stat-grid .sales-rise:nth-child(4) { animation-delay: .18s; }
.sales-grid .sales-rise:nth-child(5) { animation-delay: .24s; }
.sales-grid .sales-rise:nth-child(6) { animation-delay: .3s; }
.sales-bob { animation: sales-bob 3.2s ease-in-out infinite; }
.sales-grid .sales-card:nth-child(2n) .sales-bob { animation-delay: .4s; }
.sales-grid .sales-card:nth-child(3n) .sales-bob { animation-delay: .8s; }

@keyframes sales-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sales-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sales-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes sales-marquee { to { transform: translateX(-50%); } }
@keyframes sales-ping {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.65); }
    70% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}
@keyframes sales-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes sales-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.sales-hero-grid > *, .sales-split > *, .sales-price > * { min-width: 0; }
@media (max-width: 980px) {
    .sales-hero-grid, .sales-split, .sales-price, .sales-compare { grid-template-columns: minmax(0, 1fr); }
    .sales-grid-4 { grid-template-columns: 1fr 1fr; }
    .sales-stage { min-height: 0; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
    .sales-sample { position: static; }
    .sales-float, .sales-float.a, .sales-float.b, .sales-float.c { position: relative; top: auto; right: auto; left: auto; width: 100%; }
}
@media (max-width: 760px) {
    .sales-wrap { width: min(1120px, calc(100% - 28px)); }
    .sales-bar { height: 56px; padding: 0 12px; }
    .sales-nav a:not(.btn) { display: none; }
    .sales-nav { gap: 8px; }
    .sales-hero { padding: 32px 0 40px; }
    .sales-section, .sales-band, .sales-close { padding: 48px 0; }
    .sales-stat-grid, .sales-grid, .sales-grid-4 { grid-template-columns: 1fr; }
    .sales-cat-grid { grid-template-columns: 1fr; }
    .sales-cat-foot { align-items: stretch; }
    .sales-cat-foot .btn { width: 100%; }
    .sales-cta { flex-direction: column; }
    .sales-cta .btn { width: 100%; }
    .sales-price { padding: 20px; }
    .sales-foot { padding-bottom: 88px; }
    .sales-dock {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border);
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    }
    .sales-dock s { color: var(--text-faint); margin-right: 6px; font-size: 12px; }
    .sales-dock strong { font-size: 18px; letter-spacing: -0.02em; }
    .sales-dock span { color: var(--text-muted); font-size: 12px; }
}
@media (max-width: 520px) {
    .sales-bar .sales-word { display: none; }
    .sales-long { display: none; }
    .sales-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
    .sales-rise, .sales-float, .sales-bob, .sales-track, .sales-pulse, .sales-shine::after, .sales-hero::after { animation: none !important; }
    .sales-card:hover { transform: none; }
}
