﻿/* ==========================================================================
   PointHub design system
   Brand: navy #132B4B / teal #14B8A6, #2DD4BF / sky #0EA5E9, #38BDF8
   ========================================================================== */

:root {
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;

    --bg: #f3f6f9;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --surface-3: #f1f3f6;
    --border: #e4e9ef;
    --border-strong: #d2d6dd;
    --text: #132b4b;
    --text-2: #334766;
    --muted: #64748b;
    --faint: #94a3b8;

    --navy: #132b4b;
    --teal: #14b8a6;
    --teal-bright: #2dd4bf;
    --sky: #0ea5e9;
    --sky-bright: #38bdf8;

    --primary: #0d9488;
    --primary-600: #0f766e;
    --primary-soft: #e6f7f5;
    --primary-ring: rgba(13, 148, 136, .24);
    --on-primary: #ffffff;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #0284c7;
    --info-soft: #f0f9ff;

    --sidebar-bg: #ffffff;
    --sidebar-text: #3a4d6a;
    --sidebar-text-strong: #132b4b;
    --sidebar-muted: #8a97aa;
    --sidebar-hover: #eff3f7;
    --sidebar-active: #e7f6f4;
    --sidebar-active-text: #0f766e;
    --sidebar-accent: #0d9488;
    --sidebar-border: #e4e9ef;
    --logo-arm: #132b4b;
    --topbar-bg: rgba(255, 255, 255, .88);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px -2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 16px 36px -10px rgba(16, 24, 40, .2), 0 4px 10px -4px rgba(16, 24, 40, .08);
    --sidebar-w: 264px;
    --sidebar-rail-w: 76px;
    --topbar-h: 60px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #08131f; --surface: #0f1d2e; --surface-2: #0c1827; --surface-3: #16263b;
        --border: #1c2e45; --border-strong: #2a405d; --text: #e8edf6; --text-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
        --primary: #2dd4bf; --primary-600: #14b8a6; --primary-soft: rgba(45, 212, 191, .12); --primary-ring: rgba(45, 212, 191, .3); --on-primary: #06242a;
        --success: #34d399; --success-soft: rgba(52, 211, 153, .1); --warning: #fbbf24; --warning-soft: rgba(251, 191, 36, .1);
        --danger: #f87171; --danger-soft: rgba(248, 113, 113, .1); --info: #38bdf8; --info-soft: rgba(56, 189, 248, .1);
        --sidebar-bg: #0c1827; --sidebar-text: #cbd5e1; --sidebar-text-strong: #e8edf6; --sidebar-muted: #6b7c93; --sidebar-hover: #16263b; --sidebar-active: rgba(45, 212, 191, .12); --sidebar-active-text: #5eead4; --sidebar-accent: #2dd4bf; --sidebar-border: #1c2e45; --logo-arm: #ffffff; --topbar-bg: rgba(12, 24, 39, .88);
        --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 20px -10px rgba(0, 0, 0, .6);
    }
}
:root[data-theme="dark"] {
    --bg: #08131f; --surface: #0f1d2e; --surface-2: #0c1827; --surface-3: #16263b;
    --border: #1c2e45; --border-strong: #2a405d; --text: #e8edf6; --text-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
    --primary: #2dd4bf; --primary-600: #14b8a6; --primary-soft: rgba(45, 212, 191, .12); --primary-ring: rgba(45, 212, 191, .3); --on-primary: #06242a;
    --success: #34d399; --success-soft: rgba(52, 211, 153, .1); --warning: #fbbf24; --warning-soft: rgba(251, 191, 36, .1);
    --danger: #f87171; --danger-soft: rgba(248, 113, 113, .1); --info: #38bdf8; --info-soft: rgba(56, 189, 248, .1);
    --sidebar-bg: #0c1827; --sidebar-text: #cbd5e1; --sidebar-text-strong: #e8edf6; --sidebar-muted: #6b7c93; --sidebar-hover: #16263b; --sidebar-active: rgba(45, 212, 191, .12); --sidebar-active-text: #5eead4; --sidebar-accent: #2dd4bf; --sidebar-border: #1c2e45; --logo-arm: #ffffff; --topbar-bg: rgba(12, 24, 39, .88);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 20px -10px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font); font-size: 12px; line-height: 1.5; color: var(--text);
    background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01";
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; color: var(--text); }
h1 { font-size: 19px; } h2 { font-size: 14px; } h3 { font-size: 13px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 11.5px; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--text-2); word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }
.ic.lg { width: 20px; height: 20px; }
.ic.xl { width: 28px; height: 28px; stroke-width: 1.6; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3, .grid-main-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ App shell
   Light sidebar (collapses to an icon rail) | sticky white header | content | footer */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s var(--ease); }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: var(--sidebar-text);
    background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 18px; height: var(--topbar-h); flex: none; }
