/* ═══════════════════════════════════════════════════════════════════
   AUTOGENIUS · STYLESHEET
   One file, dropped into /Styles. No Bootstrap, no FontAwesome,
   no animate.css, no app.css. Nothing else is needed.

   Rebrand:  edit --brand-* in sections 2 and 3 below. Nothing else.
   Themes:   <html data-theme="light"> or "dark".
             Autogenius.js resolves "system" to one of the two.

   Assembled from tokens + base + shell + components + patterns.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   AUTOGENIUS · DESIGN TOKENS
   The only file in the project containing a colour literal.

   Change the brand:      edit --brand-* in section 2 and 3. Nothing else.
   Themes:                html[data-theme="light" | "dark"]
                          "system" is resolved to one of those by app.js,
                          so no component ever has to know about auto.

   Naming follows colour ROLES, not colour names, so a rebrand never
   leaves a variable called "--blue" holding a green.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   1 · METRICS — identical in both themes
   ───────────────────────────────────────────── */
:root {
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-num: "Inter", system-ui, sans-serif;
    --mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;

    /* Type — a real hierarchy, not eleven sizes that all look the same */
    --t-display: 28px;
    --t-title: 20px;
    --t-heading: 16px;
    --t-subhead: 14px;
    --t-body: 13.5px;
    --t-control: 13.5px;
    --t-caption: 12px;
    --t-micro: 11px;

    --w-normal: 400;
    --w-medium: 500;
    --w-semi: 600;
    --w-bold: 700;

    /* 4px base grid */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s8: 32px;
    --s10: 40px;
    --s12: 48px;

    /* Radii — flat design still needs consistent corners */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-full: 999px;

    /* Frame */
    --h-topbar: 56px;
    --h-cmdbar: 56px;
    --w-rail: 248px;
    --w-rail-min: 64px;
    --w-secnav: 208px;

    /* Density — the only three values a density switch touches */
    --h-control: 36px;
    --h-row: 40px;
    --pad-block: 10px;

    --ease: cubic-bezier(.2, 0, 0, 1);
    --dur: .16s;
    --dur-slow: .24s;
}

html[data-density="compact"] {
    --h-control: 32px;
    --h-row: 34px;
    --pad-block: 7px;
    --t-body: 13px;
    --t-control: 13px;
}

/* ─────────────────────────────────────────────
   2 · LIGHT
   Surfaces are separated by TONE, not by borders and shadows.
   Hairlines exist only where a boundary carries meaning.
   ───────────────────────────────────────────── */
html[data-theme="light"] {
    color-scheme: light;

    /* Brand — change these six lines to rebrand the product */
    --brand: #3B4CCA;
    --brand-hover: #313FA8;
    --brand-active: #283391;
    --brand-container: #E7E9FB;
    --brand-container-hi: #D3D8F7;
    --on-brand: #FFFFFF;
    --on-brand-container: #1E2775;

    /* Surfaces */
    --canvas: #F6F7F9;
    --surface: #FFFFFF;
    --surface-sunken: #F1F3F6;
    --surface-raised: #FFFFFF;
    --surface-hover: #F3F4F7;
    --surface-active: #E9EBF0;
    --surface-inverse: #1E2126;

    /* Text */
    --text: #14171C;
    --text-secondary: #4A515B;
    --text-tertiary: #737B87;
    --text-disabled: #A6ADB8;
    --text-inverse: #FFFFFF;

    /* Lines */
    --line: #E2E5EA;
    --line-strong: #C9CED6;
    --line-focus: var(--brand);

    /* Status — fixed meaning across the whole product */
    --ok: #0E7A4B;
    --ok-container: #E3F5EB;
    --on-ok-container: #0A5636;
    --warn: #A9600A;
    --warn-container: #FCF0DF;
    --on-warn-container: #7A4507;
    --danger: #C4322B;
    --danger-container: #FCEAE9;
    --on-danger-container: #8E211C;
    --info: #0B6E99;
    --info-container: #E1F1F8;
    --on-info-container: #084F6E;
    --neutral: #5B6472;
    --neutral-container: #EFF1F4;
    --on-neutral-container: #414954;
    --accent-alt: #6642B8;
    --accent-alt-container: #EFE9FA;
    --on-accent-alt-container: #4A2E88;

    /* Overlays — the only place a shadow is allowed */
    --shadow-menu: 0 8px 24px rgba(16, 20, 27, .12), 0 0 0 1px rgba(16, 20, 27, .05);
    --shadow-dialog: 0 24px 64px rgba(16, 20, 27, .18), 0 0 0 1px rgba(16, 20, 27, .05);
    --scrim: rgba(16, 20, 27, .38);

    /* Data */
    --row-hover: #F5F6F9;
    --row-selected: var(--brand-container);
    --header-bg: #F1F3F6;
    --scrollbar: #C9CED6;
    --scrollbar-hover: #A6ADB8;

    /* Always-white foreground — badges and pins that sit on a fixed
       status colour, which does not change between themes */
    --on-status: #FFFFFF;
    --key-fill: rgba(20, 23, 28, .10);
    --paper: #FFFFFF;
}

/* ─────────────────────────────────────────────
   3 · DARK
   Not an inversion. Dark surfaces are lifted with tone, text is
   never pure white, and the brand is lightened so it stays legible.
   ───────────────────────────────────────────── */
html[data-theme="dark"] {
    color-scheme: dark;

    --brand: #93A0F5;
    --brand-hover: #A8B3F8;
    --brand-active: #BCC4FA;
    --brand-container: #262C55;
    --brand-container-hi: #333A6B;
    --on-brand: #101534;
    --on-brand-container: #C3CAFB;

    --canvas: #0E1013;
    --surface: #16191E;
    --surface-sunken: #101317;
    --surface-raised: #1C2026;
    --surface-hover: #21262D;
    --surface-active: #2A3038;
    --surface-inverse: #F2F3F5;

    --text: #E8EAEE;
    --text-secondary: #B4BAC4;
    --text-tertiary: #858C98;
    --text-disabled: #5C636E;
    --text-inverse: #14171C;

    --line: #262B32;
    --line-strong: #39404A;
    --line-focus: var(--brand);

    --ok: #4FC98A;
    --ok-container: #11301F;
    --on-ok-container: #A8E8C4;
    --warn: #E0A34E;
    --warn-container: #33260F;
    --on-warn-container: #F2D3A0;
    --danger: #F0736C;
    --danger-container: #351A19;
    --on-danger-container: #F7B5B1;
    --info: #55B6DD;
    --info-container: #0F2B36;
    --on-info-container: #A9DCF0;
    --neutral: #98A0AC;
    --neutral-container: #1F242A;
    --on-neutral-container: #C4CAD3;
    --accent-alt: #B197EE;
    --accent-alt-container: #251C3D;
    --on-accent-alt-container: #D6C6F7;

    --shadow-menu: 0 8px 24px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
    --shadow-dialog: 0 24px 64px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    --scrim: rgba(0, 0, 0, .6);

    --row-hover: #1B1F25;
    --row-selected: var(--brand-container);
    --header-bg: #1A1E23;
    --scrollbar: #39404A;
    --scrollbar-hover: #4E5661;

    --on-status: #FFFFFF;
    --key-fill: rgba(255, 255, 255, .14);
    --paper: #FFFFFF;
}

/* ─────────────────────────────────────────────
   4 · MODULE ACCENT
   Showroom, workshop and accounts differ ONLY in the accent family,
   so the product reads as one system in three rooms.
   Applied by app.js as data-module on <html>.
   ───────────────────────────────────────────── */
html[data-module="workshop"][data-theme="light"] {
    --brand: #A85A00;
    --brand-hover: #8C4B00;
    --brand-active: #733E00;
    --brand-container: #FBEEDD;
    --brand-container-hi: #F5DFC2;
    --on-brand-container: #6B3A00;
}

html[data-module="workshop"][data-theme="dark"] {
    --brand: #EFA958;
    --brand-hover: #F3BB78;
    --brand-active: #F7CB96;
    --brand-container: #33240F;
    --brand-container-hi: #45311A;
    --on-brand: #251800;
    --on-brand-container: #F7D5A8;
}

html[data-module="accounts"][data-theme="light"] {
    --brand: #036B5E;
    --brand-hover: #02594E;
    --brand-active: #024940;
    --brand-container: #DCF2EE;
    --brand-container-hi: #C2E8E1;
    --on-brand-container: #024A41;
}

html[data-module="accounts"][data-theme="dark"] {
    --brand: #48C9B4;
    --brand-hover: #6BD5C3;
    --brand-active: #8CE0D2;
    --brand-container: #0D2E29;
    --brand-container-hi: #14423B;
    --on-brand: #00201C;
    --on-brand-container: #A6E9DD;
}


/* ─────────────────────────────────────────────
   5 · COMPATIBILITY ALIASES
   The date picker, time picker and custom select were written against
   the GeniusGym variable names. Mapping them onto the v2 roles here
   means those three stylesheets drop in unchanged and pick up the new
   palette, the module accent and dark mode for free.

   Nothing in v2 should USE these names. They exist only so inherited
   components keep working; delete the block when those are rewritten.
   ───────────────────────────────────────────── */
:root {
    --surface-2: var(--surface-sunken);
    --border: var(--line);
    --txt: var(--text);
    --txt-2: var(--text-secondary);
    --txt-3: var(--text-tertiary);
    --txt-4: var(--text-disabled);
    --blue: var(--brand);
    --blue-h: var(--brand-hover);
    --blue-bg: var(--brand-container);
    --blue-border: var(--brand-container-hi);
    --green: var(--ok);
    --red: var(--danger);
    --amber: var(--warn);
    --sb-hover: var(--surface-hover);
    --r-pill: var(--r-full);
    --lg: var(--shadow-menu);
    --t: var(--dur) var(--ease);
}
/* ═══════════════════════════════════════════════════════════════════
   AUTOGENIUS · BASE
   Reset, typography, focus behaviour, utilities. No component lives here.
   ═══════════════════════════════════════════════════════════════════ */

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--t-body);
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

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

