/* ============================================================
   Astrata Ops Portal - brand layer
   Astrata Visual Identity Guidelines, Edition 1.0 (2026).
   Tokens mirror the website's shared/tokens.css; the MudBlazor
   theme (Theme/AstrataTheme.cs) carries the same values.
   ============================================================ */

:root {
    /* Brand (s.04) */
    --signal-green: #00C389;
    --core-blue: #1F4DFF;
    --ink: #0F172A;
    --cloud: #F4F6FA;
    --paper: #FFFFFF;

    /* Slate scale */
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;

    /* Semantic: reserved for state, always paired with an icon or label */
    --success: var(--signal-green);
    --success-bg: #E6F9F2;
    --success-fg: #047857;
    --info: var(--core-blue);
    --info-bg: #E8EEFF;
    --warning: #FFB020;
    --warning-bg: #FFF4DC;
    --warning-fg: #92400E;
    --critical: #E5484D;
    --critical-bg: #FCE4E5;
    --critical-fg: #B42318;

    /* Spacing (base 4px), radius and elevation (s.10) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 999px;
    --elevation-1: 0 1px 2px rgba(15,23,42,0.04);
    --elevation-2: 0 4px 8px rgba(15,23,42,0.08);
    --elevation-3: 0 12px 32px rgba(15,23,42,0.12);
    --shadow-focus: 0 0 0 3px rgba(31,77,255,0.24);

    /* Type (s.05) */
    --font-sans: 'Inter', 'Inter Variable', 'Aptos', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Motion (s.08): never above 600ms */
    --dur-micro: 120ms;
    --dur-small: 200ms;
    --dur-medium: 320ms;
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html, body {
    font-family: var(--font-sans);
    background: var(--cloud);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--core-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1:focus { outline: none; }

/* ---------- Focus: Core Blue ring, never removed ---------- */
:focus-visible {
    outline: 2px solid var(--core-blue);
    outline-offset: 2px;
}
.mud-input-control:focus-within .mud-input-outlined-border { border-color: var(--core-blue) !important; }

/* ---------- Numbers and identifiers ---------- */
/* Tabular figures on every data surface (s.05). */
.mud-table, .mud-data-grid, .aos-tnum, .aos-tile-value {
    font-feature-settings: 'tnum' 1, 'cv11' 1;
    font-variant-numeric: tabular-nums;
}
/* Asset IDs, serials, job numbers and plates use JetBrains Mono (s.05). */
.aos-mono, td.aos-mono {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0;
    font-feature-settings: 'tnum' 1;
}

/* ---------- App chrome ---------- */
.aos-appbar {
    border-bottom: 1px solid var(--slate-200);
    box-shadow: none !important;
}

.aos-appbar-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-500);
}

.aos-drawer {
    border-right: 0;
}

/* The side bar still scrolls when the menu is taller than the window, but without a visible scroll bar. */
.aos-drawer,
.aos-drawer .mud-drawer-content {
    scrollbar-width: none;
}
.aos-drawer::-webkit-scrollbar,
.aos-drawer .mud-drawer-content::-webkit-scrollbar {
    display: none;
}

.aos-drawer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4) var(--space-4);   /* clear space around the mark */
}
.aos-drawer-brand img { display: block; }
.aos-drawer-brand--mini { padding: var(--space-4) 0; }

/* Loading spinner. Only `transform` is animated, so the browser runs it on the compositor
   thread (GPU): it stays at the display's refresh rate even while the main thread is busy.
   `linear` keeps the speed constant; `will-change` promotes the layer ahead of time. */
.aos-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50vh;   /* centre in the page body, not hugging the top edge */
}
.aos-spinner {
    display: block;
    height: auto;
    transform-origin: 50% 50%;
    will-change: transform;
    animation: aos-spin 1.2s linear infinite;
}
@keyframes aos-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .aos-spinner { animation-duration: 4s; }
}

