:root {
    color-scheme: light dark;
    --ink: #172033;
    --muted: #687386;
    --line: #e4e9f1;
    --soft: #eef1f7;
    --surface: #eef1f7;
    --surface-solid: #ffffff;
    --navy: #172d55;
    --indigo: #4a5bdc;
    --indigo-dark: #3848bd;
    --indigo-soft: #eef0ff;
    --blue: #2878d0;
    --green: #178267;
    --green-soft: #e8f7f1;
    --amber: #b86f11;
    --amber-soft: #fff4df;
    --red: #c23d4b;
    --red-soft: #ffedf0;
    --shadow: 0 12px 35px rgba(27, 45, 80, .08);
    --sidebar: 252px;
    --radius: 18px;
    --neu-light: rgba(255, 255, 255, .85);
    --neu-dark: rgba(163, 177, 198, .5);
    --neu-out: 7px 7px 16px var(--neu-dark), -7px -7px 16px var(--neu-light);
    --neu-out-sm: 4px 4px 9px var(--neu-dark), -4px -4px 9px var(--neu-light);
    --neu-in: inset 3px 3px 7px var(--neu-dark), inset -3px -3px 7px var(--neu-light);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e7ebf3; --muted: #99a5bd; --line: #26314e; --soft: #131d34; --surface: #131d34; --surface-solid: #16213b;
    --navy: #0c1730; --indigo: #8291f2; --indigo-dark: #6d7de8; --indigo-soft: #232d57;
    --blue: #5b9eea; --green: #3ecf9a; --green-soft: #113a30; --amber: #e3a94f; --amber-soft: #3a2c10;
    --red: #ec7986; --red-soft: #3a1620; --shadow: 0 12px 35px rgba(0, 0, 0, .45);
    --neu-light: rgba(255, 255, 255, .045); --neu-dark: rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --ink: #e7ebf3; --muted: #99a5bd; --line: #26314e; --soft: #131d34; --surface: #131d34; --surface-solid: #16213b;
        --navy: #0c1730; --indigo: #8291f2; --indigo-dark: #6d7de8; --indigo-soft: #232d57;
        --blue: #5b9eea; --green: #3ecf9a; --green-soft: #113a30; --amber: #e3a94f; --amber-soft: #3a2c10;
        --red: #ec7986; --red-soft: #3a1620; --shadow: 0 12px 35px rgba(0, 0, 0, .45);
        --neu-light: rgba(255, 255, 255, .045); --neu-dark: rgba(0, 0, 0, .6);
    }
}

/* The sign-in hub keeps its own palette so the entrance reads as RES in either
   theme: the navy sheet after dark, the same purples over paper in daylight. */
:root {
    --hub-bg: #f3f4fc;
    --hub-glow-a: rgba(134,25,143,.10); --hub-glow-b: rgba(76,29,149,.13);
    --hub-sheet-1: #fafaff; --hub-sheet-2: #eef0fb; --hub-sheet-3: #e7e7fa;
    --hub-strong: #141838; --hub-text: #4d5474; --hub-muted: #6b7492; --hub-dim: #838ca8;
    --hub-title: #2a3160; --hub-sub: #6f78a0; --hub-rule: rgba(23,28,70,.11);
    --hub-accent: #5647d6; --hub-focus: #6d5ce6;
    --hub-card-1: rgba(255,255,255,.97); --hub-card-2: rgba(250,250,255,.93);
    --hub-card-hover-1: #ffffff; --hub-card-hover-2: rgba(249,248,255,.98);
    --hub-edge-1: rgba(23,28,70,.15); --hub-edge-2: rgba(120,96,230,.22); --hub-edge-3: rgba(23,28,70,.06);
    --hub-edge-hover-1: rgba(96,74,224,.6); --hub-edge-hover-2: rgba(196,74,170,.36); --hub-edge-hover-3: rgba(96,74,224,.18);
    --hub-shadow: 0 12px 30px rgba(30,36,90,.10); --hub-shadow-hover: 0 20px 44px rgba(30,36,90,.17);
    --hub-chip-bg: rgba(112,88,232,.11); --hub-chip-border: rgba(23,28,70,.10); --hub-chip-ink: #5b49d8;
    --hub-chip-hover-bg: rgba(96,74,224,.18); --hub-chip-hover-border: rgba(96,74,224,.4); --hub-chip-hover-ink: #3f2fb8;
    --hub-tile-bg: rgba(112,88,232,.08); --hub-tile-border: rgba(23,28,70,.09);
    --hub-aura-ink: #6f57d8; --hub-aura-opacity: .13;
    --hub-logo-bg: #ffffff; --hub-logo-border: rgba(23,28,70,.10); --hub-logo-shadow: 0 8px 20px rgba(30,36,90,.13);
    --hub-field-bg: rgba(23,28,70,.045); --hub-field-border: rgba(23,28,70,.15); --hub-field-ink: #1b2140;
    --hub-field-label: #414a6d; --hub-field-focus: #6d5ce6; --hub-field-ring: rgba(109,92,230,.22);
    --hub-switch-track: rgba(23,28,70,.12); --hub-switch-on: #5647d6; --hub-switch-thumb: #ffffff; --hub-switch-ink: #2a2d63;
    --hub-code-bg: rgba(86,71,214,.11); --hub-code-ink: #3f2fb8;
    --hub-alert-bg: rgba(23,28,70,.05); --hub-alert-border: rgba(23,28,70,.13); --hub-alert-ink: #2b3153;
    --hub-danger-bg: #fdeaed; --hub-danger-border: #efb9c2; --hub-danger-ink: #8d2233;
    --hub-success-bg: #e6f7f1; --hub-success-border: #a8dfcd; --hub-success-ink: #14624f;
}
:root[data-theme="dark"] {
    --hub-bg: #0a0c22;
    --hub-glow-a: rgba(134,25,143,.32); --hub-glow-b: rgba(76,29,149,.42);
    --hub-sheet-1: #0a0c22; --hub-sheet-2: #14133a; --hub-sheet-3: #1b1348;
    --hub-strong: #ffffff; --hub-text: #b3bdd8; --hub-muted: #9aa6c2; --hub-dim: #7f8bad;
    --hub-title: #d0d8f5; --hub-sub: #8e9ada; --hub-rule: rgba(255,255,255,.09);
    --hub-accent: #a9b6ff; --hub-focus: #c9baff;
    --hub-card-1: rgba(31,32,74,.86); --hub-card-2: rgba(18,19,48,.9);
    --hub-card-hover-1: rgba(41,42,94,.9); --hub-card-hover-2: rgba(23,24,60,.92);
    --hub-edge-1: rgba(255,255,255,.22); --hub-edge-2: rgba(168,148,255,.16); --hub-edge-3: rgba(255,255,255,.06);
    --hub-edge-hover-1: rgba(216,206,255,.66); --hub-edge-hover-2: rgba(255,154,214,.38); --hub-edge-hover-3: rgba(255,255,255,.16);
    --hub-shadow: 0 12px 30px rgba(4,6,26,.34); --hub-shadow-hover: 0 20px 44px rgba(4,6,26,.46);
    --hub-chip-bg: rgba(146,124,255,.16); --hub-chip-border: rgba(255,255,255,.14); --hub-chip-ink: #cbbcff;
    --hub-chip-hover-bg: rgba(160,138,255,.28); --hub-chip-hover-border: rgba(216,206,255,.5); --hub-chip-hover-ink: #ffffff;
    --hub-tile-bg: rgba(255,255,255,.06); --hub-tile-border: rgba(255,255,255,.14);
    --hub-aura-ink: #bba9ff; --hub-aura-opacity: .10;
    --hub-logo-bg: #ffffff; --hub-logo-border: transparent; --hub-logo-shadow: 0 10px 26px rgba(0,0,0,.28);
    --hub-field-bg: rgba(255,255,255,.06); --hub-field-border: rgba(255,255,255,.14); --hub-field-ink: #f1f4ff;
    --hub-field-label: #c6cfe8; --hub-field-focus: #a99cff; --hub-field-ring: rgba(150,132,255,.26);
    --hub-switch-track: rgba(255,255,255,.09); --hub-switch-on: #6b5cf0; --hub-switch-thumb: #e9ecfb; --hub-switch-ink: #2a2d63;
    --hub-code-bg: rgba(255,255,255,.09); --hub-code-ink: #ded6ff;
    --hub-alert-bg: rgba(255,255,255,.07); --hub-alert-border: rgba(255,255,255,.16); --hub-alert-ink: #e6eaf8;
    --hub-danger-bg: rgba(190,52,68,.24); --hub-danger-border: rgba(255,138,138,.42); --hub-danger-ink: #ffd9dd;
    --hub-success-bg: rgba(24,130,103,.24); --hub-success-border: rgba(120,225,180,.35); --hub-success-ink: #d3f6e7;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --hub-bg: #0a0c22;
        --hub-glow-a: rgba(134,25,143,.32); --hub-glow-b: rgba(76,29,149,.42);
        --hub-sheet-1: #0a0c22; --hub-sheet-2: #14133a; --hub-sheet-3: #1b1348;
        --hub-strong: #ffffff; --hub-text: #b3bdd8; --hub-muted: #9aa6c2; --hub-dim: #7f8bad;
        --hub-title: #d0d8f5; --hub-sub: #8e9ada; --hub-rule: rgba(255,255,255,.09);
        --hub-accent: #a9b6ff; --hub-focus: #c9baff;
        --hub-card-1: rgba(31,32,74,.86); --hub-card-2: rgba(18,19,48,.9);
        --hub-card-hover-1: rgba(41,42,94,.9); --hub-card-hover-2: rgba(23,24,60,.92);
        --hub-edge-1: rgba(255,255,255,.22); --hub-edge-2: rgba(168,148,255,.16); --hub-edge-3: rgba(255,255,255,.06);
        --hub-edge-hover-1: rgba(216,206,255,.66); --hub-edge-hover-2: rgba(255,154,214,.38); --hub-edge-hover-3: rgba(255,255,255,.16);
        --hub-shadow: 0 12px 30px rgba(4,6,26,.34); --hub-shadow-hover: 0 20px 44px rgba(4,6,26,.46);
        --hub-chip-bg: rgba(146,124,255,.16); --hub-chip-border: rgba(255,255,255,.14); --hub-chip-ink: #cbbcff;
        --hub-chip-hover-bg: rgba(160,138,255,.28); --hub-chip-hover-border: rgba(216,206,255,.5); --hub-chip-hover-ink: #ffffff;
        --hub-tile-bg: rgba(255,255,255,.06); --hub-tile-border: rgba(255,255,255,.14);
        --hub-aura-ink: #bba9ff; --hub-aura-opacity: .10;
        --hub-logo-bg: #ffffff; --hub-logo-border: transparent; --hub-logo-shadow: 0 10px 26px rgba(0,0,0,.28);
        --hub-field-bg: rgba(255,255,255,.06); --hub-field-border: rgba(255,255,255,.14); --hub-field-ink: #f1f4ff;
        --hub-field-label: #c6cfe8; --hub-field-focus: #a99cff; --hub-field-ring: rgba(150,132,255,.26);
        --hub-switch-track: rgba(255,255,255,.09); --hub-switch-on: #6b5cf0; --hub-switch-thumb: #e9ecfb; --hub-switch-ink: #2a2d63;
        --hub-code-bg: rgba(255,255,255,.09); --hub-code-ink: #ded6ff;
        --hub-alert-bg: rgba(255,255,255,.07); --hub-alert-border: rgba(255,255,255,.16); --hub-alert-ink: #e6eaf8;
        --hub-danger-bg: rgba(190,52,68,.24); --hub-danger-border: rgba(255,138,138,.42); --hub-danger-ink: #ffd9dd;
        --hub-success-bg: rgba(24,130,103,.24); --hub-success-border: rgba(120,225,180,.35); --hub-success-ink: #d3f6e7;
    }
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--soft); font-family: "Segoe UI", Inter, Arial, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }

.auth-body { background: var(--soft); }
.setup-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) minmax(520px, 1.08fr); }
.setup-shell { grid-template-columns: minmax(360px, 1fr) minmax(440px, 540px); align-items: center; max-width: 1220px; margin: auto; padding: 48px; gap: 64px; }
.auth-brand { min-height: 100%; padding: 72px clamp(42px, 6vw, 100px); display: flex; flex-direction: column; justify-content: center; color: white; background: linear-gradient(155deg, #0a0c22 0%, #1e1b4b 32%, #4c1d95 68%, #86198f 100%); position: relative; overflow: hidden; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); }
.auth-brand::before { width: 640px; height: 640px; right: -280px; top: -290px; box-shadow: 0 0 0 80px rgba(255,255,255,.018), 0 0 0 160px rgba(255,255,255,.012); }
.auth-brand::after { width: 380px; height: 380px; left: -220px; bottom: -200px; background: rgba(255,255,255,.025); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; border-radius: 11px; background: #ffffff; box-shadow: 0 8px 18px rgba(0,0,0,.18); flex: 0 0 auto; }
.brand-mark img { display: block; height: 28px; width: auto; }
.brand-mark.large { padding: 12px 18px; border-radius: 16px; margin-bottom: 28px; box-shadow: 0 15px 35px rgba(0,0,0,.22); }
.brand-mark.large img { height: 44px; width: auto; }
.eyebrow { margin: 0 0 8px; color: var(--indigo); font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.auth-brand .eyebrow { color: #aab8ff; }
.auth-brand h1 { margin: 6px 0 20px; font-size: clamp(38px, 4vw, 62px); line-height: 1.05; letter-spacing: -.045em; max-width: 760px; position: relative; }
.auth-brand > p:not(.eyebrow) { margin: 0; color: #cbd4e5; font-size: 17px; line-height: 1.7; max-width: 610px; position: relative; }

.auth-card { margin: auto; width: min(620px, calc(100% - 64px)); padding: 44px; border-radius: 24px; background: var(--surface-solid); box-shadow: 0 22px 70px rgba(27,45,80,.11); }
.auth-card-head h2, .setup-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.auth-card-head .muted { margin: 8px 0 28px; }
.muted { color: var(--muted); }
.form-stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: var(--ink); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; color: var(--ink); background: var(--soft); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s ease; box-shadow: var(--neu-in); }
.searchable-select { position: relative; }
.searchable-select-native { display: none; }
.searchable-select-options { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: 240px; overflow-y: auto; background: var(--surface-solid); border-radius: 10px; box-shadow: 0 14px 34px rgba(11,21,42,.28); padding: 6px; }
.searchable-select-option { padding: 9px 10px; border-radius: 7px; font-size: 13px; color: var(--ink); cursor: pointer; }
.searchable-select-option:hover, .searchable-select-option.active { background: var(--soft); }
.searchable-select-empty { padding: 9px 10px; color: var(--muted); font-size: 12px; }
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #7c89e9; box-shadow: var(--neu-in), 0 0 0 3px rgba(74,91,220,.16); }
.field input:invalid, .field select:invalid, .field textarea:invalid { box-shadow: var(--neu-in); outline: none; }
.field input:invalid:focus, .field select:invalid:focus, .field textarea:invalid:focus { box-shadow: var(--neu-in), 0 0 0 3px rgba(74,91,220,.16); }
.field:has(> input[type="file"]) { position: relative; }
.field:has(> input[type="file"])::after { content: "or drag & drop a file here"; display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.field.drag-over, .template-option.drag-over { box-shadow: 0 0 0 2px var(--indigo), var(--neu-out); }
.field.drag-over > input[type="file"] { box-shadow: var(--neu-in), 0 0 0 3px rgba(74,91,220,.16); }
.field input:disabled, .field select:disabled { background: var(--soft); color: var(--muted); opacity: .7; box-shadow: none; }
.field input[readonly] { background: var(--soft); color: var(--muted); box-shadow: none; }


/* HOO monthly view: validated chart hues plus the chart primitives.
   Light and dark steps are separate selections, each validated against its own
   surface, not an automatic flip. */
:root { --chart-a: #b86f11; --chart-b: #4a5bdc; --chart-c: #178267; }
:root:not([data-theme="light"]) { --chart-a: #bd7f33; --chart-b: #5f70e0; --chart-c: #27a97b; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --chart-a: #b86f11; --chart-b: #4a5bdc; --chart-c: #178267; } }
[data-theme="dark"] { --chart-a: #bd7f33; --chart-b: #5f70e0; --chart-c: #27a97b; }

.hoo-month-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.hoo-month-bar .field { min-width: 190px; }
.hoo-scope-note { margin-top: 4px; }
.chart-row { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.donut { width: 150px; height: 150px; }
.donut-value { font-size: 11px; font-weight: 800; fill: var(--ink); }
.donut-caption { font-size: 6px; font-weight: 700; fill: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.chart-legend li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 9px; align-items: center; font-size: 12px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend span { color: var(--muted); font-weight: 600; }
.chart-legend strong { color: var(--ink); font-size: 12px; }
.chart-legend small { color: var(--muted); min-width: 42px; text-align: right; }
.inline-legend { grid-auto-flow: column; justify-content: start; gap: 16px; margin-bottom: 12px; }
.inline-legend li { grid-template-columns: 10px auto; }
.bar-list { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 11px; align-items: center; }
.bar-group { display: grid; grid-template-columns: 96px 1fr; gap: 4px 11px; align-items: center; }
.bar-group .bar-label { grid-row: span 2; }
.bar-group small { grid-column: 2; color: var(--muted); font-size: 11px; }
.bar-label { font-size: 12px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label em { font-style: normal; font-size: 10px; font-weight: 800; }
.bar-track { display: block; height: 12px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-value { font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; }
@media (max-width: 720px) { .chart-row { grid-template-columns: 1fr; justify-items: center; } .bar-row, .bar-group { grid-template-columns: 78px 1fr; } .bar-row .bar-value { grid-column: 2; } }

/* Vendor filter bar: chips and the multi-control grid */
.vendor-filter { display: grid; gap: 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; border-radius: 999px; background: var(--indigo-soft); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.filter-chip em { font-style: normal; color: var(--muted); font-size: 13px; line-height: 1; }
.filter-chip:hover em { color: var(--danger, #df6b78); }
.filter-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; color: var(--muted); }
@media (max-width: 1100px) { .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .filter-grid { grid-template-columns: 1fr; } }

/* Goods inward note: step track and repeatable material lines */
.step-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; list-style: none; margin: 0 0 16px; padding: 0; }
.step-track li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 11px; background: var(--soft); box-shadow: var(--neu-in); opacity: .6; transition: .15s ease; }
.step-track li.active { opacity: 1; background: var(--indigo-soft); box-shadow: none; }
.step-track li span { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.step-track li.active span { color: var(--indigo); }
.step-track li strong { font-size: 13px; color: var(--ink); }
.line-stack { display: grid; gap: 13px; margin-bottom: 14px; }
.line-card { padding: 16px; }
.line-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.line-card-head strong { font-size: 13px; color: var(--ink); }
@media (max-width: 640px) { .step-track { grid-auto-flow: row; } }
.field-check { display: block; margin-top: 5px; font-size: 11px; font-weight: 700; }
.field-hint { display: block; margin-top: 5px; font-size: 11px; font-weight: 700; color: var(--indigo); font-style: italic; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }

.switch { position: relative; width: 50px; height: 27px; padding: 3px; flex: 0 0 auto; display: inline-flex; align-items: center; border: 0; border-radius: 999px; background: var(--soft); box-shadow: var(--neu-in); cursor: pointer; transition: background .2s ease; }
.switch-thumb { width: 21px; height: 21px; border-radius: 50%; background: var(--surface-solid); box-shadow: var(--neu-out-sm); display: flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; transform: translateX(0); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.switch[aria-pressed="true"] { background: var(--indigo); box-shadow: none; }
.switch[aria-pressed="true"] .switch-thumb { transform: translateX(23px); }
.password-toggle { position: absolute; right: 9px; top: 50%; margin-top: -13.5px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid transparent; padding: 9px 16px; font-weight: 750; font-size: 13px; cursor: pointer; transition: .16s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: white; background: var(--indigo); border-color: var(--indigo); box-shadow: 0 7px 16px rgba(74,91,220,.28); }
.button.primary:hover { background: var(--indigo-dark); }
.button.primary:active { box-shadow: inset 3px 3px 7px rgba(0,0,0,.25); }
.button.secondary { color: var(--ink); background: var(--soft); border-color: transparent; box-shadow: var(--neu-out-sm); }
.button.secondary:hover { color: var(--indigo); }
.button.secondary:active { box-shadow: var(--neu-in); }
.button.danger { color: white; background: var(--red); border-color: var(--red); box-shadow: 0 7px 16px rgba(194,61,75,.28); }
.button.danger:hover { background: #a5313d; }
.button.danger:active { box-shadow: inset 3px 3px 7px rgba(0,0,0,.25); }
.button.small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button.wide { width: 100%; }
.text-link { color: var(--indigo); font-weight: 700; font-size: 13px; }
.text-link:hover { color: var(--indigo-dark); }
.text-link.centered { text-align: center; }
.theme-toggle-row { display: flex; justify-content: center; margin-top: 22px; }
.setup-note { margin-top: 26px; padding: 14px 16px; background: var(--soft); border-radius: 12px; color: var(--muted); font-size: 12px; }
.setup-note > strong { display: block; color: var(--ink); font-weight: 800; margin-bottom: 3px; }
code { background: var(--surface-solid); color: var(--ink); padding: 1px 5px; border-radius: 5px; font-family: Consolas, monospace; }
.status-orb { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 16px; background: var(--indigo-soft); color: var(--indigo); font-size: 22px; font-weight: 800; }
.status-orb.ready { background: var(--green-soft); color: var(--green); }
.setup-card .muted { margin: 8px 0 26px; }

.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; color: #c7d0e0; background: #152440; border-right: 1px solid #273958; }
.sidebar-brand { min-height: 82px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand > div { display: grid; }
.sidebar-brand strong { color: white; font-size: 15px; }
.sidebar-brand small { color: #8e9bb1; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; color: white; background: transparent; border: 0; font-size: 24px; }
.main-nav { flex: 1; padding: 20px 13px; overflow-y: auto; }
.nav-heading { margin: 0 11px 9px; color: #708099; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 11px; margin: 3px 0; padding: 8px 11px; border-radius: 10px; color: #acb8cb; font-size: 13px; font-weight: 650; transition: .15s; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: linear-gradient(100deg, rgba(93,109,231,.33), rgba(93,109,231,.12)); box-shadow: inset 3px 0 #8996ff; }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.07); color: #aeb9d0; font-size: 9px; font-weight: 850; letter-spacing: .03em; }
.nav-item.active .nav-icon { color: white; background: #5e6fe2; }
.nav-item.compact { min-height: 38px; margin: 1px 0; }
.nav-group { margin: 2px 0 4px; }
.nav-group-toggle { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 6px 11px; border: 0; border-radius: 9px; background: none; color: #7f8da6; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-align: left; cursor: pointer; transition: .15s; }
.nav-group-toggle:hover { color: #dbe3f2; background: rgba(255,255,255,.05); }
.nav-group-label { flex: 1 1 auto; }
.nav-group-badge { margin-left: 0; }
.nav-group-toggle[aria-expanded="true"] .nav-group-badge { display: none; }
.nav-chevron { width: 8px; height: 8px; flex: 0 0 auto; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform .18s; }
.nav-group-toggle[aria-expanded="true"] .nav-chevron { transform: rotate(45deg); }
.nav-group-items { padding-left: 9px; border-left: 1px solid rgba(255,255,255,.09); margin-left: 11px; }
.nav-group-items .nav-item { margin: 2px 0; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--red); color: white; font-size: 9px; font-weight: 800; }
.topbar-icon-btn { position: relative; width: 38px; height: 38px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: var(--soft); box-shadow: var(--neu-out-sm); color: var(--ink); font-size: 16px; text-decoration: none; }
.topbar-icon-btn:active { box-shadow: var(--neu-in); }
.topbar-icon-btn .nav-badge { position: absolute; top: -5px; right: -5px; margin-left: 0; box-shadow: 0 0 0 2px var(--surface); }
.sidebar-foot { padding: 14px 13px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-context { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 10px; padding: 7px 9px 13px; }
.sidebar-context > div { display: grid; min-width: 0; }
.sidebar-context strong { color: white; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-context small { color: #8e9bb1; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #dfe4ff; color: #4353c5; font-weight: 800; }
.sidebar .user-avatar { background: #344666; color: white; }
.main-content { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar { height: 66px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; padding: 0 clamp(20px,3vw,42px); background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.menu-button { display: none; width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--soft); box-shadow: var(--neu-out-sm); padding: 9px; }
.menu-button span { height: 2px; display: block; margin: 4px 0; background: var(--ink); }
.topbar-title { display: grid; }
.topbar-title strong { font-size: 13px; }
.topbar-title span { color: var(--muted); font-size: 10px; }
.topbar-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #27a777; box-shadow: 0 0 0 4px rgba(39,167,119,.12); }
.content-wrap { width: 100%; max-width: 1600px; margin: 0 auto; padding: 30px clamp(20px,3vw,42px) 48px; flex: 1; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(26px,2.5vw,36px); line-height: 1.15; letter-spacing: -.035em; }
.deadline-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 22px; background: var(--surface); border-radius: 14px; box-shadow: var(--neu-out-sm); text-align: center; }
.deadline-meta .eyebrow { margin: 0; }
.deadline-meta strong { font-size: 20px; }
.page-heading > div:first-child > p:last-child:not(.eyebrow) { margin: 7px 0 0; max-width: 760px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.app-footer { min-height: 56px; padding: 14px clamp(20px,3vw,42px); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); font-size: 11px; }
.sidebar-scrim { display: none; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.alert span { flex: 1; }
.alert button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; }
.alert.success { color: #11674f; background: var(--green-soft); border-color: #c6ebdd; }
.alert.danger { color: #9d2d39; background: var(--red-soft); border-color: #f3c9cf; }
.alert.warning { color: #8b570d; background: var(--amber-soft); border-color: #f3d9aa; }

.welcome-strip { min-height: 162px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 34px; margin-bottom: 20px; color: white; background: linear-gradient(100deg, #0f1123 0%, #2a1454 32%, #7c2d92 68%, #c2410c 100%); border-radius: var(--radius); overflow: hidden; position: relative; box-shadow: 0 16px 34px rgba(76,29,149,.2); }
.welcome-strip::after { content: ""; position: absolute; width: 330px; height: 330px; right: -110px; top: -180px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.welcome-strip > div { position: relative; z-index: 1; }
.welcome-strip h2 { margin: 3px 0 7px; font-size: 26px; letter-spacing: -.025em; }
.welcome-strip p { margin: 0; max-width: 720px; color: #d7ddf6; }
.welcome-kicker { color: #c3caf4; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.welcome-date { display: flex; align-items: center; gap: 12px; min-width: 145px; }
.welcome-date strong { font-size: 50px; line-height: 1; letter-spacing: -.06em; }
.welcome-date span { color: #d5dcfa; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 128px; padding: 20px; display: block; background: var(--surface); border: 0; border-radius: 15px; box-shadow: var(--neu-out); position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
a.metric-card { cursor: pointer; }
a.metric-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(27,45,80,.14), var(--neu-out); }
.metric-card::after { content: ""; position: absolute; width: 4px; height: 100%; inset: 0 auto 0 0; background: var(--indigo); }
.metric-card.amber::after { background: #e39a32; }
.metric-card.blue::after { background: #3f8edc; }
.metric-card.red::after { background: #dc5967; }
.metric-card strong { display: block; margin: 9px 0 2px; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.metric-card small { color: var(--muted); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #5b6678; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.metric-top i { width: 8px; height: 8px; border-radius: 50%; background: #c5cbe3; }
.metric-card.indigo .metric-top i { background: #7180e9; }.metric-card.amber .metric-top i { background: #e39a32; }.metric-card.blue .metric-top i { background: #3f8edc; }.metric-card.red .metric-top i { background: #dc5967; }
.compact-metrics .metric-card { min-height: 112px; padding: 17px 19px; }
.compact-metrics .metric-card strong { font-size: 24px; }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }.span-3 { grid-column: span 3; }
.panel { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--neu-out); overflow: hidden; }
.panel-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.panel-head .eyebrow { margin-bottom: 3px; font-size: 9px; }
.count-pill { min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; color: var(--indigo); background: var(--indigo-soft); font-size: 11px; font-weight: 800; }

.project-list { padding: 3px 20px 10px; }
.project-row { display: grid; grid-template-columns: 42px minmax(200px,1.3fr) minmax(170px,1fr) 100px; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.project-row:last-child { border: 0; }
.project-row:hover .project-main strong { color: var(--indigo); }
.project-code { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--indigo-soft); color: var(--indigo); font-weight: 850; }
.project-main, .project-due { display: grid; }
.project-main small, .project-due small, .progress-cell small { color: var(--muted); font-size: 10px; }
.progress-cell { display: grid; gap: 5px; }
.progress-cell > i { height: 6px; display: block; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.progress-cell b { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#4c1d95,#db2777); }
.project-due strong { font-size: 12px; }
.alert-feed { padding: 7px 17px 14px; }
.feed-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 11px 3px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border: 0; }
.feed-dot { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: #929bab; }
.feed-dot.danger { background: var(--red); }.feed-dot.warning { background: #d48820; }.feed-dot.info { background: var(--blue); }.feed-dot.success { background: var(--green); }
.feed-item span:last-child { min-width: 0; }
.feed-item small { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.feed-item strong { font-size: 12px; }
.feed-item p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }

.table-wrap { width: 100%; max-height: 460px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 1; padding: 16px 14px; color: var(--muted); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 800; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--indigo) 5%, transparent); }
td small, td strong { display: block; }
td small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-link { color: #344ac0; font-weight: 750; }
.table-link:hover { text-decoration: underline; }
.empty-cell, .empty-inline { padding: 30px; color: var(--muted); text-align: center; }
.empty-inline { padding: 22px 8px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 10px; line-height: 1.1; font-weight: 800; white-space: nowrap; }
.badge.success { color: #12694f; background: var(--green-soft); }.badge.warning { color: #8c590f; background: var(--amber-soft); }.badge.danger { color: #9e3040; background: var(--red-soft); }.badge.info { color: #2466a5; background: #eaf3fd; }.badge.neutral { color: #5e6878; background: #eef1f5; }
.success-text { color: var(--green)!important; }.danger-text { color: var(--red)!important; }.warning-text { color: var(--amber)!important; }

.filter-bar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--neu-out-sm); }
.filter-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-controls select { min-height: 40px; padding: 8px 30px 8px 12px; border: 0; border-radius: 10px; background: var(--soft); box-shadow: var(--neu-in); color: var(--ink); font-size: 12px; font-weight: 650; }
.search-box { width: min(460px,100%); display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--soft); box-shadow: var(--neu-in); }
.search-box > span { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; height: 40px; border: 0; background: transparent; outline: none; color: var(--ink); }
.filter-summary, .legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 11px; }
.filter-summary span + span { padding-left: 16px; border-left: 1px solid var(--line); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }.legend-dot.danger { background: var(--red); }.legend-dot.warning { background: #d48820; }.legend-dot.success { background: var(--green); }
.icon-button { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 9px; color: var(--indigo); border: 0; border-radius: 8px; background: var(--soft); box-shadow: var(--neu-out-sm); font-size: 11px; font-weight: 750; }
.icon-button:active { box-shadow: var(--neu-in); }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.record-hero { min-height: 154px; display: grid; grid-template-columns: 74px minmax(220px,1fr) minmax(520px,1.6fr); gap: 20px; align-items: center; padding: 24px 28px; margin-bottom: 16px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--neu-out); }
.record-monogram { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 18px; color: white; background: linear-gradient(160deg, #164e63 0%, #0e7490 50%, #14b8a6 100%); font-size: 16px; font-weight: 850; box-shadow: 0 12px 25px rgba(14,116,144,.28); }
.record-title h2 { margin: 8px 0 2px; font-size: 23px; letter-spacing: -.025em; }
.record-title p { margin: 0; color: var(--muted); }
.record-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0; border-left: 1px solid var(--line); }
.record-stats > div { min-height: 60px; display: flex; flex-direction: column; justify-content: center; padding: 0 16px; border-right: 1px solid var(--line); }
.record-stats > div:last-child { border-right: 0; }
.record-stats dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.record-stats dd { margin: 5px 0 0; font-size: 14px; font-weight: 800; }

.budget-overview { margin-bottom: 16px; }
.budget-flow { padding: 20px 24px 24px; }
.budget-flow-track { position: relative; height: 30px; border-radius: 999px; background: var(--soft); box-shadow: var(--neu-in); overflow: hidden; }
.budget-flow-fill { position: relative; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3f8edc, #4a5bdc 45%, #6675dc); background-size: 200% 100%; transition: width 1.2s cubic-bezier(.22,.9,.34,1); animation: budgetShimmer 3.2s linear infinite; overflow: hidden; }
.budget-flow-fill.budget-tier-mid { background: linear-gradient(90deg, #f7c948, #e2921b 55%, #f7c948); background-size: 200% 100%; }
.budget-flow-fill.budget-tier-high { background: linear-gradient(90deg, #f2793a, #d9551f 55%, #f2793a); background-size: 200% 100%; }
.budget-flow-fill.budget-tier-critical { background: linear-gradient(90deg, #dc5967, #c23d4b 55%, #dc5967); background-size: 200% 100%; }
.budget-flow-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 65%, rgba(255,255,255,.25) 100%); background-size: 70px 100%; animation: budgetWave 2.6s linear infinite; }
@keyframes budgetShimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes budgetWave { 0% { background-position-x: 0; } 100% { background-position-x: 140px; } }
.budget-flow-stats { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.budget-flow-stats > div { display: grid; gap: 3px; }
.budget-flow-stats span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.budget-flow-stats strong { font-size: 16px; }
.budget-flow-stats small { color: var(--muted); font-size: 10px; }
.definition-list { padding: 10px 20px 18px; }
.definition-list > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.definition-list > div:last-child { border: 0; }
.definition-list span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.definition-list p { margin: 4px 0 0; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; padding: 16px 20px 20px; align-items: stretch; }
.document-group { display: flex; flex-direction: column; background: var(--soft); box-shadow: var(--neu-in); border-radius: 12px; padding: 15px 16px 14px; min-height: 176px; }
.document-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.document-group-head > span:first-child { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.document-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.document-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.document-row:last-child { border-bottom: 0; }
.document-row a { display: block; color: #344ac0; font-weight: 700; font-size: 12px; word-break: break-word; }
.document-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.document-body .empty-inline { padding: 0; text-align: left; font-size: 12px; }
.mini-upload { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.mini-upload input[type="file"] { flex: 1; min-width: 0; font-size: 10px; color: var(--muted); }

/* A card holding a document reads as done: green edge, green tick, and the file
   itself as the thing you click rather than a line of small print. */
.document-group.is-uploaded { background: linear-gradient(160deg, var(--green-soft), var(--soft) 70%); box-shadow: inset 0 0 0 1px rgba(23, 130, 103, .3), var(--neu-in); }
@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .document-group.is-uploaded { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent), var(--neu-in); }
    .document-file.current .document-file-icon { box-shadow: 0 0 0 3px rgba(23, 130, 103, .22); }
}
.document-group.is-uploaded .document-group-head > span:first-child { color: var(--green); }
.document-file { display: grid; grid-template-columns: 36px minmax(0, 1fr) 14px; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--surface-solid); box-shadow: 0 2px 8px rgba(23, 45, 85, .07); transition: transform .16s ease, box-shadow .16s ease; }
.document-file + .document-file { margin-top: 7px; }
.document-file:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23, 45, 85, .13); }
.document-file:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.document-file-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--green); color: white; font-size: 9px; font-weight: 850; letter-spacing: .02em; }
.document-file-meta { min-width: 0; }
.document-file-meta strong { display: block; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.document-file-meta small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.document-file-open { color: var(--green); font-size: 13px; font-weight: 800; }
.document-file.current .document-file-icon { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.definition-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 20px 18px; }
.definition-grid > div { min-height: 90px; padding: 15px 12px; border-bottom: 1px solid var(--line); }
.definition-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.definition-grid span, .definition-grid small, .definition-grid strong { display: block; }
.definition-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.definition-grid strong { margin-top: 5px; }
.definition-grid small { color: var(--muted); margin-top: 2px; }

.timeline-list { padding: 5px 20px 12px; }
.timeline-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border: 0; }
.timeline-item p { margin: 1px 0; color: var(--muted); font-size: 11px; }
.timeline-item small { color: #8a94a5; font-size: 10px; }
.tx-sign { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-weight: 850; }
.tx-sign.in { color: var(--green); background: var(--green-soft); }.tx-sign.out { color: var(--red); background: var(--red-soft); }
.reservation-list { padding: 7px 18px 16px; }
.reservation-list article { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.reservation-list article:last-child { border: 0; }
.reservation-list article > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--indigo); background: var(--indigo-soft); font-size: 10px; font-weight: 850; }
.reservation-list strong, .reservation-list small { display: block; }.reservation-list small { color: var(--muted); font-size: 9px; }.reservation-list b { font-size: 11px; }
.issue-panel { margin-top: 16px; }
.mini-form { min-width: 300px; display: grid; grid-template-columns: minmax(100px,1fr) 90px auto; gap: 5px; }
.mini-form input, .mini-form select { min-width: 0; height: 32px; padding: 5px 7px; border: 0; border-radius: 7px; background: var(--soft); box-shadow: var(--neu-in); color: var(--ink); font-size: 10px; }
.add-master-form { gap: 12px; align-items: stretch; }
.add-master-form input { height: 50px; padding: 10px 16px; border-radius: 10px; font-size: 15px; }
.add-master-form .button { min-height: 50px; padding: 10px 24px; font-size: 14px; }
.master-table td input, .master-table td select { width: 100%; min-width: 0; height: 38px; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--soft); box-shadow: var(--neu-in); color: var(--ink); font-size: 12px; }
.master-table td:nth-child(4), .master-table td:nth-child(5) { text-align: center; }
.master-table .icon-button, .master-table .button { width: 100%; }

.status-pipeline { min-height: 112px; display: grid; grid-template-columns: 1fr 42px 1fr 42px 1fr 42px 1fr; align-items: center; gap: 4px; margin-bottom: 16px; padding: 18px 22px; background: var(--surface); border: 0; box-shadow: var(--neu-out); border-radius: var(--radius); }
.status-pipeline > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; }
.status-pipeline > div span { grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--indigo); background: var(--indigo-soft); font-size: 11px; font-weight: 850; }
.status-pipeline strong { font-size: 12px; }.status-pipeline small { color: var(--muted); font-size: 9px; }.status-pipeline > i { height: 1px; background: var(--line); }
.approval-trail { padding: 14px 20px 10px; }
.approval-trail > div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; position: relative; padding: 8px 0 18px; }
.approval-trail > div:not(:last-child)::after { content: ""; position: absolute; width: 1px; left: 14px; top: 37px; bottom: 0; background: var(--line); }
.approval-trail > div > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--soft); font-size: 10px; font-weight: 850; }
.approval-trail > div.complete > span { color: var(--green); background: var(--green-soft); }
.approval-trail p { margin: 0; }.approval-trail strong,.approval-trail small { display: block; }.approval-trail small { color: var(--muted); font-size: 10px; }
.note-box { margin: 5px 20px 20px; padding: 13px 14px; color: var(--ink); background: var(--soft); border-radius: 10px; font-size: 11px; }
.note-box strong { color: var(--ink); }.note-box p { margin: 4px 0 0; }.danger-note { color: #8b3a45; background: var(--red-soft); }
.action-panel { display: grid; grid-template-columns: minmax(250px,.8fr) minmax(550px,1.4fr); gap: 30px; padding: 22px; align-items: end; }
.action-panel h2 { margin: 0; }.action-panel p:not(.eyebrow) { color: var(--muted); margin: 5px 0 0; }
.inline-action-form { display: grid; grid-template-columns: .7fr 1.4fr auto; gap: 10px; align-items: end; }

.recommendation { display: grid; grid-template-columns: 38px 1fr; gap: 12px; margin: 18px 20px 12px; padding: 16px; border-radius: 12px; }
.recommendation > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-weight: 850; }
.recommendation p { margin: 3px 0 0; font-size: 11px; }.recommendation.success { color: #12684f; background: var(--green-soft); }.recommendation.success>span{background:#caebdf}.recommendation.warning { color: #81520e; background: var(--amber-soft); }.recommendation.warning>span{background:#f4ddb5}.recommendation.danger { color: #93323e; background: var(--red-soft); }.recommendation.danger>span{background:#f2ccd1}.recommendation.info { color: #275f96; background: #eaf3fd; }.recommendation.info>span{background:#d1e5fa}.recommendation.neutral { color:#5e6878;background:#f0f2f5}.recommendation.neutral>span{background:#e0e4e9}
.recommendation-inline { font-size: 10px; font-weight: 750; }.recommendation-inline.danger { color:var(--red); }.recommendation-inline.warning { color:var(--amber); }.recommendation-inline.success { color:var(--green); }.recommendation-inline.info { color:var(--blue); }

.tab-nav { display: flex; align-items: center; gap: 4px; margin-bottom: 15px; padding: 5px; overflow-x: auto; background: var(--surface); border: 0; box-shadow: var(--neu-out-sm); border-radius: 12px; }
.tab-nav a { min-height: 38px; display: flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tab-nav a.active { color: var(--indigo); background: var(--indigo-soft); }
.report-filter { align-items: flex-end; }
.inline-filter { display: flex; align-items: flex-end; gap: 10px; }
.inline-filter .field { min-width: 150px; }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line); }
.pagination-arrow, .pagination-num { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--soft); box-shadow: var(--neu-out-sm); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.pagination-arrow:active, .pagination-num:active { box-shadow: var(--neu-in); }
.pagination-num.active { background: var(--indigo); color: #fff; box-shadow: none; }
.pagination-arrow.disabled { opacity: .4; pointer-events: none; }
.pagination-ellipsis { color: var(--muted); padding: 0 2px; }
.pagination-summary { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.info-callout { margin-bottom: 16px; padding: 14px 16px; color: var(--ink); background: var(--indigo-soft); border: 1px solid transparent; border-radius: 11px; }
.criteria-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.criteria-card { display: grid; gap: 13px; padding: 18px; }
.criteria-head { display: grid; grid-template-columns: 30px 1fr; gap: 0 9px; align-items: center; }
.criteria-head small { color: var(--muted); font-size: 10px; }.rating-swatch { grid-row: span 2; width: 28px; height: 28px; border-radius: 9px; background:#dfe3e9 }.rating-swatch.success{background:#5dc09f}.rating-swatch.info{background:#6da8de}.rating-swatch.warning{background:#e4aa51}.rating-swatch.danger{background:#df6b78}
.checkbox-list { display: grid; gap: 10px; }
.checkbox-list label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.checkbox-list input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; min-height: 0; min-width: 0; accent-color: var(--indigo); cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.plan-items-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 20px 24px 10px; }
.plan-items-head strong { font-size: 13px; }
.plan-items-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; max-width: 480px; }
.plan-items-head .button.small { flex: 0 0 auto; white-space: nowrap; }
#plan-items-table th:last-child, #plan-items-table td:last-child { width: 60px; text-align: center; }
#plan-items-table td:last-child .icon-button { min-height: 40px; min-width: 40px; padding: 8px; font-size: 17px; border-radius: 10px; }
.form-submit { display: flex; justify-content: flex-end; }

.version-history-card { width: min(680px, 100%); }
.version-history-body { padding: 4px 24px 24px; overflow-y: auto; }
.version-entry { padding: 20px 0; border-bottom: 1px solid var(--line); }
.version-entry:first-child { padding-top: 4px; }
.version-entry:last-child { border-bottom: 0; }
.version-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.version-entry-head h3 { font-size: 16px; font-weight: 800; color: var(--indigo); margin: 0; }
.version-latest-pill { flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--indigo); padding: 4px 10px; border-radius: 999px; }
.version-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.version-date-sub { margin: 4px 0 0; }
.version-group { margin-top: 18px; }
.version-group h4 { font-size: 13px; font-weight: 800; margin: 0 0 10px; }
.version-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.version-item-body { flex: 1; min-width: 0; }
.version-item-body > p { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.5; }
.type-pill { flex: 0 0 auto; margin-top: 1px; font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; }
.type-pill.type-new { color: var(--green); background: var(--green-soft); }
.type-pill.type-fix { color: var(--ink); background: var(--soft); box-shadow: var(--neu-in); }
.type-pill.type-changed { color: var(--amber); background: var(--amber-soft); }
.before-now-box { margin-top: 8px; padding: 10px 12px; background: var(--soft); box-shadow: var(--neu-in); border-radius: 10px; }
.before-now-box p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.before-now-box p + p { margin-top: 6px; }
.before-now-box span { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: var(--ink); margin-right: 4px; }
.modal { width: min(760px,calc(100% - 28px)); max-height: calc(100vh - 40px); margin: auto; padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; overflow: visible; }
.modal::backdrop { background: rgba(13,23,42,.58); backdrop-filter: blur(3px); }
.modal-card { position: relative; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: auto; background: var(--surface-solid); border-radius: 20px; box-shadow: 0 28px 80px rgba(11,21,42,.27); }
.compact-modal { width: min(590px,100%); margin: auto; }
.modal-head { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--surface-solid); }
.modal-head h2 { margin: 0; font-size: 21px; }.modal-head .eyebrow { margin-bottom: 3px; font-size: 9px; }
.modal-head button { width: 36px; height: 36px; border: 0; border-radius: 10px; color: var(--muted); background: var(--soft); box-shadow: var(--neu-out-sm); cursor: pointer; font-size: 20px; }
.modal-card > .form-grid, .modal-card > .info-callout { margin: 20px 24px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 18px 24px 22px; margin-top: 4px; }

.user-cell { display: flex; align-items: center; gap: 10px; }.user-cell strong,.user-cell small{display:block}.user-cell small{margin:0}
.audit-list { padding: 6px 20px 16px; max-height: 460px; overflow-y: auto; }
.audit-item { display: grid; grid-template-columns: 38px minmax(260px,1fr) auto; gap: 13px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border: 0; }.audit-action { width: 36px; height: 36px; display:grid;place-items:center;border-radius:10px;color:var(--indigo);background:var(--indigo-soft);font-size:10px;font-weight:850}.audit-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.audit-item p{margin:2px 0;color:var(--muted);font-size:11px}.audit-item small{color:#8b95a5;font-size:10px}.audit-item details{text-align:right}.audit-item summary{color:var(--indigo);font-size:10px;font-weight:750;cursor:pointer}.audit-item pre{max-width:420px;overflow:auto;text-align:left;padding:10px;border-radius:8px;background:var(--soft);color:var(--ink);font-size:10px}
.profile-card { display:flex;flex-direction:column;align-items:center;text-align:center;padding:30px 20px 18px}.profile-avatar{width:78px;height:78px;display:grid;place-items:center;border-radius:24px;color:white;background:linear-gradient(150deg,#1e1b4b 0%,#6d28d9 50%,#db2777 100%);font-size:30px;font-weight:850;box-shadow:0 12px 25px rgba(109,40,217,.25)}.profile-card h2{margin:16px 0 2px}.profile-card p{margin:0 0 12px;color:var(--muted)}.profile-form{padding:22px}.access-summary{margin:0 22px 22px;padding:18px;border-radius:12px;background:var(--soft)}.access-summary>div{display:flex;flex-wrap:wrap;gap:8px}.access-summary span{display:flex;align-items:center;gap:7px;padding:7px 10px;border:0;border-radius:8px;background:var(--surface-solid);box-shadow:var(--neu-out-sm);font-size:11px;font-weight:700}.access-summary b{color:var(--indigo);font-size:9px}
.empty-state { min-height: 430px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:50px;background:var(--surface);border:0;box-shadow:var(--neu-out);border-radius:var(--radius)}.empty-icon{width:76px;height:76px;display:grid;place-items:center;border-radius:22px;color:var(--red);background:var(--red-soft);font-size:21px;font-weight:850}.empty-state h2{margin:20px 0 5px}.empty-state p{margin:0 0 22px;color:var(--muted)}

.async-overlay { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 30px; text-align: center; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); backdrop-filter: blur(2px); border-radius: inherit; animation: asyncFadeIn .18s ease; }
.async-overlay-label { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.async-progress-track { position: relative; width: min(280px, 100%); height: 12px; border-radius: 999px; background: var(--soft); box-shadow: var(--neu-in); overflow: hidden; }
.async-progress-fill { position: relative; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3f8edc, #4a5bdc 45%, #6675dc); background-size: 200% 100%; transition: width .25s ease-out; animation: budgetShimmer 3.2s linear infinite; }
.async-progress-pct { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.async-result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.async-result-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; font-weight: 850; margin-bottom: 4px; }
.async-result-icon.success { color: var(--green); background: var(--green-soft); }
.async-result-icon.danger { color: var(--red); background: var(--red-soft); }
.async-result p { margin: 0; max-width: 320px; color: var(--ink); font-size: 13px; }
.async-result .button { margin-top: 10px; }
@keyframes asyncFadeIn { from { opacity: 0; } to { opacity: 1; } }

.template-options { display: grid; gap: 10px; padding: 4px 24px 8px; }
.template-option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-radius: 12px; background: var(--soft); box-shadow: var(--neu-out-sm); cursor: pointer; text-decoration: none; color: inherit; font: inherit; text-align: left; width: 100%; transition: box-shadow .15s ease; }
.template-option:hover { box-shadow: var(--neu-out); }
.template-option:active { box-shadow: var(--neu-in); }
.template-option-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-size: 17px; font-weight: 800; background: var(--surface-solid); color: var(--indigo); }
.template-option strong { display: block; font-size: 13px; color: var(--ink); }
.template-option small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.template-option input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.template-reset { margin: 0 24px 22px; }
.template-reset button { border: 0; background: none; cursor: pointer; padding: 0; color: var(--indigo); font-size: 11px; font-weight: 700; }

.register-table-wrap { max-height: 540px; }
.register-section-gap { margin-top: 22px; }
.visibility-form { padding: 0 20px 4px; }
.visibility-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.visibility-option { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); cursor: pointer; }
.visibility-option:has(input:checked) { border-color: color-mix(in srgb, var(--indigo) 55%, var(--line)); background: var(--indigo-soft); }
.visibility-option input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--indigo); }
.visibility-option span { min-width: 0; display: grid; gap: 3px; }
.visibility-option strong { color: var(--ink); font-size: 12px; }
.visibility-option small { color: var(--muted); font-size: 10px; }

.pdf-preview-body { min-height: 100vh; margin: 0; overflow: hidden; background: var(--soft); }
.pdf-preview-shell { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.pdf-preview-toolbar { min-height: 76px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface-solid); box-shadow: 0 5px 22px rgba(15, 23, 42, .12); position: relative; z-index: 2; }
.pdf-preview-title { min-width: 0; display: grid; gap: 1px; }
.pdf-preview-title span { color: var(--indigo); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.pdf-preview-title strong { overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-preview-title small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-preview-stage { min-height: 0; padding: 14px; background: #2f333a; }
.pdf-preview-stage iframe { width: 100%; height: 100%; display: block; border: 0; border-radius: 8px; background: white; }

.reveal-value { display: inline-block; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; border-radius: 6px; outline: none; }
.reveal-value .reveal-dots { letter-spacing: 2px; color: var(--muted); }
.reveal-value .reveal-real { display: none; }
.reveal-value.revealed .reveal-dots { display: none; }
.reveal-value.revealed .reveal-real { display: inline; }
.reveal-value:focus-visible { box-shadow: 0 0 0 3px rgba(74,91,220,.3); }
.reveal-hint { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.gantt-shell { padding: 18px 20px 22px; }
.gantt-frame { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gantt-names { flex: 0 0 220px; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); max-height: 560px; }
.gantt-names-head { position: sticky; top: 0; z-index: 4; height: 52px; display: flex; align-items: center; padding: 0 12px; color: var(--ink); background: var(--surface-solid); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 4px 10px rgba(11,21,42,.08); }
.gantt-name-row { min-height: 46px; display: flex; align-items: center; padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.gantt-timeline { flex: 1 1 auto; overflow: auto; max-height: 560px; overscroll-behavior: contain; }
.gantt-days-row { position: sticky; top: 0; z-index: 3; display: flex; height: 52px; background: var(--surface-solid); border-bottom: 1px solid var(--line); box-shadow: 0 4px 10px rgba(11,21,42,.08); }
.gantt-day { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--muted); border-left: 1px solid var(--line); }
.gantt-day-month { color: var(--indigo); font-size: 13px; }
.gantt-day small { font-size: 9px; text-transform: uppercase; letter-spacing: .03em; color: inherit; }
.gantt-track-row { position: relative; min-height: 46px; background-image: repeating-linear-gradient(to right, var(--line) 0, var(--line) 1px, transparent 1px, transparent 40px); border-bottom: 1px solid var(--line); }
.gantt-bar { position: absolute; height: 9px; min-width: 6px; border-radius: 999px; }
.gantt-bar-planned { top: 14px; background: var(--muted); opacity: .6; }
.gantt-bar-actual { top: 27px; background: var(--indigo); box-shadow: 0 2px 6px rgba(74,91,220,.4); }

@media (max-width: 1180px) {
    .auth-brand { padding: 58px 44px; }.auth-brand h1 { font-size: 42px; }
    .record-hero { grid-template-columns: 68px 1fr; }.record-stats { grid-column: span 2; border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
    .project-row { grid-template-columns: 42px 1fr 160px; }.project-due { display:none; }
    .criteria-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .action-panel { grid-template-columns: 1fr; }.inline-action-form { grid-template-columns: 1fr 1.4fr auto; }
}

@media (max-width: 940px) {
    :root { --sidebar: 238px; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }.menu-open .sidebar { transform: translateX(0); }.sidebar-close { display:block; }.sidebar-scrim { position:fixed;inset:0;z-index:25;background:rgba(12,20,35,.5); }.menu-open .sidebar-scrim { display:block; }
    .main-content { margin-left:0; }.menu-button { display:block;margin-right:12px; }.topbar-title { display:none; }
    .auth-brand h1 { font-size:38px; }
    .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.dashboard-grid,.detail-grid { grid-template-columns:1fr 1fr; }.span-3 { grid-column:span 2; }.detail-grid>.span-2 { grid-column:span 2; }
    .status-pipeline { grid-template-columns:1fr 1fr;gap:14px }.status-pipeline>i{display:none}
    .visibility-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    body { font-size:13px; }.content-wrap { padding:22px 14px 36px; }.topbar { padding:0 14px; }.topbar-meta span:last-child { display:none; }
    .page-heading { align-items:flex-start;flex-direction:column;margin-bottom:18px }.page-actions { width:100%;justify-content:flex-start }.page-actions .button { flex:1 }
    .auth-card { width:calc(100% - 28px);padding:25px 20px;border-radius:18px }.auth-brand h1{font-size:33px}.auth-brand>p:not(.eyebrow){font-size:14px}
    .setup-shell{display:block;padding:0}.setup-shell .auth-brand{min-height:300px;padding:40px 24px}.setup-card{margin:20px auto}
    .welcome-strip{padding:24px}.welcome-date{display:none}.welcome-strip h2{font-size:22px}
    .metric-grid{grid-template-columns:1fr 1fr;gap:10px}.metric-card{min-height:105px;padding:16px}.metric-card strong{font-size:22px}.metric-card small{font-size:10px}
    .dashboard-grid,.detail-grid{grid-template-columns:1fr}.span-2,.span-3,.detail-grid>.span-2{grid-column:span 1}.panel-head{min-height:65px;padding:14px 16px}
    .project-row{grid-template-columns:38px 1fr}.progress-cell{display:none}.project-list{padding:3px 15px 10px}
    .filter-bar{align-items:stretch;flex-direction:column}.search-box{width:100%}.legend,.filter-summary{flex-wrap:wrap}.filter-summary{justify-content:space-between}
    .record-hero{grid-template-columns:56px 1fr;padding:20px}.record-monogram{width:54px;height:54px;border-radius:15px}.record-stats{grid-template-columns:1fr 1fr;grid-column:span 2}.record-stats>div{padding:10px 11px;border-top:1px solid var(--line)}
    .definition-grid{grid-template-columns:1fr}.definition-grid>div:nth-child(odd){border-right:0}
    .form-grid{grid-template-columns:1fr}.form-grid .span-2{grid-column:span 1}.modal-card>.form-grid,.modal-card>.info-callout{margin:17px 17px 0}.modal-head,.modal-actions{padding-left:17px;padding-right:17px}.modal-actions .button{flex:1}
    .status-pipeline{grid-template-columns:1fr;padding:16px}.inline-action-form{grid-template-columns:1fr}.criteria-grid{grid-template-columns:1fr}.inline-filter{width:100%;display:grid;grid-template-columns:1fr 1fr}.inline-filter .field{min-width:0}.inline-filter .button{grid-column:span 2}.report-filter>span{display:none}
    .mini-form{min-width:240px;grid-template-columns:1fr 80px}.mini-form .button{grid-column:span 2}
    .pdf-preview-toolbar { min-height: 68px; grid-template-columns: auto 1fr auto; gap: 8px; padding: 9px; }
    .pdf-preview-toolbar .button { min-height: 36px; padding: 7px 10px; font-size: 10px; }
    .pdf-preview-title small { display: none; }
    .pdf-preview-stage { padding: 6px; }
    .visibility-form { padding: 0 14px 2px; }
    .visibility-grid { grid-template-columns: 1fr; }
    .app-footer{flex-direction:column}.app-footer span:last-child{display:none}.audit-item{grid-template-columns:36px 1fr}.audit-item details{grid-column:span 2;text-align:left}.audit-item pre{max-width:100%}
}

@media (max-width: 420px) {
    .metric-grid{grid-template-columns:1fr}.metric-card{min-height:96px}.record-stats{grid-template-columns:1fr}.auth-card-head h2{font-size:25px}
}

@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto!important;transition:none!important;animation:none!important; } }


/* ============================================================ sign-in hub ====
   One surface for the whole page, painted from the --hub-* tokens above so the
   theme switch in the footer actually changes what you are looking at. */
body.hub-body { min-height: 100vh; color: var(--hub-text); background: var(--hub-bg); background-image:
    radial-gradient(1100px 620px at 78% -10%, var(--hub-glow-a), transparent 62%),
    radial-gradient(900px 560px at 6% 110%, var(--hub-glow-b), transparent 60%),
    linear-gradient(158deg, var(--hub-sheet-1) 0%, var(--hub-sheet-2) 46%, var(--hub-sheet-3) 100%); background-attachment: fixed; }
.hub-aura { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hub-aura svg { position: absolute; right: -60px; top: 50%; width: 620px; max-width: 60vw; transform: translateY(-50%); color: var(--hub-aura-ink); opacity: var(--hub-aura-opacity); }
.hub-shell { position: relative; z-index: 1; min-height: 100vh; max-width: 1240px; margin: 0 auto; padding: clamp(20px, 2.6vh, 30px) clamp(20px, 4vw, 44px) clamp(18px, 2.4vh, 26px); display: flex; flex-direction: column; gap: clamp(20px, 3vh, 34px); }

.hub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 22px; padding-bottom: 16px; border-bottom: 1px solid var(--hub-rule); }
.hub-brand { display: inline-flex; align-items: center; gap: 13px; color: inherit; border-radius: 12px; }
.hub-logo { display: grid; place-items: center; padding: 7px 11px; border: 1px solid var(--hub-logo-border); border-radius: 12px; background: var(--hub-logo-bg); box-shadow: var(--hub-logo-shadow); }
.hub-logo img { display: block; height: 30px; width: auto; }
.hub-brand-copy { display: flex; flex-direction: column; gap: 2px; }
.hub-brand-copy strong { color: var(--hub-strong); font-size: 19px; font-weight: 800; letter-spacing: .045em; }
.hub-brand-copy small { color: var(--hub-sub); font-size: 11px; font-weight: 650; }
.hub-org { margin: 0; display: flex; flex-direction: column; gap: 3px; text-align: right; color: var(--hub-title); font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.hub-org span { color: var(--hub-sub); font-size: 9.5px; letter-spacing: .2em; }

.hub-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: clamp(18px, 2.6vh, 28px); }
.hub-intro { max-width: 820px; }
.hub-intro .eyebrow, .signin-card .eyebrow { color: var(--hub-accent); }
.hub-intro h1 { margin: 7px 0 12px; color: var(--hub-strong); font-size: clamp(27px, 2.55vw, 40px); line-height: 1.14; letter-spacing: -.032em; }
.hub-sub { margin: 0; max-width: 670px; color: var(--hub-text); font-size: 14.5px; line-height: 1.65; }
.hub-highlights { list-style: none; max-width: 920px; margin: clamp(16px, 2.2vh, 24px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 26px; }
.hub-highlights li { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; column-gap: 11px; }
.hub-hl-icon { grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--hub-tile-border); background: var(--hub-tile-bg); color: var(--hub-chip-ink); }
.hub-hl-icon svg { width: 16px; height: 16px; }
.hub-highlights strong { color: var(--hub-strong); font-size: 12.5px; font-weight: 750; }
.hub-highlights small { color: var(--hub-muted); font-size: 11.5px; line-height: 1.45; }

/* Nine choices, three across. The gradient lives in the border, so the card face
   stays quiet and the eye lands on the name. */
.dept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.35vw, 18px); }
.dept-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 22px; align-items: center; gap: 15px; padding: 17px 18px; border: 1px solid transparent; border-radius: 16px; color: inherit; box-shadow: var(--hub-shadow);
    background-image: linear-gradient(158deg, var(--hub-card-1), var(--hub-card-2)), linear-gradient(150deg, var(--hub-edge-1), var(--hub-edge-2) 48%, var(--hub-edge-3));
    background-origin: border-box; background-clip: padding-box, border-box;
    transition: transform .2s ease, box-shadow .2s ease, background-image .2s ease; }
.dept-card:hover { transform: translateY(-3px); box-shadow: var(--hub-shadow-hover);
    background-image: linear-gradient(158deg, var(--hub-card-hover-1), var(--hub-card-hover-2)), linear-gradient(150deg, var(--hub-edge-hover-1), var(--hub-edge-hover-2) 55%, var(--hub-edge-hover-3)); }
.dept-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--hub-chip-border); background: var(--hub-chip-bg); color: var(--hub-chip-ink); transition: background .2s ease, color .2s ease, border-color .2s ease; }
.dept-icon svg { width: 21px; height: 21px; }
.dept-card:hover .dept-icon { border-color: var(--hub-chip-hover-border); background: var(--hub-chip-hover-bg); color: var(--hub-chip-hover-ink); }
.dept-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dept-copy strong { color: var(--hub-strong); font-size: 14px; font-weight: 750; letter-spacing: -.005em; }
.dept-copy small { color: var(--hub-muted); font-size: 11.5px; line-height: 1.45; }
.dept-go { width: 22px; height: 22px; display: grid; place-items: center; color: var(--hub-dim); transition: transform .2s ease, color .2s ease; }
.dept-go svg { width: 18px; height: 18px; }
.dept-card:hover .dept-go { color: var(--hub-strong); transform: translateX(4px); }

.hub-signin { display: flex; justify-content: center; padding: clamp(4px, 2vh, 24px) 0; }
.signin-card { width: min(460px, 100%); padding: 30px 30px 26px; border: 1px solid var(--hub-edge-1); border-radius: 20px; background: linear-gradient(160deg, var(--hub-card-1), var(--hub-card-2)); box-shadow: var(--hub-shadow-hover); }
.signin-card .dept-icon.large { width: 52px; height: 52px; margin-bottom: 16px; border-radius: 15px; }
.signin-card .dept-icon.large svg { width: 25px; height: 25px; }
.signin-card h1 { margin: 6px 0 8px; color: var(--hub-strong); font-size: 26px; letter-spacing: -.025em; }
.signin-card .hub-sub { font-size: 13px; }
.signin-card .form-stack { margin-top: 22px; }
.hub-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--hub-accent); font-size: 12.5px; font-weight: 700; border-radius: 8px; }
.hub-back svg { width: 15px; height: 15px; transition: transform .18s ease; }
.hub-back:hover { color: var(--hub-strong); }
.hub-back:hover svg { transform: translateX(-3px); }

.hub-demo { max-width: 560px; border: 1px solid var(--hub-rule); border-radius: 12px; background: var(--hub-tile-bg); }
.hub-demo summary { display: flex; align-items: center; gap: 9px; padding: 11px 15px; color: var(--hub-title); font-size: 12px; font-weight: 750; letter-spacing: .04em; cursor: pointer; list-style: none; border-radius: 12px; }
.hub-demo summary::-webkit-details-marker { display: none; }
.hub-demo summary::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .18s ease; }
.hub-demo[open] summary::before { transform: rotate(45deg); }
.hub-demo p { margin: 0; padding: 0 15px 13px; color: var(--hub-muted); font-size: 12px; line-height: 1.6; }
.hub-demo code { padding: 2px 6px; border-radius: 6px; background: var(--hub-code-bg); color: var(--hub-code-ink); font-size: 11.5px; }

.hub-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--hub-rule); }
.hub-foot p { margin: 0; color: var(--hub-dim); font-size: 11px; }
.hub-foot .switch { background: var(--hub-switch-track); box-shadow: none; }
.hub-foot .switch .switch-thumb { background: var(--hub-switch-thumb); color: var(--hub-switch-ink); box-shadow: none; }
.hub-foot .switch[aria-pressed="true"] { background: var(--hub-switch-on); }

.hub-alert { max-width: 820px; margin: 0; border: 1px solid var(--hub-alert-border); background: var(--hub-alert-bg); color: var(--hub-alert-ink); }
.hub-alert.danger { border-color: var(--hub-danger-border); background: var(--hub-danger-bg); color: var(--hub-danger-ink); }
.hub-alert.success { border-color: var(--hub-success-border); background: var(--hub-success-bg); color: var(--hub-success-ink); }

/* Form controls have to read on the card in either theme. */
body.hub-body .field > span { color: var(--hub-field-label); }
body.hub-body .field input { color: var(--hub-field-ink); background: var(--hub-field-bg); border: 1px solid var(--hub-field-border); box-shadow: none; }
body.hub-body .field input::placeholder { color: var(--hub-dim); }
body.hub-body .field input:focus { border-color: var(--hub-field-focus); box-shadow: 0 0 0 3px var(--hub-field-ring); }
body.hub-body .password-toggle { background: var(--hub-switch-track); box-shadow: none; }
body.hub-body .password-toggle .switch-thumb { background: var(--hub-switch-thumb); color: var(--hub-switch-ink); box-shadow: none; }
body.hub-body .password-toggle[aria-pressed="true"] { background: var(--hub-switch-on); }

body.hub-body a:focus-visible, body.hub-body button:focus-visible, body.hub-body summary:focus-visible { outline: 2px solid var(--hub-focus); outline-offset: 3px; }
.dept-card:focus-visible { outline: 2px solid var(--hub-focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .dept-card, .dept-icon, .dept-go, .hub-back svg, .hub-demo summary::before { transition: none; }
    .dept-card:hover { transform: none; }
    .dept-card:hover .dept-go, .hub-back:hover svg { transform: none; }
}
@media (max-width: 1080px) { .hub-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 940px) {
    .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-org { text-align: left; }
    .hub-aura svg { opacity: calc(var(--hub-aura-opacity) * .7); }
}
@media (max-width: 680px) {
    .dept-grid, .hub-highlights { grid-template-columns: 1fr; }
    .hub-head, .hub-foot { flex-direction: column; align-items: flex-start; }
    .hub-intro h1 { font-size: 26px; }
    .hub-sub { font-size: 13.5px; }
    .signin-card { padding: 24px 20px 22px; border-radius: 16px; }
}

/* ===================================================== project budget lines ==
   Six heads, six fixed hues. The order is the slice order, which is the order the
   palette was validated on (adjacent pairs, both modes), and a head keeps its hue
   whether or not the others are present. */
:root {
    --budget-a: #2a78d6; --budget-b: #eb6834; --budget-c: #1baf7a;
    --budget-d: #eda100; --budget-e: #e87ba4; --budget-f: #008300;
}
:root[data-theme="dark"] {
    --budget-a: #3987e5; --budget-b: #d95926; --budget-c: #199e70;
    --budget-d: #c98500; --budget-e: #d55181; --budget-f: #008300;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --budget-a: #3987e5; --budget-b: #d95926; --budget-c: #199e70;
        --budget-d: #c98500; --budget-e: #d55181; --budget-f: #008300;
    }
}
.budget-slot-a { --slot: var(--budget-a); }
.budget-slot-b { --slot: var(--budget-b); }
.budget-slot-c { --slot: var(--budget-c); }
.budget-slot-d { --slot: var(--budget-d); }
.budget-slot-e { --slot: var(--budget-e); }
.budget-slot-f { --slot: var(--budget-f); }

.budget-split { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 22px; padding: 18px 20px 6px; align-items: start; }
.budget-figure { margin: 0; }
.budget-figure figcaption { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.budget-donut { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }
/* the 2px gap is drawn in surface colour so slices never touch */
.budget-slice { fill: var(--slot); stroke: var(--surface-solid); stroke-width: 2; transition: opacity .15s ease; }
.budget-slice:hover { opacity: .78; }
.budget-donut-value { fill: var(--ink); font-size: 17px; font-weight: 800; text-anchor: middle; }
.budget-donut-label { fill: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-anchor: middle; text-transform: uppercase; }
.budget-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; }
.budget-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: baseline; column-gap: 9px; }
.budget-legend strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.budget-legend small { grid-column: 2; color: var(--muted); font-size: 11px; }
.budget-key { width: 10px; height: 10px; border-radius: 3px; background: var(--slot); display: inline-block; flex: 0 0 auto; }
td .budget-key { margin-right: 7px; vertical-align: middle; }

.budget-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-content: start; }
.budget-totals > div { padding: 12px 14px; border-radius: 12px; background: var(--soft); box-shadow: var(--neu-in); }
.budget-totals span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.budget-totals strong { display: block; margin-top: 5px; color: var(--ink); font-size: 17px; font-weight: 800; }
.budget-totals small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.budget-subtotal td { background: var(--soft); font-weight: 750; }
.budget-subtotal td:first-child { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }

@media (max-width: 900px) { .budget-split { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .budget-slice { transition: none; } }

/* the frozen budget and what has been sanctioned on top of it */
.budget-envelope { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; padding: 16px 20px 0; align-items: end; }
.budget-envelope > div { padding: 12px 14px; border-radius: 12px; background: var(--soft); box-shadow: var(--neu-in); }
.budget-envelope span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.budget-envelope strong { display: block; margin-top: 5px; color: var(--ink); font-size: 16px; font-weight: 800; }
.budget-envelope small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.budget-envelope-action { background: none !important; box-shadow: none !important; padding: 0 !important; }

/* saved or overrun, as bars about a zero line */
.forecast-figure { margin: 18px 20px 0; padding: 14px 16px; border-radius: 12px; background: var(--soft); box-shadow: var(--neu-in); }
.forecast-figure figcaption { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.forecast-figure .forecast-foot { margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.5; }
.forecast-bars { display: grid; gap: 7px; margin-top: 12px; }
.forecast-row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) 84px; align-items: center; gap: 12px; }
.forecast-label { color: var(--ink); font-size: 11.5px; font-weight: 650; }
.forecast-track { position: relative; height: 16px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.forecast-bar { position: absolute; top: 3px; height: 10px; border-radius: 3px; }
.forecast-bar.over { background: var(--red); }
.forecast-bar.under { background: var(--green); }
.forecast-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); opacity: .55; }
.forecast-value { font-size: 11.5px; font-weight: 750; text-align: right; }
.warning-text { color: var(--amber); }
@media (max-width: 680px) { .forecast-row { grid-template-columns: minmax(80px, 1fr) minmax(0, 1.4fr) 70px; gap: 8px; } }