::selection {
    background: var(--brand-container-hi);
    color: var(--on-brand-container);
}

/* ─── Type scale ─────────────────────────────────────────────── */
.display {
    font-size: var(--t-display);
    font-weight: var(--w-bold);
    letter-spacing: -.022em;
    line-height: 1.2;
}

.title {
    font-size: var(--t-title);
    font-weight: var(--w-semi);
    letter-spacing: -.016em;
    line-height: 1.3;
}

.heading {
    font-size: var(--t-heading);
    font-weight: var(--w-semi);
    letter-spacing: -.01em;
}

.subhead {
    font-size: var(--t-subhead);
    font-weight: var(--w-semi);
}

.caption {
    font-size: var(--t-caption);
    color: var(--text-tertiary);
}

.micro {
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

.overline {
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.num {
    font-variant-numeric: tabular-nums;
}

.mono {
    font-family: var(--mono);
    font-size: .94em;
    letter-spacing: -.01em;
}

.secondary {
    color: var(--text-secondary);
}

.tertiary {
    color: var(--text-tertiary);
}

.strong {
    font-weight: var(--w-semi);
    color: var(--text);
}

.right {
    text-align: right;
}

.center {
    text-align: center;
}

.nowrap {
    white-space: nowrap;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ─── Icons ──────────────────────────────────────────────────── */
.i {
    font-family: "Material Symbols Rounded";
    font-weight: 400;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    flex: none;
    user-select: none;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.i-sm {
    font-size: 18px;
}

.i-xs {
    font-size: 16px;
}

.i-lg {
    font-size: 24px;
}

.i-fill {
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ─── Focus ───────────────────────────────────────────────────
   Keyboard users always see it; pointer users never do.
   ───────────────────────────────────────────────────────────── */
:focus {
    outline: none;
}

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

/* ─── Scrollbars ─────────────────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: var(--r-full);
    border: 3px solid transparent;
    background-clip: content-box;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--scrollbar-hover);
        background-clip: content-box;
    }

/* ─── Layout helpers ─────────────────────────────────────────── */
.row {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.row-3 {
    gap: var(--s3);
}

.row-4 {
    gap: var(--s4);
}

.col {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.wrap {
    flex-wrap: wrap;
}

.grow {
    flex: 1;
    min-width: 0;
}

.push {
    margin-left: auto;
}

.hide {
    display: none !important;
}

.mt-2 {
    margin-top: var(--s2);
}

.mt-4 {
    margin-top: var(--s4);
}

.mt-6 {
    margin-top: var(--s6);
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-3 {
    margin-bottom: var(--s3);
}

.mb-4 {
    margin-bottom: var(--s4);
}

/* Responsive column grid used by dashboards and page layouts */
.grid {
    display: grid;
    gap: var(--s4);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
}

.c3 {
    grid-column: span 3;
}

.c4 {
    grid-column: span 4;
}

.c5 {
    grid-column: span 5;
}

.c6 {
    grid-column: span 6;
}

.c7 {
    grid-column: span 7;
}

.c8 {
    grid-column: span 8;
}

.c9 {
    grid-column: span 9;
}

.c12 {
    grid-column: span 12;
}

@media (max-width: 1280px) {
    .c3 {
        grid-column: span 6;
    }

    .c4, .c5 {
        grid-column: span 6;
    }

    .c7, .c8, .c9 {
        grid-column: span 12;
    }
}

@media (max-width: 860px) {
    .c3, .c4, .c5, .c6, .c7, .c8, .c9 {
        grid-column: span 12;
    }
}

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

   Two navigation modes from one markup:
     html[data-nav="top"]   menubar with flyouts   (default)
     html[data-nav="side"]  collapsible left rail
   Switched in Profile › Settings. Nothing else in the app changes.

   The frame never scrolls. Only .content does.
   ═══════════════════════════════════════════════════════════════════ */

.app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ═══ TOPBAR ══════════════════════════════════════════════════ */
.topbar {
    height: var(--h-topbar);
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: 0 var(--s4);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 60;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s3);
    flex: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: var(--r-md);
    background: var(--brand);
    color: var(--on-brand);
    display: grid;
    place-items: center;
}

    .brand-mark .i {
        font-size: 19px;
    }

.brand-name {
    font-size: 15px;
    font-weight: var(--w-bold);
    letter-spacing: -.02em;
}

.brand-sub {
    font-size: var(--t-micro);
    color: var(--text-tertiary);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ═══ MENUBAR + FLYOUTS ═══════════════════════════════════════ */
.menubar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

html[data-nav="side"] .menubar {
    display: none;
}

.mb-item {
    position: relative;
}

.mb-btn {
    display: flex;
    align-items: center;
    gap: var(--s1);
    height: 34px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    font-size: var(--t-control);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .mb-btn:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .mb-btn[aria-expanded="true"] {
        background: var(--brand-container);
        color: var(--on-brand-container);
    }

    .mb-btn .i {
        font-size: 17px;
        opacity: .6;
    }

/* flyout panel — used at all three levels */
.flyout {
    display: none;
    position: fixed;
    z-index: 200;
    min-width: 236px;
    max-width: 320px;
    padding: var(--s1);
    background: var(--surface-raised);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-menu);
}

    .flyout.open {
        display: block;
        animation: fly-in var(--dur) var(--ease);
    }

@keyframes fly-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.fly-label {
    padding: var(--s3) var(--s3) var(--s1);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.fly-sep {
    height: 1px;
    margin: var(--s1) var(--s2);
    background: var(--line);
}

.fly-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    width: 100%;
    height: 34px;
    padding: 0 var(--s3);
    border-radius: var(--r-sm);
    font-size: var(--t-control);
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

    .fly-item > .i {
        font-size: 18px;
        color: var(--text-tertiary);
    }

    .fly-item .label {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fly-item .key {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
        letter-spacing: .02em;
    }

    .fly-item .chev {
        font-size: 18px;
        color: var(--text-tertiary);
        margin-right: -4px;
    }

    .fly-item:hover,
    .fly-item.hl {
        background: var(--surface-hover);
        color: var(--text);
    }

        .fly-item:hover > .i,
        .fly-item.hl > .i {
            color: var(--brand);
        }

    .fly-item.current {
        background: var(--brand-container);
        color: var(--on-brand-container);
        font-weight: var(--w-medium);
    }

        .fly-item.current > .i {
            color: var(--brand);
        }

    .fly-item.check::after {
        content: "check";
        font-family: "Material Symbols Rounded";
        font-size: 18px;
        color: var(--brand);
    }

/* ═══ SEARCH ══════════════════════════════════════════════════ */
.search {
    position: relative;
    flex: 1;
    max-width: 460px;
    margin-left: auto;
}

.search-field {
    display: flex;
    align-items: center;
    gap: var(--s2);
    height: 36px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    border: 1px solid transparent;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

    .search-field:focus-within {
        background: var(--surface);
        border-color: var(--brand);
    }

    .search-field .i {
        font-size: 19px;
        color: var(--text-tertiary);
    }

    .search-field input {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        background: none;
        font-size: var(--t-control);
    }

        .search-field input::placeholder {
            color: var(--text-tertiary);
        }

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: var(--r-xs);
    background: var(--surface-active);
    color: var(--text-tertiary);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    font-family: var(--font);
    white-space: nowrap;
}

.search-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 200;
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--s1);
    background: var(--surface-raised);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-menu);
}

    .search-panel.open {
        display: block;
        animation: fly-in var(--dur) var(--ease);
    }

.sr-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 42px;
    padding: 0 var(--s3);
    border-radius: var(--r-sm);
    cursor: pointer;
}

    .sr-item .i {
        color: var(--text-tertiary);
    }

    .sr-item:hover,
    .sr-item.hl {
        background: var(--surface-hover);
    }

        .sr-item:hover .i,
        .sr-item.hl .i {
            color: var(--brand);
        }

.sr-main {
    flex: 1;
    min-width: 0;
}

    .sr-main b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-medium);
    }

    .sr-main span {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
    }

.sr-path {
    font-size: var(--t-micro);
    color: var(--text-tertiary);
    white-space: nowrap;
}

.sr-empty {
    padding: var(--s8) var(--s4);
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--t-body);
}

mark {
    background: none;
    color: var(--brand);
    font-weight: var(--w-semi);
}

/* ═══ TOPBAR ACTIONS ══════════════════════════════════════════ */
.bar-actions {
    display: flex;
    align-items: center;
    gap: var(--s1);
    flex: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    position: relative;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .icon-btn:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .icon-btn[aria-expanded="true"] {
        background: var(--brand-container);
        color: var(--on-brand-container);
    }

.dot {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: var(--on-status);
    font-size: 9px;
    font-weight: var(--w-bold);
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: var(--s2);
    height: 36px;
    padding: 0 var(--s2) 0 var(--s1);
    border-radius: var(--r-md);
    transition: background var(--dur) var(--ease);
}

    .profile-btn:hover {
        background: var(--surface-hover);
    }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--r-full);
    background: var(--brand-container);
    color: var(--on-brand-container);
    display: grid;
    place-items: center;
    font-size: var(--t-micro);
    font-weight: var(--w-bold);
    flex: none;
}

.avatar-lg {
    width: 44px;
    height: 44px;
    font-size: var(--t-subhead);
}

/* ═══ NOTIFICATIONS ═══════════════════════════════════════════ */
.panel {
    display: none;
    position: fixed;
    z-index: 200;
    width: 380px;
    max-height: 70vh;
    background: var(--surface-raised);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-menu);
    overflow: hidden;
    flex-direction: column;
}

    .panel.open {
        display: flex;
        animation: fly-in var(--dur) var(--ease);
    }

.panel-head {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--line);
    flex: none;
}

