/* StationWash: our own layout only. DevExpress controls take their look from the Fluent theme
   (one accent colour per client, set in App.razor). Rule: no selector overrides of DevExpress
   internals and no !important; change a control through the theme or its CSS variables.
   --sw-accent, --sw-accent-strong (text and buttons, 4.5:1 on white), --sw-accent-soft,
   --sw-font, --sw-font-display, --sw-btn-radius, --sw-btn-pad and --sw-title-mark come from the
   client brand (App.razor). DevExpress follows the brand through its public variables:
   --dxds-font-family-sans-serif (set in App.razor) and, on each DxButton with CssClass
   "sw-dxbtn", --dxds-border-radius-40 (the radius the Fluent button reads). */

:root {
    --sw-page: #F4F5F6;
    --sw-surface: #FFFFFF;
    --sw-line: #E3E5E8;
    --sw-line-soft: #EEF0F2;
    --sw-ink: #1F2328;
    --sw-ink-soft: #3D4550;
    --sw-muted: #5B6470;
    --sw-ok-bg: #E7F5EC; --sw-ok-fg: #1E6B3A;
    --sw-warn-bg: #FFF4E0; --sw-warn-fg: #8A5300;
    --sw-bad-bg: #FDECEC; --sw-bad-fg: #9B1C1C;
    --sw-info-bg: #EEF0F2; --sw-info-fg: #3D4550;
    --sw-radius: 8px;
    --sw-font: Inter, "Segoe UI", Arial, sans-serif;
    --sw-font-display: var(--sw-font);
    --sw-btn-radius: 0.375rem;
    --sw-btn-pad: 14px;
    --sw-title-mark: transparent;
}

html, body { margin: 0; background: var(--sw-page); color: var(--sw-ink); font-family: var(--sw-font); font-size: 14px; line-height: 1.5; }
h1 { font-family: var(--sw-font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.3px; margin: 0 0 4px; }
/* A client's short bar above page titles (bp: yellow), only when the brand sets one. */
.sw-title-marked .sw-main h1::before,
.sw-title-marked .sw-login-card h1::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--sw-title-mark); margin-bottom: 10px; }
/* DevExpress buttons take the brand's shape through the public radius variable they read. */
.sw-dxbtn { --dxds-border-radius-40: var(--sw-btn-radius); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
/* Navigation moves focus to the page heading (screen readers announce it); no frame on a heading. */
h1:focus { outline: none; }
a { color: var(--sw-accent-strong); }
code { font-family: "JetBrains Mono", monospace; }

.sw-muted { color: var(--sw-muted); }
.sw-small { font-size: 12px; }
.sw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sw-accent-text { color: var(--sw-accent-strong); }

/* ---------- shell ---------- */
.sw-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sw-side { flex: 1 1 240px; max-width: 256px; min-width: 220px; background: var(--sw-surface); border-right: 1px solid var(--sw-line); display: flex; flex-direction: column; }
.sw-brand { padding: 18px 20px; border-bottom: 1px solid var(--sw-line-soft); }
.sw-logo { display: inline-flex; align-items: center; gap: 10px; }
.sw-logo-text { font-family: var(--sw-font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.3px; color: #2A2622; line-height: 1.15; }
.sw-logo-badge { width: 34px; height: 34px; border-radius: 8px; background: var(--sw-accent); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; }
.sw-logo-stack { display: flex; flex-direction: column; }
.sw-logo-sub { font-size: 12px; color: var(--sw-muted); }
/* A client's own logo: shown unchanged, at least 40 px high (bp's smallest own use is 37 px), with clear space. */
.sw-logo-client { gap: 14px; }
.sw-logo-img { height: 44px; max-width: 160px; display: block; }
.sw-logo-product { padding-left: 14px; border-left: 1px solid var(--sw-line); font-weight: 500; font-size: 15px; color: var(--sw-accent-strong); white-space: nowrap; }
.sw-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; }
.sw-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--sw-ink-soft); }
.sw-nav a:hover { background: var(--sw-line-soft); }
.sw-nav a.active { background: var(--sw-accent-soft); color: var(--sw-accent-strong); font-weight: 600; }
.sw-side-fill { flex: 1 1 auto; }
.sw-demo-note { margin: 0 12px 10px; padding: 8px 10px; border-radius: 6px; background: var(--sw-warn-bg); color: var(--sw-warn-fg); font-size: 12px; }
.sw-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--sw-line-soft); }
.sw-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sw-accent-strong); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; }
.sw-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sw-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-user-role { font-size: 12px; color: var(--sw-muted); }
.sw-icon-btn { width: 36px; height: 36px; border: 1px solid var(--sw-line); border-radius: 6px; color: var(--sw-ink-soft); display: inline-flex; align-items: center; justify-content: center; background: var(--sw-surface); }
.sw-powered { display: flex; align-items: center; gap: 6px; padding: 10px 16px 14px; font-size: 12px; color: var(--sw-muted); }
.sw-powered img { opacity: 0.85; }
.sw-powered-name { font-weight: 600; }
.sw-login-card .sw-powered { padding: 14px 0 0; margin-top: 6px; border-top: 1px solid var(--sw-line-soft); justify-content: center; }