.aos-nav-heading {
    display: block;
    padding: var(--space-4) var(--space-4) var(--space-1);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-400);
}

.aos-drawer .mud-nav-link {
    margin: 2px var(--space-2);
    border-radius: var(--radius-md);
    color: var(--slate-300);
    transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.aos-drawer .mud-nav-link:hover { background: var(--slate-800); color: var(--cloud); }
/* Active page: Signal Green on the dark drawer (strong contrast; green is never used for text on light surfaces). */
.aos-drawer.mud-drawer .mud-navmenu.mud-navmenu-default .mud-nav-link.active:not(.mud-nav-link-disabled) {   /* out-ranks MudBlazor's active rule */
    background: var(--slate-800);
    color: var(--signal-green);
    box-shadow: inset 3px 0 0 var(--signal-green);
}
.aos-drawer .mud-nav-link .mud-nav-link-icon { color: var(--slate-400); }
.aos-drawer .mud-nav-link.active .mud-nav-link-icon { color: var(--signal-green); }
.aos-drawer .mud-nav-link.active .mud-nav-link-text { font-weight: 600; }
.aos-drawer .mud-nav-link-text { font-size: 14px; font-weight: 500; }

.aos-drawer-footer {
    margin-top: auto;
    padding: var(--space-4);
    font-size: 12px;
    line-height: 16px;
    color: var(--slate-400);
}

.mud-drawer--closed .aos-nav-heading,
.mud-drawer-mini:not(.mud-drawer--open) .aos-nav-heading,
.mud-drawer-mini:not(.mud-drawer--open) .aos-drawer-footer { display: none; }

.aos-content { padding-top: var(--space-6); padding-bottom: var(--space-8); }

/* ---------- Page header ---------- */
.aos-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.aos-page-title { margin: 0; }                          /* sentence case, set by Typo.h4 */
.aos-page-subtitle { margin: var(--space-1) 0 0; max-width: 72ch; color: var(--slate-600); }
.aos-page-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ---------- Panels, tables ---------- */
.mud-paper { border-radius: var(--radius-md); }
.mud-paper.mud-paper-outlined { border-color: var(--slate-200); }

.mud-table, .mud-data-grid {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.mud-table-head .mud-table-cell, .mud-data-grid .mud-table-head .mud-table-cell {
    background: var(--slate-50);
    color: var(--slate-600);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-bottom: 1px solid var(--slate-200);
}
.mud-table-body .mud-table-row:hover { background: var(--slate-50); }
.mud-table-cell { border-bottom-color: var(--slate-200); font-size: 14px; }

.mud-input-control .mud-input-outlined .mud-input-outlined-border { border-radius: var(--radius-sm); }
.mud-button-root { border-radius: var(--radius-md); white-space: nowrap; }
.mud-dialog { border-radius: var(--radius-lg); box-shadow: var(--elevation-3); }
.mud-dialog .mud-dialog-title { font-weight: 600; }

/* ---------- Form rows: inputs share a row when there is room, wrap when there is not ---------- */
.aos-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-2) var(--space-4);
    align-items: end;
}

.aos-warn-text { color: var(--warning-fg) !important; }

/* ---------- Billable toggle pill: a compact chip-like checkbox next to the equipment actions ---------- */
.aos-toggle-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--slate-100);
    padding: 0 var(--space-2) 0 0;
    margin-right: var(--space-1);
    transition: background-color .15s ease, color .15s ease;
}
.aos-toggle-pill--on { background: var(--success-bg); color: var(--success-fg); }
.aos-toggle-pill .mud-typography-body1 { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }

/* ---------- Checklist rows: a card per step that highlights green once checked off ---------- */
.aos-checklist-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-3);
    margin-bottom: var(--space-2);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--slate-50);
    transition: background-color .15s ease, border-color .15s ease;
}
.aos-checklist-row--done {
    background: var(--success-bg);
    border-color: var(--success);
}
/* MudBlazor gives a boolean MudInputControl width:0 and lets its label overflow visually - fine when
   nothing sits to its right, but here it would overlap the remarks field. Give it a real reserved width
   (wide enough for "Location Correct", the longest step name) so every remarks field lines up and is
   the same width regardless of step name length. */