.panel-body {
    overflow-y: auto;
    flex: 1;
}

.panel-foot {
    padding: var(--s2);
    border-top: 1px solid var(--line);
    flex: none;
}

.notif {
    display: flex;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

    .notif:last-child {
        border-bottom: none;
    }

    .notif:hover {
        background: var(--surface-hover);
    }

    .notif.unread {
        background: var(--brand-container);
    }

        .notif.unread:hover {
            background: var(--brand-container-hi);
        }

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    flex: none;
}

    .notif-icon.is-warn {
        background: var(--warn-container);
        color: var(--on-warn-container);
    }

    .notif-icon.is-danger {
        background: var(--danger-container);
        color: var(--on-danger-container);
    }

    .notif-icon.is-ok {
        background: var(--ok-container);
        color: var(--on-ok-container);
    }

    .notif-icon.is-info {
        background: var(--info-container);
        color: var(--on-info-container);
    }

.notif-body {
    flex: 1;
    min-width: 0;
}

    .notif-body b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .notif-body p {
        font-size: var(--t-caption);
        color: var(--text-secondary);
        line-height: 1.45;
        margin-top: 1px;
    }

    .notif-body time {
        display: block;
        font-size: var(--t-micro);
        color: var(--text-tertiary);
        margin-top: var(--s1);
    }

/* ═══ BODY ════════════════════════════════════════════════════ */
.body {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ═══ SIDE RAIL (alternate nav mode) ══════════════════════════ */
.rail {
    width: var(--w-rail);
    flex: none;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--dur-slow) var(--ease);
}

html[data-nav="side"] .rail {
    display: flex;
}

html[data-nav="side"][data-rail="min"] .rail {
    width: var(--w-rail-min);
}

.rail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--s2);
}

.rail-group {
    padding: var(--s4) var(--s3) var(--s1);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.rail-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 38px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    font-size: var(--t-control);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .rail-item .i {
        font-size: 20px;
        color: var(--text-tertiary);
    }

    .rail-item:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .rail-item.current {
        background: var(--brand-container);
        color: var(--on-brand-container);
        font-weight: var(--w-medium);
    }

        .rail-item.current .i {
            color: var(--brand);
        }

.rail-foot {
    padding: var(--s2);
    border-top: 1px solid var(--line);
    flex: none;
}

html[data-rail="min"] .rail-group,
html[data-rail="min"] .rail-item .label,
html[data-rail="min"] .rail-item .push {
    display: none;
}

html[data-rail="min"] .rail-item {
    justify-content: center;
    padding: 0;
}

/* ═══ MAIN + COMMAND BAR ══════════════════════════════════════ */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cmdbar {
    min-height: var(--h-cmdbar);
    flex: none;
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s2) var(--s6);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.cmd-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.crumb {
    display: flex;
    align-items: center;
    gap: var(--s1);
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

    .crumb .i {
        font-size: 14px;
    }

    .crumb a:hover {
        color: var(--brand);
    }

.cmd-h1 {
    display: flex;
    align-items: center;
    gap: var(--s3);
    font-size: var(--t-title);
    font-weight: var(--w-semi);
    letter-spacing: -.016em;
}

.cmd-actions {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-left: auto;
}

/* ═══ CONTENT — the only scrolling region ═════════════════════ */
.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--s6);
}

.page {
    max-width: 1480px;
    margin: 0 auto;
}

.page-narrow {
    max-width: 1080px;
    margin: 0 auto;
}

/* ═══ SECTION NAV — the anti-scrolling device ═════════════════
   A form is split into named groups. This rail lists them, marks
   which one you are in, and jumps straight there. Nothing is hidden
   behind a tab, and nothing needs hunting for.
   ═══════════════════════════════════════════════════════════════ */
.with-secnav {
    display: grid;
    grid-template-columns: var(--w-secnav) minmax(0, 1fr);
    gap: var(--s6);
    align-items: start;
}

.secnav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.secnav-title {
    padding: 0 var(--s3) var(--s2);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.secnav a {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 34px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    font-size: var(--t-control);
    color: var(--text-secondary);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .secnav a .i {
        font-size: 18px;
        color: var(--text-tertiary);
    }

    .secnav a:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .secnav a.current {
        background: var(--brand-container);
        color: var(--on-brand-container);
        font-weight: var(--w-medium);
    }

        .secnav a.current .i {
            color: var(--brand);
        }

.secnav .count {
    margin-left: auto;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

@media (max-width: 1080px) {
    .with-secnav {
        grid-template-columns: 1fr;
    }

    .secnav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: var(--s1);
        padding-bottom: var(--s2);
        border-bottom: 1px solid var(--line);
    }

    .secnav-title, .secnav .count {
        display: none;
    }

    .secnav a {
        white-space: nowrap;
    }
}

/* ═══ DIALOG ══════════════════════════════════════════════════ */
.dialog-root {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
}

    .dialog-root.open {
        display: block;
    }

.scrim {
    position: absolute;
    inset: 0;
    background: var(--scrim);
}

.dialog {
    position: relative;
    width: min(600px, calc(100% - 32px));
    max-height: 84vh;
    margin: 8vh auto 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-dialog);
    overflow: hidden;
    animation: fly-in var(--dur-slow) var(--ease);
}

.dialog-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--line);
    flex: none;
}

.dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--s5);
}

.dialog-foot {
    display: flex;
    gap: var(--s2);
    justify-content: flex-end;
    padding: var(--s4) var(--s5);
    border-top: 1px solid var(--line);
    flex: none;
}

/* ═══ SETTINGS ROWS ═══════════════════════════════════════════ */
.setting {
    display: flex;
    align-items: center;
    gap: var(--s4);
    padding: var(--s4) 0;
    border-bottom: 1px solid var(--line);
}

    .setting:last-child {
        border-bottom: none;
    }

.setting-main {
    flex: 1;
    min-width: 0;
}

    .setting-main b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .setting-main p {
        font-size: var(--t-caption);
        color: var(--text-secondary);
        margin-top: 2px;
        line-height: 1.45;
    }

/* ═══ TOAST ═══════════════════════════════════════════════════ */
.toasts {
    position: fixed;
    left: 50%;
    bottom: var(--s6);
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    align-items: center;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border-radius: var(--r-full);
    background: var(--surface-inverse);
    color: var(--text-inverse);
    font-size: var(--t-control);
    font-weight: var(--w-medium);
    box-shadow: var(--shadow-menu);
    animation: fly-in var(--dur-slow) var(--ease);
    white-space: nowrap;
}

    .toast .i {
        font-size: 19px;
    }

/* ═══ AUTH LAYOUT ═════════════════════════════════════════════ */
.auth {
    min-height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--canvas);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--s12) 8%;
    background: var(--surface);
    overflow-y: auto;
}

.auth-inner {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-aside {
    background: var(--brand);
    color: var(--on-brand);
    padding: var(--s12) 8%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--s6);
}

    .auth-aside h2 {
        font-size: 30px;
        font-weight: var(--w-bold);
        letter-spacing: -.024em;
        line-height: 1.22;
    }

    .auth-aside p {
        font-size: var(--t-subhead);
        opacity: .82;
        line-height: 1.6;
        max-width: 44ch;
    }

.aside-list {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    margin-top: var(--s2);
}

.aside-row {
    display: flex;
    gap: var(--s3);
    align-items: flex-start;
}

    .aside-row .i {
        opacity: .85;
        margin-top: 1px;
    }

    .aside-row b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .aside-row span {
        font-size: var(--t-caption);
        opacity: .78;
        line-height: 1.5;
    }

.auth-foot {
    margin-top: var(--s8);
    font-size: var(--t-caption);
    color: var(--text-tertiary);
}

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-panel {
        padding: var(--s8) var(--s5);
    }
}

/* ═══ RESPONSIVE SHELL ════════════════════════════════════════ */
@media (max-width: 1180px) {
    .brand-sub {
        display: none;
    }

    .search {
        max-width: 280px;
    }
}

@media (max-width: 980px) {
    .mb-btn .label-full {
        display: none;
    }

    .brand-name {
        display: none;
    }
}

@media (max-width: 760px) {
    .topbar {
        padding: 0 var(--s3);
        gap: var(--s2);
    }

    .menubar {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

        .menubar::-webkit-scrollbar {
            display: none;
        }

    .content {
        padding: var(--s4);
    }

    .cmdbar {
        padding: var(--s3) var(--s4);
    }

    .panel {
        width: calc(100vw - 24px);
    }
}

@media print {
    .topbar, .rail, .cmdbar, .secnav, .toasts, .no-print {
        display: none !important;
    }

    .app, .content {
        overflow: visible;
        height: auto;
    }

    body {
        background: var(--paper);
    }
}
/* ═══════════════════════════════════════════════════════════════════
   AUTOGENIUS · COMPONENTS
   Flat, 2D, no gradients. Depth is expressed with tone, never shadow,
   except on things that genuinely float above the page.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══ BUTTONS ═════════════════════════════════════════════════
   Three levels only: filled (one per screen), tonal, text.
   Every form uses the same words: Save · Save & close · Cancel.
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    height: var(--h-control);
    padding: 0 var(--s4);
    border-radius: var(--r-md);
    font-size: var(--t-control);
    font-weight: var(--w-medium);
    white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    border: 1px solid transparent;
}

    .btn .i {
        font-size: 19px;
    }

.btn-filled {
    background: var(--brand);
    color: var(--on-brand);
}

    .btn-filled:hover {
        background: var(--brand-hover);
    }

    .btn-filled:active {
        background: var(--brand-active);
    }

.btn-tonal {
    background: var(--brand-container);
    color: var(--on-brand-container);
}

    .btn-tonal:hover {
        background: var(--brand-container-hi);
    }

.btn-outline {
    border-color: var(--line-strong);
    color: var(--text-secondary);
    background: var(--surface);
}

    .btn-outline:hover {
        background: var(--surface-hover);
        color: var(--text);
        border-color: var(--text-tertiary);
    }

.btn-text {
    color: var(--text-secondary);
    padding: 0 var(--s3);
}

    .btn-text:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

.btn-danger {
    background: var(--danger-container);
    color: var(--on-danger-container);
}

    .btn-danger:hover {
        filter: brightness(.96);
    }

.btn-sm {
    height: 30px;
    padding: 0 var(--s3);
    font-size: var(--t-caption);
}

    .btn-sm .i {
        font-size: 17px;
    }

.btn-icon {
    width: var(--h-control);
    padding: 0;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 44px;
    padding: 0 var(--s5);
    font-size: var(--t-subhead);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .45;
    pointer-events: none;
}

.btn .kbd {
    background: var(--key-fill);
    color: inherit;
    opacity: .8;
}

/* ═══ FIELDS ══════════════════════════════════════════════════ */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    min-width: 0;
}