.sw-main { flex: 999 1 560px; min-width: 0; padding: 20px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.sw-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sw-top-fill { flex: 1 1 auto; }
.sw-search-host { flex: 1 1 320px; max-width: 520px; min-width: 0; }
.sw-search { position: relative; flex: 1 1 320px; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--sw-surface); border: 1px solid #D5D9DE; border-radius: 6px; color: var(--sw-muted); }
.sw-search input { border: 0; outline: none; flex: 1 1 auto; font: inherit; color: var(--sw-ink); background: transparent; }
.sw-search:focus-within { border-color: var(--sw-accent-strong); }
.sw-search-hits { position: absolute; top: 44px; left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--sw-surface); border: 1px solid var(--sw-line); border-radius: var(--sw-radius); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.sw-search-hits a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; text-decoration: none; color: var(--sw-ink); }
.sw-search-hits a:hover { background: var(--sw-line-soft); }

/* ---------- building blocks ---------- */
.sw-card { background: var(--sw-surface); border: 1px solid var(--sw-line); border-radius: var(--sw-radius); padding: 18px; min-width: 0; }
.sw-narrow { max-width: 560px; }
.sw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.sw-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.sw-kpi-label { color: var(--sw-muted); font-size: 13px; }
.sw-kpi-value { font-size: 26px; font-weight: 600; margin-top: 2px; }
.sw-kpi-note { color: var(--sw-muted); font-size: 12px; }
.sw-bar { height: 8px; background: #E8EAED; border-radius: 4px; overflow: hidden; }
.sw-bar-fill { height: 8px; background: var(--sw-accent); }
.sw-usage { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sw-usage-row { display: flex; justify-content: space-between; }
.sw-list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--sw-line-soft); }
.sw-wash-row { display: grid; grid-template-columns: 84px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--sw-line-soft); }
.sw-wash-row > span:nth-child(3) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 500; }

.sw-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sw-badge-ok { background: var(--sw-ok-bg); color: var(--sw-ok-fg); }
.sw-badge-warn { background: var(--sw-warn-bg); color: var(--sw-warn-fg); }
.sw-badge-bad { background: var(--sw-bad-bg); color: var(--sw-bad-fg); }
.sw-badge-info { background: var(--sw-info-bg); color: var(--sw-info-fg); }

