/* ════════════════════════════════════════════════════════════════
   AutoLoc — feuille de style (mobile-first, thème clair/sombre, WCAG AA)
   Aucune étape de build requise.
   ════════════════════════════════════════════════════════════════ */
:root {
    --brand: #0f766e; --brand-600: #0d6660; --brand-50: #e6f4f2;
    --accent: #d97706;
    --bg: #f6f8f8; --surface: #ffffff; --surface-2: #eef2f2;
    --text: #172224; --muted: #56666a; --border: #d8e0e1;
    --success: #15803d; --success-bg: #e7f6ec;
    --warning: #a16207; --warning-bg: #fef6e0;
    --danger: #b91c1c; --danger-bg: #fdecec;
    --info: #1d4ed8; --info-bg: #e8effd;
    --radius: 12px; --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.06);
    --focus: 0 0 0 3px rgba(15,118,110,.45);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}
[data-theme="dark"] {
    --brand: #2dd4bf; --brand-600: #14b8a6; --brand-50: #0f2a28;
    --accent: #f59e0b;
    --bg: #0b1416; --surface: #121e20; --surface-2: #1a2a2d;
    --text: #e6eeef; --muted: #9db0b3; --border: #2a3b3e;
    --success: #4ade80; --success-bg: #10281a;
    --warning: #fbbf24; --warning-bg: #2a220c;
    --danger: #f87171; --danger-bg: #2c1414;
    --info: #93b4ff; --info-bg: #141f38;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
    --focus: 0 0 0 3px rgba(45,212,191,.55);
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2, .h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.h3 { font-size: 1.2rem; } .h4 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 6px 0; border-bottom: 1px solid var(--border); } .plain li:last-child { border: 0; }