.label {
    display: flex;
    align-items: center;
    gap: var(--s1);
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
}

    .label .req {
        color: var(--danger);
    }

    .label .hint {
        margin-left: auto;
        font-weight: var(--w-normal);
        color: var(--text-tertiary);
        font-size: var(--t-micro);
    }

.input,
.select,
.textarea {
    width: 100%;
    height: var(--h-control);
    padding: 0 var(--s3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--text);
    font-size: var(--t-control);
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

    .input::placeholder,
    .textarea::placeholder {
        color: var(--text-tertiary);
    }

    .input:hover:not(:disabled):not([readonly]),
    .select:hover:not(:disabled),
    .textarea:hover:not(:disabled):not([readonly]) {
        border-color: var(--text-tertiary);
    }

    .input:focus,
    .select:focus,
    .textarea:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-container);
    }

    .input[readonly] {
        background: var(--surface-sunken);
        color: var(--text-secondary);
        border-color: var(--line);
        cursor: default;
    }

    .input:disabled,
    .select:disabled {
        background: var(--surface-sunken);
        color: var(--text-disabled);
        cursor: not-allowed;
    }

.textarea {
    height: auto;
    min-height: 76px;
    padding: var(--pad-block) var(--s3);
    line-height: 1.55;
    resize: vertical;
}

.select {
    appearance: none;
    cursor: pointer;
    padding-right: var(--s8);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737B87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* leading icon / trailing unit */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-wrap > .i {
        position: absolute;
        left: 10px;
        font-size: 18px;
        color: var(--text-tertiary);
        pointer-events: none;
    }

    .input-wrap.has-icon .input {
        padding-left: 34px;
    }

.unit {
    position: absolute;
    right: 12px;
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-wrap.has-unit .input {
    padding-right: 44px;
}

.input-wrap .btn-inline {
    position: absolute;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
}

    .input-wrap .btn-inline:hover {
        background: var(--surface-hover);
        color: var(--brand);
    }

.input-wrap.has-btn .input {
    padding-right: 38px;
}

/* numeric fields line up column to column */
.input[data-type="amount"],
.input[data-type="qty"],
.input[data-type="percent"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.input[data-type="reg"],
.input[data-type="pan"],
.input[data-type="gstin"] {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: var(--w-medium);
}

.help {
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

.field.invalid .input,
.field.invalid .select {
    border-color: var(--danger);
}

.field .error {
    display: none;
    font-size: var(--t-micro);
    color: var(--danger);
}

.field.invalid .error {
    display: block;
}

/* checkbox / radio / switch */
.check {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--t-control);
    color: var(--text-secondary);
    cursor: pointer;
    min-height: var(--h-control);
}

    .check input {
        accent-color: var(--brand);
        width: 16px;
        height: 16px;
        flex: none;
    }

.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    cursor: pointer;
    font-size: var(--t-control);
    color: var(--text-secondary);
}

    .switch input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.track {
    width: 40px;
    height: 22px;
    border-radius: var(--r-full);
    background: var(--line-strong);
    position: relative;
    flex: none;
    transition: background var(--dur) var(--ease);
}

    .track::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 16px;
        height: 16px;
        border-radius: var(--r-full);
        background: var(--surface);
        transition: transform var(--dur) var(--ease);
    }

.switch input:checked + .track {
    background: var(--brand);
}

    .switch input:checked + .track::after {
        transform: translateX(18px);
    }

.switch input:focus-visible + .track {
    outline: 2px solid var(--line-focus);
    outline-offset: 2px;
}

/* segmented control */
.segment {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    gap: 2px;
}

.seg {
    height: 30px;
    padding: 0 var(--s3);
    border-radius: var(--r-sm);
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .seg:hover {
        color: var(--text);
    }

    .seg.on {
        background: var(--surface);
        color: var(--text);
    }

/* ═══ FIELD GROUPS ════════════════════════════════════════════
   A group is a labelled band of related inputs — no nested boxes,
   no card inside a card. Related things sit together and the eye
   finds them without scrolling.
   ═══════════════════════════════════════════════════════════════ */
.surface {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    overflow: hidden;
}

.group {
    padding: var(--s5) var(--s6);
    border-bottom: 1px solid var(--line);
    scroll-margin-top: var(--s4);
}

    .group:last-child {
        border-bottom: none;
    }

.group-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s4);
}

    .group-head .i {
        color: var(--brand);
    }

    .group-head h3 {
        font-size: var(--t-subhead);
        font-weight: var(--w-semi);
    }

    .group-head .note {
        font-size: var(--t-caption);
        color: var(--text-tertiary);
    }

.group-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--s2);
}

/* form grid — 4 fields per row is the automobile default:
   reg no, km, chassis, fuel are all short */
.fields {
    display: grid;
    gap: var(--s4);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fields-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fields-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fields-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.fields-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.span-all {
    grid-column: 1 / -1;
}

@media (max-width: 1400px) {
    .fields-5, .fields-6 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .fields, .fields-3, .fields-5, .fields-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .fields, .fields-2, .fields-3, .fields-5, .fields-6 {
        grid-template-columns: 1fr;
    }

    .span-2, .span-3, .span-all {
        grid-column: span 1;
    }
}

/* ═══ SAVE BAR ════════════════════════════════════════════════
   Sticks to the bottom of the content region. The same two words
   on every form in the product, always on screen.
   ═══════════════════════════════════════════════════════════════ */
.savebar {
    position: sticky;
    bottom: calc(var(--s6) * -1);
    margin: var(--s4) calc(var(--s6) * -1) calc(var(--s6) * -1);
    padding: var(--s3) var(--s6);
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: var(--s4);
    z-index: 20;
}

.savebar-info {
    display: flex;
    align-items: center;
    gap: var(--s4);
    font-size: var(--t-caption);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.savebar-actions {
    margin-left: auto;
    display: flex;
    gap: var(--s2);
}

.total-inline {
    display: flex;
    align-items: baseline;
    gap: var(--s2);
    color: var(--text-secondary);
}

    .total-inline b {
        font-size: var(--t-heading);
        font-weight: var(--w-bold);
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

@media (max-width: 760px) {
    .savebar {
        margin: var(--s4) calc(var(--s4) * -1) calc(var(--s4) * -1);
        padding: var(--s3) var(--s4);
    }

    .savebar-info {
        display: none;
    }

    .savebar-actions {
        width: 100%;
    }

    .savebar .btn {
        flex: 1;
    }
}

/* ═══ CHIPS & BADGES ══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    height: 22px;
    padding: 0 var(--s2);
    border-radius: var(--r-sm);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    white-space: nowrap;
}

    .badge .i {
        font-size: 14px;
    }

.b-open {
    background: var(--neutral-container);
    color: var(--on-neutral-container);
}

.b-progress {
    background: var(--info-container);
    color: var(--on-info-container);
}

.b-hold {
    background: var(--warn-container);
    color: var(--on-warn-container);
}

.b-parts {
    background: var(--accent-alt-container);
    color: var(--on-accent-alt-container);
}

.b-ready {
    background: var(--ok-container);
    color: var(--on-ok-container);
}

.b-late {
    background: var(--danger-container);
    color: var(--on-danger-container);
}

.b-brand {
    background: var(--brand-container);
    color: var(--on-brand-container);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    height: 30px;
    padding: 0 var(--s2) 0 var(--s3);
    border-radius: var(--r-full);
    background: var(--brand-container);
    color: var(--on-brand-container);
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
}

    .chip .i {
        font-size: 16px;
        cursor: pointer;
        opacity: .7;
    }

        .chip .i:hover {
            opacity: 1;
        }

.chip-plain {
    background: var(--surface-sunken);
    color: var(--text-secondary);
    padding: 0 var(--s3);
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
}

/* ═══ FILTER BAR ══════════════════════════════════════════════ */
.filters {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
    margin-bottom: var(--s4);
}

    .filters .input,
    .filters .select {
        width: auto;
        min-width: 150px;
    }

.filter-search {
    position: relative;
    flex: 1;
    max-width: 320px;
    min-width: 200px;
}

    .filter-search .i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        color: var(--text-tertiary);
        pointer-events: none;
    }

    .filter-search .input {
        padding-left: 34px;
    }

/* ═══ TABLES ══════════════════════════════════════════════════ */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.table-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--line);
}

    .table-head h3 {
        font-size: var(--t-subhead);
        font-weight: var(--w-semi);
    }