.aos-checklist-check { flex: 0 0 170px; width: 170px; }
.aos-checklist-check .mud-checkbox { width: 100%; }
.aos-checklist-check .mud-typography-body1 { font-weight: 500; white-space: nowrap; }
.aos-checklist-remarks { flex: 0 0 auto; width: 220px; }

/* Outlined text fields default to the primary (blue) color on focus; the checklist remarks use a
   neutral gray instead so the whole row stays within the green/slate palette used here. */
.aos-checklist-remarks .mud-input-outlined:focus-within > .mud-input-outlined-border,
.aos-checklist-remarks .mud-input-outlined:focus-within .mud-shrink > .mud-input-outlined-border {
    border-color: var(--slate-400) !important;
}

/* ---------- Device model picker activator: looks like a text field, opens a MudMenu on click ---------- */
.aos-device-model-activator {
    width: 100%;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .42);
}
.aos-device-model-activator-label { display: block; color: rgba(0, 0, 0, .6); }

/* ---------- Blacklisted-client badge: a small warning bubble pinned to a button's corner ---------- */
/* Size.Small MudIconButton renders at 26x26px, so this is exactly half that. MudBadge's own CSS sets a
   fixed width/height, so these need !important to win. */
.aos-blacklist-badge.mud-badge {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    padding: 0 !important;
}
.aos-blacklist-badge.mud-badge .mud-icon-root {
    font-size: 9px !important;
    width: 9px !important;
    height: 9px !important;
}

/* ---------- Alerts: dark text on a tinted fill (state colour on its own is too light for text) ---------- */
.mud-alert-text-error   { background: var(--critical-bg); color: var(--critical-fg); }
.mud-alert-text-warning { background: var(--warning-bg);  color: var(--warning-fg); }
.mud-alert-text-success { background: var(--success-bg);  color: var(--success-fg); }
.mud-alert-text-info    { background: var(--info-bg);     color: #1639C4; }
.mud-alert .mud-link { font-weight: 600; text-decoration: underline; }

/* ---------- Status chip: tinted fill + icon + label (colour is never the only signal) ---------- */
.aos-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    white-space: nowrap;
}
.aos-chip .mud-icon-root { width: 14px; height: 14px; }
.aos-chip--neutral  { background: var(--slate-100); color: var(--slate-700); }
.aos-chip--info     { background: var(--info-bg); color: #1639C4; }
.aos-chip--success  { background: var(--success-bg); color: var(--success-fg); }
.aos-chip--warning  { background: var(--warning-bg); color: var(--warning-fg); }
.aos-chip--critical { background: var(--critical-bg); color: var(--critical-fg); }

/* ---------- Stat tiles ("data with a job": each number links to the queue it counts) ---------- */
.aos-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}
.aos-tile {
    display: block;
    padding: var(--space-4) var(--space-6);
    background: var(--paper);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-1);
    color: var(--ink);
    transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-small) var(--ease-out);
}
.aos-tile:hover { text-decoration: none; border-color: var(--slate-300); box-shadow: var(--elevation-2); }
.aos-tile-label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.02em; color: var(--slate-600); }
.aos-tile-value { margin-top: var(--space-2); font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -0.01em; }
.aos-tile-hint { margin-top: var(--space-1); font-size: 14px; line-height: 20px; color: var(--slate-600); }
.aos-tile--critical { border-left: 3px solid var(--critical); }
.aos-tile--critical .aos-tile-value { color: var(--critical-fg); }
.aos-tile--warning { border-left: 3px solid var(--warning); }