/* ── Layout ── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.section { padding: 32px 0; }
.section-head, .page-head, .row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stack > * + * { margin-top: 16px; }
.two-col, .detail-layout, .checkout-layout, .search-layout, .dash-grid { display: grid; gap: 20px; }
.dash-grid canvas { max-height: 260px; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-form > input, .row-form > select { width: auto; flex: 1 1 150px; }
.page-head .row-form { flex-wrap: nowrap; } .page-head .row-form > input { flex: 0 1 170px; }
@media (min-width: 900px) {
    .two-col { grid-template-columns: 1fr 1fr; }
    .detail-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
    .checkout-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
    .search-layout { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
    .dash-grid { grid-template-columns: 1fr 1fr; }
    .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
    .sticky { position: sticky; top: 84px; }
}

/* ── Header / nav ── */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--brand); text-decoration: none; }
.nav-toggle { display: inline-flex; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; color: var(--text); cursor: pointer; }
.main-nav { display: none; position: absolute; inset: 64px 0 auto 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px 16px; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.main-nav.open { display: flex; }
.main-nav a { padding: 10px 8px; text-decoration: none; color: var(--text); border-radius: 8px; }
.main-nav a:hover { background: var(--surface-2); }
.main-nav a.btn-primary { color: #fff; } .main-nav a.btn-primary:hover { background: var(--brand-600); }
[data-theme="dark"] .main-nav a.btn-primary { color: #04201d; }
.nav-bell { position: relative; } .nav-bell .dot { position: absolute; top: 2px; right: -2px; background: var(--danger); color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 5px; }
.prefs { display: flex; gap: 6px; align-items: center; padding-top: 8px; }
.prefs select { padding: 6px 8px; font-size: .85rem; width: auto; }
.link-btn { background: none; border: 0; color: var(--text); font: inherit; padding: 10px 8px; cursor: pointer; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; min-width: 40px; min-height: 40px; cursor: pointer; font-size: 1.25rem; line-height: 1; }
@media (min-width: 960px) {
    .nav-toggle { display: none; }
    .main-nav { display: flex; position: static; flex-direction: row; align-items: center; padding: 0; box-shadow: none; border: 0; background: none; }
    .prefs { padding: 0 0 0 8px; }
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .88rem; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
[data-theme="dark"] .btn-primary { color: #04201d; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-outline:hover { background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link { font-weight: 600; text-decoration: none; }

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
label, legend { font-weight: 600; font-size: .92rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.card { padding: 20px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
input[type="range"] { padding: 0; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
input[aria-invalid="true"] { border-color: var(--danger); }
.help { font-size: .82rem; color: var(--muted); margin: 0; }
.field-error { color: var(--danger); font-size: .85rem; margin: 0; }
.field.checkbox, .checkbox-inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; display: inline-flex; margin-right: 14px; }
.input-group { display: flex; gap: 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.form-actions { display: flex; justify-content: flex-end; }
meter { width: 100%; height: 8px; }

/* ── Cards, badges, alerts ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-glass { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; }
.alert { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; border: 1px solid transparent; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert-close { background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.chips li { background: var(--brand-50); color: var(--brand); padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.chips-input { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 8px; }
.empty { text-align: center; padding: 40px; }

/* ── Hero & home ── */
.hero { background: linear-gradient(135deg, #0f766e 0%, #134e4a 60%, #1f2937 100%); color: #f0fdfa; padding: 40px 0 48px; }
.hero-inner { display: grid; gap: 28px; align-items: center; }
@media (min-width: 960px) { .hero-inner { grid-template-columns: 1.1fr 1fr; } .hero { padding: 72px 0; } }
.hero h1 { color: #fff; } .lead { font-size: 1.12rem; opacity: .92; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: #99f6e4; }
.hero-points { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.search-form { display: grid; gap: 0 12px; color: var(--text); }
.search-form .btn { margin-top: 6px; }
@media (min-width: 640px) { .search-form { grid-template-columns: 1fr 1fr; } .search-form .field:first-child, .search-form .btn { grid-column: span 2; } }
.category-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.category-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.category-tile:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.steps-list { display: grid; gap: 16px; padding-left: 20px; }
@media (min-width: 768px) { .steps-list { grid-template-columns: repeat(3, 1fr); } }

/* ── Vehicle cards ── */
.vehicle-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vehicle-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s; }
.vehicle-card:hover { transform: translateY(-3px); }
.vehicle-card-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); display: block; }
.vehicle-card-media img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vehicle-card-title { font-size: 1.08rem; margin: 0; } .vehicle-card-title a { color: var(--text); text-decoration: none; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; font-size: .82rem; color: var(--muted); }
.specs li { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
.vehicle-card-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; }
.price { margin: 0; } .price strong { font-size: 1.25rem; color: var(--brand); } .price span { color: var(--muted); font-size: .85rem; }
.price.big strong { font-size: 1.7rem; }
.rating { margin: 0; color: var(--accent); font-weight: 600; } .rating span { color: var(--muted); font-weight: 400; }

/* ── Search & detail ── */
.filters { position: relative; }
@media (min-width: 900px) { .filters { position: sticky; top: 84px; } }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.results-bar select { width: auto; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.gallery { margin-bottom: 20px; }
.gallery-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0 20px; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; cursor: pointer; flex: 0 0 96px; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--brand); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.spec-grid div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.spec-grid dt { font-size: .78rem; color: var(--muted); } .spec-grid dd { margin: 2px 0 0; font-weight: 600; }
.conditions { padding-left: 18px; }
.review { border-bottom: 1px solid var(--border); padding: 12px 0; }
.review header { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.stars { color: var(--accent); letter-spacing: 1px; }
.reply { margin: 8px 0 0; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 4px; }
.booking-box { position: relative; }
@media (min-width: 900px) { .booking-box { position: sticky; top: 84px; } }
.quote-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 14px; font-size: .92rem; }
.quote-box dl { margin: 0; } .quote-box .total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }
.booked summary { cursor: pointer; font-size: .9rem; margin-top: 10px; }

/* ── Checkout ── */
.checkout-steps { display: grid; gap: 18px; }
.option-list { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.option-body { display: flex; flex-direction: column; flex: 1; gap: 2px; font-weight: 400; }
.option-price { font-weight: 600; white-space: nowrap; }
.option .qty { width: 72px; }
.summary-img { border-radius: var(--radius-sm); margin-bottom: 12px; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.price-lines { margin: 0; } .price-lines > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.price-lines dt { color: var(--muted); } .price-lines dd { margin: 0; font-weight: 600; text-align: right; }
.price-lines .total { border-top: 2px solid var(--border); margin-top: 6px; padding-top: 8px; font-size: 1.1rem; }
.price-lines .total dt { color: var(--text); font-weight: 700; }
.price-lines .success dd { color: var(--success); }
.checklist { padding-left: 0; list-style: none; counter-reset: step; }
.checklist li { position: relative; padding: 10px 0 10px 40px; border-bottom: 1px dashed var(--border); counter-increment: step; }
.checklist li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.checklist li.done::before { content: "✓"; background: var(--success); color: #fff; }
.booking-summary { display: flex; gap: 16px; flex-wrap: wrap; } .booking-summary img { border-radius: var(--radius-sm); object-fit: cover; }
.booking-card { display: flex; gap: 12px; text-decoration: none; color: var(--text); } .booking-card img { border-radius: 8px; object-fit: cover; width: 110px; height: 70px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; margin-bottom: 12px; }
.star-input legend { width: 100%; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 2rem; color: var(--border); cursor: pointer; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--accent); }
.star-input input:focus-visible + label { box-shadow: var(--focus); }
.contract-preview { max-height: 420px; overflow: auto; background: #fff; color: #111; margin-bottom: 16px; }
.signature-pad { width: 100%; max-width: 600px; height: 200px; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.table.compact th, .table.compact td { padding: 6px 8px; }
.table .actions { white-space: nowrap; }
.table .thumb { border-radius: 6px; object-fit: cover; }
.row-alert { background: var(--danger-bg); } .row-unread td:first-child { font-weight: 700; }
.matrix td, .matrix th { text-align: center; } .matrix th[scope="row"] { text-align: left; }

/* ── Tabs & pagination ── */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; min-height: 40px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; }
.pagination .active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Chat ── */
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat-log { list-style: none; padding: 0; margin: 0; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; }
[data-theme="dark"] .bubble.mine { color: #04201d; }
.bubble.staff:not(.mine) { border-left: 3px solid var(--accent); }
.bubble .author { font-size: .75rem; font-weight: 700; opacity: .8; display: block; }
.bubble p { margin: 2px 0; } .bubble time { font-size: .72rem; opacity: .75; }
.chat-form { display: flex; gap: 8px; } .chat-form textarea { min-height: 48px; }
.conv-list { list-style: none; padding: 0; } .conv-list a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.notif-list { list-style: none; padding: 0; } .notif-list li { padding: 12px; border-bottom: 1px solid var(--border); } .notif-list .unread { border-left: 3px solid var(--brand); background: var(--brand-50); }

/* ── Auth ── */
.auth-card { max-width: 440px; margin: 40px auto; } .auth-card.wide { max-width: 720px; }

/* ── Footer & PWA ── */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 16px; margin-top: 40px; background: var(--surface); }
.footer-grid { display: grid; gap: 20px; } .footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.install-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); z-index: 60; }
.error-page { padding: 80px 0; } .error-code { font-size: 5rem; font-weight: 800; color: var(--brand); margin: 0; }

/* ── Maps ── */
.map { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }
.map-sm { height: 320px; margin-bottom: 20px; } .map-lg { height: calc(100vh - 180px); min-height: 420px; }
.tracking-layout { display: grid; gap: 16px; }
@media (min-width: 1100px) { .tracking-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.tracking-panel { max-height: calc(100vh - 180px); overflow-y: auto; }
.fleet-list { list-style: none; padding: 0; margin: 8px 0 16px; max-height: 260px; overflow-y: auto; }
.fleet-list button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 8px 4px; color: var(--text); cursor: pointer; font: inherit; }
.fleet-list button:hover { background: var(--surface-2); }
.legend { font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 6px; }
.dot.moving { background: #16a34a; } .dot.stopped { background: #2563eb; } .dot.offline { background: #6b7280; } .dot.maintenance { background: #ea580c; }
.vehicle-marker { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.vehicle-marker.moving { background: #16a34a; } .vehicle-marker.stopped { background: #2563eb; } .vehicle-marker.offline { background: #6b7280; } .vehicle-marker.maintenance { background: #ea580c; }
.alert-list { list-style: none; padding: 0; } .alert-list li { padding: 8px; border-left: 3px solid var(--warning); margin-bottom: 8px; background: var(--surface-2); border-radius: 4px; }
.alert-list .sev-critical { border-color: var(--danger); } .alert-list .sev-info { border-color: var(--info); }
.kyc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 20px; }
.kyc-grid img { border-radius: 8px; max-height: 260px; object-fit: contain; width: 100%; background: var(--surface-2); }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; } .thumb-grid figure { position: relative; margin: 0; }
.thumb-grid figure .btn { position: absolute; top: 4px; right: 4px; min-height: 28px; padding: 2px 8px; }
.thumb-grid figcaption { position: absolute; bottom: 4px; left: 4px; }
.inline-details summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .88rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .filter-bar input, .filter-bar select { width: auto; flex: 1 1 160px; }

/* ── Admin shell ── */
.admin-shell { display: grid; min-height: 100vh; }
.admin-sidebar { background: #0c1f21; color: #cfe3e1; padding: 16px 12px; display: none; flex-direction: column; gap: 12px; position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; overflow-y: auto; }
.admin-sidebar.open { display: flex; }
.admin-sidebar .logo { color: #fff; padding: 4px 8px 12px; } .admin-sidebar .logo small { font-weight: 500; color: #5eead4; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a { color: #cfe3e1; text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-size: .93rem; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-sidebar nav a[aria-current="page"] { background: #0f766e; color: #fff; }
.sidebar-foot { margin-top: auto; } .sidebar-foot a { color: #9fbfbc; }
.admin-topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.admin-content { padding: 20px 16px 40px; }
@media (min-width: 1024px) {
    .admin-shell { grid-template-columns: 250px minmax(0, 1fr); }
    .admin-sidebar { display: flex; position: sticky; top: 0; height: 100vh; }
    .admin-topbar .nav-toggle { display: none; }
    .admin-content { padding: 24px 32px 48px; }
}
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kpi strong { font-size: 1.55rem; } .kpi small { color: var(--muted); font-size: .8rem; }
.kpi-alert { border-color: var(--danger); } .kpi-alert strong { color: var(--danger); }
.alert-card { border-color: var(--warning); }

/* ── Leaflet popups en mode sombre ── */
[data-theme="dark"] .leaflet-popup-content-wrapper, [data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--text); }
[data-theme="dark"] .leaflet-tile { filter: brightness(.75) contrast(1.1) saturate(.8); }

@media print { .site-header, .site-footer, .admin-sidebar, .admin-topbar, .btn, form { display: none !important; } body { background: #fff; } }