.table-scroll {
    overflow: auto;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--header-bg);
    height: 36px;
    padding: 0 var(--s4);
    text-align: left;
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.table td {
    height: var(--h-row);
    padding: 0 var(--s4);
    font-size: var(--t-body);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: var(--row-hover);
}

.table tbody tr.selected td {
    background: var(--row-selected);
}

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

.table td .link {
    color: var(--brand);
    font-weight: var(--w-medium);
}

    .table td .link:hover {
        text-decoration: underline;
    }

.cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.35;
    padding: var(--s1) 0;
}

    .cell-stack b {
        font-weight: var(--w-medium);
        color: var(--text);
    }

    .cell-stack span {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
    }

.row-actions {
    display: flex;
    gap: var(--s1);
    justify-content: flex-end;
}

.act-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .act-btn:hover {
        background: var(--brand-container);
        color: var(--brand);
    }

    .act-btn .i {
        font-size: 18px;
    }

.table-foot {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-top: 1px solid var(--line);
    font-size: var(--t-caption);
    color: var(--text-tertiary);
}

.pager {
    margin-left: auto;
    display: flex;
    gap: var(--s1);
}

.page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 var(--s2);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
}

    .page-btn:hover {
        background: var(--surface-hover);
    }

    .page-btn.on {
        background: var(--brand);
        color: var(--on-brand);
    }

    .page-btn:disabled {
        opacity: .4;
        pointer-events: none;
    }

/* phone: rows become cards, no sideways scrolling */
@media (max-width: 760px) {
    .table.stack thead {
        display: none;
    }

    .table.stack tbody tr {
        display: block;
        padding: var(--s2) 0;
        border-bottom: 1px solid var(--line);
    }

    .table.stack td {
        display: flex;
        align-items: center;
        gap: var(--s3);
        height: auto;
        min-height: 30px;
        padding: var(--s1) var(--s4);
        border: none;
        white-space: normal;
    }

        .table.stack td::before {
            content: attr(data-th);
            flex: 0 0 96px;
            font-size: var(--t-micro);
            font-weight: var(--w-semi);
            letter-spacing: .04em;
            text-transform: uppercase;
            color: var(--text-tertiary);
        }

        .table.stack td.num {
            text-align: left;
            justify-content: flex-start;
        }

    .table.stack .row-actions {
        justify-content: flex-start;
    }
}

/* ═══ LINE-ITEM GRID ══════════════════════════════════════════ */
.grid-table {
    width: 100%;
}

    .grid-table th {
        background: var(--header-bg);
        height: 34px;
        padding: 0 var(--s2);
        text-align: left;
        font-size: var(--t-micro);
        font-weight: var(--w-semi);
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--text-tertiary);
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
    }

    .grid-table td {
        padding: 0;
        border-bottom: 1px solid var(--line);
    }

.cell {
    width: 100%;
    height: var(--h-row);
    padding: 0 var(--s2);
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--t-control);
    outline: none;
}

    .cell:hover {
        border-color: var(--line);
    }

    .cell:focus {
        border-color: var(--brand);
        background: var(--surface);
        box-shadow: 0 0 0 2px var(--brand-container);
        color: var(--text);
    }

    .cell.num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .cell[readonly] {
        color: var(--text-tertiary);
    }

.idx {
    width: 36px;
    text-align: center;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.del-col {
    width: 40px;
    text-align: center;
}

.grid-foot {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2) var(--s3);
    background: var(--surface-sunken);
    border-top: 1px solid var(--line);
    font-size: var(--t-caption);
    color: var(--text-tertiary);
}

/* ═══ CARDS & STATS ═══════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--line);
}

    .card-head h3 {
        font-size: var(--t-subhead);
        font-weight: var(--w-semi);
    }

    .card-head .i {
        color: var(--text-tertiary);
    }

    .card-head .push {
        font-size: var(--t-caption);
        color: var(--text-tertiary);
    }

.card-body {
    padding: var(--s5);
}

    .card-body.flush {
        padding: 0;
    }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s3);
    margin-bottom: var(--s4);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    padding: var(--s4) var(--s5);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    text-align: left;
    transition: border-color var(--dur) var(--ease);
}

    .stat:hover {
        border-color: var(--brand);
    }

.stat-label {
    font-size: var(--t-caption);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.stat-value {
    font-size: 26px;
    font-weight: var(--w-bold);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.stat-note {
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

.trend-up {
    color: var(--ok);
    font-weight: var(--w-semi);
}

.trend-down {
    color: var(--danger);
    font-weight: var(--w-semi);
}

/* bar list */
.bars {
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

.bar {
    display: grid;
    grid-template-columns: 116px 1fr 64px;
    align-items: center;
    gap: var(--s3);
    font-size: var(--t-caption);
}

.bar-name {
    color: var(--text-secondary);
    font-weight: var(--w-medium);
}

.bar-track {
    height: 6px;
    border-radius: var(--r-full);
    background: var(--surface-sunken);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--r-full);
    background: var(--brand);
}

    .bar-fill.ok {
        background: var(--ok);
    }

    .bar-fill.warn {
        background: var(--warn);
    }

    .bar-fill.danger {
        background: var(--danger);
    }

.bar-value {
    text-align: right;
    font-weight: var(--w-semi);
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* compact list */
.list {
    display: flex;
    flex-direction: column;
}

.list-row {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

    .list-row:last-child {
        border-bottom: none;
    }

    .list-row:hover {
        background: var(--row-hover);
    }

.list-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    color: var(--text-tertiary);
    display: grid;
    place-items: center;
    flex: none;
}

.list-main {
    flex: 1;
    min-width: 0;
}

    .list-main b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-medium);
    }

    .list-main span {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
    }

/* banner */
.banner {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    border-radius: var(--r-md);
    font-size: var(--t-body);
    margin-bottom: var(--s4);
    line-height: 1.5;
}

    .banner .i {
        flex: none;
        margin-top: 1px;
    }

    .banner a {
        color: inherit;
        font-weight: var(--w-semi);
        text-decoration: underline;
    }

.banner-info {
    background: var(--brand-container);
    color: var(--on-brand-container);
}

.banner-warn {
    background: var(--warn-container);
    color: var(--on-warn-container);
}

.banner-danger {
    background: var(--danger-container);
    color: var(--on-danger-container);
}

.banner-ok {
    background: var(--ok-container);
    color: var(--on-ok-container);
}

/* record header — the pinned vehicle context */
.record-head {
    display: flex;
    align-items: center;
    gap: var(--s5);
    padding: var(--s4) var(--s5);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: var(--s4);
    flex-wrap: wrap;
}

.plate {
    font-family: var(--mono);
    font-size: var(--t-heading);
    font-weight: var(--w-bold);
    letter-spacing: .06em;
    padding: var(--s2) var(--s3);
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    border: 1px solid var(--line-strong);
}

.facts {
    display: flex;
    gap: var(--s6);
    flex-wrap: wrap;
}

.fact span {
    display: block;
    font-size: var(--t-micro);
    color: var(--text-tertiary);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fact b {
    font-size: var(--t-control);
    font-weight: var(--w-medium);
}

/* totals ladder */
.ladder {
    display: flex;
    flex-direction: column;
}

.ladder-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s4);
    align-items: center;
    padding: 0 var(--s5);
    height: var(--h-row);
    font-size: var(--t-body);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--line);
}

    .ladder-row:last-child {
        border-bottom: none;
    }

    .ladder-row b {
        font-variant-numeric: tabular-nums;
        font-weight: var(--w-medium);
        color: var(--text);
    }

    .ladder-row.indent {
        padding-left: var(--s8);
        color: var(--text-tertiary);
    }

    .ladder-row.sub {
        background: var(--surface-sunken);
        font-weight: var(--w-semi);
        color: var(--text);
    }

    .ladder-row.less b {
        color: var(--danger);
    }

    .ladder-row.total {
        background: var(--brand-container);
        color: var(--on-brand-container);
        height: 52px;
        font-weight: var(--w-semi);
    }

        .ladder-row.total b {
            font-size: var(--t-title);
            color: var(--on-brand-container);
        }

/* empty state */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s2);
    padding: var(--s12) var(--s5);
    text-align: center;
}

    .empty .i {
        font-size: 40px;
        color: var(--text-disabled);
        margin-bottom: var(--s2);
    }

    .empty b {
        font-size: var(--t-heading);
        font-weight: var(--w-semi);
    }

    .empty p {
        font-size: var(--t-body);
        color: var(--text-secondary);
        max-width: 42ch;
    }

    .empty .btn {
        margin-top: var(--s3);
    }

/* ═══ INHERITED PICKER ALIGNMENT ══════════════════════════════
   u-datepicker.css and u-timepicker.css come from the previous build
   unchanged, apart from having their hardcoded colours swapped for
   tokens. These few rules line their trigger fields up with .input so
   a date field and a text field on the same row match exactly.
   ═══════════════════════════════════════════════════════════════ */
.single-date-picker,
.single-time-picker {
    height: var(--h-control);
    border-radius: var(--r-md);
    border: 1px solid var(--line-strong);
    gap: var(--s2);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

    .single-date-picker:hover,
    .single-time-picker:hover {
        border-color: var(--text-tertiary);
    }

    .single-date-picker.sdp-open,
    .single-time-picker.stp-open {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-container);
    }

    .single-date-picker .input,
    .single-time-picker .input {
        height: auto;
        border: none;
        padding: 0;
        background: none;
        box-shadow: none;
        font-size: var(--t-control);
        cursor: pointer;
    }

    .single-date-picker .i,
    .single-time-picker .i {
        color: var(--text-tertiary);
        order: -1;
    }

/* the picker popovers float, so they get the overlay shadow */
.dr-picker,
.tp-picker,
.cs-menu {
    border: none;
    box-shadow: var(--shadow-menu);
    border-radius: var(--r-lg);
    font-family: var(--font);
}