.logo-mark { width: 30px; height: 30px; flex: none; display: block; color: #fff; }
.hub { color: var(--teal-bright); }
/* "PRO" pill after the wordmark: navy on light surfaces, teal on navy backgrounds (login art) */
.pro-badge {
    display: inline-block; margin-left: .4em; padding: .2em .5em .16em; border-radius: .4em; vertical-align: .2em;
    font-size: .5em; font-weight: 700; letter-spacing: .1em; line-height: 1; text-transform: uppercase; color: var(--teal-bright); background: var(--navy);
}
.auth-art .pro-badge { color: var(--navy); background: var(--teal-bright); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text .caption { font-size: 9px; font-weight: 500; letter-spacing: 0; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .name { color: var(--sidebar-text-strong); font-weight: 800; font-size: 15.5px; letter-spacing: -.025em; line-height: 1.1; white-space: nowrap; }
.sidebar-brand .hub { color: var(--sidebar-accent); }
.sidebar-brand .logo-mark { width: 34px; height: 34px; color: var(--logo-arm); padding: 4px; border-radius: 10px; background: var(--sidebar-hover); }
.sidebar-brand .caption { margin-top: 3px; line-height: 1.25; }

/* tenant switcher card (top of the sidebar) */
.sidebar-ws { padding: 2px 14px 6px; flex: none; }
.sidebar-ws .ctx { display: block; }
.sidebar-ws .ctx-btn { width: 100%; max-width: none; height: auto; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--surface-2); box-shadow: none; }
.sidebar-ws .ctx-btn:hover { box-shadow: var(--shadow-sm); }
.sidebar-ws .ctx-text { flex: 1; }
.sidebar-ws .ctx-mark .brand-mark, .sidebar-ws .ctx-empty-mark { width: 32px; height: 32px; border-radius: 9px; }
.sidebar-ws .ctx-menu { left: 0; right: auto; width: 340px; }

.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--sidebar-border) transparent; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-group[hidden], .nav-link[hidden] { display: none; }
/* main menu (group) items: solid row with an accent bar, distinct from the compact sub-items below */
.nav-head {
    all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; cursor: pointer; padding: 7px 10px; min-height: 32px;
    color: var(--sidebar-text-strong); font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; border-radius: 8px;
    background: var(--sidebar-hover); transition: background .15s, color .15s;
}
.nav-head::before { content: ""; width: 3px; height: 14px; border-radius: 3px; background: var(--sidebar-accent); flex: none; }
.nav-head:hover { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-head:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.nav-head .chev { margin-left: auto; color: var(--sidebar-muted); transition: transform .2s var(--ease); }
.nav-group.closed .nav-head .chev { transform: rotate(-90deg); }
/* sub-items: compact, indented under a guide line */
.nav-items { display: grid; gap: 1px; margin: 3px 0 2px 11px; padding-left: 7px; border-left: 1px solid var(--sidebar-border); }
.nav-group.closed .nav-items { display: none; }
.nav-link {
    display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 4px 8px; border-radius: 7px; color: var(--sidebar-text);
    font-size: 12px; font-weight: 500; transition: background .15s, color .15s; position: relative;
}
.nav-link .ic { width: 15px; height: 15px; stroke-width: 1.8; color: var(--sidebar-muted); transition: color .15s; }
.nav-link .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-link:hover .ic { color: var(--sidebar-text); }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600; }
.nav-link.active .ic { color: var(--sidebar-accent); }
.nav-link.active::before { content: ""; position: absolute; left: -9px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--sidebar-accent); }
.nav-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

