/* ==== Design tokens (issue 222, UX-C3 / C4 / C7) ====
   The same values as Services/NSLogiTheme.cs (the MudTheme). Rules: indigo is the only interactive colour (buttons, links, focus);
   amber is the marketing call to action only; success / warning / danger / info mark state, never decoration. Prefer these variables
   (or MudBlazor's --mud-palette-*) over hard-coded hex in new styles. */
:root {
    --brand-50: #EEF2FF;
    --brand-100: #E0E7FF;
    --brand-400: #818CF8;
    --brand-500: #6366F1;
    --brand-600: #4F46E5;   /* buttons, links, focus, app bar */
    --brand-700: #4338CA;
    --accent-500: #F59E0B;  /* marketing CTA only */
    --accent-600: #D97706;
    --gray-900: #111827;    /* headings */
    --gray-700: #374151;
    --gray-600: #4B5563;    /* body / meta minimum on white */
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;    /* borders */
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --success: #15803D;
    --warning: #B45309;
    --danger: #DC2626;
    --info: #2563EB;
    /* context strip (only if a banner is ever needed again — the company now lives in the neutral app-bar chip) */
    --context-bg: #FEF3C7;
    --context-fg: #78350F;
    /* type scale: 12 is the floor; 14 is body, labels, tables and buttons */
    --font-xs: 0.75rem;     /* 12px */
    --font-sm: 0.875rem;    /* 14px */
    --font-md: 1rem;        /* 16px */
    --font-lg: 1.25rem;     /* 20px */
    --font-xl: 1.75rem;     /* 28px */
    /* spacing 4 · 8 · 12 · 16 · 24 · 32 · 48 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --row-height: 44px;
    --input-height: 40px;
    --radius: 8px;
    --focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--brand-600);
}

/* Semantic text aliases follow the live theme (light / dark) through MudBlazor's palette variables. */
:root {
    --text-strong: var(--mud-palette-text-primary, var(--gray-900));
    --text-muted: var(--mud-palette-text-secondary, var(--gray-600));
}

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: var(--mud-palette-primary, var(--brand-600));
}

.btn-primary {
    color: #fff;
    background-color: var(--brand-600);
    border-color: var(--brand-700);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: var(--focus-ring);
}

/* ==== Global type rules (UX-C4 / C7) ==== sentence case everywhere: no uppercase transforms on buttons, tabs, overlines or chips
   (the MudTheme sets Button / Overline TextTransform "none"; these catch the components that style themselves). */
.mud-button-root, .mud-tab, .mud-chip, .mud-typography-overline, .mud-table-head .mud-table-cell {
    text-transform: none;
    letter-spacing: normal;
}
.mud-button-root .mud-button-label { font-size: var(--font-sm); }
.mud-button-root.mud-button-size-small .mud-button-label { font-size: 0.8125rem; }
.mud-tab { font-size: var(--font-sm); font-weight: 600; }
.mud-chip.mud-chip-size-small { font-size: var(--font-xs); }
.mud-table-cell { font-size: var(--font-sm); }
.mud-input-helper-text, .mud-typography-caption { font-size: var(--font-xs); }

/* ==== UX-C2: company context chip in the app bar (MainLayout) ====
   Issue 258: our own activator (MudMenu ActivatorContent) — one flex row that never wraps, 30px tall:
   [building icon, child company only] [Group › ]Company (ellipsis) [▾]. Phones (<600px) show only the company's own name. */