/* ═══ NEW-FIELD TAG ═══════════════════════════════════════════
   Marks anything that was NOT on the original ASP.NET form, so the
   client can tell a redesign from an addition at a glance.
   .tag-hidden marks a field moved out of the live form.
   ═══════════════════════════════════════════════════════════════ */
.tag-new {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 5px;
    border-radius: var(--r-xs);
    background: var(--accent-alt-container);
    color: var(--on-accent-alt-container);
    font-size: 9.5px;
    font-weight: var(--w-bold);
    letter-spacing: .06em;
    text-transform: uppercase;
    flex: none;
}

.tag-hidden {
    background: var(--neutral-container);
    color: var(--on-neutral-container);
}

/* ═══ PASSWORD RULES ══════════════════════════════════════════ */
.pwd-meter {
    display: flex;
    gap: 3px;
    margin-top: var(--s2);
}

.pwd-seg {
    flex: 1;
    height: 3px;
    border-radius: var(--r-full);
    background: var(--line);
    transition: background var(--dur) var(--ease);
}

    .pwd-seg.on {
        background: var(--warn);
    }

    .pwd-seg.strong {
        background: var(--ok);
    }

.pwd-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s1) var(--s3);
    margin-top: var(--s2);
}

.pwd-rule {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--t-micro);
    color: var(--text-tertiary);
}

    .pwd-rule .i {
        font-size: 14px;
    }

    .pwd-rule.met {
        color: var(--ok);
    }

/* ═══ OTP ═════════════════════════════════════════════════════ */
.otp {
    display: flex;
    gap: var(--s2);
}

    .otp input {
        width: 46px;
        height: 54px;
        text-align: center;
        font-size: var(--t-title);
        font-weight: var(--w-semi);
        font-variant-numeric: tabular-nums;
        border: 1px solid var(--line-strong);
        border-radius: var(--r-md);
        background: var(--surface);
        color: var(--text);
        outline: none;
        transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    }

        .otp input:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px var(--brand-container);
        }

        .otp input.filled {
            border-color: var(--brand);
        }

.captcha {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.captcha-img {
    height: var(--h-control);
    min-width: 124px;
    padding: 0 var(--s4);
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    border: 1px solid var(--line-strong);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: var(--t-heading);
    font-weight: var(--w-bold);
    letter-spacing: .22em;
    color: var(--text-secondary);
    user-select: none;
    font-style: italic;
}

/* ═══ PLAN CARDS ══════════════════════════════════════════════ */
.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s3);
}

.plan {
    padding: var(--s4);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

    .plan:hover {
        border-color: var(--text-tertiary);
    }

    .plan.on {
        border-color: var(--brand);
        background: var(--brand-container);
    }

    .plan b {
        display: block;
        font-size: var(--t-subhead);
        font-weight: var(--w-semi);
    }

    .plan .price {
        display: block;
        font-size: var(--t-title);
        font-weight: var(--w-bold);
        letter-spacing: -.02em;
        margin: var(--s1) 0;
        font-variant-numeric: tabular-nums;
    }

    .plan span {
        font-size: var(--t-caption);
        color: var(--text-secondary);
        line-height: 1.45;
    }

/* ═══ IMAGE UPLOAD ════════════════════════════════════════════ */
.dropzone {
    display: block;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface-sunken);
    padding: var(--s6);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

    .dropzone:hover {
        border-color: var(--brand);
        background: var(--brand-container);
    }

    .dropzone .i {
        font-size: 34px;
        color: var(--text-tertiary);
        margin-bottom: var(--s2);
    }

    .dropzone:hover .i {
        color: var(--brand);
    }

    .dropzone b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .dropzone span {
        font-size: var(--t-caption);
        color: var(--text-tertiary);
    }

.thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: var(--s2);
    margin-top: var(--s3);
}

.thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-sunken);
    display: grid;
    place-items: center;
    overflow: hidden;
}

    .thumb .i {
        font-size: 26px;
        color: var(--text-disabled);
    }

    .thumb .badge {
        position: absolute;
        left: 4px;
        bottom: 4px;
    }

    .thumb .remove {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 22px;
        height: 22px;
        border-radius: var(--r-full);
        background: var(--surface);
        color: var(--text-tertiary);
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
    }

        .thumb .remove:hover {
            color: var(--danger);
        }

.row-thumb {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    flex: none;
}

    .row-thumb .i {
        font-size: 20px;
        color: var(--text-tertiary);
    }

/* ═══ FIELD AUDIT ═════════════════════════════════════════════ */
.audit-head,
.audit-row {
    display: grid;
    grid-template-columns: 190px 120px minmax(0, 1fr) auto;
    gap: var(--s4);
    align-items: center;
}

.audit-head {
    padding: var(--s2) var(--s5);
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.audit-row {
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--line);
    font-size: var(--t-caption);
}

    .audit-row:last-child {
        border-bottom: none;
    }

    .audit-row code {
        font-family: var(--mono);
        font-size: var(--t-micro);
        color: var(--text-secondary);
        background: var(--surface-sunken);
        padding: 2px 6px;
        border-radius: var(--r-xs);
        justify-self: start;
    }

    .audit-row p {
        color: var(--text-secondary);
        line-height: 1.45;
    }

@media (max-width: 900px) {
    .audit-head {
        display: none;
    }

    .audit-row {
        grid-template-columns: 1fr;
        gap: var(--s2);
    }
}
/* ═══════════════════════════════════════════════════════════════════
   AUTOGENIUS · DOMAIN PATTERNS
   The automobile-specific pieces, redrawn flat.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══ DAMAGE MAP ══════════════════════════════════════════════
   Tap the outline to record pre-existing damage at check-in. The
   single most argued-about record in a service centre, so it has
   to be fast, unambiguous and printable.
   ═══════════════════════════════════════════════════════════════ */
.damage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--s5);
    align-items: start;
}

@media (max-width: 960px) {
    .damage {
        grid-template-columns: 1fr;
    }
}

.damage-stage {
    position: relative;
    background: var(--surface-sunken);
    border-radius: var(--r-lg);
    padding: var(--s4);
    display: grid;
    place-items: center;
    touch-action: manipulation;
}

    .damage-stage svg {
        width: 100%;
        max-width: 320px;
        height: auto;
        cursor: crosshair;
    }

.dm-body {
    fill: var(--surface);
    stroke: var(--line-strong);
    stroke-width: 2;
}

.dm-glass {
    fill: var(--surface-sunken);
    stroke: var(--line-strong);
    stroke-width: 1.5;
}

.dm-line {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1.5;
    opacity: .7;
}

.dm-zone {
    fill: transparent;
}

    .dm-zone:hover {
        fill: var(--brand-container);
        opacity: .55;
    }

.dm-text {
    fill: var(--text-tertiary);
    font-family: var(--font);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .06em;
    text-anchor: middle;
    pointer-events: none;
}

.pin {
    position: absolute;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: var(--w-bold);
    color: var(--on-status);
    border: 2px solid var(--surface);
    cursor: pointer;
    transition: transform var(--dur) var(--ease);
}

    .pin:hover {
        transform: scale(1.15);
    }

.t-dent {
    background: var(--warn);
}

.t-scratch {
    background: var(--info);
}

.t-crack {
    background: var(--danger);
}

.t-missing {
    background: var(--accent-alt);
}

.t-rust {
    background: var(--neutral);
}

.tools {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
}

.tool {
    display: flex;
    align-items: center;
    gap: var(--s3);
    height: 38px;
    padding: 0 var(--s3);
    border-radius: var(--r-md);
    font-size: var(--t-control);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
    text-align: left;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .tool:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .tool.on {
        background: var(--brand-container);
        color: var(--on-brand-container);
    }

.swatch {
    width: 12px;
    height: 12px;
    border-radius: var(--r-full);
    flex: none;
}

.tool .kbd {
    margin-left: auto;
}

.damage-list {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}

.dm-row {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
    font-size: var(--t-caption);
    border-bottom: 1px solid var(--line);
}

    .dm-row:last-child {
        border-bottom: none;
    }

    .dm-row b {
        width: 18px;
        height: 18px;
        border-radius: var(--r-full);
        display: grid;
        place-items: center;
        font-size: 10px;
        color: var(--on-status);
        flex: none;
    }

    .dm-row span {
        flex: 1;
        color: var(--text-secondary);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* ═══ PHOTOS ══════════════════════════════════════════════════ */
.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: var(--s2);
}

.photo {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
}

    .photo .i {
        font-size: 26px;
        color: var(--text-disabled);
    }

    .photo .cap {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 3px 6px;
        background: var(--surface);
        border-top: 1px solid var(--line);
        font-size: var(--t-micro);
        font-weight: var(--w-medium);
        color: var(--text-tertiary);
        text-align: center;
    }

.photo-add {
    border-style: dashed;
    border-color: var(--line-strong);
    background: var(--surface);
    cursor: pointer;
}

    .photo-add:hover {
        border-color: var(--brand);
        background: var(--brand-container);
    }

        .photo-add:hover .i {
            color: var(--brand);
        }

/* ═══ SIGNATURE ═══════════════════════════════════════════════ */
.signature {
    position: relative;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    height: 120px;
    overflow: hidden;
}

    .signature canvas {
        display: block;
        width: 100%;
        height: 100%;
        touch-action: none;
        cursor: crosshair;
    }

.sig-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: var(--t-body);
    color: var(--text-tertiary);
    pointer-events: none;
}

.signature.inked .sig-hint {
    display: none;
}

/* ═══ TIMELINE ════════════════════════════════════════════════ */
.timeline {
    position: relative;
    padding-left: var(--s6);
}

    .timeline::before {
        content: "";
        position: absolute;
        left: 7px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--line);
    }