/* ---------- Validation / errors ---------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--signal-green); }
.invalid { outline: 1px solid var(--critical); }
.validation-message { color: var(--critical-fg); }

.blazor-error-boundary {
    background: var(--critical);
    padding: 1rem 1rem 1rem 1rem;
    color: #fff;
    border-radius: var(--radius-md);
}
.blazor-error-boundary::after { content: "Something went wrong on this page." }

#blazor-error-ui {
    color-scheme: light only;
    background: var(--critical-bg);
    color: var(--critical-fg);
    border-top: 2px solid var(--critical);
    bottom: 0;
    box-shadow: var(--elevation-3);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---------- Reduced motion is non-negotiable (s.08) ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
        animation-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}

/* Spinner shown inside a data grid's body while it loads: shorter than the full-page one. */
.aos-spinner-wrap.aos-spinner-wrap--grid { min-height: 260px; }

/* ---------- Signed-in user (app bar) ---------- */
.aos-user { display: inline-flex; align-items: center; gap: var(--space-2); }
.aos-user-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: var(--radius-full);
    background: var(--ink); color: var(--cloud); font-size: 12px; font-weight: 600;
}
.aos-user-name { font-size: 14px; font-weight: 500; color: var(--ink); }
@media (max-width: 599px) { .aos-user-name { display: none; } }

/* ---------- Login page: 60% brand panel / 40% sign-in panel ---------- */
.aos-login { display: grid; grid-template-columns: 3fr 2fr; min-height: 100vh; }
.aos-login-brand {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--space-6); padding: var(--space-8); text-align: center;
    background: var(--ink); color: var(--cloud);
}
.aos-login-logo { display: block; max-width: 70%; height: auto; }
.aos-login-tag { margin: 0; font-size: 18px; line-height: 28px; font-weight: 500; letter-spacing: 0.01em; color: var(--cloud); }
.aos-login-panel { display: flex; align-items: center; justify-content: center; padding: var(--space-8) var(--space-6); background: var(--paper); }
.aos-login-card {
    width: 100%; max-width: 380px; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
    box-shadow: var(--elevation-2); padding: var(--space-8); background: var(--paper);
}
.aos-login-eyebrow { margin: 0 0 var(--space-1); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-500); }
.aos-login-title { margin: 0 0 var(--space-2); font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.aos-login-lede { margin: 0 0 var(--space-6); color: var(--slate-600); }
.aos-login-btn {
    display: flex; align-items: center; justify-content: center; gap: var(--space-3);
    width: 100%; min-height: 44px; padding: 0 var(--space-4);
    background: var(--ink); color: var(--cloud); border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500; text-decoration: none;
    transition: background var(--dur-micro) var(--ease-out);
}
.aos-login-btn:hover { background: var(--slate-800); text-decoration: none; }
.aos-login-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.aos-login-notice { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 14px; }
.aos-login-notice--error { background: var(--critical-bg); color: var(--critical-fg); }
.aos-login-notice--ok { background: var(--success-bg); color: var(--success-fg); }
.aos-login-foot { margin: var(--space-6) 0 0; font-size: 12px; color: var(--slate-500); text-align: center; }

/* Narrow screens: brand becomes a banner above the sign-in panel. */
@media (max-width: 799px) {
    .aos-login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .aos-login-brand { padding: var(--space-8) var(--space-4); gap: var(--space-3); }
    .aos-login-logo { width: 180px; max-width: 60%; }
    .aos-login-tag { font-size: 14px; line-height: 20px; }
    .aos-login-panel { align-items: flex-start; }
}

/* ---------- Paper job sheet workbench (Portal/Components/Pages/Installations/PaperSheets.razor) ---------- */
.ps-jobpick { max-width: 420px; margin-bottom: var(--space-4); }
/* One column (scan above the form) on narrower screens; two columns with the scan pinned when there is room for both. */
.ps-workbench { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--space-6); }
@media (min-width: 1280px) {
    .ps-workbench { grid-template-columns: minmax(380px, 1fr) minmax(540px, 1.2fr); }
    .ps-scan { position: sticky; top: 72px; max-height: calc(100vh - 96px); }
}
.ps-muted { color: var(--slate-600); font-size: 13px; font-weight: 400; }