.ctx-chip.mud-menu {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(420px, 46vw);
}
/* MudBlazor makes the activator display:contents (and loads after this file): a real box keeps the focus ring and the ellipsis chain. */
.ctx-chip.mud-menu > div.mud-menu-activator {
    display: flex;
    min-width: 0;
    max-width: 100%;
    border-radius: 999px;
    outline: none;
}
.ctx-chip.mud-menu > div.mud-menu-activator:focus-visible .ctx-chip-btn { box-shadow: 0 0 0 2px #fff; }
/* Issue 287: before the live connection the chip is a plain link (to the company page) with the same face. */
.ctx-chip.ctx-chip-link {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(420px, 46vw);
    color: inherit;
    text-decoration: none;
    border-radius: 999px;
    outline: none;
}
.ctx-chip.ctx-chip-link:focus-visible .ctx-chip-btn { box-shadow: 0 0 0 2px #fff; }
.ctx-chip-btn {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    height: 30px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 4px 0 12px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.ctx-chip-btn:hover { border-color: #fff; background-color: rgba(255, 255, 255, .1); }
.ctx-chip-linked .ctx-chip-btn { padding-left: 8px; }
.ctx-chip-btn .ctx-chip-icon, .ctx-chip-btn .ctx-chip-caret { flex: 0 0 auto; font-size: 18px; width: 18px; height: 18px; }
.ctx-chip-btn .ctx-chip-caret { margin-left: -2px; }
.ctx-chip-name, .ctx-chip-static > span[aria-hidden] {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 28px;
}
/* Issue 247: working inside a child company keeps the same neutral outline (no amber on every page); the building icon at the
   start of the chip and the "Parent › Child" path say where you are. */
.ctx-chip-static {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(420px, 46vw);
    height: 30px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}
/* Issue 282: no switching → no chip, just the company's name. */
.ctx-chip-static.ctx-chip-plain { border: none; padding: 0; height: auto; }
@media (max-width: 599.98px) {
    .ctx-chip.mud-menu, .ctx-chip.ctx-chip-link, .ctx-chip-static { max-width: 44vw; }
    .ctx-chip-parent { display: none; }   /* phones: the company's own name only — the group is in the menu */
}
/* Issue 292: the chip's menu shows at once (no fade) and its items take a click the moment they are visible. */
.mud-popover.ctx-chip-popover.mud-popover-open { transition: none !important; opacity: 1; pointer-events: auto; }
/* Issue 292: a company switch is a full page load through the server — say it is on its way (js/nslogiPwa.js sets the class). */
html.nslogi-navigating, html.nslogi-navigating * { cursor: progress !important; }
html.nslogi-navigating body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10000;
    background: linear-gradient(90deg, transparent, var(--accent-500), transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: nslogi-nav-bar 1s linear infinite;
}
@keyframes nslogi-nav-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
/* Issue 288: a header click made before the page is live is remembered (replayed when it starts) — the button says so. */
.nslogi-pending { opacity: .6; cursor: progress; }
/* Issues 274 / 288: the signed-out phone menu — a plain <details> link list that works with or without the live connection. */
.nslogi-phone-menu { position: relative; }
.nslogi-phone-menu > summary { list-style: none; cursor: pointer; }
.nslogi-phone-menu > summary::-webkit-details-marker { display: none; }
.nslogi-phone-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: calc(var(--mud-zindex-appbar, 1300) + 10);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    border-radius: 8px;
    background-color: var(--mud-palette-surface);
}
.nslogi-phone-menu-list > a {
    padding: 10px 16px;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    font-size: .95rem;
}
.nslogi-phone-menu-list > a:hover, .nslogi-phone-menu-list > a:focus-visible { background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .06)); }

/* If a context strip is ever rendered: one line, 32px, readable amber. */
.context-strip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-4);
    background: var(--context-bg);
    color: var(--context-fg);
    font-size: var(--font-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

/* Issue 169: FocusOnNavigate lands on the page heading (tabindex -1) for screen readers; no ring around a heading. */
.mud-main-content :is(h1, h2, h3, h4, h5)[tabindex="-1"]:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Google Places autocomplete dropdown must sit above the MudBlazor dialog (z-index ~1400). */
.pac-container {
    z-index: 13000 !important;
}

/* Red asterisk for MudBlazor required fields. */
.mud-input-required,
.mud-input-label .mud-input-required { color: var(--mud-palette-error) !important; }

/* Multi-line MudBlazor text areas default to ~5 lines and are user-resizable (drag the corner). */
.mud-input-control textarea,
textarea.mud-input-slot { resize: vertical !important; min-height: 118px; }

/* Loads page trailer rail — fixed to the right window edge as an overlay so the loads layout
   underneath stays full width. Toggled from the tracking-board header. */
.nslogi-trailer-rail {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 280px;
    z-index: 1100;
}
/* On wide screens, push the loads content left so the rail doesn't cover it. */
@media (min-width: 960px) {
    .nslogi-rail-open { padding-right: 300px !important; }
}
/* Tablets: the rail is still fixed, so keep pushing the content (it used to sit on top of the table between 600 and 960px). */
@media (min-width: 600px) and (max-width: 959.98px) {
    .nslogi-rail-open { padding-right: 290px !important; }
}
/* Phones: the rail is a wider overlay (content stays full width underneath). */
@media (max-width: 599.98px) {
    .nslogi-trailer-rail { width: 78vw; }
}

/* App-bar search sits on the primary (purple) bar — force readable light text/icon/border. */
.appbar-search .mud-input-slot,
.appbar-search input,
.appbar-search .mud-input-adornment .mud-icon-root { color: #fff !important; }
.appbar-search input::placeholder { color: rgba(255, 255, 255, 0.75) !important; opacity: 1; }
.appbar-search .mud-input-outlined-border { border-color: rgba(255, 255, 255, 0.6) !important; }
.appbar-search.mud-input-control:hover .mud-input-outlined-border { border-color: #fff !important; }

/* ---- Responsive helpers (mobile/tablet/desktop) ---- */
/* Wrap a wide list table so it scrolls horizontally inside its own area instead of widening the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Global: every MudTable's container scrolls horizontally on overflow (many-column money/fleet tables
   on phones) instead of widening the whole page. MudSimpleTable (portal breakdowns) is 2-col, unaffected. */
.mud-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Page headers (title + action buttons) wrap instead of overflowing on small screens. */
.page-header { flex-wrap: wrap; gap: 8px; }

/* Load board row card (issue 78): a CSS grid, so every column keeps its place at every width instead of
   flex-wrap dropping columns onto a second line at random. 7 tracks = ⋮ menu + 6 columns; below 1400px
   the card is two rows of three (identity / pickup / drop-off, then dispatch / money / counts), below
   900px three rows of two, on phones one column. */
.load-row-grid { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .7fr); gap: 8px 20px; align-items: start; }
@media (max-width: 1399.95px) {
    .load-row-grid { grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
    .load-row-grid > .lr-dispatch { grid-column: 2; }
}
@media (max-width: 899.95px) {
    .load-row-grid { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
    .load-row-grid > .lr-dispatch { grid-column: auto; }
    .load-row-grid > .lr-drop, .load-row-grid > .lr-money { grid-column: 2; }
}
/* Master lists (drivers, units…): on phones, stack each field full-width so two min-width columns can't
   combine to exceed the viewport and force horizontal scroll. */
@media (max-width: 599.95px) {
    .load-row-grid { grid-template-columns: auto minmax(0, 1fr); }
    .load-row-grid > div:not(.lr-menu) { grid-column: 2; }
    .master-row > div { flex-basis: 100% !important; min-width: 0 !important; }
}

/* Load editor: actual check-in/out times read red so they aren't mistaken for the appointment window. */
.actual-time .mud-input-label,
.actual-time .mud-input-label.mud-input-label-inputcontrol { color: var(--mud-palette-error) !important; font-weight: 600; }
.actual-time .mud-input.mud-input-underline:before { border-bottom-color: var(--mud-palette-error) !important; }

/* Documents panel drop zone */
.doc-drop-input { opacity: 0; cursor: pointer; }
.doc-drop-zone { border-style: dashed !important; transition: background-color .15s, border-color .15s; }
.doc-drop-zone-active { background-color: rgba(79, 70, 229, .08); border-color: var(--mud-palette-primary) !important; }

/* Dialogs: the close "X" reads red on every modal so it's unmistakable. */
.mud-dialog .mud-button-close,
.mud-dialog .mud-button-close .mud-icon-root { color: var(--mud-palette-error) !important; }
.mud-dialog .mud-button-close:hover { background-color: rgba(244, 67, 54, .08); }

/* ---- Ops dashboard / Revenue by Truck analysis cards (MonthAnalysisCards, Dashboard) ---- */
.dash-h { font-size: 1.15rem; font-weight: 700; margin-bottom: 2px; }
.dash-sub { color: var(--mud-palette-text-secondary); font-size: .85rem; }
.dash-sec { border-left: 4px solid var(--mud-palette-primary); padding-left: 8px; font-weight: 700; font-size: 1rem; margin: 12px 0 6px; }
.dash-sec.muted { border-left-color: var(--mud-palette-text-secondary); color: var(--mud-palette-text-secondary); }
.dash-row { font-size: .95rem; line-height: 1.7; }
.dash-row b { font-weight: 700; }
.dash-hr { border-top: 1px solid var(--mud-palette-lines-default); margin: 8px 0; }
.dash-up { color: var(--mud-palette-success); } .dash-down { color: var(--mud-palette-error); }
.dash-score { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .95rem; margin-top: 8px; }
.dash-score .rev { color: var(--mud-palette-text-secondary); font-size: .85rem; }
.dash-score .pct { color: var(--mud-palette-error); font-weight: 700; }
.dash-score .pct.ok { color: var(--mud-palette-success); }
.dash-score .last { color: var(--mud-palette-text-secondary); font-size: .8rem; }
.dash-bar { height: 6px; border-radius: 3px; background: var(--mud-palette-lines-default); overflow: hidden; margin-top: 3px; }
.dash-bar > div { height: 100%; background: var(--mud-palette-error); }
.dash-bar > div.ok { background: var(--mud-palette-success); }
.dash-days { display: flex; justify-content: space-between; text-align: center; font-size: .8rem; }
.dash-days .col { flex: 1; }
.dash-days .bar { width: 26px; margin: 4px auto 2px; border-radius: 3px; background: var(--mud-palette-primary); }
.dash-days .bar.low { background: var(--mud-palette-text-secondary); }

/* App bar on phones: smaller company name so it isn't clipped, icon-only actions (see MainLayout). */
@media (max-width: 599.98px) {
    .mud-appbar .appbar-title { font-size: .95rem !important; letter-spacing: 0 !important; }
    .mud-appbar img { height: 28px !important; max-width: 80px !important; }
}

/* Load editor: near full-screen so the document pane and the form both fit. */
.load-editor-backdrop .mud-dialog { width: 96vw !important; max-width: 96vw !important; }
.load-editor-backdrop .mud-dialog-content { max-height: calc(100vh - 140px); }

/* ---- Sign-in and the other Identity pages (statically rendered: plain HTML, no MudBlazor components) ---- */
.auth { display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px 64px; min-height: calc(100vh - 64px); background: var(--mud-palette-background); }
.auth-card { width: 100%; max-width: 440px; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); border: 1px solid var(--mud-palette-lines-default); border-radius: 14px; padding: 28px 28px 24px; box-shadow: 0 12px 40px rgba(20, 20, 60, .10); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-brand img { height: 52px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--mud-palette-lines-default); }
.auth-company { font-weight: 700; font-size: 1.05rem; letter-spacing: .3px; }
.auth-sub { font-size: .82rem; opacity: .7; }
.auth h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 14px; text-wrap: balance; }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: .875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.auth-field input { width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 11px 13px; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; background: var(--mud-palette-surface); color: inherit; }
.auth-field input:focus { outline: 2px solid var(--mud-palette-primary); outline-offset: 1px; border-color: var(--mud-palette-primary); }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 18px; font-size: .9rem; }
.auth-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--mud-palette-primary); }
.auth-btn { width: 100%; font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: .3px; padding: 12px; border: 0; border-radius: 8px; background: var(--mud-palette-primary); color: var(--mud-palette-primary-text, #fff); cursor: pointer; }
.auth-btn:hover { filter: brightness(1.08); }
.auth-alt { text-align: center; margin-top: 14px; font-size: .9rem; }
.auth-alt button, .auth-link { background: none; border: 0; font: inherit; font-size: .9rem; color: var(--mud-palette-primary); cursor: pointer; text-decoration: underline; padding: 0; }
.auth-errors, .auth-error { color: var(--mud-palette-error); font-size: .85rem; margin: 6px 0 0; padding-left: 0; list-style: none; }
.auth-errors:empty { display: none; }
.auth-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--mud-palette-lines-default); font-size: .85rem; opacity: .85; line-height: 1.5; }
.auth a { color: var(--mud-palette-primary); }
.auth .alert, .auth .text-danger { color: var(--mud-palette-error); font-size: .9rem; margin-bottom: 10px; }
@media (max-width: 480px) { .auth { padding: 20px 12px 40px; } .auth-card { padding: 22px 18px 18px; } }