.tl {
    position: relative;
    padding-bottom: var(--s5);
}

    .tl:last-child {
        padding-bottom: 0;
    }

    .tl::before {
        content: "";
        position: absolute;
        left: calc(var(--s6) * -1 + 3px);
        top: 5px;
        width: 10px;
        height: 10px;
        border-radius: var(--r-full);
        background: var(--surface);
        border: 2px solid var(--line-strong);
    }

    .tl.now::before {
        background: var(--brand);
        border-color: var(--brand);
    }

    .tl.warn::before {
        background: var(--warn);
        border-color: var(--warn);
    }

    .tl time {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
        font-weight: var(--w-medium);
    }

    .tl b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
        margin: 1px 0 2px;
    }

    .tl p {
        font-size: var(--t-caption);
        color: var(--text-secondary);
        line-height: 1.5;
    }

/* ═══ BAY BOARD ═══════════════════════════════════════════════ */
.bays {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--s2);
}

.bay {
    padding: var(--s3);
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    border-left: 3px solid var(--line-strong);
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

    .bay:hover {
        background: var(--surface-hover);
    }

    .bay .no {
        font-size: var(--t-micro);
        font-weight: var(--w-semi);
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--text-tertiary);
    }

    .bay .veh {
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .bay .meta {
        font-size: var(--t-micro);
        color: var(--text-tertiary);
    }

    .bay.busy {
        border-left-color: var(--info);
    }

    .bay.hold {
        border-left-color: var(--warn);
    }

    .bay.done {
        border-left-color: var(--ok);
    }

    .bay.late {
        border-left-color: var(--danger);
        background: var(--danger-container);
    }

    .bay.free {
        border-left-color: var(--line-strong);
        opacity: .7;
    }

/* ═══ SPLIT / MASTER-DETAIL ═══════════════════════════════════ */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--s4);
    align-items: start;
}

.split-wide {
    grid-template-columns: 360px minmax(0, 1fr);
}

@media (max-width: 1180px) {
    .split, .split-wide {
        grid-template-columns: 1fr;
    }
}

.rail-sticky {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s4);
}

/* ═══ A4 SHEET ════════════════════════════════════════════════ */
.sheet {
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 0 auto;
    padding: 14mm 12mm;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 11px;
    color: var(--text);
}

.sheet-head {
    display: flex;
    gap: var(--s4);
    align-items: flex-start;
    padding-bottom: var(--s3);
    border-bottom: 2px solid var(--text);
}

    .sheet-head h2 {
        font-size: 17px;
        font-weight: var(--w-bold);
        letter-spacing: -.02em;
    }

    .sheet-head p {
        font-size: 10px;
        color: var(--text-secondary);
        line-height: 1.5;
    }

.sheet-doc {
    margin-left: auto;
    text-align: right;
}

    .sheet-doc h3 {
        font-size: 13px;
        font-weight: var(--w-bold);
        letter-spacing: .08em;
        text-transform: uppercase;
    }

.sheet-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s3);
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line-strong);
}

    .sheet-cols h4 {
        font-size: 8.5px;
        font-weight: var(--w-bold);
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--text-tertiary);
        margin-bottom: 2px;
    }

    .sheet-cols p {
        font-size: 10.5px;
        line-height: 1.55;
    }

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--s3) 0;
    font-size: 10px;
}

    .sheet-table th {
        background: var(--surface-sunken);
        text-align: left;
        padding: 5px 6px;
        border: 1px solid var(--line-strong);
        font-size: 8.5px;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .sheet-table td {
        padding: 4px 6px;
        border: 1px solid var(--line);
        vertical-align: top;
    }

    .sheet-table .num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .sheet-table tfoot td {
        font-weight: var(--w-bold);
        background: var(--surface-sunken);
    }

.sheet-foot {
    display: flex;
    justify-content: space-between;
    gap: var(--s5);
    margin-top: var(--s8);
    padding-top: var(--s3);
    border-top: 1px solid var(--line);
    font-size: 9.5px;
    color: var(--text-secondary);
}

.sign-block {
    text-align: center;
    min-width: 140px;
}

    .sign-block span {
        display: block;
        border-top: 1px solid var(--text-tertiary);
        margin-top: 32px;
        padding-top: 3px;
    }

@media print {
    .sheet {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
    }
}

/* ═══ TABS ════════════════════════════════════════════════════ */
.tabs {
    display: flex;
    align-items: center;
    gap: var(--s1);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--s4);
    overflow-x: auto;
    scrollbar-width: none;
}

    .tabs::-webkit-scrollbar {
        display: none;
    }

.tab {
    display: flex;
    align-items: center;
    gap: var(--s2);
    height: 40px;
    padding: 0 var(--s4);
    font-size: var(--t-control);
    font-weight: var(--w-medium);
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

    .tab:hover {
        color: var(--text);
    }

    .tab.on {
        color: var(--brand);
        border-bottom-color: var(--brand);
    }

.tab .count {
    padding: 0 var(--s2);
    height: 18px;
    border-radius: var(--r-full);
    background: var(--surface-sunken);
    font-size: var(--t-micro);
    font-weight: var(--w-semi);
    display: inline-grid;
    place-items: center;
}

.tab.on .count {
    background: var(--brand-container);
    color: var(--on-brand-container);
}

.tabpanel {
    display: none;
}

    .tabpanel.on {
        display: block;
    }

/* ═══ STEPPER ═════════════════════════════════════════════════ */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: var(--s4);
}

    .steps::-webkit-scrollbar {
        display: none;
    }

.step {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1) var(--s3);
    border-radius: var(--r-full);
    font-size: var(--t-caption);
    font-weight: var(--w-medium);
    color: var(--text-tertiary);
    white-space: nowrap;
    flex: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

    .step:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

.step-dot {
    width: 20px;
    height: 20px;
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    background: var(--surface-sunken);
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: var(--w-bold);
    flex: none;
}

    .step-dot .i {
        font-size: 13px;
    }

.step.done {
    color: var(--text-secondary);
}

    .step.done .step-dot {
        background: var(--ok);
        color: var(--on-status);
    }

.step.now {
    background: var(--brand);
    color: var(--on-brand);
}

    .step.now:hover {
        background: var(--brand-hover);
        color: var(--on-brand);
    }

    .step.now .step-dot {
        background: var(--on-brand);
        color: var(--brand);
    }

.step-line {
    width: 18px;
    height: 1px;
    background: var(--line-strong);
    flex: none;
}

.steps .push .btn {
    margin-left: var(--s3);
}

/* ═══ PROCESS STEPS ═══════════════════════════════════════════
   The five-step job order. The strip is a real control: every step
   is clickable, completed ones are ticked, and the current one is
   filled. Replaces fourteen tabs and one Save button.
   ═══════════════════════════════════════════════════════════════ */
.steppanel {
    display: none;
}

    .steppanel.on {
        display: block;
    }

.step[data-step] {
    cursor: pointer;
}

/* Reference rail — things you consult, never fill in */
.ref-head {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s3) var(--s4);
    border-bottom: 1px solid var(--line);
    font-size: var(--t-caption);
    font-weight: var(--w-semi);
    color: var(--text-secondary);
}

/* Key-value strip used inside reference cards */
.kv {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--s3);
    padding: var(--s2) var(--s4);
    font-size: var(--t-caption);
    border-bottom: 1px solid var(--line);
}

    .kv:last-child {
        border-bottom: none;
    }

    .kv span {
        color: var(--text-tertiary);
    }

    .kv b {
        font-weight: var(--w-medium);
        text-align: right;
    }

/* A sub-section inside a step — battery pack, charger, and so on */
.subgroup {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-top: var(--s4);
}

.subgroup-head {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s4);
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--line);
    font-size: var(--t-caption);
    font-weight: var(--w-semi);
    color: var(--text-secondary);
}

.subgroup-body {
    padding: var(--s4);
}

    .subgroup-body.flush {
        padding: 0;
    }

/* Search-first block at the top of step one */
.finder {
    display: flex;
    gap: var(--s2);
    align-items: flex-end;
    flex-wrap: wrap;
}

    .finder .field {
        flex: 1;
        min-width: 200px;
    }

    .finder .field.narrow {
        flex: 0 0 200px;
    }

/* A gate that must be cleared before the step can be left */
.gate {
    display: flex;
    gap: var(--s3);
    align-items: flex-start;
    padding: var(--s4);
    border-radius: var(--r-md);
    background: var(--danger-container);
    color: var(--on-danger-container);
    margin-bottom: var(--s4);
}

    .gate .i {
        flex: none;
        margin-top: 2px;
    }

    .gate b {
        display: block;
        font-size: var(--t-control);
        font-weight: var(--w-semi);
    }

    .gate p {
        font-size: var(--t-caption);
        line-height: 1.5;
        margin-top: 2px;
    }

    .gate .btn {
        flex: none;
        align-self: center;
    }

/* ═══════════════════════════════════════════════════════════════════
   ASP.NET WEBFORMS ADJUSTMENTS
   The server renders a few things we don't control. These rules make
   them match the rest of the design without touching any codebehind.
   ═══════════════════════════════════════════════════════════════════ */

/* asp:Wizard renders nested tables. Flatten them. */
.wizard,
.wizard > table,
.wizard > table > tbody,
.wizard > table > tbody > tr,
.wizard > table > tbody > tr > td {
    display: block !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    padding: 0 !important;
    background: none !important;
    vertical-align: top;
}

/* The sidebar DataList renders as a flow of spans — lay them out as the strip */
.wizard .steps {
    flex-wrap: wrap;
}

.wizard .step-cell {
    display: inline-flex;
    align-items: center;
}

    .wizard .step-cell + .step-cell::before {
        content: "";
        width: 18px;
        height: 1px;
        background: var(--line-strong);
        flex: none;
    }

