html, body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 14px; }
h1, .h1 { font-size: 1.45rem; font-weight: 600; margin-bottom: 1rem; }
/* the router focuses the page title after navigation (for screen readers); no visible box */
h1:focus, h1:focus-visible { outline: none; }
h2, .h2 { font-size: 1.1rem; font-weight: 600; margin-top: 1.25rem; }
.card { border-color: #e3e6ea; }
.table { background: #fff; font-size: .9rem; }
.table th { white-space: nowrap; font-weight: 600; background: #f0f2f5; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.toolbar .form-label { font-size: .8rem; margin-bottom: .1rem; color: #59636e; }
.stat { background: #fff; border: 1px solid #e3e6ea; border-radius: .5rem; padding: .9rem 1rem; }
.stat .value { font-size: 1.5rem; font-weight: 600; }
.stat .label { color: #59636e; font-size: .85rem; }
.quickgrid table { width: 100%; }
.quickgrid th button.col-title { font-weight: 600; }
/* QuickGrid pads each page with empty rows up to the page size; hide them */
table tbody tr:not(:has(td:not(:empty))) { display: none; }
.validation-message { color: #b02a37; font-size: .85rem; }
.muted { color: #6c757d; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .85rem; }
.json { font-family: Consolas, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-all; max-width: 520px; }

/* ===== Application frame: sidebar (pinned = full width, unpinned = icon rail that expands on hover), top bar, content ===== */
:root {
    --nav-w: 244px; --rail-w: 64px;
    /* Routeqiva: navy, road blue and pin orange (a courier's own colours replace these, see App.razor) */
    --nav-bg: #0b2a55; --nav-bg-2: #0e3366; --nav-fg: #c3d1e4; --nav-fg-strong: #fff; --nav-muted: #7f98bb;
    --accent: #3b9cff; --accent-2: #ff6a13; --page-bg: #f4f6f9; --line: #e3e6ea;
}
body { background: var(--page-bg); }
.app { min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1030; width: var(--nav-w);
    display: flex; flex-direction: column; background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%); color: var(--nav-fg);
    transition: width .18s ease, box-shadow .18s ease, transform .2s ease; overflow: hidden;
}
.sidebar-head { display: flex; align-items: center; gap: .25rem; height: 56px; padding: 0 .75rem 0 .9rem; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; flex: 1; }
.brand-mark { flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.brand-name { color: var(--nav-fg-strong); font-weight: 700; font-size: 1.12rem; letter-spacing: .01em; white-space: nowrap; }
.brand-name span { color: var(--accent); font-weight: 600; }
.pin-btn { flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--nav-muted); }
.pin-btn:hover, .pin-btn:focus-visible { background: rgba(255,255,255,.08); color: var(--nav-fg-strong); outline: none; }
.pin-btn .when-unpinned { display: none; }
html.nav-unpinned .pin-btn .when-pinned { display: none; }
html.nav-unpinned .pin-btn .when-unpinned { display: inline; }
.sidebar-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nav-more { position: absolute; left: 0; right: 0; z-index: 2; height: 34px; border: 0; padding: 0; display: grid; place-items: center;
    color: var(--nav-fg-strong); opacity: 0; pointer-events: none; transition: opacity .15s ease; cursor: pointer; }
.nav-more-up { top: 0; align-items: start; padding-top: 2px; background: linear-gradient(180deg, var(--nav-bg) 35%, transparent); }
.nav-more-down { bottom: 0; align-items: end; padding-bottom: 2px; background: linear-gradient(0deg, var(--nav-bg-2) 35%, transparent); }
.nav-more .bi { opacity: .7; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.nav-more:hover .bi { opacity: 1; color: var(--accent); }
.sidebar.can-up .nav-more-up, .sidebar.can-down .nav-more-down { opacity: 1; pointer-events: auto; }
.sidebar.can-down .nav-more-down .bi { animation: nav-nudge 1.6s ease-in-out 2; }
@keyframes nav-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .sidebar.can-down .nav-more-down .bi { animation: none; } }
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .4rem 0 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }

.nav-sections { display: flex; flex-direction: column; }
.nav-heading { position: relative; height: 30px; margin-top: .55rem; padding: 0 1.15rem; display: flex; align-items: flex-end; padding-bottom: .3rem;
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-muted); white-space: nowrap; }
/* folding sections (App.razor: stb.navToggle); without the script everything stays open */
.nav-toggle { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; justify-content: space-between; }
.nav-toggle:hover { color: var(--nav-fg-strong); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.nav-toggle::after { content: ""; width: 7px; height: 7px; margin: 0 .1rem .3rem 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg); transition: transform .15s ease; opacity: .8; }
html.nav-folding .nav-group { display: none; }
html[data-nav-open~="hub"] .nav-group[data-group="hub"], html[data-nav-here="hub"] .nav-group[data-group="hub"],
html[data-nav-open~="dispatch"] .nav-group[data-group="dispatch"], html[data-nav-here="dispatch"] .nav-group[data-group="dispatch"],
html[data-nav-open~="fleet"] .nav-group[data-group="fleet"], html[data-nav-here="fleet"] .nav-group[data-group="fleet"],
html[data-nav-open~="insights"] .nav-group[data-group="insights"], html[data-nav-here="insights"] .nav-group[data-group="insights"],
html[data-nav-open~="shipments"] .nav-group[data-group="shipments"], html[data-nav-here="shipments"] .nav-group[data-group="shipments"],
html[data-nav-open~="billing"] .nav-group[data-group="billing"], html[data-nav-here="billing"] .nav-group[data-group="billing"],
html[data-nav-open~="commissions"] .nav-group[data-group="commissions"], html[data-nav-here="commissions"] .nav-group[data-group="commissions"],
html[data-nav-open~="rates"] .nav-group[data-group="rates"], html[data-nav-here="rates"] .nav-group[data-group="rates"],
html[data-nav-open~="reference"] .nav-group[data-group="reference"], html[data-nav-here="reference"] .nav-group[data-group="reference"],
html[data-nav-open~="admin"] .nav-group[data-group="admin"], html[data-nav-here="admin"] .nav-group[data-group="admin"] { display: block; }
html[data-nav-open~="hub"] .nav-toggle[data-group="hub"]::after, html[data-nav-here="hub"] .nav-toggle[data-group="hub"]::after,
html[data-nav-open~="dispatch"] .nav-toggle[data-group="dispatch"]::after, html[data-nav-here="dispatch"] .nav-toggle[data-group="dispatch"]::after,
html[data-nav-open~="fleet"] .nav-toggle[data-group="fleet"]::after, html[data-nav-here="fleet"] .nav-toggle[data-group="fleet"]::after,
html[data-nav-open~="insights"] .nav-toggle[data-group="insights"]::after, html[data-nav-here="insights"] .nav-toggle[data-group="insights"]::after,
html[data-nav-open~="shipments"] .nav-toggle[data-group="shipments"]::after, html[data-nav-here="shipments"] .nav-toggle[data-group="shipments"]::after,
html[data-nav-open~="billing"] .nav-toggle[data-group="billing"]::after, html[data-nav-here="billing"] .nav-toggle[data-group="billing"]::after,
html[data-nav-open~="commissions"] .nav-toggle[data-group="commissions"]::after, html[data-nav-here="commissions"] .nav-toggle[data-group="commissions"]::after,
html[data-nav-open~="rates"] .nav-toggle[data-group="rates"]::after, html[data-nav-here="rates"] .nav-toggle[data-group="rates"]::after,
html[data-nav-open~="reference"] .nav-toggle[data-group="reference"]::after, html[data-nav-here="reference"] .nav-toggle[data-group="reference"]::after,
html[data-nav-open~="admin"] .nav-toggle[data-group="admin"]::after, html[data-nav-here="admin"] .nav-toggle[data-group="admin"]::after { transform: rotate(45deg); }
.nav-help { margin-top: .8rem; }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-toggle::after { opacity: 0; }
.nav-item-link { position: relative; display: flex; align-items: center; gap: .8rem; height: 36px; margin: 1px .55rem; padding: 0 .65rem;
    border-radius: 7px; color: var(--nav-fg); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.nav-item-link .bi { flex-shrink: 0; width: 18px; height: 18px; opacity: .85; }
.nav-item-link:hover { background: rgba(255,255,255,.07); color: var(--nav-fg-strong); }
.nav-item-link.active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--nav-fg-strong); }
.nav-item-link.active .bi { color: var(--accent); opacity: 1; }
/* a count beside a menu item (Exceptions): grey, red when something is urgent; on the folded rail, a dot on the icon */
.nav-count { margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.25rem;
             text-align: center; background: rgba(255,255,255,.18); color: var(--nav-fg-strong); }
.nav-count.urgent { background: #dc3545; color: #fff; }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-count { position: absolute; left: 1.7rem; top: 4px; min-width: .55rem; height: .55rem; padding: 0; font-size: 0; line-height: 0; }
.nav-item-link.active::before { content: ""; position: absolute; left: -.55rem; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item-link:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }

.main { margin-left: var(--nav-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .18s ease; }
.topbar { position: sticky; top: 0; z-index: 1020; height: 56px; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
    background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.user-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-weight: 600; font-size: .86rem; color: #1f2937; }
.user-roles { font-size: .72rem; color: #6b7280; }
.signout { border: 1px solid var(--line); }
.menu-btn, .topbar-brand { display: none; }
.content { padding: 1.4rem 1.75rem 3rem; max-width: 1800px; width: 100%; flex: 1 0 auto; }
/* footer: always at the bottom of the window (sticky inside the full-height .main column) */
.app-footer { position: sticky; bottom: 0; z-index: 1015; display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.25rem;
              flex-wrap: wrap; padding: .4rem 1.75rem; background: #fff; border-top: 1px solid #e3e7ee; font-size: .8rem; color: #5b6676;
              box-shadow: 0 -2px 8px rgba(15, 27, 45, .04); }
.app-footer .foot-left { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.25rem; min-width: 0; }
.app-footer .foot-vendor { font-weight: 600; color: #0f1b2d; display: inline-flex; align-items: center; }
.app-footer .foot-vendor img { display: block; height: 40px; width: auto; }
.app-footer .foot-help, .app-footer .foot-session { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.app-footer .foot-help a { color: inherit; text-decoration: none; }
.app-footer .foot-help a:hover { color: #1f6feb; text-decoration: underline; }
.app-footer .foot-help a + a::before { content: "·"; margin-right: .35rem; color: #9aa4b2; }
.app-footer .foot-session .btn-link { font-size: inherit; line-height: inherit; vertical-align: baseline; }
.app-footer .foot-session.warn { color: #9a6700; font-weight: 600; }
.app-footer .foot-session.expired { color: #b42318; font-weight: 600; }
.app-footer .foot-right { color: #8590a0; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media print { .app-footer { display: none; } }

/* unpinned: icon rail; hovering it shows the full menu over the page */
html.nav-unpinned .main { margin-left: var(--rail-w); }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) { width: var(--rail-w); }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .brand-name,
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .pin-btn,
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-item-link .label { opacity: 0; pointer-events: none; }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-heading { color: transparent; }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-heading::after { content: ""; position: absolute; left: 1.1rem; right: 1.1rem; bottom: .55rem; height: 1px; background: rgba(255,255,255,.1); }
html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .sidebar-head { padding-left: 1rem; }
html.nav-unpinned .sidebar:hover, html.nav-unpinned .sidebar:focus-within { width: var(--nav-w); box-shadow: 8px 0 28px rgba(15,27,45,.28); transition-delay: .12s; }
.brand-name, .pin-btn, .nav-item-link .label { transition: opacity .12s ease; }

/* narrow screens: the menu slides in over the page */
.nav-backdrop { display: none; }
@media (max-width: 900px) {
    .sidebar, html.nav-unpinned .sidebar:not(:hover):not(:focus-within) { width: var(--nav-w); transform: translateX(-100%); }
    html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .brand-name,
    html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-item-link .label { opacity: 1; }
    html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-heading { color: var(--nav-muted); }
    html.nav-unpinned .sidebar:not(:hover):not(:focus-within) .nav-heading::after { display: none; }
    html.nav-open .sidebar, html.nav-open.nav-unpinned .sidebar:not(:hover):not(:focus-within) { transform: none; box-shadow: 8px 0 28px rgba(15,27,45,.35); }
    html.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1025; background: rgba(15,27,45,.35); }
    .main, html.nav-unpinned .main { margin-left: 0; }
    .pin-btn { display: none; }
    .menu-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: #1f2937; }
    .menu-btn:hover { background: #eef1f5; }
    .topbar-brand { display: flex; align-items: center; gap: .45rem; font-weight: 700; color: #0f1b2d; text-decoration: none; }
    .topbar { padding: 0 .75rem; }
    .user-text { display: none; }
    .content { padding: 1rem 1rem 3rem; }
    .app-footer { padding: .3rem 1rem; font-size: .72rem; gap: .1rem 1rem; }
    .app-footer .foot-left { gap: .1rem 1rem; }
    .app-footer .foot-vendor { display: none; }
}
@media print { .sidebar, .topbar { display: none; } .main { margin-left: 0 !important; } }

#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1100; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* roles chart (Users & access) */
.role-matrix .rm-what { min-width: 18rem; }
.role-matrix th.rm-role { min-width: 8.5rem; vertical-align: bottom; white-space: normal; }
.role-matrix .rm-summary { font-weight: 400; font-size: .72rem; color: #6b7280; line-height: 1.25; margin-top: .15rem; }
.role-matrix tr.rm-area td { background: #f4f6f9; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #475569; padding-top: .55rem; }
.role-matrix .rm-yes, .role-matrix .rm-view, .role-matrix .rm-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.role-matrix .rm-yes { background: #d1fae5; color: #047857; }
.role-matrix .rm-view { background: #e0f2fe; color: #0369a1; }
.role-matrix .rm-no { color: #cbd5e1; }

/* ---- Insights: headline tiles and charts (palette: validated categorical slots 1-3 + muted grid) */
.insights { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #6250d6; --viz-grid: #e6e9ee; --viz-axis: #6b7684; --viz-ink: #0f1b2d; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin: 1rem 0; }
.kpi { background: #fff; border: 1px solid #e3e6ea; border-radius: .6rem; padding: .8rem 1rem; }
.kpi-label { font-size: .8rem; color: #5b6676; }
.kpi-value { font-size: 1.55rem; font-weight: 700; color: var(--viz-ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-change { font-size: .8rem; color: #5b6676; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.kpi-change.good { color: #146c43; } .kpi-change.bad { color: #b42318; }
.kpi-hint { color: #8590a0; font-size: .75rem; }
.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.viz { background: #fff; border: 1px solid #e3e6ea; border-radius: .6rem; padding: .8rem 1rem; margin: 0; min-width: 0; }
.viz-wide { grid-column: 1 / -1; }
.viz-title { font-weight: 600; font-size: .92rem; color: var(--viz-ink); margin-bottom: .35rem; }
.viz-legend { display: flex; gap: 1rem; font-size: .8rem; color: #5b6676; margin-bottom: .25rem; }
.viz-legend .sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }
.viz .s1 { --c: var(--series-1); } .viz .s2 { --c: var(--series-2); } .viz .s3 { --c: var(--series-3); } .viz .s4 { --c: var(--series-4); }
.viz-legend .sw { background: var(--c); }
.viz-svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-svg .grid { stroke: var(--viz-grid); stroke-width: 1; } .viz-svg .grid.zero { stroke: #c9ced6; }
.viz-svg .axis { fill: var(--viz-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-svg .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-svg .col { fill: var(--c); stroke: #fff; stroke-width: 1; }
.viz-svg .col:hover { opacity: .8; }
.viz-svg .hover .xhair, .viz-svg .hover .dot { visibility: hidden; }
.viz-svg .hover:hover .xhair, .viz-svg .hover:hover .dot { visibility: visible; }
.viz-svg .xhair { stroke: #9aa4b2; stroke-width: 1; stroke-dasharray: 3 3; }
.viz-svg .dot { fill: var(--c); stroke: #fff; stroke-width: 2; }
.viz-svg .hit { fill: transparent; }
.viz-bars { display: grid; gap: 4px; }
.viz-bar { display: grid; grid-template-columns: minmax(120px, 40%) 1fr auto; gap: .6rem; align-items: center; font-size: .82rem; padding: 2px 0; }
.viz-bar:hover { background: #f5f7fa; }
.viz-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-bar-track { height: 12px; }
.viz-bar-fill { height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.viz-bar-fill.neg { background: #9aa4b2; }
.viz-bar-value { font-variant-numeric: tabular-nums; color: var(--viz-ink); text-align: right; min-width: 5.5rem; }
.viz-empty, .viz-note { color: #8590a0; font-size: .82rem; }
.viz-tip { position: fixed; z-index: 2000; pointer-events: none; background: #0f1b2d; color: #fff; font-size: .78rem; line-height: 1.35; padding: .4rem .55rem;
           border-radius: .35rem; white-space: pre-line; box-shadow: 0 4px 14px rgba(15, 27, 45, .25); max-width: 320px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .viz-grid { grid-template-columns: 1fr; } .viz-bar { grid-template-columns: 38% 1fr auto; } }
@media print { .viz-tip { display: none; } }

/* staging copy: a strip on every page */
.staging-strip { background: repeating-linear-gradient(135deg, #fff3cd 0 14px, #ffe69c 14px 28px); color: #664d03; border-bottom: 1px solid #ffda6a;
                 padding: .35rem 1.5rem; font-size: .85rem; text-align: center; }
.staging-strip strong { letter-spacing: .08em; margin-right: .25rem; }

/* ---- customer portal (server-rendered pages under /portal) ---- */
.portal { min-height: 100vh; display: flex; flex-direction: column; background: #f6f7f9; }
.portal-top { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid #e3e6ea; flex-wrap: wrap; }
.portal-brand { font-weight: 700; font-size: 1.15rem; color: #12324d; text-decoration: none; }
.portal-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.portal-nav a { color: #43505c; text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.portal-nav a.active, .portal-nav a:hover { color: #12324d; border-bottom-color: #1f8fbf; }
.portal-user { margin-left: auto; display: flex; gap: .75rem; align-items: center; }
.portal-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.portal-card { max-width: 420px; margin: 3rem auto; background: #fff; border: 1px solid #e3e6ea; border-radius: .5rem; padding: 1.75rem; }
.portal-card h1 { font-size: 1.4rem; }
.portal-foot { text-align: center; padding: 1rem; }

/* dispatch board map */
.dispatch-map { height: 360px; border-radius: .5rem; border: 1px solid var(--bs-border-color); z-index: 0; }
.map-label { background: rgba(255,255,255,.9); border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); font-size: .75rem; padding: 1px 5px; }
.map-label::before { display: none; }
.map-stop { display: flex !important; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font: 600 .7rem/1 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.map-stop.pickup { background: #b54708; }
.map-stop.delivery { background: #2e6bd6; }
.map-traffic { display: flex !important; align-items: center; justify-content: center; background: #f79009; color: #111; font: 800 .9rem/1 system-ui, sans-serif; border: 2px solid #fff; border-radius: 4px; transform: rotate(45deg); box-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* dispatch board: drivers sit above the jobs (as a wrapping strip) until the screen is wide enough for a side column */
.driver-cards { display: flex; flex-wrap: wrap; gap: .5rem; }
.driver-cards > .driver-card { flex: 1 1 15rem; max-width: 24rem; margin: 0; }
@media (min-width: 1400px) {
    .driver-cards { display: block; }
    .driver-cards > .driver-card { max-width: none; margin-bottom: .5rem; }
}
.drag-row { cursor: grab; }
.drag-row:active { cursor: grabbing; }
.driver-cards.dragging > .driver-card { border-style: dashed; }
.driver-card.drop-target { border: 2px solid var(--bs-primary) !important; background: var(--bs-primary-bg-subtle); }
.route-list { list-style: none; max-height: 22rem; overflow: auto; }
.route-num { flex: 0 0 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .75rem; }
.route-num.pickup { background: #b54708; } .route-num.delivery { background: #2e6bd6; }

/* Administration → System health */
.health-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--bs-secondary); }
.health-dot.ok { background: #1a8754; }
.health-dot.info { background: #6c8ebf; }
.health-dot.warn { background: #e0a106; }
.health-dot.bad { background: #c0392b; }

/* the shared sign-in pages */
.signin-shell .portal-brand { display: inline-flex; align-items: center; }
.signin-card { max-width: 440px; }
.signin-or { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 .9rem; color: #6b7280; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid #e3e6ea; }
.start-area:hover { border-color: var(--accent-2); box-shadow: 0 2px 10px rgba(15,27,45,.08); }

/* the role switcher (click your name, top right) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: .2rem .45rem; border-radius: 8px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: #f1f4f8; }
.user-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1100; width: 320px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 10px 30px rgba(15,27,45,.16); padding: .35rem; }
.user-menu-head { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; padding: .35rem .6rem .25rem; }
.user-menu-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: transparent; text-align: left;
    padding: .45rem .6rem; border-radius: 7px; font-size: .86rem; color: #1f2937; }
.user-menu-item span { font-size: .75rem; color: #6b7280; }
.user-menu-item:hover { background: #f1f4f8; }
.user-menu-item.current { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.user-menu-item.current strong::after { content: " ✓"; color: var(--accent-2); }

/* an Admin viewing as someone else (every page, staff and portal) */
.impersonation-strip { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .45rem 1.5rem;
    background: #7c2d12; color: #fff; font-size: .86rem; position: sticky; top: 0; z-index: 1030; }
.impersonation-strip.owner-support { background: #1e3a8a; }
.brand-name.brand-own { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