/* The scan stays in view while the form scrolls. */
.ps-scan {
    min-width: 0; max-height: 70vh;
    display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); overflow: hidden;
}
.ps-scan-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 16px; border-bottom: 1px solid var(--slate-200); }
.ps-scan-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.ps-scan-name { font-size: 14px; font-weight: 600; }
.ps-scan-tools { display: flex; gap: 6px; }
.ps-iconbtn {
    width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--slate-200); background: var(--paper); color: var(--slate-700);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.ps-iconbtn:hover { background: var(--slate-50); text-decoration: none; }
.ps-iconbtn:disabled { opacity: .4; cursor: default; }
.ps-scan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 12px 16px 0; }
.ps-scan-note { margin: 8px 16px 0; font-size: 12px; }
.ps-scan-body { flex: 1; min-height: 0; overflow: auto; background: var(--slate-200); margin-top: 12px; padding: 16px; }
.ps-scan-body iframe { width: 100%; height: 70vh; border: 0; background: var(--paper); border-radius: var(--radius-sm); }
.ps-scan-img img { display: block; max-width: none; background: var(--paper); box-shadow: var(--elevation-2); }
.ps-scan-file { margin: 0 0 8px; font-size: 12px; }
.ps-empty { margin: 0; padding: 24px 8px; color: var(--slate-600); font-size: 14px; text-align: center; }