.sidebar-foot { flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--sidebar-border); }
.collapse-btn {
    all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px;
    color: var(--sidebar-muted); cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.collapse-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.collapse-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.collapse-btn .ic { transition: transform .22s var(--ease); }
.rail-tip {
    position: fixed; z-index: 95; pointer-events: none; padding: 6px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
    background: var(--navy); color: #eef3f9; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translateY(-50%);
}

/* icon rail (desktop only) */
@media (min-width: 961px) {
    html.sb-rail .app { grid-template-columns: var(--sidebar-rail-w) minmax(0, 1fr); }
    html.sb-rail .brand-text, html.sb-rail .nav-link .lbl, html.sb-rail .nav-head span, html.sb-rail .nav-head .chev,
    html.sb-rail .sidebar-ws .ctx-text, html.sb-rail .sidebar-ws .ctx-caret, html.sb-rail .collapse-btn .lbl { display: none; }
    html.sb-rail .sidebar-brand { padding: 0; justify-content: center; }
    html.sb-rail .sidebar-ws .ctx-btn { justify-content: center; padding: 6px; }
    html.sb-rail .nav-head { justify-content: center; padding: 4px 0 8px; min-height: 0; cursor: default; background: none; }
    html.sb-rail .nav-head::before { display: none; }
    html.sb-rail .nav-head::after { content: ""; width: 22px; height: 1px; background: var(--sidebar-border); }
    html.sb-rail .nav-items { margin: 0; padding: 0; border-left: 0; }
    html.sb-rail .nav-group.closed .nav-items { display: grid; }
    html.sb-rail .nav-link { justify-content: center; padding: 9px 0; }
    html.sb-rail .nav-link .ic { width: 18px; height: 18px; }
    html.sb-rail .nav-link.active::before { left: -14px; top: 9px; bottom: 9px; border-radius: 0 3px 3px 0; }
    html.sb-rail .collapse-btn { justify-content: center; }
    html.sb-rail .collapse-btn .ic { transform: rotate(180deg); }
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 28px;
    background: var(--topbar-bg); backdrop-filter: saturate(170%) blur(12px); -webkit-backdrop-filter: saturate(170%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar .icon-btn { width: 36px; height: 36px; border-radius: 9px; }
.topbar .icon-btn .ic { width: 18px; height: 18px; stroke-width: 1.8; }
.topbar-crumbs { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar-crumbs .home { display: inline-flex; color: var(--faint); }
.topbar-crumbs .home:hover { color: var(--primary); }
.topbar-crumbs .sep { color: var(--border-strong); }
.topbar-crumbs b { color: var(--text); font-weight: 600; min-width: 0; }

/* user menu (header) */
.user-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 3px 8px 3px 3px; border-radius: 11px; cursor: pointer; max-width: 240px; }
.user-btn:hover, .user-menu.open .user-btn { background: var(--surface-3); }
.user-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.user-btn .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 11.5px; }
.user-btn .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-btn .who b { font-size: 12px; font-weight: 600; color: var(--text); }
.user-btn .who small { font-size: 11px; color: var(--muted); }
.user-btn .chev { color: var(--faint); }
.user-menu .dropdown-menu { min-width: 250px; padding: 6px; border-radius: 12px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 4px; }
.menu-user .grow { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.menu-user b { font-size: 12px; }
.menu-user small { font-size: 11px; color: var(--muted); }
.avatar {
    width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 11px;
    color: #fff; background: linear-gradient(135deg, #0d9488, #132b4b); flex: none;
}

/* company / tenant switcher */
.ctx { position: relative; flex: none; }
.ctx-btn {
    display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px 0 5px; max-width: 300px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
.ctx-btn:hover { border-color: var(--border-strong); }
.ctx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.ctx.open .ctx-btn { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ctx-mark { display: inline-flex; flex: none; }
.ctx-group-mark { display: inline-flex; flex: none; }
.ctx-group-mark .brand-mark { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.ctx-empty-mark { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.ctx-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ctx-company { font-size: 10px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-tenant { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-caret { color: var(--muted); margin-left: 2px; transition: transform .2s var(--ease); }
.ctx.open .ctx-caret { transform: rotate(180deg); }
.ctx-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 340px; max-width: calc(100vw - 32px);
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
    animation: fade .15s var(--ease);
}
.ctx-menu[hidden] { display: none; }
.ctx-search { position: relative; padding: 8px; border-bottom: 1px solid var(--border); }
.ctx-search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.ctx-search input { width: 100%; height: 32px; padding: 0 10px 0 32px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 12px var(--font); }
.ctx-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ctx-list { max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; }
.ctx-group + .ctx-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.ctx-group-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; font-size: 10px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ctx-group-head span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-count { font-weight: 600; color: var(--faint); letter-spacing: 0; }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 12px; border-radius: 7px; color: var(--text); font-size: 12px; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--surface-3); color: var(--text); outline: none; }
.ctx-item.active { background: var(--primary-soft); color: var(--text); }
.ctx-item.inactive { opacity: .6; }
.ctx-item .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); flex: none; }
.ctx-item-name { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-item-meta { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.ctx-check { color: var(--primary); }
.ctx-default-badge { height: 18px; font-size: 10px; }
.ctx-default-badge[hidden] { display: none; }
.ctx-pin { all: unset; cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--faint); opacity: 0; transition: opacity .12s, background .12s; }
.ctx-item:hover .ctx-pin, .ctx-item:focus-within .ctx-pin, .ctx-pin:focus-visible, .ctx-pin.on { opacity: 1; }
.ctx-pin:hover { background: var(--surface); color: var(--primary); }
.ctx-pin.on { color: var(--primary); }
.ctx-pin:focus-visible { outline: 2px solid var(--primary-ring); }
.ctx-none { padding: 14px; font-size: 12px; color: var(--muted); margin: 0; }
.ctx-foot { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ctx-foot a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.ctx-foot a:hover { background: var(--surface-3); color: var(--text); }

.search-trigger {
    display: flex; align-items: center; gap: 9px; width: min(380px, 100%); min-width: 0; height: 38px; padding: 0 8px 0 12px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--faint); font: inherit; text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: 0 0 0 4px var(--primary-ring); }
.search-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger .kbd { flex: none; }
.kbd { font-family: var(--font); font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.content { padding: 26px 28px 36px; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1 0 auto; }
.content.flush { padding: 0; max-width: none; }
.content.wide { padding-left: 18px; padding-right: 18px; max-width: none; }
.topbar .menu-toggle { display: none; }   /* scoped: .icon-btn (declared later) would otherwise show it on desktop */
.scrim { display: none; }

/* footer */
.footer { flex: none; border-top: 1px solid var(--border); background: var(--surface); }
.footer-in { display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; max-width: 1480px; margin: 0 auto; padding: 14px 28px; font-size: 12px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-brand .logo-mark { width: 22px; height: 22px; color: var(--logo-arm); }
.footer-brand b { color: var(--text); font-weight: 700; }
.footer-status { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.footer-status .st { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.footer-status a.st:hover { color: var(--primary); }
.footer .env { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.footer-links { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.footer-links a:hover { color: var(--primary); }

@media (max-width: 1100px) {
    .user-btn .who, .user-btn .chev { display: none; }
    .user-btn { padding: 2px; }
}
@media (max-width: 960px) {
    .app, html.sb-rail .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-100%); transition: transform .25s var(--ease); }
    body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 35; }
    .sidebar-foot { display: none; }
    .sidebar-ws .ctx-menu { width: min(340px, calc(100vw - 32px)); }
    .topbar .menu-toggle { display: inline-grid; }
    .topbar { padding: 0 12px; gap: 6px; }
    .content { padding: 20px 16px; }
    .search-trigger .kbd { display: none; }
    .search-trigger span:not(.kbd) { display: none; }
    .search-trigger { width: 36px; flex: none; justify-content: center; padding: 0; border: 0; background: none; }
    .search-trigger:hover { box-shadow: none; background: var(--surface-3); }
    .hide-sm { display: none; }
    .footer-in { padding: 14px 16px; }
    .footer-links { margin-left: 0; }
}
@media (max-width: 560px) {
    .topbar-crumbs .home, .topbar-crumbs .sep, .topbar-crumbs .section { display: none; }
}

/* ------------------------------------------------------------------ Page header */
.page-header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header .titles { flex: 1; min-width: 240px; }
.page-header h1 { display: flex; align-items: center; gap: 10px; }
.page-header .sub { color: var(--muted); margin-top: 3px; font-size: 12px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .ic { width: 12px; height: 12px; opacity: .6; }

/* ------------------------------------------------------------------ Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
    font: 600 12px/1 var(--font); letter-spacing: -.003em; border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn .ic { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-primary:hover { background: var(--primary-600); color: var(--on-primary); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 5px; gap: 6px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .65; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent;
    color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 5px; }
.fav-btn.on { color: #f59e0b; }
.fav-btn.on .ic { fill: #f59e0b; }

/* ------------------------------------------------------------------ Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; gap: 10px; padding: 12px 18px; min-height: 50px; border-bottom: 1px solid var(--border); }
.card-header h2, .card-header h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header .ic { color: var(--muted); }
.card-header .sub { color: var(--muted); font-size: 11.5px; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; gap: 8px; align-items: center; }
.card.flat { box-shadow: none; }

/* Stat tiles */
.stat { padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; }
.stat .ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat .ico.teal { background: rgba(13, 148, 136, .1); color: #0d9488; }
.stat .ico.amber { background: rgba(217, 119, 6, .1); color: #d97706; }
.stat .ico.rose { background: rgba(225, 29, 72, .1); color: #e11d48; }
.stat .ico.sky { background: rgba(2, 132, 199, .1); color: #0284c7; }
.stat .label { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.stat .value { font-size: 20.5px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* Welcome banner */
.hero {
    position: relative; overflow: hidden; border-radius: 12px; padding: 22px 24px; color: #fff; margin-bottom: 20px;
    background: radial-gradient(1200px 300px at 0% 0%, rgba(255, 255, 255, .18), transparent 60%),
                linear-gradient(120deg, var(--h1, #0d9488) 0%, var(--h2, #132b4b) 55%, var(--h3, #0ea5e9) 100%);
    box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--h1, #0d9488) 70%, transparent);
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}
.hero h1 { color: #fff; font-size: 19px; }
.hero p { color: rgba(255, 255, 255, .85); margin-top: 4px; font-size: 12px; max-width: 640px; }
.hero .row { position: relative; z-index: 1; }
.hero .btn-outline { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; box-shadow: none; }
.hero .btn-outline:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.hero .meta { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; font-size: 12px; color: rgba(255, 255, 255, .9); }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .brand-mark { box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); }

/* Brand marks (logos / monograms) */
.brand-mark {
    --c: #0d9488; display: inline-grid; place-items: center; flex: none; font-weight: 700; color: #fff; overflow: hidden;
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #132b4b)); border-radius: 8px;
}
.brand-mark.has-logo { background: #fff; border: 1px solid var(--border); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.brand-xs { width: 20px; height: 20px; font-size: 9px; border-radius: 5px; }
.brand-sm { width: 28px; height: 28px; font-size: 10.5px; border-radius: 7px; }
.brand-md { width: 38px; height: 38px; font-size: 12.5px; border-radius: 9px; }
.brand-lg { width: 52px; height: 52px; font-size: 17px; border-radius: 12px; }
.brand-xl { width: 72px; height: 72px; font-size: 22.5px; border-radius: 16px; }

/* ------------------------------------------------------------------ Library: company & tenant cards */
.company-block { margin-bottom: 26px; }
.company-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.company-head h2 { font-size: 14px; }
.company-head .line { flex: 1; height: 1px; background: var(--border); }
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tenant-card {
    --c: #0ea5e9; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.tenant-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 40%, #38bdf8)); }
.tenant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); color: var(--text); }
.tenant-card .top { display: flex; gap: 12px; align-items: center; }
.tenant-card h3 { font-size: 13px; }
.tenant-card .desc { color: var(--muted); font-size: 12px; min-height: 19px; }
.tenant-card .foot { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--muted); margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.tenant-card .foot span { display: inline-flex; align-items: center; gap: 5px; }
.tenant-card .go { margin-left: auto; color: var(--c); display: inline-flex; transition: transform .2s; }
.tenant-card:hover .go { transform: translateX(3px); }

/* Report cards */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 33px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; font: 500 11.5px var(--font);
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .n { font-size: 10.5px; opacity: .7; }
.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--surface-3); gap: 2px; }
.seg button { all: unset; cursor: pointer; display: grid; place-items: center; width: 30px; height: 26px; border-radius: 5px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.cat-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 11px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.cat-title .ic { color: var(--primary); }
.cat-title .n { font-weight: 500; color: var(--faint); text-transform: none; letter-spacing: 0; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.report-card {
    --c: #0d9488; position: relative; display: flex; flex-direction: column; gap: 9px; padding: 16px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s, transform .2s var(--ease);
}
.report-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--border)); transform: translateY(-2px); }
.report-card .head { display: flex; gap: 12px; align-items: flex-start; }
.report-card .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); flex: none; }
.report-card h3 { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.report-card h3 a { color: var(--text); }
.report-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.report-card .desc { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.report-card .meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); margin-top: auto; }
.report-card .fav-btn, .report-card .actions { position: relative; z-index: 2; }
.report-card .head .fav-btn { margin: -6px -6px 0 auto; }
.report-card.inactive { opacity: .6; }
.report-grid.as-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.report-grid.as-list .report-card { flex-direction: row; align-items: center; padding: 10px 14px; }
.report-grid.as-list .report-card .head { flex: 1; align-items: center; }
.report-grid.as-list .report-card .desc { -webkit-line-clamp: 1; min-height: 0; }
.report-grid.as-list .report-card .meta { margin: 0; }

/* compact report rows (dashboard lists) */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); color: var(--text); }
.list-item .ttl { font-weight: 550; font-size: 12px; }
.list-item .sub { font-size: 11px; color: var(--muted); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #0d9488) 12%, transparent); color: var(--c, #0d9488); flex: none; }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px 4px 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 24px; min-height: 3px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #2dd4bf, #0d9488); transition: filter .15s; }
.bars .bar:hover i { filter: brightness(1.15); }
.bars .bar span { font-size: 10px; color: var(--faint); }
.bars .bar.today i { background: linear-gradient(180deg, #38bdf8, #0ea5e9); }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
    padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .strong { color: var(--text); font-weight: 600; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.cell-entity { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-entity .t { font-weight: 600; color: var(--text); }
.cell-entity .s { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------------ Badges & status */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge .ic { width: 11px; height: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

/* ------------------------------------------------------------------ Forms */
.form-section { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.form-section:first-child { padding-top: 4px; }
.form-section:last-child { border-bottom: 0; }
.form-section .intro h3 { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.form-section .intro p { color: var(--muted); font-size: 12px; margin-top: 4px; }
@media (max-width: 900px) { .form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.field .help { font-size: 11px; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
.input, select.input, textarea.input {
    width: 100%; height: 34px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background-color: var(--surface);
    color: var(--text); font: 12px var(--font); box-shadow: 0 1px 1px rgba(16, 24, 40, .03); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 8px 11px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--muted); }
.input.mono { font-family: var(--mono); font-size: 12px; }
.input-validation-error, .input.error { border-color: var(--danger) !important; }
.field-validation-error { color: var(--danger); font-size: 11px; font-weight: 500; }
.validation-summary-errors { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 12px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 34px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 40px; height: 34px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 12px; font-weight: 500; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked ~ .track { background: var(--primary); }
.switch input:checked ~ .track::after { transform: translateX(14px); }
.switch input:focus-visible ~ .track { box-shadow: 0 0 0 3px var(--primary-ring); }

/* radio cards */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.radio-card { position: relative; display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card .ic { color: var(--muted); margin-top: 1px; }
.radio-card .t { font-weight: 600; font-size: 12px; }
.radio-card .d { font-size: 11px; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.radio-card:has(input:checked) .ic { color: var(--primary); }
.radio-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-ring); }

/* logo uploader */
.logo-upload { display: flex; align-items: center; gap: 16px; }
.logo-upload .preview { width: 72px; height: 72px; border-radius: 14px; border: 2px dashed var(--border-strong); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--faint); flex: none; }
.logo-upload .preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.logo-upload input[type=file] { display: none; }

/* checkbox tiles (tenant access) */
.check-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.check-group + .check-group { margin-top: 12px; }
.check-group .gh { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 10px; }
.check-tile { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; transition: all .15s; }
.check-tile:hover { border-color: var(--border-strong); }
.check-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check-tile input { accent-color: var(--primary); width: 15px; height: 15px; }

/* per-tenant / per-report access picker */
.access-list { display: flex; flex-direction: column; }
.access-tenant { border-top: 1px solid var(--border); }
.access-tenant:first-child { border-top: 0; }
.access-tenant.granted { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.access-head { display: flex; align-items: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.access-head input[type=checkbox][data-tenant-toggle] { accent-color: var(--primary); width: 15px; height: 15px; }
.access-summary { min-width: 90px; text-align: right; }
.report-picker { padding: 4px 14px 12px 44px; }
.picker-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 6px 0; }
.report-picker .check-tile { background: var(--surface); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-x: auto; }
.tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; font-weight: 600; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:focus-visible { outline: 2px solid var(--primary-ring); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* alerts */
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius); font-size: 12px; border: 1px solid transparent; }
.alert .ic { margin-top: 1px; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert b { color: inherit; }
.test-result { margin-top: 12px; display: none; }
.test-result.show { display: flex; }

/* key/value list */
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 9px 16px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
@media (max-width: 640px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; } }

/* empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .art { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; font-size: 12px; }

/* pager */
.pager { display: flex; align-items: center; gap: 6px; }
.pager a, .pager span { min-width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.pager a:hover { border-color: var(--border-strong); }
.pager .current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pager .disabled { opacity: .45; }

/* dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; padding: 5px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; animation: fade .15s var(--ease); }
.dropdown-menu a, .dropdown-menu button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 5px; cursor: pointer; color: var(--text-2); font-size: 12px; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu hr { margin: 6px 0; }

/* ------------------------------------------------------------------ Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
    display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 11px 13px; border-radius: var(--radius);
    background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 12px; animation: toast-in .3s var(--ease);
}
.toast .ic { margin-top: 1px; }
.toast.success .ic { color: #34d399; }
.toast.error .ic { color: #f87171; }
.toast.info .ic { color: #38bdf8; }
.toast .close { all: unset; cursor: pointer; margin-left: auto; opacity: .6; }
.toast.hide { animation: toast-out .25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ------------------------------------------------------------------ Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 16px; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); }
.modal.open { display: grid; animation: fade .15s; }
.modal-dialog { width: min(440px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-body { padding: 22px; display: flex; gap: 14px; }
.modal-body .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); flex: none; }
.modal-body h3 { font-size: 14px; margin-bottom: 4px; }
.modal-body p { color: var(--muted); }
.modal-footer { padding: 12px 22px; background: var(--surface-2); display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ Command palette */
.palette { position: fixed; inset: 0; z-index: 95; display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(2, 6, 23, .5); backdrop-filter: blur(4px); }
.palette.open { display: flex; animation: fade .15s; }
.palette-box { width: min(620px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input .ic { color: var(--faint); }
.palette-input input { flex: 1; height: 50px; border: 0; outline: 0; background: transparent; color: var(--text); font: 13.5px var(--font); }
.palette-results { max-height: 420px; overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 10px 4px; font-size: 10px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
.palette-item .ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #0d9488) 14%, transparent); color: var(--c, #0d9488); flex: none; }
.palette-item .t { font-weight: 550; }
.palette-item .s { font-size: 11px; color: var(--muted); }
.palette-item.sel, .palette-item:hover { background: var(--primary-soft); color: var(--text); }
.palette-item .enter { margin-left: auto; opacity: 0; }
.palette-item.sel .enter { opacity: 1; }
.palette-empty { padding: 30px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); background: var(--surface-2); }

/* ------------------------------------------------------------------ Report viewer page */
.viewer-shell { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.viewer-bar h1 { font-size: 14px; }
.viewer-bar .crumbs { margin: 0; }
.viewer-frame-wrap { position: relative; flex: 1; background: var(--surface-2); }
.viewer-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; transition: opacity .3s; }
.viewer-loading.done { opacity: 0; }
.viewer-loading .spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 12px; }
.viewer-shell.fullscreen { position: fixed; inset: 0; z-index: 80; height: 100vh; background: var(--surface); }

/* ------------------------------------------------------------------ Auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
    background: radial-gradient(900px 500px at 10% 10%, rgba(20, 184, 166, .38), transparent 60%),
                radial-gradient(700px 500px at 90% 90%, rgba(56, 189, 248, .28), transparent 60%),
                linear-gradient(160deg, #132b4b 0%, #0b1d36 100%);
}
.auth-art::before {
    content: ""; position: absolute; inset: 0; opacity: .25;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
}
.auth-art > * { position: relative; }
.auth-art .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22.5px; letter-spacing: -.02em; }
.auth-art .brand .logo-mark { width: 38px; height: 38px; }
.auth-art .brand .wordmark { line-height: 1.1; }
.auth-art .brand .caption { font-size: 11px; letter-spacing: .03em; margin-top: 3px; color: #9fb2cb; }
.auth-art .pitch { margin-top: auto; margin-bottom: auto; max-width: 520px; }
.auth-illustration { display: block; width: 100%; max-width: 480px; height: auto; margin: 28px 0 30px; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (max-height: 820px) { .auth-illustration { max-width: 380px; margin: 18px 0 20px; } }
@media (max-height: 700px) { .auth-illustration { display: none; } }
.auth-art h1 { color: #fff; font-size: 32px; font-weight: 650; line-height: 1.15; letter-spacing: -.025em; }
.auth-art h1 span { background: linear-gradient(90deg, #2dd4bf, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { color: #b3c3d8; font-size: 14px; margin-top: 14px; }
.auth-art .features { display: grid; gap: 14px; margin-top: 30px; }
.auth-art .feature { display: flex; gap: 14px; align-items: flex-start; }
.auth-art .feature .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(45, 212, 191, .12); border: 1px solid rgba(45, 212, 191, .25); color: var(--teal-bright); flex: none; }
.auth-art .feature b { display: block; color: #fff; font-weight: 600; }
.auth-art .feature span { color: #9fb2cb; font-size: 12px; }
.auth-art .foot { font-size: 12px; color: #7890b0; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: min(380px, 100%); }
.key-tile { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--teal-bright); background: var(--navy); }
.auth-card h2 { font-size: 20.5px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 4px 0 24px; }
.auth-card .field { margin-bottom: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap .icon-btn { position: absolute; right: 1px; top: 1px; }
@media (max-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } }

/* ------------------------------------------------------------------ Sign-in page
   White form side | navy-to-teal brand panel with the Healthcare Data / Analytics / Reports illustration */
.signin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); min-height: 100vh; background: var(--surface); }
.si-side { display: flex; flex-direction: column; padding: 32px 48px; min-width: 0; }
.si-brand { display: flex; align-items: center; gap: 11px; }
.si-brand .logo-mark { width: 40px; height: 40px; padding: 5px; border-radius: 11px; color: var(--logo-arm); background: var(--surface-3); }
.si-brand .name { font-weight: 800; font-size: 18px; letter-spacing: -.025em; line-height: 1.1; color: var(--text); white-space: nowrap; }
.si-brand .hub { color: var(--primary); }
.si-brand .caption { font-size: 10.5px; color: var(--faint); margin-top: 3px; white-space: nowrap; }
.si-form-wrap { flex: 1; display: grid; place-items: center; padding: 40px 0; }
.si-card { width: min(400px, 100%); }
.si-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.si-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.si-card h1 { font-size: 26.5px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; }
.si-sub { color: var(--muted); font-size: 13px; margin: 8px 0 28px; }
.si-alert {
    display: flex; gap: 10px; padding: 11px 14px; margin-bottom: 18px; border-radius: 10px; font-size: 12px;
    background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
}
.si-alert .ic { margin-top: 2px; }
.si-field { display: grid; gap: 6px; margin-bottom: 16px; }
.si-field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.si-control { position: relative; display: flex; align-items: center; }
.si-control > .ic { position: absolute; left: 14px; color: var(--faint); pointer-events: none; transition: color .15s; }
.si-control:focus-within > .ic { color: var(--primary); }
.si-input {
    width: 100%; height: 46px; padding: 0 14px 0 42px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font: 13px var(--font); transition: border-color .15s, box-shadow .15s;
}
.si-input::placeholder { color: var(--faint); }
.si-input:hover { border-color: var(--faint); }
.si-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.si-input.pw { padding-right: 50px; }
.si-reveal { all: unset; position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.si-reveal:hover { background: var(--surface-3); color: var(--text); }
.si-reveal:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.si-caps { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--warning); background: var(--warning-soft); }
.si-caps[hidden] { display: none; }
.si-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 24px; }
.si-help { font-size: 12px; color: var(--muted); }
.si-btn {
    all: unset; box-sizing: border-box; width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border-radius: 11px; cursor: pointer; font: 650 13.5px var(--font); color: var(--on-primary);
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, #fff), var(--primary));
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent); transition: filter .15s, transform .06s;
}
.si-btn:hover { filter: brightness(1.05); }
.si-btn:active { transform: translateY(1px); }
.si-btn:focus-visible { box-shadow: 0 0 0 4px var(--primary-ring); }
.si-btn .ic { transition: transform .2s; }
.si-btn:hover .ic { transform: translateX(3px); }
.si-btn.loading { pointer-events: none; opacity: .85; }
.si-btn.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.si-btn.loading .ic { display: none; }
.si-otp { font: 700 20px var(--font); letter-spacing: .45em; }
.si-otp::placeholder { letter-spacing: .3em; }
.si-otp-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.si-otp-actions form { margin: 0; }
.si-link { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.si-link:hover { text-decoration: underline; }
.si-link:focus-visible { border-radius: 4px; box-shadow: 0 0 0 3px var(--primary-ring); }
.si-link:disabled { cursor: default; color: var(--faint); text-decoration: none; }
.si-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 26px; padding: 13px 14px; border-radius: 12px; font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.si-note .ic { color: var(--primary); margin-top: 2px; }
.si-note b { color: var(--text-2); font-weight: 600; }
.si-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--faint); }
.si-env { margin-right: 8px; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--primary-soft); color: var(--primary); }

.si-art {
    position: relative; overflow: hidden; display: flex; flex-direction: column; margin: 14px 14px 14px 0; padding: 36px 44px; border-radius: 26px; color: #fff;
    background: radial-gradient(90% 70% at 100% 0%, rgba(45, 212, 191, .35), transparent 60%),
                radial-gradient(70% 60% at 0% 100%, rgba(56, 189, 248, .22), transparent 60%),
                linear-gradient(150deg, #132b4b 10%, #0f3b52 55%, #0f766e 120%);
}
.si-art::before {
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px; -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
}
.si-art > * { position: relative; }
.si-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: #d6fbf5; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.si-pill b { padding: 2px 7px; border-radius: 99px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; background: #2dd4bf; color: #0d2140; }
.si-art h2 { margin: 20px 0 10px; max-width: 16ch; color: #fff; font-size: clamp(26px, 2.4vw, 34px); font-weight: 750; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.si-art h2 span { background: linear-gradient(90deg, #5eead4, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.si-lead { max-width: 46ch; color: #bcd0e0; font-size: 14px; }
.si-hero { margin: 22px 0 24px; max-width: 500px; }
.si-hero svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.si-hero .flow path { animation: si-flow 1.4s linear infinite; }
.si-hero .trend { stroke-dasharray: 200; animation: si-draw 1.4s .2s ease-out both; }
.si-hero .rbars rect { opacity: .85; transform-box: fill-box; transform-origin: bottom; animation: si-grow .9s cubic-bezier(.2, .8, .2, 1) both; }
.si-hero .rbars rect:nth-child(2) { animation-delay: .05s; } .si-hero .rbars rect:nth-child(3) { animation-delay: .1s; }
.si-hero .rbars rect:nth-child(4) { animation-delay: .15s; } .si-hero .rbars rect:nth-child(5) { animation-delay: .2s; }
.si-hero .rbars rect:nth-child(6) { animation-delay: .25s; } .si-hero .rbars rect:nth-child(7) { animation-delay: .3s; }
.si-hero .rbars rect:nth-child(8) { animation-delay: .35s; }
@keyframes si-flow { to { stroke-dashoffset: -18; } }
@keyframes si-draw { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes si-grow { from { transform: scaleY(.15); } }
.si-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: auto; }
.si-feature { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.si-feature .ico { width: 32px; height: 32px; margin-bottom: 10px; border-radius: 9px; display: grid; place-items: center; background: rgba(45, 212, 191, .14); color: #5eead4; }
.si-feature b { display: block; font-size: 12px; color: #fff; }
.si-feature span { display: block; margin-top: 2px; font-size: 11.5px; color: #a9bfd3; }
@media (max-width: 1200px) {
    .si-features { grid-template-columns: minmax(0, 1fr); }
    .si-feature { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
    .si-feature .ico { margin: 0; flex: none; }
}
@media (max-width: 980px) {
    .signin { grid-template-columns: minmax(0, 1fr); }
    .si-art { display: none; }
    .si-side { padding: 24px 20px; }
}

/* error page */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-page .code { font-size: 67.5px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(90deg, #0d9488, #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ Dashboard */
.dash-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 20px;
    padding: 26px 28px; border-radius: 16px; color: #fff; box-shadow: 0 12px 30px -18px rgba(19, 43, 75, .55);
    background: radial-gradient(120% 140% at 100% 0%, rgba(45, 212, 191, .32), transparent 55%), linear-gradient(120deg, #132b4b 30%, #0f766e);
}
.dash-hero-mark { position: absolute; right: 26%; top: -50px; width: 230px; height: 230px; opacity: .07; pointer-events: none; }
.dash-hero-text { position: relative; flex: 1 1 380px; min-width: 0; }
.dash-hero .date { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: #8fe9dc; }
.dash-hero h1 { color: #fff; font-size: 23.5px; font-weight: 750; letter-spacing: -.025em; margin: 6px 0; text-wrap: balance; }
.dash-hero p { color: #c4d4e3; font-size: 12.5px; max-width: 62ch; margin-bottom: 18px; }
.dash-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hbtn {
    all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; cursor: pointer;
    font-weight: 650; font-size: 12px; color: #fff; border: 1px solid rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .08); transition: background .15s;
}
.hbtn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.hbtn:focus-visible { box-shadow: 0 0 0 3px rgba(45, 212, 191, .5); }
.hbtn.solid { background: #fff; color: #132b4b; border-color: #fff; }
.hbtn.solid:hover { background: #e7f6f4; color: #132b4b; }
.dash-hero-stats { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex: 0 1 430px; }
.dash-hero-stats > div { padding: 14px 16px; border-radius: 13px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.dash-hero-stats small { display: block; color: #a9bfd3; font-size: 11px; font-weight: 500; white-space: nowrap; }
.dash-hero-stats b { display: block; font-size: 20.5px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dash-hero-stats em { font-style: normal; font-size: 11px; color: #8fe9dc; white-space: nowrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kpi-top .lbl { color: var(--muted); font-size: 12px; font-weight: 550; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-ic .ic { width: 18px; height: 18px; stroke-width: 1.8; }
.kpi-ic.teal { background: rgba(13, 148, 136, .12); color: #0d9488; }
.kpi-ic.sky { background: rgba(2, 132, 199, .12); color: #0284c7; }
.kpi-ic.amber { background: rgba(217, 119, 6, .12); color: #d97706; }
.kpi-ic.violet { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.kpi-ic.rose { background: rgba(225, 29, 72, .12); color: #e11d48; }
.kpi .val { font-size: 25.5px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 11px; color: var(--faint); }
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.delta { display: inline-flex; align-items: center; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 99px; }
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.spark { width: 96px; height: 34px; flex: none; }
.spark .l { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .a { fill: var(--primary-soft); stroke: none; }
.spark circle { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1280px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } }

.range-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-3); }
.range-seg button { all: unset; cursor: pointer; padding: 4px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.range-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.range-seg button:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
.runs-sum { display: flex; gap: 28px; flex-wrap: wrap; padding: 14px 20px 0; }
.runs-sum small { display: block; color: var(--muted); font-size: 11.5px; }
.runs-sum b { font-size: 18px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.runs-chart { position: relative; padding: 8px 10px 12px; }
.runs-chart svg { display: block; max-width: 100%; }
.runs-chart text { fill: var(--faint); font-size: 10.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.runs-chart .gl { stroke: var(--border); stroke-width: 1; opacity: .7; }
.runs-chart .base { stroke: var(--border-strong); stroke-width: 1; }
.runs-chart .bar { fill: var(--primary); opacity: .85; transition: opacity .1s; }
.runs-chart .bar.wk { opacity: .45; }
.runs-chart .bar.hl { opacity: 1; }
.runs-chart .hit { fill: transparent; cursor: default; }
.runs-tip {
    position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap; font-size: 11.5px;
    padding: 7px 11px; border-radius: 9px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.runs-tip small { display: block; color: var(--muted); }
.runs-tip b { font-size: 13px; font-variant-numeric: tabular-nums; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px 18px; }
.quick-actions a {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 12px; color: var(--text);
    border: 1px solid var(--border); background: var(--surface-2); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick-actions a:hover { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); transform: translateY(-1px); color: var(--text); }
.quick-actions b { font-size: 12px; font-weight: 650; line-height: 1.25; }
.quick-actions small { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--muted); }

.fee-card { padding: 14px 18px 18px; display: grid; gap: 12px; }
.fee-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); }
.fee-top .kpi-ic { background: var(--surface); }
.fee-top b { display: block; font-size: 13px; }
.fee-top small { color: var(--muted); font-size: 11.5px; }
.fee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fee-grid div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.fee-grid small { display: block; color: var(--muted); font-size: 11px; }
.fee-grid b { font-size: 16px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .dash-hero { padding: 20px 18px; }
    .dash-hero-stats { flex-basis: 100%; }
    .dash-hero-stats > div { padding: 10px 12px; }
    .dash-hero-stats b { font-size: 17px; }
    .quick-actions { grid-template-columns: minmax(0, 1fr); }
}

/* utilities */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 28px; }
.p-0 { padding: 0 !important; }
.text-right { text-align: right; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.divider-v { width: 1px; height: 20px; background: var(--border); }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ In-place navigation (Scripts/app.js) */
.nav-progress {
    position: fixed; top: 0; left: 0; z-index: 9999; height: 3px; width: 0; opacity: 0; pointer-events: none;
    background: linear-gradient(90deg, var(--primary), var(--sky)); box-shadow: 0 0 8px var(--primary-ring);
}
.nav-progress.run { opacity: 1; width: 82%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .15s; }
.nav-progress.run.end { width: 100%; opacity: 0; transition: width .2s ease, opacity .25s ease .12s; }
#main { transition: opacity .15s; }
#main[aria-busy="true"] { opacity: .55; pointer-events: none; }
#main:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