/* A sidebar button for a step already passed, and the current one */
.wizard .steps .step {
    border: none;
    background: none;
    text-decoration: none;
}

.wizard .steps a.step {
    cursor: pointer;
}

/* RequiredFieldValidator / CompareValidator messages */
.field .error,
span[data-validator-for] > span {
    display: block;
    font-size: var(--t-micro);
    color: var(--danger);
    margin-top: 2px;
}

.field .error {
    display: none;
}

.field.invalid .error {
    display: block;
}

/* asp:Label used as a status message */
.caption.strong:empty {
    display: none;
}

/* asp:Label rendered as a banner — hide it when the server left it blank */
.banner:empty {
    display: none;
}

/* A TextBox inside .input-wrap is still .input, so nothing else is needed,
   but ASP.NET adds its own inline width on some controls. */
.input-wrap .input[style*="width"] {
    width: 100% !important;
}

/* Toast colours for the codebehind message shims */
.toast-ok .i {
    color: var(--ok);
}

.toast-error .i {
    color: var(--danger);
}

.toast-warning .i {
    color: var(--warn);
}

.toast-info .i {
    color: var(--info);
}

.toast {
    max-width: min(520px, calc(100vw - 32px));
    white-space: normal;
    text-align: left;
}

/* ═══ BROWSER NOTICE ══════════════════════════════════════════
   Deliberately written with no custom properties, no flexbox and no
   grid — the whole point is that it has to render in the browser that
   cannot render anything else on the page.
   ═══════════════════════════════════════════════════════════════ */
.browser-notice {
    position: relative;
    z-index: 9999;
    background: #7A4507;
    color: #FFFFFF;
    padding: 10px 44px 10px 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

    .browser-notice .bn-icon {
        display: inline-block;
        width: 18px;
        height: 18px;
        line-height: 18px;
        text-align: center;
        background: #FFFFFF;
        color: #7A4507;
        font-weight: bold;
        margin-right: 8px;
        vertical-align: middle;
    }

    .browser-notice .bn-text {
        vertical-align: middle;
    }

    .browser-notice .bn-links {
        margin-left: 10px;
        vertical-align: middle;
    }

        .browser-notice .bn-links a {
            color: #FFFFFF;
            text-decoration: underline;
            margin-right: 12px;
            white-space: nowrap;
        }

    .browser-notice .bn-close {
        position: absolute;
        top: 6px;
        right: 10px;
        background: none;
        border: 0;
        color: #FFFFFF;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }


/* ═══ NESTED FLYOUT ═══════════════════════════════════════════
   A sub-menu is a .flyout inside a .fly-item, and .fly-item is a flex
   row. The flyout is position:fixed so it is out of flow, but these
   rules stop it inheriting the row's sizing or being clipped, and keep
   the parent row highlighted while the child is open.
   ═══════════════════════════════════════════════════════════════ */
.fly-item > .flyout {
    flex: none;
    text-align: left;
    font-weight: var(--w-normal);
    cursor: default;
}

.fly-item.has-child {
    overflow: visible;
}

/* the row you came in through stays lit while its sub-menu is open */
.fly-item.has-child:has(> .flyout.open) {
    background: var(--surface-hover);
    color: var(--text);
}

    .fly-item.has-child:has(> .flyout.open) > .i {
        color: var(--brand);
    }

/* the arrow turns to show which way the menu went */
.fly-item.has-child > .chev {
    transition: transform var(--dur) var(--ease);
}

.fly-item.has-child:has(> .flyout.open) > .chev {
    color: var(--brand);
}












































/* ═══════════════════════════════════════════════════════════════
   DMS CONNECT · AUTH REFINEMENT
   ═══════════════════════════════════════════════════════════════ */

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
}

/* Full viewport auth page */
.auth {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   LEFT PANEL
   ───────────────────────────────────────────────────────────── */

.auth-panel {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px clamp(32px, 8vw, 120px);
    background: var(--surface);
    overflow: hidden;
}

.auth-inner {
    width: 100%;
    max-width: 432px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────
   BRAND
   ───────────────────────────────────────────────────────────── */

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand-logo {
    width: 70px;
    height: 42px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.brand-box {
    margin-bottom: var(--s10);
    border: 1px solid #e4e6ff;
    background: #f6faff;
    padding: 10px 20px;
    border-radius: 14px;
}
.auth-brand-name {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #154587;
}

.auth-brand-subtitle {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────────────────────
   THEME CONTROLS
   ───────────────────────────────────────────────────────────── */

.auth-theme-controls {
    position: absolute;
    top: 28px;
    right: 28px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.theme-btn {
    width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

    .theme-btn:hover {
        background: var(--surface-hover);
        color: var(--text);
    }

    .theme-btn.active,
    .theme-btn[aria-pressed="true"] {
        background: var(--surface);
        color: var(--brand);
        box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    }

    .theme-btn .i {
        font-size: 18px;
    }

/* ─────────────────────────────────────────────────────────────
   DARK MODE — make the page feel deliberate, not inverted
   ───────────────────────────────────────────────────────────── */

html[data-theme="dark"] .auth-panel {
    background: radial-gradient( circle at 15% 20%, rgba(147, 160, 245, .055), transparent 32% ), var(--surface);
}

html[data-theme="dark"] .auth-theme-controls {
    background: #101317;
    border-color: #2B3038;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .theme-btn.active,
html[data-theme="dark"] .theme-btn[aria-pressed="true"] {
    background: #252A33;
    color: #A8B3F8;
}

/* ─────────────────────────────────────────────────────────────
   LOGIN HEADER
   ───────────────────────────────────────────────────────────── */

.auth-title {
    margin: 0;
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text);
}

.auth-subtitle {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────────────────
   REMEMBER / FORGOT ROW
   ───────────────────────────────────────────────────────────── */

.auth-options {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

    .auth-remember input {
        width: 14px;
        height: 14px;
        margin: 0;
        accent-color: var(--brand);
        flex: 0 0 auto;
    }

.auth-forgot {
    flex: 0 0 auto;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s ease;
}

    .auth-forgot:hover {
        color: var(--brand-hover);
        text-decoration: underline;
    }

/* ─────────────────────────────────────────────────────────────
   HIDE GOOGLE / OR
   ───────────────────────────────────────────────────────────── */

.auth-google,
.auth-divider,
.auth-social,
.auth-or {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */

.auth-foot {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────
   RIGHT PANEL
   ───────────────────────────────────────────────────────────── */

.auth-aside {
    min-height: 100vh;
    padding: clamp(48px, 8vw, 120px);
    background: var(--brand);
    color: var(--on-brand);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

html[data-theme="dark"] .auth-aside {
    background: linear-gradient( 145deg, #4C5AD1 0%, #3B48B5 100% );
    color: #FFFFFF;
}

.auth-aside h2 {
    max-width: 700px;
    font-size: clamp(30px, 3.1vw, 44px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.auth-aside p {
    max-width: 600px;
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.55;
    opacity: .84;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE
   ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {

    .auth {
        min-height: 100vh;
        height: auto;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 32px 24px;
    }

    .auth-aside {
        display: none;
    }

    .auth-theme-controls {
        top: 20px;
        right: 20px;
    }

  /*  .auth-brand {
        margin-bottom: 42px;
    }*/

    .auth-inner {
        max-width: 440px;
    }
}

@media (max-width: 480px) {

    .auth-panel {
        padding: 24px 20px;
    }

   /* .auth-brand {
        margin-bottom: 36px;
    }
*/
    .auth-options {
        gap: 12px;
    }

    .auth-remember,
    .auth-forgot {
        font-size: 12.5px;
    }
}



/* ═══════════════════════════════════════════════════════════════
   AUTH THEME SWITCHER
   Existing markup/classes/JS preserved
   ═══════════════════════════════════════════════════════════════ */

.auth-panel > .push.segment,
.auth-panel .push.segment {
    position: absolute;
    top: 28px;
    right: 28px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(16, 20, 27, .06);
    z-index: 10;
}

    /* Existing .seg buttons */
    .auth-panel .push.segment .seg {
        width: 34px;
        height: 32px;
        display: grid;
        place-items: center;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: var(--text-tertiary);
        cursor: pointer;
        transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    }

        /* Hover */
        .auth-panel .push.segment .seg:hover {
            background: var(--surface-hover);
            color: var(--text);
        }

        /* Existing JS already applies .on */
        .auth-panel .push.segment .seg.on {
            background: var(--surface);
            color: var(--brand);
            box-shadow: 0 1px 3px rgba(16, 20, 27, .10);
        }

        /* Icon */
        .auth-panel .push.segment .seg .i {
            font-size: 18px;
            line-height: 1;
        }

        /* Keyboard focus */
        .auth-panel .push.segment .seg:focus-visible {
            outline: 2px solid var(--brand);
            outline-offset: 1px;
        }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

html[data-theme="dark"] .auth-panel .push.segment {
    background: #101317;
    border-color: #2B3038;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
}

    html[data-theme="dark"] .auth-panel .push.segment .seg {
        color: #858D99;
    }

        html[data-theme="dark"] .auth-panel .push.segment .seg:hover {
            background: #1C2027;
            color: #E3E7ED;
        }

        html[data-theme="dark"] .auth-panel .push.segment .seg.on {
            background: #292F38;
            color: #A8B3F8;
            box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
        }
html[data-theme="dark"] .brand-box {
    background: #959ff1;
}
/* ═══════════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .auth-panel .push.segment {
        top: 20px;
        right: 20px;
    }
}

.auth-brand-name span {
    background: #154587;
    padding: 1px 5px;
    border-radius: 5px;
    color: white;
    font-weight: 300;
    font-size: 14px;
    margin-left: 2px;
}