/* The form column. */
.ps-form { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.ps-card { background: var(--paper); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 20px 24px; }
.ps-card h2 { margin: 0 0 var(--space-4); font-size: 15px; line-height: 22px; font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
.ps-h2-split { justify-content: space-between; flex-wrap: wrap; }
.ps-h2-split > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2); }
.ps-h2-actions { display: inline-flex; gap: var(--space-2); }
.ps-h2-count { font-size: 12px; }
.ps-jobline p { margin: 8px 0 0; }
.ps-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; margin-top: var(--space-3); }
.ps-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.ps-field-block { margin-top: var(--space-4); }
.ps-label { display: block; font-size: 12px; font-weight: 500; color: var(--slate-600); margin: 0 0 6px; }
.ps-center { display: flex; justify-content: center; align-items: center; }
@media (max-width: 1500px) {
    .ps-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chips and the reading summary. */
.ps-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); background: var(--paper); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 8px 16px; }
.ps-summary-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.ps-summary-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.ps-chip-neutral, .ps-chip-blue, .ps-chip-amber, .ps-chip-red {
    display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 3px 10px; font-size: 12px; font-weight: 500;
}
.ps-chip-neutral { background: var(--slate-100); color: var(--slate-700); }
.ps-chip-blue { background: var(--info-bg); color: #1237C9; font-weight: 600; font-size: 13px; padding: 4px 12px; }
.ps-chip-amber { background: var(--warning-bg); color: var(--warning-fg); }
.ps-chip-red { background: var(--critical-bg); color: var(--critical-fg); }

/* Field states: from the scan (blue), to check (amber), missing (red). Colour always comes with a word or an icon. */
.ps-scan-f .mud-input-outlined { background: #F3F6FF; }
.ps-scan-f .mud-input-outlined .mud-input-outlined-border { border-color: #B8C7FF !important; }
.ps-check-f .mud-input-outlined { background: #FFF9EB; }
.ps-check-f .mud-input-outlined .mud-input-outlined-border { border-color: var(--warning) !important; }
.ps-miss .mud-input-outlined { background: #FFF5F5; }
.ps-miss .mud-input-outlined .mud-input-outlined-border { border-color: var(--critical) !important; }
.ps-miss .mud-input-outlined { box-shadow: 0 0 0 3px rgba(229, 72, 77, .12); }
.ps-mono input { font-family: var(--font-mono); font-size: 13px; }

/* Notes under a field. */
.ps-note { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0; font-size: 12px; line-height: 16px; }
.ps-note-icon { flex: none; width: 14px; text-align: center; font-weight: 700; }
.ps-note--ok { color: var(--success-fg); }
.ps-note--info { color: #1237C9; }
.ps-note--warn { color: var(--warning-fg); }
.ps-note--bad { color: var(--critical-fg); }
.ps-note--muted { color: var(--slate-600); }
.ps-verdict { min-height: 0; }

/* Pills: vehicle type, checks, work choices. */
.ps-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ps-pill {
    height: 36px; padding: 0 14px; border-radius: var(--radius-full); border: 1px solid var(--slate-300); background: var(--paper); color: var(--slate-700);
    font-family: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.ps-pill:hover { background: var(--slate-50); }
.ps-pill.on { background: var(--info-bg); border-color: #B8C7FF; color: #1237C9; }
.ps-pill--dashed { border-style: dashed; }
.ps-newstep { max-width: 220px; }
.ps-segment { display: inline-flex; border: 1px solid var(--slate-300); border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--space-2); }
.ps-segment button { height: 34px; padding: 0 14px; border: 0; background: var(--paper); color: var(--slate-700); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ps-segment button.on { background: var(--ink); color: var(--cloud); }

/* Vehicles table and equipment rows. */
.ps-paste { margin: 0 0 var(--space-4); }
.ps-vgrid { display: grid; grid-template-columns: 28px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.5fr) 36px; gap: 12px; align-items: start; margin-bottom: 10px; }
.ps-egrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 80px 36px; gap: 12px; align-items: start; margin-bottom: 10px; }
.ps-vhead { margin-bottom: 6px; }
.ps-num { height: 40px; display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--slate-500); }
.ps-recorded { margin: 0 0 var(--space-3); }
.ps-x {
    width: 34px; height: 34px; margin-top: 3px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--slate-500);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ps-x:hover { background: var(--slate-100); color: var(--critical-fg); }
.ps-add {
    margin-top: var(--space-2); height: 36px; padding: 0 12px; border-radius: var(--radius-md); border: 1px dashed var(--slate-400); background: var(--paper);
    color: var(--slate-700); font-family: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.ps-add:hover { background: var(--slate-50); }
@media (max-width: 760px) {
    .ps-vgrid, .ps-egrid { grid-template-columns: minmax(0, 1fr); }
    .ps-vhead { display: none; }
    .ps-grid2, .ps-grid4 { grid-template-columns: minmax(0, 1fr); }
}

/* The pinned action bar. */
.ps-actionbar-wrap { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(to top, var(--cloud) 70%, rgba(244, 246, 250, 0)); }
.ps-actionbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); background: var(--ink); border-radius: var(--radius-lg); padding: 12px 16px; box-shadow: var(--elevation-3); }
.ps-actionbar-status { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--slate-200); }
.ps-status { display: inline-flex; align-items: center; gap: 6px; }
.ps-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.ps-dot--ok { background: var(--signal-green); }
.ps-dot--warn { background: var(--warning); }
.ps-dot--bad { background: var(--critical); }
.ps-actionbar-buttons { display: flex; gap: 10px; }
.ps-btn { height: 40px; padding: 0 18px; border-radius: var(--radius-md); border: 0; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ps-btn:disabled { opacity: .5; cursor: default; }
.ps-btn--ghost { border: 1px solid var(--slate-600); background: transparent; color: var(--slate-200); font-weight: 500; }
.ps-btn--primary { background: var(--core-blue); color: var(--cloud); }
.ps-btn--ready { background: var(--signal-green); color: var(--ink); }
.ps-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Fields on this page use the brand corner radius (8px) rather than the Material default. */
.ps-card .mud-input-outlined, .ps-card .mud-input-outlined .mud-input-outlined-border, .ps-jobpick .mud-input-outlined, .ps-jobpick .mud-input-outlined .mud-input-outlined-border { border-radius: var(--radius-md); }