.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 var(--sw-btn-pad); border: 1px solid #D5D9DE; background: var(--sw-surface); color: var(--sw-ink); border-radius: var(--sw-btn-radius); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.sw-btn:disabled { color: var(--sw-muted); cursor: not-allowed; background: #F7F8F9; }
.sw-btn-primary { background: var(--sw-accent-strong); border-color: var(--sw-accent-strong); color: #FFFFFF; font-weight: 600; }
.sw-btn-wide { width: 100%; }
.sw-alert { padding: 10px 12px; border-radius: 6px; background: var(--sw-bad-bg); color: var(--sw-bad-fg); margin: 8px 0; }
.sw-alert-ok { background: var(--sw-ok-bg); color: var(--sw-ok-fg); }
.sw-alert-warn { background: var(--sw-warn-bg); color: var(--sw-warn-fg); }
.sw-ok { padding: 10px 12px; border-radius: 6px; background: var(--sw-ok-bg); color: var(--sw-ok-fg); margin: 8px 0; }

/* ---------- the EU plate (same look as SafeStation's LicensePlateDisplay) ---------- */
.sw-plate { display: inline-flex; align-items: stretch; border: 1.5px solid #1F2328; border-radius: 4px; overflow: hidden; background: #FFFFFF; font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 13px; line-height: 1; text-decoration: none; vertical-align: middle; }
.sw-plate-band { background: #003399; color: #FFFFFF; font-size: 9px; padding: 3px 4px; display: flex; align-items: flex-end; }
.sw-plate-body { padding: 5px 8px; color: #1F2328; letter-spacing: 0.5px; }
a.sw-plate:hover, a.sw-plate:focus-visible { box-shadow: 0 0 0 3px var(--sw-accent-soft); outline: none; }
.sw-plate-large { font-size: 24px; border-width: 2px; border-radius: 6px; }
.sw-plate-large .sw-plate-band { font-size: 12px; padding: 6px 7px; }
.sw-plate-large .sw-plate-body { padding: 8px 14px; letter-spacing: 1px; }

/* ---------- login ---------- */
.sw-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; background: linear-gradient(var(--sw-accent-soft), var(--sw-accent-soft)) top / 100% 220px no-repeat, var(--sw-page); }
.sw-login-card { width: 100%; max-width: 440px; background: var(--sw-surface); border: 1px solid var(--sw-line); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.sw-login-brand { margin-bottom: 8px; }
.sw-code-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sw-code-form .sw-label { margin-bottom: 0; }
.sw-input { height: 40px; padding: 0 12px; border: 1px solid #C9CED4; border-radius: 6px; font: inherit; color: var(--sw-ink); background: var(--sw-surface); box-sizing: border-box; width: 100%; }
.sw-input:focus { outline: 2px solid var(--sw-accent-strong); outline-offset: 1px; border-color: var(--sw-accent-strong); }
.sw-input-code { font-family: "JetBrains Mono", monospace; font-size: 22px; letter-spacing: 8px; text-align: center; height: 48px; }
.sw-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; font-size: 12px; color: var(--sw-muted); }
.sw-or::before, .sw-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--sw-line); }
.sw-login-staff { margin: 0; text-align: center; font-size: 12px; }
.sw-login-staff a { color: var(--sw-muted); }
.sw-dev { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sw-line-soft); display: flex; flex-direction: column; gap: 6px; }
.sw-dev h2 { margin: 0; }
.sw-dev-row { margin: 0; }
.sw-dev-btn { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border: 1px solid var(--sw-line); background: var(--sw-surface); border-radius: 6px; font: inherit; cursor: pointer; color: var(--sw-ink); }
.sw-dev-btn:hover { border-color: var(--sw-accent-strong); background: var(--sw-accent-soft); }
.sw-dev-name { font-weight: 600; }
.sw-dev-role { font-size: 12px; color: var(--sw-muted); }

/* ---------- customer page: managers and mails ---------- */
.sw-manager { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.sw-mail { border-top: 1px solid var(--sw-line-soft); padding: 8px 0; }
.sw-mail summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; list-style: none; }
.sw-mail summary::-webkit-details-marker { display: none; }
.sw-mail summary::before { content: "\25B8"; color: var(--sw-muted); }
.sw-mail[open] summary::before { content: "\25BE"; }
.sw-mail-time { font-variant-numeric: tabular-nums; color: var(--sw-muted); }
.sw-mail-subject { font-weight: 500; flex: 1 1 200px; min-width: 0; }
.sw-mail-body { white-space: pre-wrap; margin: 8px 0 4px 18px; padding: 10px 12px; background: #F6F7F8; border: 1px solid var(--sw-line); border-radius: 6px; font-size: 13px; }

/* ---------- import window ---------- */
.sw-steps { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.sw-import-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.sw-import-table { max-height: 46vh; overflow: auto; border: 1px solid var(--sw-line); border-radius: 6px; }
.sw-import-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sw-import-table th { position: sticky; top: 0; background: #F6F7F8; text-align: left; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--sw-line); }
.sw-import-table td { padding: 6px 10px; border-bottom: 1px solid var(--sw-line-soft); vertical-align: top; }
.sw-import-table td:first-child { font-variant-numeric: tabular-nums; color: var(--sw-muted); width: 56px; }
.sw-import-error td { background: var(--sw-bad-bg); }

/* ---------- simulator ---------- */
.sw-sim-result { border-radius: var(--sw-radius); padding: 16px 18px; }
.sw-sim-ok { background: var(--sw-ok-bg); color: var(--sw-ok-fg); }
.sw-sim-no { background: var(--sw-warn-bg); color: var(--sw-warn-fg); }
.sw-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-chip { border: 1px solid var(--sw-line); background: var(--sw-surface); border-radius: 6px; padding: 4px; cursor: pointer; }
.sw-chip:hover { border-color: var(--sw-accent-strong); }
.sw-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,0.12); vertical-align: middle; }
.sw-form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sw-form-row > * { flex: 1 1 160px; min-width: 0; }
.sw-label { display: block; font-size: 13px; color: var(--sw-muted); margin-bottom: 4px; }
.sw-code { background: #F6F7F8; border: 1px solid var(--sw-line); border-radius: 6px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; }

/* Driver pages (docs/24): one column, built for a phone first; a wide screen keeps the same column. */
.sw-grow { flex: 1 1 auto; min-width: 0; }
.sw-drv-shell { min-height: 100vh; display: flex; flex-direction: column; }
.sw-drv-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--sw-surface); border-bottom: 1px solid var(--sw-line); }
.sw-drv-top-fill { flex: 1 1 auto; }
.sw-drv-main { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.sw-drv-main h1 { font-size: 20px; }
.sw-drv-main h2 { font-size: 16px; margin: 0 0 6px; }
.sw-drv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sw-drv-cars { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.sw-drv-car { flex: 0 0 auto; display: flex; flex-direction: column; padding: 8px 12px; border: 1px solid var(--sw-line); border-radius: var(--sw-radius); background: var(--sw-surface); color: var(--sw-ink); text-decoration: none; min-height: 44px; box-sizing: border-box; justify-content: center; }
.sw-drv-car-on { border-color: var(--sw-accent-strong); background: var(--sw-accent-soft); }
.sw-drv-car-plate { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.sw-drv-now { border-radius: var(--sw-radius); padding: 14px 16px; }
.sw-drv-now p { margin: 0; font-size: 15px; }
.sw-drv-now-yes { background: var(--sw-ok-bg); color: var(--sw-ok-fg); }
.sw-drv-now-no { background: var(--sw-warn-bg); color: var(--sw-warn-fg); }
.sw-drv-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sw-line-soft); }
.sw-drv-row-text { flex: 1 1 auto; min-width: 0; }
.sw-drv-row .sw-btn { min-height: 44px; }
.sw-drv-strong { font-weight: 600; }
.sw-drv-when { flex: 0 0 84px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.sw-drv-switch { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
.sw-drv-switch input { width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--sw-accent-strong); }
.sw-drv-who { text-align: center; margin: 4px 0 0; }
.sw-drv-main .sw-powered { justify-content: center; }

@media (max-width: 640px) {
    .sw-main { padding: 16px; }
    .sw-side { max-width: none; }
}

/* Side by side (wide enough that the menu does not wrap above the page): the menu stays in view while the page
   scrolls, so the account and the sign-out at its foot are visible on long pages too. A short window scrolls the
   menu itself. */
@media (min-width: 840px) {
    .sw-side { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; box-sizing: border-box; }
}