/* Load editor: form beside the document pane on wide screens, stacked on phones (a 360px pane floor pushed the form off-screen) */
.load-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); gap: 12px; align-items: start; }
@media (max-width: 959.95px) { .load-editor-grid { display: block; } }
/* Issue 642: the "you can't edit loads — view-only now" warning stays at the top of the dialog's scroll area wherever the form is scrolled.
   The alert's own tint is translucent, so it sits on a solid surface (the tint as an image over it) — the stops don't show through. */
.mud-alert.load-editor-block-notice { position: sticky; top: 0; z-index: 5; background-color: var(--mud-palette-surface); background-image: linear-gradient(var(--mud-palette-warning-hover), var(--mud-palette-warning-hover)); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }

/* Document pane beside the load form (js/pdfPane.js) */
.pdf-pane { display: flex; flex-direction: column; border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; overflow: hidden; background: #3a3a3a; }
.pdf-pane-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--mud-palette-surface); border-bottom: 1px solid var(--mud-palette-lines-default); font-size: .8rem; color: var(--mud-palette-text-secondary); }
.pdf-pane-status { flex: 1 1 auto; }
.pdf-pane-btn { font: inherit; padding: 2px 10px; border-radius: 12px; border: 1px solid var(--mud-palette-lines-default); background: transparent; color: var(--mud-palette-text-primary); cursor: pointer; text-decoration: none; }
.pdf-pane-btn:hover { background: var(--mud-palette-action-default-hover); }
.pdf-pane-pages { flex: 1 1 auto; overflow: auto; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pdf-pane-page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); max-width: 100%; }
.pdf-pane-img { max-width: 100%; height: auto; background: #fff; }

/* Rate-con import drop zone (js/dropZone.js): highlight while a file is dragged over it */
.ratecon-drop.drop-over .mud-paper { border-color: var(--mud-palette-primary) !important; background: rgba(var(--mud-palette-primary-rgb), .08) !important; }

/* Load Search postings (issue 105): the table scrolls sideways inside its card instead of squeezing every column; dates, miles,
   rates and the action buttons never wrap mid-word. */
.postings-table .mud-table-container { overflow-x: auto; }
.postings-table table { min-width: 1180px; }
.postings-table td, .postings-table th { vertical-align: top; }
.postings-table .mud-button-root { white-space: nowrap; }
.postings-table td.posting-comments { max-width: 280px; white-space: normal; font-size: .8rem; word-break: break-word; }

/* Find Loads lane tabs (issue 110): one tab per open lane search, scrolls sideways on narrow screens */
.lane-tabs { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 4px 2px 0; border-bottom: 2px solid var(--mud-palette-lines-default); }
.lane-tab { display: flex; align-items: center; gap: 4px; padding: 6px 4px 6px 12px; min-width: 190px; max-width: 280px; cursor: pointer; border-radius: 8px 8px 0 0;
            background: var(--mud-palette-background-gray); border-bottom: 3px solid transparent; }
.lane-tab:hover { background: var(--mud-palette-action-default-hover); }
.lane-tab.active { background: var(--mud-palette-surface); border-bottom-color: var(--mud-palette-primary); }
.lane-tab-text { min-width: 0; flex: 1; }
.lane-tab-title { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-tab-sub { font-size: .75rem; color: var(--mud-palette-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-tab-add { align-self: center; flex: none; }

/* Blazor's dropped-circuit notice (issue 130; issue 656). One global rule set here — not split between app.css (an old yellow strip) and
   MainLayout's scoped CSS (which needs the scoped bundle and the layout's attribute) — in the reconnect toast's look: the dark card with
   the brand edge, a primary Reload button and a plain close button. Blazor only switches its display on.
   Issue 665: MudBlazor.min.css loads after this file and has its own #blazor-error-ui rules (red bar pinned to the bottom, full width,
   "color: inherit" on the link) — "body" makes ours more specific so they win regardless of order; the toast for a dropped circuit
   (ReconnectModal) has the same fight, handled in its own CSS. */
body #blazor-error-ui {
    display: none; position: fixed; z-index: 3000;
    top: calc(72px + env(safe-area-inset-top, 0px)); bottom: auto; right: auto; left: 50%; transform: translateX(-50%);
    width: max-content; max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box;
    padding: 12px 44px 12px 16px; border-radius: 10px; border-left: 4px solid var(--brand-600, #4F46E5);
    background: var(--gray-900, #111827); color: #F9FAFB; box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif; font-size: .9rem; line-height: 1.45;
}
body #blazor-error-ui b { color: #fff; }
body #blazor-error-ui .reload {
    display: inline-block; margin-left: 10px; padding: 4px 12px; border-radius: 6px;
    background: var(--brand-600, #4F46E5); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap;
}
body #blazor-error-ui .reload:hover, body #blazor-error-ui .reload:focus-visible { filter: brightness(1.1); }
body #blazor-error-ui .dismiss {
    position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: #D1D5DB; font-size: 1rem; line-height: 28px; text-align: center; cursor: pointer;
}
body #blazor-error-ui .dismiss:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 600px) { body #blazor-error-ui { top: calc(64px + env(safe-area-inset-top, 0px)); } }
.lane-tab-count { flex: none; min-width: 22px; padding: 0 6px; border-radius: 11px; font-size: .75rem; font-weight: 600; text-align: center; line-height: 22px;
                  background: var(--mud-palette-primary); color: var(--mud-palette-primary-text); }

/* Find Loads on a phone (issue 125): cards instead of the wide table */
.postings-cards { display: none; }
@media (max-width: 899.95px) {
    .postings-table { display: none !important; }
    .postings-cards { display: block; }
    .posting-card .mud-chip { margin: 0; }
}

/* issue 145: a posting under the lane's minimum (Flag mode) stays in the list, greyed, under the ones that clear the line */
.postings-table tr.posting-below-min td, .posting-card.posting-below-min { opacity: .55; }
.postings-table tr.posting-below-min:hover td { opacity: .9; }

/* Issue 279 (b): the light / dark toggle holds both icons; html[data-theme] (set by the server, flipped on the click by
   js/nslogiTheme.js) shows the one naming the other mode, so the icon changes with the colours, not after the server's re-render. */
html[data-theme="dark"] .nslogi-theme-icon-moon,
html:not([data-theme="dark"]) .nslogi-theme-icon-sun { display: none; }
/* While the palette flips, MudBlazor's colour transitions (buttons 250 ms, chips 300 ms, the bell's badge animates every property
   for 300 ms) painted in-between frames — a lighter Accept green, a blank badge. js/nslogiTheme.js removes the class right after. */
html.nslogi-theme-switching *, html.nslogi-theme-switching *::before, html.nslogi-theme-switching *::after { transition: none !important; }

/* Issue 327: the driver-tools bar (PortalTools) keeps two rows' height on phones, where its buttons wrap — a button that changes
   state after the phone answers (push / GPS / install) can't push the page down under the driver's finger. */
/* Run 37: at every width — My Pay is a phone-narrow column on desktop too, and "Install app" can appear ~3 s late. */
.portal-tools { min-height: 84px; align-content: flex-start; }

/* Issue 638(b): the Ask NSLogi drawer never wider than the screen (440 px wide on a 400 px phone sat 40 px off the left edge), and its
   answers rendered from markdown (AnswerMarkdown) with tight paragraph / list spacing inside the bubble. */
.ask-drawer.mud-drawer { max-width: 100vw; }
.ask-answer { white-space: normal; overflow-wrap: anywhere; }
.ask-answer p { margin: 0 0 6px; }
.ask-answer p:last-child, .ask-answer ul:last-child, .ask-answer ol:last-child { margin-bottom: 0; }
.ask-answer ul, .ask-answer ol { margin: 0 0 6px; padding-left: 20px; }
.ask-answer li { margin: 2px 0; }
.ask-answer code { font-size: .85em; padding: 0 3px; border-radius: 3px; background: var(--mud-palette-action-default-hover); }
