/* ============================================================
   NORTHSTAR COMMAND — SHARED DESIGN SYSTEM
   Flat / data-dense console: neutral stone chrome, color reserved for
   status · alerts · graphs · charts · maps. Light + dark parity.
   Easy on the eyes for long shifts — no lavender / purple / blue chrome.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Visual accounting dashboard (nscc-acct-dashboard.js) ── */
.nscc-dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--nscc-gap, 0.4rem); margin: 0 0 var(--nscc-pad-md, 0.5rem); }
.nscc-dash-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: var(--nscc-pad-sm, 0.35rem) var(--nscc-pad-md, 0.5rem); border: 2px solid #000000; border-radius: 8px; background: var(--bg-card); cursor: pointer; text-align: left; font: inherit; color: var(--text-primary); transition: transform var(--dur-fast, 70ms) var(--ease-out, ease), box-shadow var(--dur-fast, 70ms); box-shadow: 2px 2px 0 #000000; }
.nscc-dash-kpi:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 #000000; }
.nscc-dash-kpi:active { transform: translateY(0); }
.nscc-dash-kpi--warn { border-color: #000000; }
.nscc-dash-kpi--positive .nscc-dash-kpi__value { color: #15803d; }
.nscc-dash-kpi--negative .nscc-dash-kpi__value { color: #b91c1c; }
.nscc-dash-kpi__label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.nscc-dash-kpi__value { font-size: 1.25rem; font-weight: 900; line-height: 1.15; }
.nscc-dash-kpi__sub { font-size: 0.66rem; color: var(--text-muted); }
.nscc-dash-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--nscc-gap, 0.4rem); margin-bottom: var(--nscc-pad-md, 0.5rem); }
.nscc-dash-chart-card { border: 2px solid #000000; border-radius: 8px; padding: var(--nscc-pad-sm, 0.35rem) var(--nscc-pad-md, 0.5rem); background: var(--bg-card); box-shadow: 2px 2px 0 #000000; }
.nscc-dash-chart-card__title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0; }
.nscc-dash-chart-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}
.nscc-dash-chart-card__body { min-width: 0; }
.nscc-chart-view-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 2px solid #000000;
    border-radius: 6px;
    background: var(--btn-surface, #d4d4d8);
    color: var(--btn-surface-ink, #0f172a);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}
.nscc-chart-view-btn:hover,
.nscc-chart-view-btn:focus-visible {
    background: var(--btn-surface-hover, #a1a1aa);
    outline: none;
}
:root.dark .nscc-chart-view-btn,
body.dark-theme .nscc-chart-view-btn {
    background: var(--btn-surface, #0c0c0b);
    color: var(--btn-surface-ink, #f8fafc);
    border-color: #ffffff;
}
.exec-chart-card.nscc-dash-chart-card .nscc-dash-chart-card__title,
.exec-chart-card .nscc-dash-chart-card__title {
    margin: 0;
}
.nscc-dash-chart-svg { width: 100%; height: auto; display: block; }
.nscc-dash-chart-label { font-size: 8px; fill: var(--text-muted, #64748b); font-family: monospace; }
.nscc-dash-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.66rem; color: var(--text-muted); }
.nscc-dash-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.nscc-dash-swatch { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border); display: inline-block; }
.nscc-dash-aging-bar { display: flex; height: 14px; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-sunken); }
.nscc-dash-aging--current { background: #16a34a; }
.nscc-dash-aging--overdue { background: #dc2626; }
.nscc-dash-aging--paid { background: #64748b; }
.nscc-dash-cust-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 0.5rem; margin: 0.2rem 0; font-size: 0.78rem; }
.nscc-dash-cust-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nscc-dash-cust-bar { height: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sunken); overflow: hidden; }
.nscc-dash-cust-fill { height: 100%; background: var(--brand-light, #3f3f46); border-radius: 8px; }
.nscc-dash-cust-amt { font-weight: 800; font-family: var(--font-mono, monospace); font-size: 0.72rem; }
.nscc-dash-recent-table td.r, .nscc-dash-recent-table th.r { text-align: right; }

/* ── AR line breakdown + toolbar labels (IPS billing) ── */
.nscc-ar-row--has-lines { cursor: pointer; }
.nscc-ar-row--has-lines:hover { background: var(--bg-sunken); }
.nscc-ar-lines-row td { padding: 0 !important; background: var(--bg-raised, #fafafa); }
.nscc-ar-lines-table { margin: 0; border: none; }
.nscc-ar-lines-table thead th { font-size: 0.66rem !important; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: transparent !important; }
.nscc-ar-lines-table tbody td { padding: 0.3rem 0.55rem !important; font-size: 0.74rem !important; }
.nscc-ar-line-meta { display: block; color: var(--text-muted); font-size: 0.7rem; }
.nscc-ar-line-extras { display: block; color: var(--text-muted); font-size: 0.66rem; font-style: italic; }
.nscc-finance-toolbar__label { display: inline-flex; flex-direction: column; gap: 0.15rem; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-finance-toolbar__label input[type="date"] { padding: 0.3rem 0.45rem; border: 2px solid #000000; border-radius: 6px; font-size: 0.8rem; font-weight: 700; }
.nscc-dash-recent-table tbody td { padding: 0.35rem 0.5rem !important; font-size: 0.78rem !important; }

/* ——— Field Payroll panel: pay-basis badges + per-role hour table ——— */
.nscc-fp-badge { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 8px; border: 2px solid #000000; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4; }
.nscc-fp-badge--hourly { background: var(--info-wash, #f4f4f5); color: var(--info-wash-ink, #27272a); }
.nscc-fp-badge--salary { background: var(--info-wash, #f4f4f5); color: var(--info-wash-ink, #27272a); }
.nscc-fp-badge--trips  { background: transparent; color: #92400e; border: 2px solid #f59e0b; }
.nscc-fp-table tbody td { font-size: 0.82rem !important; }
.nscc-fp-table tbody tr:hover { background: var(--bg-raised, #fafafa); }

/* ——— Colour Tokens (light) — cool neutral gray (no pink / peach / cream washes) ——— */
:root {
    /* Surfaces — cool zinc neutrals */
    --bg-page:          #f4f4f5;
    --bg-card:          #ffffff;
    --bg-raised:        #fafafa;
    --bg-sunken:        #e4e4e7;
    --bg-overlay:       #ffffff;
    --bg-atmosphere:    none;
    --bg-grid:          none;
    /* Muted action fill — darker than info/card boxes so buttons do not look like labels */
    --btn-surface:      #d4d4d8;
    --btn-surface-hover:#a1a1aa;
    --btn-surface-ink:  #18181b;

    /* Text */
    --text-primary:     #18181b;
    --text-secondary:   #3f3f46;
    --text-muted:       #71717a;
    --text-inverse:     #fafafa;
    --text-link:        #27272a;

    /* Brand — charcoal (no purple / blue chrome) */
    --brand:            #18181b;
    --brand-light:      #52525b;
    --brand-accent:     #3f3f46;
    --brand-glow:       rgba(24, 24, 27, 0.14);
    --brand-display:    'IBM Plex Sans', 'Segoe UI', sans-serif;

    /* Office chrome — cool tabs (match muted button surface, darker than info cards) */
    --chrome-folder:        var(--btn-surface);
    --chrome-folder-deep:   var(--btn-surface-hover);
    --chrome-folder-ink:    var(--btn-surface-ink);
    --chrome-folder-active: #27272a;
    --chrome-folder-label:  #52525b;
    /* Strip behind folder tabs (under LIVE ticker) — same as left menu rail */
    --chrome-folder-strip-bg:  var(--chrome-folder-panel-bg, var(--bg-page));
    --chrome-folder-panel-bg:  var(--bg-page);
    /* Left-nav / menu selection — cool gray (never pink/peach) */
    --nav-selected-bg:      #e4e4e7;
    --nav-selected-ink:     #18181b;
    --nav-selected-bar:     #27272a;
    /* Folder tabs: every button is 2-line tall; strip reserves 2 rows */
    --nscc-folder-tab-h:    2.55rem;
    --nscc-folder-strip-h:  calc((2 * var(--nscc-folder-tab-h)) + 0.4rem);

    /* Primary action / schedule CTAs — charcoal (frost-* kept for CSS compat) */
    --frost-blue:       #3f3f46;
    --frost-blue-hover: #292524;
    --frost-blue-deep:  #1c1917;
    --frost-blue-glow:  rgba(28, 25, 23, 0.18);

    /* Trip lifecycle — KEEP (status / alerts / maps / charts only)
       UNASSIGNED #FF3B30 · PENDING #FF9500 · EN-ROUTE #5856D6 · PICKUP #FFCC00
       IN TRANSIT #007AFF · DELIVERED #34C759 · ASSIGNED #AF52DE */
    --status-unassigned:    #FF3B30;
    --status-unassigned-bg: #FF3B30;
    --status-assigned:      #AF52DE;
    --status-assigned-bg:   #AF52DE;
    --status-secure:        #34C759;
    --status-secure-bg:     #34C759;
    --status-transit:       #007AFF;
    --status-transit-bg:    #007AFF;
    --status-breach:        #FF3B30;
    --status-breach-bg:     #FF3B30;
    --status-pending:       #FF9500;
    --status-pending-bg:    #FF9500;
    --status-scheduled:     #06b6d4;
    --status-scheduled-bg:  #06b6d4;
    --status-enroute:       #5856D6;
    --status-enroute-bg:    #5856D6;
    --status-pickup:        #FFCC00;
    --status-pickup-bg:     #FFCC00;

    /* Alert banner — muted amber (readable, not purple/blue) */
    --alert-banner-bg:      var(--bg-card, #ffffff);
    --alert-banner-fg:      #78350f;
    --alert-banner-border:  #fcd34d;

    /* Soft info / selection washes — zinc only (no baby / powder / sky blue) */
    --info-wash:            #f4f4f5;
    --info-wash-border:     #a1a1aa;
    --info-wash-ink:        #27272a;
    --select-wash:          rgba(24, 24, 27, 0.08);
    --select-glow:          rgba(24, 24, 27, 0.22);

    /* Table / panel surfaces — cool zinc (no slate/sky blue) */
    --bg-elevated:          #fafafa;
    --table-head-bg:        #e4e4e7;
    --table-row-hover:      #f4f4f5;
    --table-row-selected:   #e5e7eb;
    --table-stripe:         #f4f4f5;

    /* Borders — cool zinc hairlines (no warm stone / peach) */
    --border:           #d4d4d8;
    --border-strong:    #a1a1aa;
    --border-focus:     #3f3f46;

    /* Elevation — nearly flat */
    --shadow-xs:        none;
    --shadow-sm:        none;
    --shadow-md:        none;
    --shadow-lg:        none;
    --shadow-glow-brand:0 0 0 2px rgba(28, 25, 23, 0.2);
    --shadow-glow-green:0 0 0 2px rgba(52, 199, 89, 0.28);
    --shadow-glow-amber:0 0 0 2px rgba(255, 149, 0, 0.28);

    /* Radius — tight, console-like (no capsule pills; ticker chips use their own radius) */
    --radius-xs:        2px;
    --radius-sm:        3px;
    --radius-md:        4px;
    --radius-lg:        6px;
    --radius-xl:        8px;
    --radius-full:      8px;

    /* Typography — compact sans for density */
    --font-sans:        'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-mono:        'IBM Plex Mono', 'Cascadia Mono', monospace;

    /* Spacing — tight default rhythm (keep usable hit targets) */
    --space-1:  0.15rem;
    --space-2:  0.3rem;
    --space-3:  0.45rem;
    --space-4:  0.6rem;
    --space-5:  0.8rem;
    --space-6:  1rem;
    --space-8:  1.35rem;
    --space-10: 1.65rem;
    --space-12: 2rem;

    /* Density helpers */
    --dense-row-h:      1.55rem;
    --dense-pad-y:      0.2rem;
    --dense-pad-x:      0.4rem;
    --dense-font:       0.8125rem;
    --dense-font-sm:    0.75rem;

    /* Global layout padding scale */
    --nscc-pad-xs: 0.2rem;
    --nscc-pad-sm: 0.35rem;
    --nscc-pad-md: 0.5rem;
    --nscc-pad-lg: 0.7rem;
    --nscc-gap:    0.4rem;
    --nscc-gap-lg: 0.65rem;

    /* Status / accent outline chips — thick colored border */
    --nscc-status-border-w: 4px;

    /* Docs chrome (library / Support Documentation cards) */
    --docs-ink-border:  #000000;
    --docs-ink-shadow:  #000000;
    --docs-logo-tile:   #ffffff;
    --docs-title:       #18181b;
    --docs-link:        #1d4ed8;
    --docs-code-bg:     #e4e4e7;
    --docs-code-fg:     #18181b;

    /* Transitions */
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:  cubic-bezier(0.2, 0.9, 0.3, 1);
    --dur-instant:  0ms;
    --dur-fast:     70ms;
    --dur-base:     120ms;
    --dur-slow:     200ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ——— Dark Theme — soft charcoal (12-hour shift friendly) ——— */
:root.dark,
body.dark-theme {
    --bg-page:          #141413;
    --bg-card:          #1c1c1b;
    --bg-raised:        #262624;
    --bg-sunken:        #0c0c0b;
    --bg-overlay:       #262624;
    --bg-atmosphere:    none;
    --bg-grid:          none;
    /* Darker than info/card surfaces so muted buttons stay distinct */
    --btn-surface:      #0c0c0b;
    --btn-surface-hover:#050504;
    --btn-surface-ink:  #f5f5f4;

    --text-primary:     #f5f5f4;
    --text-secondary:   #d4d4d8;
    --text-muted:       #a1a1aa;
    --text-inverse:     #141413;
    --text-link:        #e4e4e7;

    --brand:            #0c0c0b;
    --brand-light:      #a1a1aa;
    --brand-accent:     #d4d4d8;
    --brand-glow:       rgba(228, 228, 231, 0.14);

    /* Inactive tabs lighter than page; selected stays mid-zinc (not lightened) */
    --chrome-folder:        #71717a;
    --chrome-folder-deep:   #52525b;
    --chrome-folder-ink:    #fafafa;
    --chrome-folder-active: #3f3f46;
    --chrome-folder-label:  #a1a1aa;
    --chrome-folder-strip-bg:  var(--chrome-folder-panel-bg, var(--bg-page));
    --chrome-folder-panel-bg:  var(--bg-page);
    --nav-selected-bg:      #3f3f46;
    --nav-selected-ink:     #fafafa;
    --nav-selected-bar:     #a1a1aa;

    --frost-blue:       #a1a1aa;
    --frost-blue-hover: #d4d4d8;
    --frost-blue-deep:  #e4e4e7;
    --frost-blue-glow:  rgba(228, 228, 231, 0.16);

    --status-unassigned:    #FF3B30;
    --status-unassigned-bg: #FF3B30;
    --status-assigned:      #AF52DE;
    --status-assigned-bg:   #AF52DE;
    --status-secure:        #34C759;
    --status-secure-bg:     #34C759;
    --status-transit:       #007AFF;
    --status-transit-bg:    #007AFF;
    --status-breach:        #FF3B30;
    --status-breach-bg:     #FF3B30;
    --status-pending:       #FF9500;
    --status-pending-bg:    #FF9500;
    --status-scheduled:     #06b6d4;
    --status-scheduled-bg:  #06b6d4;
    --status-enroute:       #5856D6;
    --status-enroute-bg:    #5856D6;
    --status-pickup:        #FFCC00;
    --status-pickup-bg:     #FFCC00;

    --alert-banner-bg:      #422006;
    --alert-banner-fg:      #fde68a;
    --alert-banner-border:  #a16207;

    --info-wash:            #27272a;
    --info-wash-border:     #52525b;
    --info-wash-ink:        #e4e4e7;
    --select-wash:          rgba(228, 228, 231, 0.1);
    --select-glow:          rgba(228, 228, 231, 0.22);

    --bg-elevated:          #262624;
    --table-head-bg:        #262624;
    --table-row-hover:      #27272a;
    --table-row-selected:   #3f3f46;
    --table-stripe:         #1c1c1b;

    --border:           #3f3f46;
    --border-strong:    #52525b;
    --border-focus:     #a1a1aa;

    --docs-ink-border:  #fafafa;
    --docs-ink-shadow:  #fafafa;
    --docs-logo-tile:   #ffffff;
    --docs-title:       #f5f5f4;
    --docs-link:        #93c5fd;
    --docs-code-bg:     #52525b;
    --docs-code-fg:     #fafafa;

    --shadow-xs:        none;
    --shadow-sm:        none;
    --shadow-md:        none;
    --shadow-lg:        none;
}

/* ============================================================
   BASE RESETS & BODY
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--text-primary);
    background-color: var(--bg-page);
    background-image: none;
    background-attachment: scroll;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--dur-slow) var(--ease-out),
                color var(--dur-slow) var(--ease-out);
}

/* ============================================================
   BUTTON SYSTEM  (unified across all apps)
   ============================================================ */

/* Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.32rem 0.7rem;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,0);
    transition: background var(--dur-fast) var(--ease-out);
}

.btn:hover::after  { background: rgba(255,255,255,0.06); }
.btn:active        { transform: translateY(1px); }
.btn:active::after { background: rgba(0,0,0,0.05); }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow-brand);
}

/* Primary — muted fill (darker than info/card boxes) */
.btn-primary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: 2.5px solid #000000;
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: #000000;
    box-shadow: none;
    transform: translateY(-1px);
}

/* Frost / schedule — outlined accent */
.btn-frost,
.btn-submit-schedule {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
}
.btn-frost:hover:not(:disabled):not([aria-disabled="true"]),
.btn-submit-schedule:hover:not(:disabled):not([aria-disabled="true"]) {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
    transform: translateY(-1px);
}
.btn-frost:disabled,
.btn-frost[aria-disabled="true"],
.btn-submit-schedule:disabled,
.btn-submit-schedule[aria-disabled="true"] {
    opacity: 0.55;
    transform: none;
    box-shadow: none !important;
}

/* Secondary — muted fill */
.btn-secondary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: 2.5px solid #000000;
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: #000000;
    box-shadow: none;
    transform: translateY(-1px);
}

/* Ghost — same muted fill as other gray/black actions */
.btn-ghost {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: 2.5px solid #000000;
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: #000000;
}
:root.dark .btn-ghost,
body.dark-theme .btn-ghost {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border-color: #ffffff;
}
:root.dark .btn-ghost:hover,
body.dark-theme .btn-ghost:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
}

/* Success — outlined green */
.btn-success {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-secure, #16a34a) !important;
    box-shadow: none !important;
}
:root.dark .btn-success,
body.dark-theme .btn-success {
    color: #ffffff !important;
    border-color: var(--status-secure, #22c55e) !important;
}
.btn-success:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Warning — outlined amber */
.btn-warning {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-pending, #d97706) !important;
    box-shadow: none !important;
}
:root.dark .btn-warning,
body.dark-theme .btn-warning {
    color: #ffffff !important;
    border-color: #fbbf24 !important;
}
.btn-warning:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Danger — outlined red */
.btn-danger {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: var(--nscc-status-border-w, 4px) solid var(--status-breach, #dc2626) !important;
    box-shadow: none !important;
}
:root.dark .btn-danger,
body.dark-theme .btn-danger {
    color: #ffffff !important;
    border-color: #f87171 !important;
}
.btn-danger:hover {
    background: transparent !important;
    background-color: transparent !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Outline variant — muted gray fill like other black/gray actions */
.btn-outline-primary {
    background: var(--btn-surface);
    color: var(--btn-surface-ink);
    border: 2.5px solid #000000;
    box-shadow: none;
}
.btn-outline-primary:hover {
    background: var(--btn-surface-hover);
    color: var(--btn-surface-ink);
    border-color: #000000;
}

/* Sizes */
.btn-xs   { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
.btn-sm   { padding: 0.4rem 1rem;    font-size: 0.8125rem; }
.btn-lg   { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-xl   { padding: 1rem 2rem;      font-size: 1.125rem; letter-spacing: 0.02em; }
.btn-block { width: 100%; }

/* Disabled */
.btn:disabled, .btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* Icon-only circular */
.btn-icon {
    padding: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
}
.btn-icon.btn-sm { width: 1.875rem; height: 1.875rem; font-size: 0.875rem; }
.btn-icon.btn-lg { width: 2.75rem;  height: 2.75rem;  font-size: 1.25rem; }

/* ============================================================
   BADGE / STATUS CHIPS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.2em 0.65em;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    background: transparent;
    color: var(--text-primary);
    border: 4px solid #64748b;
    box-shadow: none;
}

.badge-unassigned { background: transparent; color: var(--text-primary); border: 4px solid #FF3B30; }
.badge-assigned   { background: transparent; color: var(--text-primary); border: 4px solid #AF52DE; }
.badge-secure     { background: transparent; color: var(--text-primary); border: 4px solid #34C759; }
.badge-transit    { background: transparent; color: var(--text-primary); border: 4px solid #007AFF; }
.badge-breach     { background: transparent; color: var(--text-primary); border: 4px solid #FF3B30; }
.badge-pending    { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; }
.badge-scheduled  { background: transparent; color: var(--text-primary); border: 4px solid #06b6d4; }
.badge-pickup     { background: transparent; color: var(--text-primary); border: 4px solid #FFCC00; }
.badge-neutral    { background: transparent; color: var(--text-primary); border: 4px solid #64748b; }
.badge-primary    { background: transparent; color: var(--text-primary); border: 4px solid var(--brand-light, #0d9488); }

/* Legacy aliases for backward compat */
.badge.green  { background: transparent; color: var(--text-primary); border: 4px solid #34C759; }
.badge.amber  { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; }

/* Dark mode: outline chips keep light ink (not white-on-fill) */
:root.dark .badge, body.dark-theme .badge,
:root.dark [class*="badge-"], body.dark-theme [class*="badge-"] {
    color: #fafaf9 !important;
    background: transparent !important;
}

/* ============================================================
   CARD BASE
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition:
        box-shadow var(--dur-base) var(--ease-out),
        transform  var(--dur-base) var(--ease-out),
        border-color var(--dur-base) var(--ease-out);
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.card-interactive {
    cursor: pointer;
}
.card-interactive:hover { transform: translateY(-2px); }
.card-interactive:active { transform: translateY(0); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
input[type="search"] {
    display: block;
    width: 100%;
    padding: 0.55rem 0.875rem;
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea {
    display: block;
    width: 100%;
    padding: 0.55rem 0.875rem;
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow-brand);
}
input[type="search"]:focus {
    outline: none;
    border-color: #000000;
    box-shadow: var(--shadow-sm);
}
.input:hover:not(:disabled):not(:focus),
input[type="text"]:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
    background: var(--bg-sunken);
}
input[type="search"]:hover:not(:disabled):not(:focus) {
    background: var(--bg-sunken);
    border-color: #000000;
}
.input::placeholder { color: var(--text-muted); }

/* ============================================================
   DROPDOWN / SELECT SYSTEM
   ============================================================ */
:root {
    --nscc-select-height: 32px;
    --nscc-select-padding-x: 0.4rem;
    --nscc-select-padding-y: 0.2rem;
    --nscc-select-font-size: 0.8125rem;
    --nscc-select-radius: var(--radius-sm);
    --nscc-select-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6573' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --nscc-select-chevron-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b0bc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --nscc-select-chevron: var(--nscc-select-chevron-light);
}

:root.dark,
body.dark-theme {
    --nscc-select-chevron: var(--nscc-select-chevron-dark);
}

select,
.nscc-select,
.form-select,
.nscc-form-select,
.nscc-support-select,
.select-control,
.form-control-panel,
.filter-select {
    display: block;
    width: 100%;
    min-height: var(--nscc-select-height);
    height: auto;
    padding: var(--nscc-select-padding-y) calc(var(--nscc-select-padding-x) + 1.1rem) var(--nscc-select-padding-y) var(--nscc-select-padding-x);
    background-color: var(--bg-card);
    background-image: var(--nscc-select-chevron);
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 0.75rem;
    border: 2px solid #000000;
    border-radius: var(--nscc-select-radius);
    box-shadow: none;
    font-family: var(--font-sans);
    font-size: var(--nscc-select-font-size);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    color-scheme: light;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    transition: background-color 60ms linear;
}

:root.dark select,
:root.dark .nscc-select,
:root.dark .form-select,
:root.dark .nscc-form-select,
:root.dark .nscc-support-select,
:root.dark .select-control,
:root.dark .form-control-panel,
:root.dark .filter-select,
body.dark-theme select,
body.dark-theme .nscc-select,
body.dark-theme .form-select,
body.dark-theme .nscc-form-select,
body.dark-theme .nscc-support-select,
body.dark-theme .select-control,
body.dark-theme .form-control-panel,
body.dark-theme .filter-select {
    border-color: #ffffff;
    color-scheme: dark;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

select:active,
select:focus,
.nscc-select:active,
.nscc-select:focus,
.form-select:active,
.form-select:focus,
.filter-select:active,
.filter-select:focus {
    transform: none;
}

select:hover:not(:disabled),
.nscc-select:hover:not(:disabled),
.form-select:hover:not(:disabled),
.nscc-form-select:hover:not(:disabled),
.nscc-support-select:hover:not(:disabled),
.select-control:hover:not(:disabled),
.filter-select:hover:not(:disabled) {
    background-color: var(--bg-raised);
    box-shadow: none;
    border-color: #000000;
}

:root.dark select:hover:not(:disabled),
body.dark-theme select:hover:not(:disabled),
:root.dark .nscc-select:hover:not(:disabled),
body.dark-theme .nscc-select:hover:not(:disabled),
:root.dark .form-select:hover:not(:disabled),
body.dark-theme .form-select:hover:not(:disabled),
:root.dark .nscc-form-select:hover:not(:disabled),
body.dark-theme .nscc-form-select:hover:not(:disabled),
:root.dark .select-control:hover:not(:disabled),
body.dark-theme .select-control:hover:not(:disabled),
:root.dark .filter-select:hover:not(:disabled),
body.dark-theme .filter-select:hover:not(:disabled) {
    border-color: #ffffff;
}

input.form-control-panel:hover:not(:disabled),
textarea.form-control-panel:hover:not(:disabled) {
    background-color: var(--bg-sunken);
    box-shadow: none;
}

select:focus,
.nscc-select:focus,
.form-select:focus,
.nscc-form-select:focus,
.nscc-support-select:focus,
.select-control:focus,
.form-control-panel:focus,
.filter-select:focus,
select:active,
select:open,
.nscc-select:active,
.nscc-select:open,
.form-select:active,
.form-select:open,
.nscc-form-select:active,
.nscc-form-select:open,
.select-inline--ghost:focus,
.select-inline--ghost:active,
.select-inline--ghost:open,
.select-compact:focus,
.select-compact:active,
.select-compact:open {
    outline: none;
    border: 2px solid #000000 !important;
    box-shadow: none;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

:root.dark select:focus,
:root.dark select:active,
:root.dark select:open,
body.dark-theme select:focus,
body.dark-theme select:active,
body.dark-theme select:open,
:root.dark .nscc-select:focus,
:root.dark .nscc-form-select:focus,
:root.dark .select-control:focus,
:root.dark .filter-select:focus,
body.dark-theme .nscc-select:focus,
body.dark-theme .nscc-form-select:focus,
body.dark-theme .select-control:focus,
body.dark-theme .filter-select:focus {
    border-color: #ffffff !important;
}

select:disabled,
.nscc-select:disabled,
.form-select:disabled,
.select-control:disabled,
.form-control-panel:disabled,
.filter-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    box-shadow: none;
}

select option,
.form-select option,
.nscc-form-select option,
.nscc-support-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
}

/* Panel selects ΓÇö card surface (Reports, Batch, Planner, Support); not sunken gray */
select.form-control-panel,
select.select-control,
.nscc-form-select,
.nscc-support-select {
    background-color: var(--bg-card);
    -webkit-text-fill-color: var(--text-primary);
    opacity: 1;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Sunken background variant ΓÇö text inputs only (forms, modals, batch tools) */
input.form-control-panel,
textarea.form-control-panel {
    background-color: var(--bg-sunken);
    border: 2px solid #000000;
}

/* Compact toolbar / planner week pickers */
select.nscc-form-select--compact,
select.form-control-panel.nscc-form-select--compact {
    min-height: 32px;
    padding: 0.35rem calc(0.5rem + 1.1rem) 0.35rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

/* Compact map / toolbar filters */
.filter-select {
    width: auto;
    font-size: 0.8125rem;
    font-weight: 700;
}

.filter-select--compact {
    min-height: 30px;
    height: auto;
    padding: 0.25rem 1.75rem 0.25rem 0.5rem !important;
    line-height: 1.35;
    font-size: 0.75rem;
}

.filter-select--wide { width: 100%; }

/* Pill-shaped toolbar filters (card view, ops toolbar) */
.select-toolbar {
    width: auto;
    min-height: 32px;
    height: auto;
    padding: 0.4rem 1.75rem 0.4rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.select-toolbar--branch { max-width: 220px; }

/* Dispatch table inline selects */
.select-inline {
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 0.2rem 1.25rem 0.28rem 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.35;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
}

.select-inline--dispatch {
    font-size: 11pt;
    font-weight: 700;
    padding: 0.15rem 1.25rem 0.22rem 0.25rem;
    line-height: 1.35;
}

.select-inline--dispatch.select-inline--ghost {
    font-size: 11pt;
    padding-right: 1.1rem;
}

.select-inline--ghost {
    background-color: transparent;
    background-image: var(--nscc-select-chevron);
    border: 2px solid #000000;
    box-shadow: none;
    padding-left: 0.2rem;
    padding-right: 1.1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--font-mono);
    min-height: auto;
    height: auto;
}

.select-inline--ghost:hover:not(:disabled) {
    background-color: var(--bg-sunken);
    box-shadow: none;
    border: 2px solid #000000;
}

.select-inline--ghost:focus,
.select-inline--ghost:active,
.select-inline--ghost:open {
    background-color: var(--bg-sunken);
    box-shadow: none;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-xs);
}

:root.dark .select-inline--ghost,
body.dark-theme .select-inline--ghost {
    border-color: #ffffff;
}

:root.dark .select-inline--ghost:hover:not(:disabled),
:root.dark .select-inline--ghost:focus,
:root.dark .select-inline--ghost:active,
:root.dark .select-inline--ghost:open,
body.dark-theme .select-inline--ghost:hover:not(:disabled),
body.dark-theme .select-inline--ghost:focus,
body.dark-theme .select-inline--ghost:active,
body.dark-theme .select-inline--ghost:open {
    border-color: #ffffff !important;
}

/* Gantt / timeline compact selects */
.select-compact {
    min-height: auto;
    height: auto;
    padding: 0.2rem 1.1rem 0.28rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    border-radius: var(--radius-xs);
    background-color: var(--bg-sunken);
    box-shadow: none;
}

.select-compact--flex { flex: 1; min-width: 0; }
.select-compact--block { width: 100%; margin-bottom: 6px; }

.select-compact:hover:not(:disabled) {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-md);
}

/* Primary dispatch table filter row */
.select-filter-row {
    flex: 1 1 auto;
    max-width: 140px;
    min-height: auto;
    height: auto;
    padding: 0.25rem 1.25rem 0.3rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    border-radius: var(--radius-xs);
}

.nscc-location-combobox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    max-width: 140px;
    min-width: 0;
    padding: 0;
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
}

:root.dark .nscc-location-combobox,
body.dark-theme .nscc-location-combobox {
    border-color: #ffffff;
}

.nscc-location-combobox.select-filter-row {
    min-height: auto;
    height: auto;
}

.nscc-location-combobox__trigger {
    width: 100%;
    min-height: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    padding: 0.25rem 0.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.nscc-location-combobox__trigger.has-value {
    color: var(--text-primary);
}

.nscc-location-combobox__trigger:hover,
.nscc-location-combobox__trigger:focus {
    color: var(--text-primary);
    outline: none;
}

.nscc-location-combobox__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 120;
    min-width: 220px;
    width: max-content;
    max-width: min(320px, 85vw);
    padding: 0.35rem;
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    color: var(--text-primary);
}

:root.dark .nscc-location-combobox__panel,
body.dark-theme .nscc-location-combobox__panel {
    border-color: #ffffff;
}

.nscc-location-combobox__search {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.3rem;
    padding: 0.25rem 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-xs);
    outline: none;
}

:root.dark .nscc-location-combobox__search,
body.dark-theme .nscc-location-combobox__search {
    border-color: #ffffff;
}

.nscc-location-combobox__search:focus {
    border-color: #000000;
}

:root.dark .nscc-location-combobox__search:focus,
body.dark-theme .nscc-location-combobox__search:focus {
    border-color: #ffffff;
}

.nscc-location-combobox__menu {
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nscc-location-combobox__option {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nscc-location-combobox__option:hover,
.nscc-location-combobox__option.is-active {
    background: rgba(88, 86, 214, 0.14);
    color: var(--text-primary);
}

.nscc-location-combobox__empty {
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

.nscc-location-combobox.is-open {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow-brand);
}

.nscc-location-combobox:hover {
    background-color: var(--bg-raised);
    box-shadow: 3px 3px 0 var(--border);
}

/* Pulse / analytics monospace selects */
.select-pulse {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    padding: 0.375rem 1.75rem 0.375rem 0.5rem;
    border-radius: var(--radius-xs);
}

/* Chart metric micro-select */
.select-chart-metric {
    min-height: auto;
    height: auto;
    padding: 0.05rem 1rem 0.05rem 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.47rem;
    font-weight: 800;
    border-radius: 2px;
    background-color: var(--bg-sunken);
    box-shadow: none;
}

/* Form switcher inside bordered header bar (mobile apps) */
.form-switcher {
    flex: 1;
    width: auto;
    min-height: auto;
    height: auto;
    padding: 0;
    padding-right: 1rem;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0;
}

.form-switcher:hover,
.form-switcher:focus {
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Custom nav dropdown panel */
.nav-dropdown-content {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-dropdown-content .nav-btn {
    color: var(--text-secondary);
}

.nav-dropdown-content .nav-btn:hover {
    background: var(--bg-sunken) !important;
    color: var(--text-primary) !important;
}

.nav-dropdown-content .nav-btn.active {
    background: var(--brand-light) !important;
    color: var(--text-inverse) !important;
    border: 2px solid var(--border) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--bg-sunken);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    transition: background var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}
.slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base);
}
input:checked + .slider {
    background: var(--brand-light);
    border-color: #000000;
    box-shadow: 0 0 0 3px var(--brand-glow);
}
input:checked + .slider::before {
    transform: translateX(22px);
    background: #fff;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.35);
    overflow: auto;
}
.modal.open { display: flex; align-items: center; justify-content: center; padding: 1rem; overscroll-behavior: contain; }
.modal .nscc-scroll-edges { display: none !important; }
.modal.open > .nscc-scroll-shell { display: contents; }
.modal-content {
    background: var(--bg-page, #f4f4f5);
    border: 4px solid #000000;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-5);
    width: min(100%, 440px);
    max-width: 440px;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    animation: modalIn var(--dur-base) var(--ease-out);
    position: relative;
    margin: 0;
    will-change: opacity, transform;
    color: var(--text-primary);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: var(--space-6);
    padding: 0.55rem 0.85rem;
    background: var(--bg-card, #ffffff);
    border: 2px solid #000000;
    border-radius: 8px;
    box-sizing: border-box;
}
.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    text-transform: none;
}

.close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem; height: 2rem;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-sunken);
    color: var(--text-secondary);
    font-size: 1.125rem;
    cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
    line-height: 1;
}
.close-btn:hover { background: var(--bg-sunken); color: var(--text-primary); }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
}
.setting-row:first-of-type { border-top: none; }

/* ============================================================
   TOPBAR (Mobile Apps)
   ============================================================ */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1rem 0.625rem;
    padding-top: max(0.875rem, env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10000 !important;
    box-shadow: var(--shadow-xs);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
}

.brand-star {
    font-size: 1.375rem;
    color: var(--text-primary);
    filter: drop-shadow(0 0 6px var(--brand-glow));
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; overflow: hidden; }
.brand-name {
    font-size: 0.95rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-unit {
    font-size: 0.6rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 58%;
    overflow: hidden;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
    overflow: hidden;
}

.topbar .user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.topbar .user-name {
    font-size: 0.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.topbar .user-role {
    font-size: 0.58rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.topbar-user > :last-child { flex-shrink: 0; }

/* Base (non-topbar) ΓÇö kept for any legacy field-app usage */
.user-info { display: flex; flex-direction: column; text-align: right; }
.user-name  { font-size: 0.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.user-role  { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Keep topbar clear of demo phone notch / Dynamic Island overlays */
html.nscc-demo-phone-viewport .topbar,
html.nscc-in-phone-frame .topbar {
    padding-top: 2.85rem;
}

.avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border-strong);
}

/* ============================================================
   BOTTOM NAVIGATION (Mobile Apps)
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 10000 !important;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 max(1.25rem, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(13,27,42,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-md);
    transition: color var(--dur-fast), background var(--dur-fast);
    user-select: none;
}

.nav-item .nav-icon {
    font-size: 1.35rem;
    transition: transform var(--dur-fast) var(--ease-spring);
}

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

.nav-item.active {
    color: var(--text-primary);
}
.nav-item.active .nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px var(--brand-glow));
}

/* ============================================================
   STATUS INDICATOR (Pulse Dot)
   ============================================================ */
.pulse-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: var(--radius-full);
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    animation: pulse 2.5s infinite;
    opacity: 0.5;
}
.pulse-dot.green { background: var(--status-secure); }
.pulse-dot.green::after { background: var(--status-secure); box-shadow: 0 0 0 3px var(--status-secure); }
.pulse-dot.amber { background: var(--status-pending); }
.pulse-dot.amber::after { background: var(--status-pending); box-shadow: 0 0 0 3px var(--status-pending); }
.pulse-dot.blue { background: var(--status-transit); }
.pulse-dot.blue::after { background: var(--status-transit); box-shadow: 0 0 0 3px var(--status-transit); }
.pulse-dot.red { background: var(--status-breach); }
.pulse-dot.red::after { background: var(--status-breach); box-shadow: 0 0 0 3px var(--status-breach); }
.pulse-dot.purple { background: var(--status-unassigned); }
.pulse-dot.purple::after { background: var(--status-unassigned); box-shadow: 0 0 0 3px var(--status-unassigned); }

@keyframes pulse {
    0%   { opacity: 0.6; transform: scale(1); }
    50%  { opacity: 0;   transform: scale(2); }
    100% { opacity: 0;   transform: scale(2); }
}

/* ============================================================
   VIEWS / ANIMATIONS
   ============================================================ */
.view { display: none; }
.view.active { display: block; animation: fadeSlideIn var(--dur-fast) var(--ease-out); }

@keyframes fadeSlideIn {
    from { opacity: 0.85; }
    to   { opacity: 1; }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================/* --- LAYOUT UTILS & OVERFLOW FIXES --- */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-wrap { flex-wrap: wrap; }
.card { overflow: hidden; display: flex; flex-direction: column; }
.btn { white-space: nowrap; flex-shrink: 0; }

input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="hidden"]) {
    height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 1200px) {
    .kanban-board { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.text-mono     { font-family: var(--font-mono); }
.text-brand { color: var(--text-primary); }
.text-secure { color: var(--text-primary); }
.text-transit  { color: var(--status-transit); }
.text-breach   { color: var(--status-breach); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-upper    { text-transform: uppercase; letter-spacing: 0.06em; }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.font-bold     { font-weight: 700; }
.font-black    { font-weight: 800; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: 0.5rem; }
.gap-4         { gap: 1rem; }
.w-full        { width: 100%; }
.mt-auto       { margin-top: auto; }
/* ============================================================
   BRANDING & LOGO UTILS
   ============================================================ */
.sidebar-brand-star img,
.brand-star img,
.topbar-brand img,
.sim-label img {
    object-fit: contain;
    filter: brightness(0); /* Force absolute black in light mode */
    transition: filter var(--dur-base);
}

.dark .sidebar-brand-star img,
.dark-theme .sidebar-brand-star img,
.dark .brand-star img,
.dark-theme .brand-star img,
.dark .topbar-brand img,
.dark-theme .topbar-brand img,
.dark .sim-label img {
    filter: brightness(0) invert(1); /* Absolute white in dark mode */
}

/* ============================================================
   CONNECTIVITY BANNER (Store & Forward)
   ============================================================ */
.connectivity-banner {
    background: transparent;
    color: #000000;
    -webkit-text-fill-color: #000000;
    padding: var(--space-2) var(--space-4);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    z-index: 9999;
    position: relative;
    border: 4px solid #FF3B30;
    box-shadow: none;
    transition: all var(--dur-normal, 0.3s) ease;
}
.connectivity-banner.hidden {
    display: none;
}
.connectivity-banner.minimized {
    position: fixed;
    top: 0;
    right: var(--space-4);
    left: auto;
    width: auto;
    max-width: calc(100vw - var(--space-8));
    padding: var(--space-2) var(--space-3);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}
.connectivity-banner.minimized .banner-text,
.connectivity-banner.minimized .banner-icon {
    display: none;
}
.connectivity-banner:not(.minimized) .banner-pill-label {
    display: none;
}
.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    position: relative;
}
.connectivity-banner:not(.minimized) .banner-content {
    padding-right: 2rem;
}
.banner-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.banner-pill-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.banner-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-inverse, #ffffff);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background var(--dur-fast, 0.15s) ease;
}
.connectivity-banner:not(.minimized) .banner-toggle-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.banner-toggle-btn:hover,
.banner-toggle-btn:focus-visible {
    background: rgba(255, 255, 255, 0.35);
    outline: none;
}

/* Compact sync badge ΓÇö queued / syncing / synced / offline */
.nscc-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 26px;
    padding: 0 0.65rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color var(--dur-fast, 70ms), border-color var(--dur-fast, 70ms);
}
.nscc-sync-badge:hover {
    background: var(--bg-raised);
}
.nscc-sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nscc-sync-color, #34C759);
    flex-shrink: 0;
}
.nscc-sync-badge[data-state="syncing"] .nscc-sync-dot {
    animation: nscc-sync-pulse 1s ease-in-out infinite;
}
.nscc-sync-badge[data-state="queued"] .nscc-sync-dot,
.nscc-sync-badge[data-state="offline"] .nscc-sync-dot {
    animation: nscc-sync-pulse 1.4s ease-in-out infinite;
}
@keyframes nscc-sync-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}
@media (max-width: 640px) {
    .nscc-sync-label { max-width: 4.5rem; overflow: hidden; text-overflow: ellipsis; }
}


/* ========================================================= */
/* MOBILE & TABLET RESPONSIVENESS                            */
/* ========================================================= */
@media (max-width: 900px) {
    #main-layout {
        display: flex;
        flex-direction: column;
    }
    #app-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border);
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem;
    }
    #sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }
    #primary-view {
        grid-template-columns: 1fr;
    }
    #primary-right-panel {
        display: none; /* Hide batching and side pulse on mobile */
    }
    .top-tabs {
        flex-wrap: wrap;
    }
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    .table-container {
        overflow-x: auto;
    }
}

/* ============================================================
   STATUS CHIPS — clear fill, black text, colored border, rounded square
   (Do NOT use [class*="status"] wildcards — they paint kanban columns.)
   ============================================================ */

.ref-status-pill,
.status-badge,
.status-chip,
.ops-chip,
.trip-status,
.nscc-dispatch-status-pill,
.nscc-pulse-action-chip__status,
.nscc-pulse-segment-tip__status-pill,
.nscc-fp-badge,
.cm-status-badge,
.badge-secure,
.badge-success,
.badge-pending,
.badge-pickup,
.badge-transit,
.badge-assigned,
.badge-unassigned,
.badge-scheduled,
.badge-danger,
.badge-en-route,
.badge-current,
.badge.green,
.badge.amber,
.badge.transit,
.badge.delivered,
.status-secure,
.status-pending,
.status-pickup,
.status-transit,
.status-assigned,
.status-unassigned,
.status-scheduled,
.status-exception,
.status-conflict,
.status-en-route,
.status-current,
.status.green,
.status.amber,
.timeline-event-inline {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    border-width: var(--nscc-status-border-w, 4px) !important;
    border-style: solid !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-weight: 800 !important;
    opacity: 1 !important;
}

.ref-status-pill.delivered,
.ref-status-pill.secure,
.ref-status-pill.success,
.ref-status-pill.accepted,
.badge-secure,
.badge-success,
.badge.green,
.badge.delivered,
.status-secure,
.status.green,
.timeline-event-inline.delivered,
.nscc-dispatch-status-pill[data-status="delivered"] {
    border-color: #34C759 !important;
}

.ref-status-pill.pending,
.ref-status-pill.pending-pickup,
.ref-status-pill.pickup-pending,
.badge-pending,
.status-pending,
.badge.amber,
.status.amber,
.nscc-dispatch-status-pill[data-status="pending"],
.nscc-dispatch-status-pill[data-status="pending pickup"] {
    border-color: #FF9500 !important;
}

.ref-status-pill.pickup,
.badge-pickup,
.status-pickup,
.nscc-dispatch-status-pill[data-status="pickup"] {
    border-color: #FFCC00 !important;
}

.ref-status-pill.transit,
.ref-status-pill.current,
.badge-transit,
.badge-current,
.status-transit,
.status-current,
.badge.transit,
.timeline-event-inline.transit,
.nscc-dispatch-status-pill[data-status="transit"],
.nscc-dispatch-status-pill[data-status="in transit"] {
    border-color: #007AFF !important;
}

.ref-status-pill.en-route,
.ref-status-pill.enroute,
.badge-en-route,
.status-en-route,
.nscc-dispatch-status-pill[data-status="en-route"] {
    border-color: #5856D6 !important;
}

.ref-status-pill.assigned,
.badge-assigned,
.status-assigned,
.nscc-dispatch-status-pill[data-status="assigned"] {
    border-color: #AF52DE !important;
}

.ref-status-pill.unassigned,
.badge-unassigned,
.status-unassigned,
.ref-status-pill.exception,
.ref-status-pill.conflict,
.badge-danger,
.status-exception,
.status-conflict,
.nscc-dispatch-status-pill[data-status="unassigned"] {
    border-color: #FF3B30 !important;
}

.ref-status-pill.scheduled,
.badge-scheduled,
.status-scheduled {
    border-color: #06b6d4 !important;
}

/* Action buttons — outline status style (clear fill / black ink / bright border) */
/* NOTE: .sim-btn.active is intentionally excluded — the simulator control bar is
   dark, so black ink is unreadable. The demo shells style .sim-btn.active inline
   (green fill / white text). */
.btn-success,
.btn-checkin {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #34C759 !important;
    box-shadow: none !important;
}
.btn-success:hover,
.btn-checkin:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}
.btn-warning,
.btn-checkout {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF9500 !important;
    box-shadow: none !important;
}
.btn-warning:hover,
.btn-checkout:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}
.btn-danger {
    background: transparent !important;
    background-color: transparent !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF3B30 !important;
    box-shadow: none !important;
}
.btn-danger:hover {
    background: transparent !important;
    background-color: transparent !important;
    filter: brightness(1.05);
}

/* Card assign control uses standard filter-select styling */
.card-assign-control select { cursor: pointer; }

/* ΓöÇΓöÇ NSCC Compact Date Navigation (shared across all screens) ΓöÇΓöÇ */
.nscc-date-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    padding: 0;
    border: none;
    height: 1.5rem;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

.nscc-date-nav__btn,
.nscc-date-nav .date-nav-btn,
.nscc-date-nav .nscc-custom-date-arrow,
.nscc-date-nav .date-nav-arrow {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #000000;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 2px 2px 0 #000000;
    transition: background 0.15s ease;
    outline: none;
}

.nscc-date-nav__btn:hover,
.nscc-date-nav .date-nav-btn:hover,
.nscc-date-nav .nscc-custom-date-arrow:hover,
.nscc-date-nav .date-nav-arrow:hover {
    background: var(--bg-sunken);
}

.nscc-date-nav__field {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-card, #fff);
    border: 2px solid #000000;
    border-radius: 3px;
    height: 1.5rem;
    padding: 0 0.35rem;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 2px 2px 0 #000000;
}

.nscc-date-nav__field input[type="date"] {
    background: transparent;
    border: none;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: auto;
    min-width: 6.5rem;
    -webkit-appearance: none;
    appearance: none;
}

.nscc-date-nav__text,
.nscc-date-nav .nscc-custom-date-text {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
}

.nscc-date-nav__text:hover,
.nscc-date-nav .nscc-custom-date-text:hover {
    color: var(--text-primary);
}

.nscc-date-nav__cal,
.nscc-date-nav .nscc-custom-date-cal {
    background: transparent;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    color: var(--text-primary);
    outline: none;
}

.nscc-date-nav__cal:hover,
.nscc-date-nav .nscc-custom-date-cal:hover {
    transform: scale(1.1);
}

.nscc-date-nav__today,
.nscc-date-nav .nscc-custom-date-today,
.nscc-date-nav .today-date-btn {
    height: 1.5rem;
    padding: 0 0.45rem;
    border: 2px solid #000000;
    border-radius: 3px;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000000;
    white-space: nowrap;
    outline: none;
    line-height: 1;
}

.nscc-date-nav__today:hover,
.nscc-date-nav .nscc-custom-date-today:hover,
.nscc-date-nav .today-date-btn:hover {
    background: var(--bg-sunken);
}

.nscc-date-nav__hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    border: none;
    padding: 0;
    margin: 0;
}

/* Legacy aliases ΓÇö map old class names to compact nav */
.nscc-custom-date-selector,
.condensed-date-selector,
.pulse-date-picker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    padding: 0;
    border: none;
    height: 1.5rem;
    box-sizing: border-box;
}

.dispatch-date-control.nscc-date-nav,
.nscc-date-nav.dispatch-date-control {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    gap: 0.2rem;
    height: 1.5rem;
}

/* ΓöÇΓöÇ NSCC schedule / gantt time-slot grid cells ΓöÇΓöÇ */
.nscc-time-slot {
    position: absolute;
    top: 0;
    bottom: 0;
    box-sizing: border-box;
    border-right: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    pointer-events: none;
}
.nscc-time-slot--interactive {
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
}
.nscc-time-slot--interactive:hover {
    background: var(--select-wash, rgba(24, 24, 27, 0.08));
}
.nscc-schedule-hour-grid {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}
.nscc-schedule-hour-grid .nscc-schedule-hour-cell {
    min-height: 2.5rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
    border-right: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    box-sizing: border-box;
}
.nscc-schedule-hour-grid .nscc-schedule-hour-cell:nth-child(24n) {
    border-right: none;
}
.nscc-schedule-hour-grid--scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    margin-bottom: 1rem;
}
.nscc-schedule-hour-grid--scroll .nscc-schedule-hour-cell {
    flex: 0 0 3.25rem;
    min-height: 2.75rem;
    border-right: 2px solid var(--border);
    border-bottom: none;
}
.nscc-schedule-hour-grid--scroll .nscc-schedule-hour-cell:last-child {
    border-right: none;
}

/* ΓöÇΓöÇ Demo phone viewport (standalone mobile apps on desktop) ΓöÇΓöÇ */
:root {
    --nscc-phone-width: 390px;
    --nscc-phone-height: 844px;
}

html.nscc-demo-phone-viewport {
    background: #05080f;
    min-height: 100%;
}

html.nscc-demo-phone-viewport body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background:
        radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.18) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 35%, rgba(255,255,255,0.15) 0%, transparent 100%),
        #05080f;
    overflow: auto;
}

html.nscc-demo-phone-viewport .nscc-phone-shell {
    position: relative;
    width: var(--nscc-phone-width);
    max-width: 100%;
    height: var(--nscc-phone-height);
    max-height: calc(100vh - 48px);
    flex-shrink: 0;
    background: #000;
    border-radius: 44px;
    box-shadow:
        0 30px 60px rgba(0,0,0,0.75),
        inset 0 0 0 2px #2a2a2a,
        inset 0 0 0 10px #111,
        inset 0 0 0 12px #222;
    overflow: hidden;
    transform: translateZ(0);
}

html.nscc-demo-phone-viewport .nscc-phone-notch {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 28px;
    background: #000;
    border-radius: 0 0 18px 18px;
    z-index: 10000001;
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

html.nscc-demo-phone-viewport .nscc-phone-notch::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 7px;
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #111, 0 0 4px rgba(100,200,255,0.2);
}

html.nscc-demo-phone-viewport .mobile-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 34px;
    overflow: hidden;
}

/* ============================================================
   DARK MODE ΓÇö GLOBAL BLACK-TEXT / BLACK-ICON OVERRIDES
   Ensures no hardcoded black survives into dark theme.
   ============================================================ */

/* Transit wildcard also sets color:#000 ΓÇö override in dark */
:root.dark [class*="transit"]:not(.connectivity-banner),
body.dark-theme [class*="transit"]:not(.connectivity-banner) {
    color: #ffffff !important;
}

/* Any non-brand img that was forced to black in light mode
   should be white in dark mode (covers icon sets, illustrations). */
:root.dark img:not([class*="avatar"]):not([class*="photo"]):not([class*="pravatar"]):not([src*="pravatar"]),
body.dark-theme img:not([class*="avatar"]):not([class*="photo"]):not([class*="pravatar"]):not([src*="pravatar"]) {
    filter: brightness(0) invert(1);
}

/* Brand logos: stone tile in light; invert tile + gray star in dark (see rules below). */
:root.dark .sim-label img,
body.dark-theme .sim-label img {
    filter: invert(1) brightness(0.72) !important;
    background: #d4d4d8 !important;
    border: 1.5px solid #9ca3af;
}

/* Consistent NorthStar mark (stone tile) across chrome, apps, FS banner */
.nscc-brand-logo,
.brand-star img,
.sidebar-brand-star img,
.topbar-brand img,
.nscc-bo-fs-brand img {
    background: #d4d4d8 !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
/* Header chrome logo: match page/window background in light mode (not a white tile).
   OAuth gate logo stays on a white tile — do not fold .nscc-auth-logo into this rule. */
.nscc-chrome-brand-mark img,
.nscc-chrome-brand-row .nscc-chrome-brand-mark img {
    background: var(--bg-page, #f4f4f5) !important;
    border: 2px solid #000000 !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
/* OAuth gate logo: white tile + black border (unchanged) */
.nscc-auth-logo {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px;
    padding: 3px;
    box-sizing: border-box;
    filter: none !important;
}
:root.dark .nscc-brand-logo,
:root.dark .brand-star img,
:root.dark .sidebar-brand-star img,
:root.dark .topbar-brand img,
:root.dark .nscc-bo-fs-brand img,
body.dark-theme .nscc-brand-logo,
body.dark-theme .brand-star img,
body.dark-theme .sidebar-brand-star img,
body.dark-theme .topbar-brand img,
body.dark-theme .nscc-bo-fs-brand img {
    background: #d4d4d8 !important;
    filter: invert(1) brightness(0.72) !important;
}
:root.dark .nscc-chrome-brand-mark img,
:root.dark .nscc-chrome-brand-row .nscc-chrome-brand-mark img,
body.dark-theme .nscc-chrome-brand-mark img,
body.dark-theme .nscc-chrome-brand-row .nscc-chrome-brand-mark img {
    /* Dark chrome: keep white tile so the mark reads on dark page */
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    filter: none !important;
}
:root.dark .nscc-auth-logo,
body.dark-theme .nscc-auth-logo {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    filter: none !important;
}
:root.dark .nscc-chrome-brand-mark,
body.dark-theme .nscc-chrome-brand-mark,
:root.dark button.nscc-chrome-brand-mark,
body.dark-theme button.nscc-chrome-brand-mark {
    border-color: #9ca3af !important;
}
:root.dark .nscc-chrome-brand-row button.nscc-chrome-brand-mark,
body.dark-theme .nscc-chrome-brand-row button.nscc-chrome-brand-mark {
    background: #4b5563 !important;
}

/* Inline SVG fill/stroke: catch svg elements rendered black */
:root.dark svg path[fill="#000000"],
:root.dark svg path[fill="black"],
:root.dark svg rect[fill="#000000"],
:root.dark svg circle[fill="#000000"],
body.dark-theme svg path[fill="#000000"],
body.dark-theme svg path[fill="black"],
body.dark-theme svg rect[fill="#000000"],
body.dark-theme svg circle[fill="#000000"] {
    fill: #ffffff;
}
:root.dark svg path[stroke="#000000"],
:root.dark svg path[stroke="black"],
body.dark-theme svg path[stroke="#000000"],
body.dark-theme svg path[stroke="black"] {
    stroke: #ffffff;
}

/* ============================================================
   UI CONSISTENCY NORMALIZATION LAYER
   Enforces uniform heading sizes, button styles, table headers,
   container spacing, and input styling across all view sections.
   ============================================================ */

/* Primary screen titles — match chrome title bar (1.15rem / 800 / black box in styles.css).
   Do not force 1.5rem on sage-connect / master-data / overview screen titles. */
.view-section h2.section-title,
.view-section h2.panel-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.25;
}
.view-section h2:first-of-type:not(.sage-connect-title):not(.master-data-title):not(.nscc-overview-intro__title):not(.modal-title-strong),
.view-section .master-data-shell > div > h2:not(.sage-connect-title):not(.master-data-title) {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.25;
}

/* Secondary headings (h3 within view sections): uniform 1.1rem / 800 / brand-light */
.view-section h3,
.view-section h3.section-subtitle,
.view-section .panel-header h3 {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    text-transform: none;
    line-height: 1.2;
}

/* Gantt/timeline header bars ΓÇö normalize to consistent 1rem / 700 */
.view-section .gantt-header,
.view-section .timeline-header,
.view-section .scheduler-header {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0 1rem !important;
    background: var(--bg-sunken);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
}

/* ΓöÇΓöÇ "Save to PDF" Buttons ΓöÇΓöÇ */
/* All PDF export buttons: muted fill darker than info boxes */
.view-section .st-pdf-btn,
.view-section button[class*="pdf"],
.view-section .btn[class*="pdf"] {
    background: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    cursor: pointer;
}
.view-section .st-pdf-btn:hover,
.view-section button[class*="pdf"]:hover,
.view-section .btn[class*="pdf"]:hover {
    background: var(--btn-surface-hover) !important;
    border-color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* ΓöÇΓöÇ Action Buttons ("+ New", "Manage Groups", etc.) ΓöÇΓöÇ */
/* All primary action buttons in view sections: muted fill, darker than cards */
.view-section .btn-primary,
.view-section button[class*="new-template"],
.view-section button[class*="manage"],
.view-section .nscc-action-btn {
    background: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.4rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
.view-section .btn-primary:hover,
.view-section button[class*="new-template"]:hover,
.view-section button[class*="manage"]:hover,
.view-section .nscc-action-btn:hover {
    background: var(--btn-surface-hover) !important;
    border-color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* Submit schedule stays frost blue even under view-section primary overrides */
.view-section .btn-frost,
.view-section .btn-submit-schedule,
.view-section button[onclick*="nsccPlannerSubmit"] {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
}
.view-section .btn-frost:hover:not(:disabled):not([aria-disabled="true"]),
.view-section .btn-submit-schedule:hover:not(:disabled):not([aria-disabled="true"]),
.view-section button[onclick*="nsccPlannerSubmit"]:hover:not(:disabled):not([aria-disabled="true"]) {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-color: var(--frost-blue-deep, #1c1917) !important;
    box-shadow: none !important;
}

/* ΓöÇΓöÇ Table Headers ΓöÇΓöÇ */
/* All tables in view sections: uniform header background, font, padding */
.view-section table thead th,
.view-section .table thead th,
.view-section .data-table thead th {
    background: var(--table-head-bg, var(--bg-sunken)) !important;
    color: var(--text-primary) !important;
    font-size: 0.8125rem !important;
    font-weight: 800 !important;
    padding: 0.55rem 0.7rem !important;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
    position: static;
    box-shadow: 0 1px 0 var(--border);
}

/* Table body cells: consistent padding */
.view-section table tbody td,
.view-section .table tbody td,
.view-section .data-table tbody td {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.8125rem !important;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}

/* ΓöÇΓöÇ Master Data Shell Containers ΓöÇΓöÇ */
/* All Back Office / master-data screens: uniform padding (Master Data keeps capped width) */
.view-section .master-data-shell {
    padding: 1.25rem 1.5rem 2rem !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Accounting / HR / Payroll / Forms permanently use the full available width */
#accounting-view .master-data-shell,
#accounting-view .master-data-shell--finance,
#accounting-view .nscc-bo-fullwidth,
#back-office-view .master-data-shell--finance,
#back-office-view .back-office-payroll-mount,
#back-office-payroll-mount.master-data-shell,
#back-office-payroll-panel,
#back-office-payroll-panel.nscc-bo-fullwidth,
#ops-field-view .master-data-shell--ops,
#form-management-view .master-data-shell,
#form-management-view .master-data-shell--finance,
#form-management-view .nscc-forms-shell {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}
#accounting-view .nscc-finance-panel,
#accounting-view .sage-erp-tab-panel,
#back-office-payroll-panel .nscc-finance-panel,
#back-office-payroll-panel .sage-erp-tab-panel,
#form-management-view .nscc-forms-panel,
#form-management-view .sage-erp-tab-panel {
    width: 100% !important;
    max-width: none !important;
}
#accounting-view .sage-table,
#accounting-view .master-data-table,
#back-office-payroll-panel .sage-table,
#back-office-payroll-panel .master-data-table,
#accounting-view .bo-table-scroll-wrap,
#back-office-payroll-panel .bo-table-scroll-wrap,
#accounting-view .sage-queue-table-wrap--bo-fill,
#back-office-payroll-panel .sage-queue-table-wrap--bo-fill,
#accounting-view .master-data-table-shell,
#back-office-payroll-panel .master-data-table-shell {
    width: 100% !important;
    max-width: none !important;
}
#accounting-view .nscc-finance-cards,
#back-office-payroll-panel .nscc-finance-cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
@media (min-width: 1400px) {
    #accounting-view .nscc-finance-cards,
    #back-office-payroll-panel .nscc-finance-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Sticky table headers while scrolling Accounting / HR / Payroll */
#accounting-view .nscc-finance-panel .nscc-ledger-table-wrap .sage-table thead th,
#accounting-view .nscc-finance-panel .nscc-table-scroll .master-data-table thead th,
#back-office-payroll-panel .nscc-finance-panel .nscc-ledger-table-wrap .sage-table thead th,
#back-office-payroll-panel .nscc-finance-panel .nscc-table-scroll .master-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--table-head-bg, var(--bg-sunken)) !important;
    box-shadow: 0 1px 0 var(--border);
}
#accounting-view [data-nscc-acct-panel="reports"] table thead th,
#accounting-view [data-nscc-acct-panel="reports"] .sage-table thead th,
#accounting-view [data-nscc-acct-panel="reports"] .master-data-table thead th { position: static !important; }
#accounting-view [data-nscc-acct-panel="reports"] .nscc-roundtrip-toolbar { position: static !important; }

/* Screen tools: compact density + find */
.nscc-bo-screen-chrome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.55rem 0.75rem;
    margin: 0 0 0.65rem;
    border: 2px solid #000000;
    border-radius: var(--radius-md, 10px);
    position: static;
    background: var(--bg-page, var(--bg-card));
    box-sizing: border-box;
}
.nscc-bo-dense-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.nscc-bo-screen-find {
    min-width: 12rem;
    flex: 1 1 14rem;
    max-width: 22rem;
    padding: 0.35rem 0.55rem;
    border: 2px solid #000000;
    border-radius: var(--radius-md, 10px);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
}
:root.dark .nscc-bo-screen-find,
body.dark-theme .nscc-bo-screen-find {
    border-color: rgba(245, 245, 244, 0.68);
    background: transparent;
}
/* Find-on-this-screen match rows — cleared on click/type elsewhere */
tr.nscc-bo-find-hit,
.nscc-bo-find-hit {
    outline: 2px solid #ca8a04;
    outline-offset: -2px;
    background: rgba(250, 204, 21, 0.28) !important;
}
:root.dark tr.nscc-bo-find-hit,
:root.dark .nscc-bo-find-hit,
body.dark-theme tr.nscc-bo-find-hit,
body.dark-theme .nscc-bo-find-hit {
    outline-color: #facc15;
    background: rgba(250, 204, 21, 0.18) !important;
}
.nscc-bo-screen-chrome__hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
}
html.nscc-bo-dense #accounting-view .sage-table td,
html.nscc-bo-dense #accounting-view .sage-table th,
html.nscc-bo-dense #back-office-payroll-panel .sage-table td,
html.nscc-bo-dense #back-office-payroll-panel .sage-table th,
.nscc-bo-dense .sage-table td,
.nscc-bo-dense .sage-table th {
    padding-top: 0.22rem !important;
    padding-bottom: 0.22rem !important;
    font-size: 0.74rem !important;
}
html.nscc-bo-dense #accounting-view .nscc-finance-card,
html.nscc-bo-dense #back-office-payroll-panel .nscc-finance-card,
.nscc-bo-dense .nscc-finance-card {
    padding: 0.35rem 0.5rem !important;
}
html.nscc-bo-dense #accounting-view .nscc-overview-section,
html.nscc-bo-dense #back-office-payroll-panel .nscc-overview-section {
    margin-bottom: 0.65rem;
}

/* Sticky day-to-day action bars */
#accounting-view .nscc-finance-toolbar,
#back-office-payroll-panel .nscc-finance-toolbar {
    position: static;
    background: var(--bg-page, var(--bg-card));
    padding: 0.35rem 0;
}

/* All search/filter inputs: black border */
.md-search-input,
.st-search,
.master-data-search,
.comms-contact-search,
.nscc-portal-search__input,
.global-search input,
.nscc-location-combobox__search,
input[type="search"],
input[type="text"].master-data-search,
input[type="text"].md-search-input,
input[type="text"].st-search,
.view-section .md-search-input,
.view-section .st-search,
.view-section input[type="search"],
.view-section input[type="text"].master-data-search {
    border: 2px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-card) !important;
    box-shadow: none !important;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.md-search-input:focus,
.st-search:focus,
.master-data-search:focus,
.comms-contact-search:focus,
.nscc-portal-search__input:focus,
.global-search input:focus,
.nscc-location-combobox__search:focus,
input[type="search"]:focus,
input[type="text"].master-data-search:focus,
input[type="text"].md-search-input:focus,
input[type="text"].st-search:focus,
.view-section .md-search-input:focus,
.view-section .st-search:focus,
.view-section input[type="search"]:focus,
.view-section input[type="text"].master-data-search:focus {
    outline: none;
    border-color: #000000 !important;
    box-shadow: var(--shadow-sm) !important;
}

/* ΓöÇΓöÇ Filter/Toolbar Bars ΓöÇΓöÇ */
/* Consistent filter bar spacing and alignment */
.view-section .filter-bar,
.view-section .toolbar-filters,
.view-section .form-control-panel-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* ΓöÇΓöÇ Status Badge Consistency ΓöÇΓöÇ */
/* Count badges in support tickets and similar: uniform style */
.view-section .count-badge,
.view-section .status-pill {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 0.2rem 0.7rem !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: #000000 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

/* ΓöÇΓöÇ Back Office Panel Headers ΓöÇΓöÇ */
/* Uniform header bar for all BO panels */
.view-section .panel-header,
.view-section .master-data-header {
    padding: 0.75rem 1rem !important;
    background: var(--bg-sunken) !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1.25rem !important;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-section .panel-header p,
.view-section .master-data-header p {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin: 0.35rem 0 0 !important;
    max-width: 42rem;
}

/* ΓöÇΓöÇ Section Description Text ΓöÇΓöÇ */
.view-section .section-description {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    margin: 0.35rem 0 0 !important;
}

/* ΓöÇΓöÇ Card Panels in Back Office ΓöÇΓöÇ */
.view-section .card.panel-card,
.view-section .card.bo-card {
    padding: 1rem 1.15rem !important;
    margin-bottom: 1.25rem !important;
    border: 2px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
}

/* ΓöÇΓöÇ Date Navigation Controls ΓöÇΓöÇ */
/* Consistent date nav styling across schedule screens */
.view-section .nscc-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-section .nscc-date-nav button {
    background: var(--bg-card);
    border: 2px solid #000000;
    border-radius: var(--radius-full);
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.view-section .nscc-date-nav button:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ΓöÇΓöÇ Planner Tab Pills ΓöÇΓöÇ */
/* Active vs inactive planner sub-tabs */
.view-section .planner-tab-pill {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-full) !important;
    border: 2px solid var(--border) !important;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
}

.view-section .planner-tab-pill.active {
    background: var(--brand-light) !important;
    color: #ffffff !important;
}

.view-section .planner-tab-pill:not(.active) {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.view-section .planner-tab-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Native finance (demo2) — kept from mainline */
/* Native finance (demo2) */
.nscc-finance-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin: 0 0 0.65rem; }
.nscc-finance-card { background: var(--bg-card); border: 2px solid #000000; border-radius: var(--radius-md, 10px); padding: 0.5rem 0.65rem; }
button.nscc-finance-card.nscc-overview-kpi {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
    width: 100%; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
    transition: transform var(--dur-fast, 70ms) var(--ease-out, ease), box-shadow var(--dur-fast, 70ms);
    box-shadow: 2px 2px 0 #000000;
}
button.nscc-finance-card.nscc-overview-kpi:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 #000000; }
button.nscc-finance-card.nscc-overview-kpi:active { transform: translateY(0); }
.nscc-glance-modal__content { max-width: min(720px, 96vw); }
.nscc-glance-modal__sub { margin: 0 1rem 0.5rem; }
.nscc-glance-modal__summary {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 1rem 0.75rem;
}
.nscc-glance-modal__stat {
    display: flex; flex-direction: column; gap: 0.1rem; min-width: 7rem;
    padding: 0.4rem 0.55rem; border: 2px solid #000000; border-radius: 8px; background: var(--bg-card);
}
.nscc-glance-modal__stat span { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-glance-modal__stat strong { font-size: 1.05rem; font-weight: 900; }
.nscc-glance-modal__stat--warn { border-color: #b45309; }
.nscc-glance-modal__filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    margin: 0 1rem 0.65rem; padding: 0.45rem 0.55rem;
    border: 2px solid #000000; border-radius: 8px; background: var(--bg-card);
}
.nscc-glance-modal__filters[hidden] { display: none !important; }
.nscc-glance-modal__filters label {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
}
.nscc-glance-modal__filters select {
    padding: 0.3rem 0.45rem; border: 2px solid #000000; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
    text-transform: none; letter-spacing: normal; color: var(--text);
}
.nscc-glance-modal__body { margin: 0 1rem 0.75rem; max-height: min(50vh, 420px); overflow: auto; }
.nscc-glance-modal__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 1rem 1rem; }
.nscc-finance-card__label { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.nscc-finance-card__value { font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
.nscc-finance-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0 0 0.65rem; padding: 0.5rem 0.65rem; box-sizing: border-box; background: var(--bg-card); border: 2px solid #000000; border-radius: var(--radius-md, 10px); }
.nscc-finance-ap-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .nscc-finance-ap-grid { grid-template-columns: 1fr 1fr; } }
.nscc-finance-ap-section h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.nscc-ap-form-grid, .nscc-ar-new-form .nscc-ap-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; margin: 0.5rem 0 1rem; align-items: end; }
.nscc-ap-form-grid label, .nscc-ar-new-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-ap-form-grid input, .nscc-ap-form-grid select, .nscc-ar-new-form input { padding: 0.35rem 0.5rem; border: 2px solid #000000; border-radius: 6px; font-size: 0.85rem; }
.nscc-ap-new-bill, .nscc-ar-new-form, .nscc-gl-manual-je { margin: 0 0 0.75rem; }
.nscc-manual-je-form label { display: block; margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.nscc-manual-je-form input[type="text"] { width: 100%; padding: 0.35rem 0.5rem; border: 2px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.nscc-mje-line { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.5rem; margin: 0 0 0.35rem; }
.nscc-mje-line select, .nscc-mje-line input { padding: 0.35rem 0.5rem; border: 2px solid #000000; border-radius: 6px; font-size: 0.85rem; }
.nscc-finance-reports-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .nscc-finance-reports-grid { grid-template-columns: 1fr 1fr; } }
.nscc-report-total td { border-top: 2px solid var(--border); }
.nscc-erp-workspace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.7rem 0.8rem; border: 2px solid #000; background: var(--bg-raised); }
.nscc-erp-workspace-head > div:first-child { display: flex; flex-direction: column; gap: 0.15rem; }
.nscc-erp-workspace-head > div:first-child strong { font-size: 0.95rem; }
.nscc-erp-workspace-head > div:first-child span { color: var(--text-muted); font-size: 0.7rem; }
.nscc-erp-entry-panel { margin: 0.75rem 0; padding: 0.75rem; border: 2px solid #000; background: var(--bg-raised); }
.nscc-erp-entry-panel h3 { margin: 0 0 0.6rem; font-size: 0.85rem; }
.nscc-table-link { border: 0; padding: 0; background: transparent; color: var(--text-primary); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
@media (max-width: 900px) { .nscc-erp-workspace-head { flex-direction: column; } }
.nscc-people-report-workspace { width: 100%; min-width: 0; }
.nscc-people-report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.65rem 0.8rem; margin-bottom: 0.75rem; border: 2px solid #000; background: var(--bg-raised); }
.nscc-people-report-toolbar > div:first-child { display: flex; flex-direction: column; gap: 0.12rem; }
.nscc-people-report-toolbar strong { font-size: 0.9rem; }
.nscc-people-report-toolbar span { color: var(--text-muted); font-size: 0.7rem; }
.nscc-people-report-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.nscc-report-runner { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); gap: 0.8rem; align-items: start; }
.nscc-report-catalog { border: 2px solid #000; background: var(--bg-raised); padding: 0.65rem; }
.nscc-report-catalog h3 { margin: 0 0 0.65rem; font-size: 0.9rem; }
.nscc-report-catalog-group + .nscc-report-catalog-group { margin-top: 0.8rem; }
.nscc-report-catalog-group h4 { margin: 0 0 0.35rem; color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; }
.nscc-report-catalog-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 0.5rem 0.6rem; margin: 0 0 0.25rem; border: 1px solid var(--border); border-radius: 0; background: transparent; cursor: pointer; }
.nscc-report-catalog-item:hover { background: var(--bg-sunken); }
.nscc-report-catalog-item.active { border: 2px solid #000; background: var(--bg-sunken); }
.nscc-report-catalog-item__name { font-weight: 800; font-size: 0.78rem; }
.nscc-report-catalog-item__description { margin-top: 0.15rem; color: var(--text-muted); font-size: 0.63rem; line-height: 1.3; }
.nscc-report-asof { display: block; margin-top: 0.75rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.nscc-report-asof input { display: block; width: 100%; margin-top: 0.25rem; padding: 0.35rem; border: 2px solid var(--border); border-radius: 6px; }
.nscc-report-preview-pane { min-width: 0; border: 2px solid #000; background: var(--bg-raised); }
.nscc-report-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 0.75rem 0.9rem; border-bottom: 2px solid #000; }
.nscc-report-preview-head h3 { margin: 0.1rem 0 0.2rem; font-size: 1rem; }
.nscc-report-preview-head p { margin: 0; max-width: 70ch; color: var(--text-muted); font-size: 0.7rem; }
.nscc-report-eyebrow { color: var(--text-muted); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.nscc-report-run-meta { display: grid; grid-template-columns: auto auto; gap: 0.2rem 0.55rem; font-size: 0.65rem; white-space: nowrap; }
.nscc-report-run-meta span { color: var(--text-muted); text-transform: uppercase; }
.nscc-people-report-results { min-width: 0; padding: 0.75rem; overflow-x: auto; }
.nscc-people-report-results .nscc-ledger-table-wrap { max-height: none; overflow: visible; border: 0; border-radius: 0; }
.nscc-people-report-results .sage-table thead th { position: static; }
.nscc-report-preview-scroll { overflow-x: auto; overflow-y: visible; max-height: none; border: 2px solid var(--border); border-radius: 0; padding: 0.5rem; background: var(--bg-card); }
.nscc-report-preview-table { font-size: 0.75rem; }
@media (max-width: 900px) { .nscc-report-runner { grid-template-columns: 1fr; } .nscc-people-report-toolbar, .nscc-report-preview-head { align-items: flex-start; flex-direction: column; } .nscc-report-run-meta { white-space: normal; } }
.nscc-roundtrip-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; padding: 0.5rem; border: 2px dashed var(--brand); border-radius: 8px; background: var(--bg-raised); }
.nscc-roundtrip-toolbar .nscc-file-btn { margin: 0; cursor: pointer; }
.nscc-roundtrip-preview { margin: 0.5rem 0 1rem; padding: 0.75rem; border: 2px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.nscc-roundtrip-preview h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.nscc-finance-master-shell { display: flex; flex-direction: column; gap: 0.75rem; }
.nscc-finance-master-editor { border: 2px solid #000; background: var(--bg-raised); padding: 0.75rem; }
.nscc-finance-master-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.65rem; align-items: end; }
.nscc-finance-master-fields label { display: flex; flex-direction: column; gap: 0.25rem; color: var(--text-muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; }
.nscc-finance-master-fields input[type="text"], .nscc-finance-master-fields select { min-height: 2.2rem; border: 2px solid var(--border); background: var(--bg-card); color: var(--text-primary); padding: 0.35rem 0.45rem; }
.nscc-finance-master-fields .nscc-finance-master-check { flex-direction: row; align-items: center; min-height: 2.2rem; }
.nscc-finance-master-editor .nscc-finance-toolbar { margin: 0.75rem 0 0; }
.nscc-ar-invoice-link { border: 0; background: transparent; color: var(--brand-light); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0; }
.nscc-ar-invoice-document-modal { z-index: 52000; }
.nscc-ar-invoice-document-modal .modal-content { width: min(960px, 94vw); height: min(860px, 92vh); }
.nscc-ar-invoice-document-body { flex: 1; min-height: 0; overflow: auto; background: #e5e7eb; padding: 1rem; }
.nscc-ar-invoice-document-body iframe, .nscc-ar-invoice-document-body img { display: block; width: 100%; height: 100%; min-height: 680px; border: 0; object-fit: contain; background: #fff; }
.nscc-ar-invoice-document { max-width: 780px; margin: auto; background: #fff; color: #111827; border: 1px solid #9ca3af; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 2rem; }
.nscc-ar-invoice-document header, .nscc-ar-invoice-document section, .nscc-ar-invoice-document footer { display: flex; justify-content: space-between; gap: 2rem; }
.nscc-ar-invoice-document header div, .nscc-ar-invoice-document section div { display: flex; flex-direction: column; gap: .25rem; }
.nscc-ar-invoice-document header { border-bottom: 3px solid #0f172a; padding-bottom: 1rem; font-size: 1.1rem; }
.nscc-ar-invoice-document section { padding: 1.25rem 0; }
.nscc-ar-invoice-document footer { border-top: 2px solid #111827; padding-top: 1rem; margin-top: 1rem; }
.nscc-roundtrip-preview--error { border-color: #dc2626; background: rgba(220,38,38,0.06); }
.nscc-sod-override-box { margin: 0.5rem 0 0.75rem; padding: 0.65rem 0.75rem; border: 2px dashed var(--border); border-radius: 8px; background: var(--bg-card); }
.nscc-sod-override-label { display: flex; align-items: flex-start; gap: 0.4rem; font-size: 0.82rem; cursor: pointer; }
.nscc-sod-override-active { margin: 0.35rem 0 0.65rem; font-size: 0.78rem; }
.badge-warn { background: transparent; color: var(--text-primary); border: 4px solid #FF9500; border-radius: 8px; }
.exec-dash-shell .exec-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.exec-kpi-card { border: 2px solid #000000; border-radius: 8px; padding: 0.55rem 0.65rem; background: var(--bg-card); }
.exec-kpi-card--brand { border-color: #000000; }
.exec-kpi-card--positive .exec-kpi-card__value { color: #15803d; }
.exec-kpi-card--negative .exec-kpi-card__value { color: #b91c1c; }
.exec-kpi-card--accent-green .exec-kpi-card__value { color: #15803d; }
.exec-kpi-card--accent-blue .exec-kpi-card__value { color: #1d4ed8; }
.exec-kpi-card--warn { border-color: #000000; }
.exec-kpi-card--link {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.exec-kpi-card--link:hover,
.exec-kpi-card--link:focus-visible {
    border-color: #000000;
    box-shadow: 0 0 0 1px #000000;
    outline: none;
}
.exec-kpi-card--active {
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
    background: rgba(13, 148, 136, 0.06);
}
.exec-kpi-card__hint {
    margin-top: 0.3rem;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand);
}
.exec-kpi-card__label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.exec-kpi-card__value { font-size: 1.2rem; font-weight: 900; line-height: 1.2; margin-top: 0.1rem; }
.exec-kpi-card__sub { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.15rem; }
.nscc-linkish {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--brand);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.nscc-linkish:hover,
.nscc-linkish:focus-visible { color: var(--brand-light, #14b8a6); outline: none; }
.nscc-row-flash,
.nscc-portal-row--flash {
    animation: nscc-row-flash-pulse 1.4s ease;
}
@keyframes nscc-row-flash-pulse {
    0% { background: rgba(13, 148, 136, 0.28); }
    100% { background: transparent; }
}
.exec-dash-section { margin: 0 0 1rem; }
.exec-dash-section__title { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 800; }
.exec-dash-shortcuts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 1rem; }
.exec-dash-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.exec-dash-filter label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.exec-dash-filter select { margin-left: 0.35rem; padding: 0.3rem 0.45rem; border: 2px solid #000000; border-radius: 6px; }
.exec-state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem; }
.exec-state-card { border: 2px solid #000000; border-radius: 8px; padding: 0.55rem 0.65rem; background: var(--bg-card); font-size: 0.78rem; }
.exec-state-card__head { font-weight: 800; margin-bottom: 0.25rem; }
.exec-state-card__stats { display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--text-muted); font-size: 0.7rem; margin-bottom: 0.25rem; }
.exec-state-card__meta { font-size: 0.68rem; color: var(--text-muted); }
.exec-kpi-card__value-row { display: flex; align-items: center; justify-content: space-between; gap: 0.45rem; }
.nscc-payroll-estimate-banner {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--alert-banner-border, #fcd34d);
    border-radius: 8px;
    background: var(--alert-banner-bg, #fffbeb);
    color: var(--alert-banner-fg, #78350f);
    font-size: 0.78rem;
    line-height: 1.4;
}
.nscc-payroll-estimate-banner strong { font-weight: 800; }
.exec-pillar-ready {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}
.exec-pillar-ready__card {
    border: 2px solid #000;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: var(--bg-card);
}
.exec-pillar-ready__name {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.exec-pillar-ready__status {
    font-size: 0.95rem;
    font-weight: 900;
    margin-top: 0.15rem;
}
.exec-pillar-ready__status--ready { color: #15803d; }
.exec-pillar-ready__status--partial { color: #a16207; }
.exec-pillar-ready__note {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.exec-sparkline-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.1rem 0.15rem 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.03);
}
.exec-sparkline { width: 96px; height: 32px; display: block; }
.exec-sparkline__area { fill-opacity: 0.22; }
.exec-sparkline__line { stroke-width: 2.75; }
.exec-sparkline__end { stroke: #fff; stroke-width: 1.25; }
.exec-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.65rem; }
.exec-chart-card { border: 2px solid #000000; border-radius: 8px; padding: 0.5rem 0.6rem; background: var(--bg-card); }
.exec-chart-card__title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.35rem; }
.exec-chart-card--link {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.exec-chart-card--link:hover,
.exec-chart-card--link:focus-visible {
  border-color: var(--brand, #1c1917);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #1c1917) 25%, transparent);
  outline: none;
}
.exec-chart-card__hint {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.exec-chart-svg { width: 100%; height: auto; display: block; }
.exec-chart-label { font-size: 8px; fill: var(--text-muted, #64748b); font-family: monospace; }
.exec-chart-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; font-size: 0.65rem; color: var(--text-muted); }
.exec-chart-legend-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.exec-drill-panel {
    margin-top: 1rem;
    padding: 0.85rem 1rem 1rem;
    border: 2px solid #000000;
    border-radius: 10px;
    background: var(--bg-card, #fff);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.exec-drill-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.exec-drill-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}
.exec-drill-panel__lead {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.exec-drill-panel__subtitle {
    margin: 0.85rem 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.exec-drill-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}


/* ============================================================
   FLAT / DATA-DENSE CONSOLE OVERRIDES (light + dark)
   Color stays on status chips, alerts, charts, graphs, maps.
   ============================================================ */

html, body,
.app-container,
.main-content,
.top-header,
.nscc-chrome-brand-row {
    background-image: none !important;
}

.card,
.panel,
.modal,
.modal-content,
.drawer,
.popover,
.dropdown-menu,
.job-card:not([data-trip-status]),
.trip-card,
.batch-card,
.gantt-alert-card,
.timeline-pending-trip,
.nscc-kpi-card,
.finance-card,
.overview-card {
    box-shadow: none !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: #000000 !important;
}
/* Modals: thicker frame than cards/panels */
.modal-content,
.trip-modal-content {
    border-width: 4px !important;
}
:root.dark .card,
:root.dark .panel,
:root.dark .drawer,
:root.dark .popover,
:root.dark .dropdown-menu,
:root.dark .batch-card,
:root.dark .trip-card,
:root.dark .job-card:not([data-trip-status]),
:root.dark .gantt-alert-card,
:root.dark .timeline-pending-trip,
:root.dark .nscc-kpi-card,
:root.dark .finance-card,
:root.dark .overview-card,
body.dark-theme .card,
body.dark-theme .panel,
body.dark-theme .drawer,
body.dark-theme .popover,
body.dark-theme .dropdown-menu,
body.dark-theme .batch-card,
body.dark-theme .trip-card,
body.dark-theme .job-card:not([data-trip-status]),
body.dark-theme .gantt-alert-card,
body.dark-theme .timeline-pending-trip,
body.dark-theme .nscc-kpi-card,
body.dark-theme .finance-card,
body.dark-theme .overview-card {
    border-color: rgba(245, 245, 244, 0.68) !important;
    background: transparent !important;
    background-color: transparent !important;
}
/* Dark modals: solid panel + dimmed scrim (never clear glass) */
:root.dark .modal,
body.dark-theme .modal {
    background: rgba(0, 0, 0, 0.55) !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
}
:root.dark .modal-content,
:root.dark .trip-modal-content,
body.dark-theme .modal-content,
body.dark-theme .trip-modal-content {
    border-width: 4px !important;
    border-color: rgba(245, 245, 244, 0.68) !important;
    background: var(--bg-card, #1c1c1b) !important;
    background-color: var(--bg-card, #1c1c1b) !important;
}

.job-card:hover,
.trip-card:hover,
.batch-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #000000 !important;
}
:root.dark .job-card:hover,
:root.dark .trip-card:hover,
:root.dark .batch-card:hover,
body.dark-theme .job-card:hover,
body.dark-theme .trip-card:hover,
body.dark-theme .batch-card:hover {
    border-color: rgba(245, 245, 244, 0.85) !important;
}

/* Tables — denser rows, hairline rules */
table,
.data-table,
.nscc-table,
.master-table,
.sage-table {
    border-collapse: collapse;
    font-size: var(--dense-font);
}

table th,
table td,
.data-table th,
.data-table td,
.nscc-table th,
.nscc-table td,
.master-table th,
.master-table td,
.sage-table th,
.sage-table td {
    padding: var(--dense-pad-y) var(--dense-pad-x) !important;
    border-color: var(--border) !important;
    line-height: 1.25;
}

table th,
.data-table th,
.nscc-table th,
.master-table th,
.sage-table th {
    font-size: var(--dense-font-sm);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--table-head-bg, var(--bg-sunken)) !important;
    color: var(--text-secondary);
}

/* Chrome / nav — flat zinc, not earth folder gold */
.nscc-folder-tab,
.folder-tab,
.pulse-folder-tab,
[class*="folder-tab"] {
    background: var(--chrome-folder) !important;
    color: var(--chrome-folder-ink) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    box-shadow: none !important;
}

.nscc-folder-tab.active,
.folder-tab.active,
.pulse-folder-tab.active,
[class*="folder-tab"].active {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--bg-card) !important;
}

/* Inputs — 1px theme hairline. Native <select> keeps 2px black (select rules above
   + styles.css); do not pull dropdowns back to --border. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
textarea,
.form-control:not(select),
.form-control-panel:not(select),
.select-toolbar,
.nscc-search-input,
.search-input,
.input {
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: var(--dense-font);
}

input:focus,
textarea:focus,
.form-control:not(select):focus,
.form-control-panel:not(select):focus,
.input:focus {
    border-color: var(--border-focus) !important;
    outline: none;
    box-shadow: var(--shadow-glow-brand) !important;
}

/* Neutral chrome badges stay muted; status/trip chips keep color */
.badge:not([class*="status"]):not(.trip-status):not(.job-status):not(.ref-status-pill),
.mode-badge,
.chip:not([class*="status"]):not(.ops-chip),
.tag:not([class*="status"]) {
    background: var(--bg-sunken) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    font-weight: 600;
}

/* Status / alert / ops chips — transparent fill, black text, colored border */
.status,
.status-chip,
.status-badge,
.trip-status,
.job-status,
.ref-status-pill,
.ops-chip,
[class*="status-"] {
    border-radius: 8px !important;
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    box-shadow: none !important;
    font-weight: 700;
}

/* Header / ticker — flat strip (light chrome banner stays granite) */
.top-header,
.ticker-strip,
#ticker-container,
.nscc-ticker {
    background: var(--bg-card) !important;
    border: none !important;
    box-shadow: none !important;
}
html:not(.dark) body:not(.dark-theme) .nscc-chrome-brand-row,
body:not(.dark-theme) .nscc-chrome-brand-row {
    background: var(--chrome-brand-row-bg, #e4e4e7) !important;
    border: none !important;
    box-shadow: none !important;
}
:root.dark .nscc-chrome-brand-row,
body.dark-theme .nscc-chrome-brand-row {
    background: var(--bg-card) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Left / top nav */
.nav-item,
.top-tab,
.sidebar-item,
.nscc-nav-item {
    border-radius: var(--radius-sm) !important;
}

/* Kill leftover warm-earth hardcodes when tokens already apply */
:root.dark body,
body.dark-theme {
    background-color: var(--bg-page);
    color: var(--text-primary);
}

/* Ops alert / jeopardy banners — purple signal color (allowed) */
.nscc-ops-alert,
.nscc-pulse-alert,
.connectivity-banner.warn,
.banner-warn,
[class*="pulse"][class*="alert"],
.alert-banner {
    background: var(--alert-banner-bg) !important;
    color: var(--alert-banner-fg) !important;
    border: 1px solid var(--alert-banner-border) !important;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
}


/* ==========================================================================
   Action buttons — muted gray/black fill (darker than info boxes);
   success / warning / danger / frost keep transparent + status borders.
   ========================================================================== */
html body .btn.btn-primary,
html body .btn.btn-secondary,
html body .btn.btn-ghost,
html body .btn.btn-outline-primary,
html body .btn.btn-strong,
html body .view-section .btn-primary,
html body .view-section .nscc-action-btn,
html body .view-section .st-pdf-btn,
html body .view-section .btn[class*="pdf"],
html body button.btn[onclick*="saveToPdf"],
html body button.btn[onclick*="print"],
html body button.btn[onclick*="Print"],
html body button.btn[onclick*="submit"],
html body button.btn[onclick*="Submit"] {
    background: var(--btn-surface) !important;
    background-color: var(--btn-surface) !important;
    color: var(--btn-surface-ink) !important;
    border: 2.5px solid #000000 !important;
    box-shadow: none !important;
}
html body .btn.btn-primary:hover,
html body .btn.btn-secondary:hover,
html body .btn.btn-ghost:hover,
html body .btn.btn-outline-primary:hover,
html body .btn.btn-strong:hover,
html body .view-section .btn-primary:hover,
html body .view-section .nscc-action-btn:hover,
html body .view-section .st-pdf-btn:hover,
html body .view-section .btn[class*="pdf"]:hover {
    background: var(--btn-surface-hover) !important;
    background-color: var(--btn-surface-hover) !important;
}
:root.dark .btn.btn-primary,
:root.dark .btn.btn-secondary,
:root.dark .btn.btn-ghost,
:root.dark .btn.btn-outline-primary,
:root.dark .btn.btn-strong,
body.dark-theme .btn.btn-primary,
body.dark-theme .btn.btn-secondary,
body.dark-theme .btn.btn-ghost,
body.dark-theme .btn.btn-outline-primary,
body.dark-theme .btn.btn-strong,
:root.dark .view-section .btn-primary,
:root.dark .view-section .nscc-action-btn,
:root.dark .view-section .st-pdf-btn,
body.dark-theme .view-section .btn-primary,
body.dark-theme .view-section .nscc-action-btn,
body.dark-theme .view-section .st-pdf-btn {
    border-color: #ffffff !important;
}
html body .btn.btn-success,
html body .btn.btn-warning,
html body .btn.btn-danger,
html body .btn.btn-frost,
html body .btn.btn-submit-schedule,
html body button.btn[onclick*="cancel"],
html body button.btn[onclick*="Cancel"],
html body button.btn[onclick*="signOut"],
html body button.btn[onclick*="SignOut"] {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
html body .btn.btn-success {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #34C759 !important;
}
html body .btn.btn-warning {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF9500 !important;
}
html body .btn.btn-danger,
html body button.btn[onclick*="signOut"],
html body button.btn[onclick*="Cancel"],
html body button.btn[onclick*="cancel"] {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    border: 4px solid #FF3B30 !important;
}
html body .btn.btn-frost,
html body .btn.btn-submit-schedule {
    color: var(--text-primary) !important;
    border: 2.5px solid var(--frost-blue-deep, #1c1917) !important;
}
:root.dark .btn.btn-success,
body.dark-theme .btn.btn-success {
    color: #ffffff !important;
    border-color: #22c55e !important;
}
:root.dark .btn.btn-danger,
body.dark-theme .btn.btn-danger {
    color: #ffffff !important;
    border-color: #f87171 !important;
}


/* Table row hover / selected — zinc washes (never baby/sky blue fills) */
.view-section table tbody tr:hover > td,
.view-section .data-table tbody tr:hover > td,
.sage-table tbody tr:hover > td,
.master-data-table tbody tr:hover > td,
.data-table tr:hover td {
    background: var(--table-row-hover, var(--info-wash, #f4f4f5)) !important;
}
.view-section table tbody tr.is-selected > td,
.view-section table tbody tr.selected > td,
.sage-table tbody tr.is-selected > td,
.sage-table tbody tr.selected > td,
.master-data-table tbody tr.is-selected > td,
.master-data-table tbody tr.selected > td,
.data-table tr.is-selected td,
.data-table tr.selected td,
.nscc-hr-state-row.is-selected,
.custom-export-history-row--selected {
    background: var(--table-row-selected, #e5e7eb) !important;
}
:root.dark .view-section table tbody tr.is-selected > td,
:root.dark .sage-table tbody tr.is-selected > td,
body.dark-theme .view-section table tbody tr.is-selected > td,
body.dark-theme .sage-table tbody tr.is-selected > td,
:root.dark .nscc-hr-state-row.is-selected,
body.dark-theme .nscc-hr-state-row.is-selected {
    background: var(--table-row-selected, #3f3f46) !important;
}
