:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #162633;
    background: #edf2f3;
    --navy: #102833;
    --teal: #006c62;
    --line: #d4e1e1;
    --muted: #4f6670;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal); text-underline-offset: .2em; }
a:hover { color: #00483f; }
:focus-visible { outline: 3px solid #008c78; outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.top { background: var(--navy); border-bottom: 4px solid #25aa91; }
.top nav, .nav-links, .heading, .org-card, .member-actions, .member-actions form, .pagination {
    display: flex; align-items: center; gap: 14px;
}
.top nav { min-height: 72px; flex-wrap: wrap; padding-block: 12px; }
.top nav > form { margin-left: auto; }
.top a { color: #f4fbfa; text-decoration: none; }
.top a:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.2rem; margin-right: 12px; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 34px; color: var(--navy); background: #86e4cf; border-radius: 7px; font-size: .84rem; }
.main { padding-block: clamp(28px, 5vw, 58px); }
h1 { margin: 0 0 22px; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin: 0 0 15px; font-size: 1.18rem; line-height: 1.25; }
.heading { justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.heading h1 { margin: 6px 0 0; }
.heading .plate { margin-top: 12px; }
.context { display: inline-block; margin-bottom: 8px; font-weight: 650; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: clamp(16px, 2.5vw, 25px); min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.org-list, .fields { display: grid; gap: 14px; }
.org-card { justify-content: space-between; text-decoration: none; }
.org-card:hover, .metric:hover { border-color: var(--teal); }
.org-card h2 { margin-bottom: 4px; }
.auth-card { max-width: 450px; margin: min(7vh, 60px) auto 0; }
.auth-card .fields { margin-bottom: 18px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric { display: flex; flex-direction: column; gap: 6px; justify-content: space-between; color: inherit; text-decoration: none; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.attention { background: #fff6df; border-color: #ead3a0; }
.form-grid, .details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.details { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.details dt, small, .muted, .empty { color: var(--muted); }
.details dd { margin: 6px 0 0; font-weight: 650; }
small { display: block; margin-top: 3px; }
label { display: grid; gap: 5px; font-weight: 650; }
label small { margin: 0; font-weight: 400; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #aebfbe; border-radius: 6px; background: #fff; color: inherit; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); }
textarea { resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; justify-self: start; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--navy); cursor: pointer; font-weight: 650; text-decoration: none; }
.button:hover { background: #e9f4f2; }
.primary { color: white; background: var(--teal); border-color: var(--teal); }
.primary:hover { background: #005248; color: #fff; }
.dark { color: #fff; border-color: #647781; background: transparent; }
.dark:hover { background: #25414b; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters label:first-child { flex: 1 1 200px; }
.check { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); }
th { background: #eef5f4; font-size: .86rem; white-space: nowrap; }
td { font-size: .94rem; }
.plate { display: inline-block; border: 1px solid var(--line); background: #f2f6f6; color: var(--navy); border-radius: 4px; padding: 3px 7px; white-space: nowrap; font-family: ui-monospace, monospace; font-weight: 750; }
.status { display: inline-block; white-space: nowrap; padding: 4px 8px; font-size: .82rem; border-radius: 5px; background: #eef1f2; }
.available { color: #1b583d; background: #dcf3e5; }
.assigned { color: #245383; background: #e4effb; }
.maintenance, .deadline { color: #744500; background: #fff3d8; }
.deadline small { color: inherit; }
.record { border-top: 1px solid var(--line); padding: 13px 0; overflow-wrap: anywhere; }
.record p { white-space: pre-wrap; margin-bottom: 0; }
.member-actions, .member-actions form { flex-wrap: wrap; margin-top: 7px; gap: 6px; }
.member-actions select { width: auto; }
.notice { margin-block: 0 18px; padding: 12px 16px; border: 1px solid #b7ded3; border-radius: 7px; background: #e0f5ec; }
form + .notice { margin-block: 16px 0; }
.error { border-color: #e5bebe; background: #fff1ee; color: #8c2b25; }
.error ul { margin-block: 0; padding-left: 18px; }
.pagination { margin-top: 15px; }
.vehicle-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.vehicle-actions [aria-current="page"] { border-color: currentColor; font-weight: 700; }
.tracking-map { min-height: 320px; height: 50vh; max-height: 560px; border-radius: 7px; }
@media (max-width: 880px) { .metrics { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); } }
@media (max-width: 680px) {
    .split, .form-grid { grid-template-columns: 1fr; }
    .wrap { width: calc(100% - 28px); }
    .nav-links { order: 3; width: 100%; }
}
