/* MobiTrack Tag mobile-first application shell. */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f0f4f9;
    --surface-3: #e8eef7;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #172033;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --accent: #e85d04;
    --accent-soft: #fff1e8;
    --accent-ink: #ffffff;
    --ok: #16a34a;
    --ok-soft: #eaf8ef;
    --warn: #d97706;
    --warn-soft: #fff7e6;
    --danger: #dc2626;
    --danger-soft: #fff0f0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, .09);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 8px;
    --tabbar-h: 72px;
    --topbar-h: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; letter-spacing: 0 !important; }

html {
    background: var(--bg);
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overscroll-behavior-y: contain;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.2; }
h1 { margin-bottom: 0; font-size: 1.08rem; font-weight: 750; letter-spacing: 0; }
h2 { margin-bottom: .45rem; font-size: 1.35rem; font-weight: 760; letter-spacing: 0; }
h3 { margin-bottom: .75rem; font-size: .82rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }

/* ---------- app chrome ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    height: calc(var(--topbar-h) + var(--safe-top));
    padding: var(--safe-top) 1rem 0;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    backdrop-filter: saturate(180%) blur(18px);
}

.topbar-title { display: flex; align-items: center; gap: .72rem; min-width: 0; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }

.brand-logo { width: 52px; height: 40px; flex: none; object-fit: contain; }
.login-logo { width: 154px; height: 94px; object-fit: contain; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: .18s ease;
}
.icon-btn:hover, .icon-btn:active { background: var(--surface-2); color: var(--accent); }
.icon-btn.is-busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 1rem 1rem calc(var(--tabbar-h) + var(--safe-bottom) + 1.4rem);
}
.page-bare { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100vh; padding: 1.25rem; }

.tabbar {
    position: fixed;
    right: .75rem;
    bottom: calc(.65rem + var(--safe-bottom));
    left: .75rem;
    z-index: 500;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: var(--tabbar-h);
    padding: 6px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 8px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, .16);
    backdrop-filter: saturate(180%) blur(18px);
}
.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 6px;
    color: var(--muted-2);
    font-size: .68rem;
    font-weight: 650;
    transition: .18s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }

.offline-banner {
    position: sticky;
    top: calc(var(--topbar-h) + var(--safe-top));
    z-index: 400;
    padding: .55rem 1rem;
    background: var(--warn-soft);
    color: #92400e;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
}

/* ---------- primitives ---------- */

.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fresh { color: var(--ok); font-weight: 650; }
.mt { margin-top: .8rem; }
.inline { display: inline; }
.rule { margin: 1rem 0; border: 0; border-top: 1px solid var(--border); }

.alert {
    margin-bottom: .9rem;
    padding: .8rem .95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-size: .88rem;
}
.alert-success { background: var(--ok-soft); border-color: #bbebcb; color: #166534; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: 1rem;
}
.stat {
    position: relative;
    overflow: hidden;
    min-height: 94px;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat::after {
    content: "";
    position: absolute;
    right: -16px;
    bottom: -22px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--accent-soft);
}
.stat:nth-child(2)::after { background: var(--ok-soft); }
.stat:nth-child(3)::after { background: var(--surface-3); }
.stat:nth-child(4)::after { background: var(--warn-soft); }
.stat-value { position: relative; z-index: 1; display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: 0; }
.stat-label { position: relative; z-index: 1; display: block; margin-top: .15rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.stat-warn .stat-value { color: var(--warn); }

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .55rem;
    margin-bottom: .9rem;
}
.toolbar input[type="search"] { grid-column: 1 / -1; }
.toolbar input:not([type="search"]), .toolbar select { min-width: 0; }

input, select, textarea {
    width: 100%;
    min-height: 48px;
    padding: .72rem .85rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
    font-size: 16px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: #7aa5f8;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; margin: 0 0 .38rem .1rem; color: #475569; font-size: .8rem; font-weight: 650; }
.field small { display: block; margin: .35rem .1rem 0; color: var(--muted); font-size: .74rem; }
.check { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; font-size: .9rem; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--accent); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 48px;
    padding: .68rem 1rem;
    background: var(--surface);
    color: #334155;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: #cc4f00; color: #fff; box-shadow: 0 6px 14px rgba(232, 93, 4, .18); }
.btn-primary:hover { background: #c94f00; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-outline { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: .45rem .78rem; font-size: .82rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .55rem;
    background: var(--surface-2);
    color: var(--muted);
    border: 0;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.tag { padding: .18rem .48rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .66rem; font-weight: 700; }
.tag-webhook { background: var(--ok-soft); color: var(--ok); }
.tag-history { background: var(--accent-soft); color: var(--accent); }
.tag-failed_webhook { background: var(--warn-soft); color: var(--warn); }
.battery { color: var(--muted); font-size: .78rem; font-weight: 600; }
.battery-low { color: var(--warn); font-weight: 750; }

/* ---------- cards and data ---------- */

.card-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.card {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:active { transform: scale(.992); }
.card-main { display: block; flex: 1; min-width: 0; padding: 1rem; color: inherit; }
.card-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .38rem; }
.card-title { flex: 1; overflow: hidden; font-size: .98rem; font-weight: 750; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { overflow: hidden; color: var(--muted); font-size: .84rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .65rem; margin-top: .55rem; font-size: .76rem; }
.card-side {
    display: grid;
    width: 58px;
    flex: none;
    place-items: center;
    background: #f7f4f0;
    border-left: 1px solid var(--border);
    color: var(--accent);
}
.card-side svg { width: 24px; height: 24px; filter: drop-shadow(0 4px 7px rgba(37, 99, 235, .2)); }

.sync-note { display: flex; align-items: center; gap: .45rem; margin: -.1rem .15rem .9rem; }
.sync-note::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.empty {
    padding: 2.7rem 1.25rem;
    background: rgba(255, 255, 255, .65);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    text-align: center;
}
.empty p { margin: .3rem 0; }

.panel, .details {
    margin-bottom: 1rem;
    padding: 1.05rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.details summary { cursor: pointer; color: #334155; font-size: .9rem; font-weight: 700; }
.pre { overflow-x: auto; padding: .8rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 12px; }

.row-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem; }
.row-actions > * { flex: 1 1 auto; }
.row-actions .inline .btn, .row-actions form .btn { width: 100%; }

.device-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: .1rem 0 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dce8fb;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.device-name { margin-bottom: .28rem; font-size: 1.28rem; }
.device-hero p { margin-bottom: 0; overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.kv > div { min-width: 0; padding: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.kv span { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.kv strong { display: block; overflow-wrap: anywhere; font-size: .92rem; font-weight: 720; }
.kv-wide { grid-column: 1 / -1; }

.chips { display: flex; gap: .45rem; overflow-x: auto; margin: .25rem 0 .8rem; padding: .15rem 0 .35rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .5rem .82rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 5px 14px rgba(37, 99, 235, .18); }

.timeline { position: relative; display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: .75rem;
    padding: .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.timeline li::before { content: ""; position: absolute; top: 1rem; left: -.25rem; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-time { color: var(--muted); font-size: .73rem; font-weight: 650; }
.timeline-body { min-width: 0; overflow-wrap: anywhere; font-size: .86rem; }
.timeline-title { display: block; margin-bottom: .15rem; color: var(--text); font-weight: 750; }

.log { display: grid; gap: .45rem; margin: .65rem 0 0; padding: 0; list-style: none; }
.log li { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.log li:last-child { border-bottom: 0; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { min-width: 0; flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }

.install-heading { display: flex; align-items: center; gap: .85rem; }
.install-heading img { width: 64px; height: 64px; flex: none; border: 1px solid var(--border); border-radius: 8px; }
.install-heading h3 { margin: 0 0 .2rem; color: var(--text); font-size: 1rem; text-transform: none; }
.install-heading p { margin: 0; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }
.install-status { min-height: 1.2rem; margin: 0; }
.install-guide { margin-top: 1rem; padding: .85rem; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.install-guide ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.install-guide p { margin: .35rem 0 0; }

/* ---------- authentication ---------- */

.is-bare { background: #f6f8fc; }
.auth-card {
    width: 100%;
    max-width: 390px;
    padding: 1.7rem 1.25rem 1.3rem;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.auth-brand { display: grid; justify-items: center; gap: .45rem; margin-bottom: 1.35rem; text-align: center; }
.auth-brand h2 { margin: .25rem 0 0; font-size: 1.5rem; }
.auth-brand p { margin-bottom: 0; }
.stack { display: block; }

/* ---------- map ---------- */

.map { width: 100%; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.map-inline { height: 285px; margin-bottom: 1rem; }
.map-full { height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - var(--safe-top) - var(--safe-bottom) - 3rem); min-height: 390px; }
.map-empty { position: relative; margin-top: -50vh; }
.leaflet-container { border-radius: var(--radius); font: inherit; }
.leaflet-control-zoom { overflow: hidden; border: 0 !important; border-radius: 8px !important; box-shadow: var(--shadow-md) !important; }
.leaflet-control-zoom a { color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-popup-content-wrapper { border-radius: 8px; box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: .7rem .9rem; font-size: .84rem; line-height: 1.45; }

@media (min-width: 480px) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .toolbar { grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto; }
    .toolbar input[type="search"] { grid-column: auto; }
}

@media (min-width: 760px) {
    body { font-size: 16px; }
    .page { padding-top: 1.35rem; }
    .tabbar { right: 50%; left: auto; width: min(560px, calc(100% - 2rem)); transform: translateX(50%); }
    .stats { gap: .85rem; }
    .stat { min-height: 104px; }
    .card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .09); }
    .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .timeline li { grid-template-columns: 112px minmax(0, 1fr); }
    .map-inline { height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- vehicle registry ---------- */
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: .2rem 0 1rem; }
.page-heading h2 { margin: 0; font-size: 1.55rem; }
.eyebrow { margin: 0 0 .25rem; color: var(--accent); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.vehicle-stats .stat:nth-child(1) { border-top: 3px solid var(--accent); }
.vehicle-stats .stat:nth-child(2) { border-top: 3px solid var(--ok); }
.vehicle-stats .stat:nth-child(3) { border-top: 3px solid #2563eb; }
.vehicle-stats .stat:nth-child(4) { border-top: 3px solid var(--warn); }
.vehicle-stats .stat::after { display: none; }
.vehicle-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.vehicle-row { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.vehicle-row-link { display: grid; grid-template-columns: 92px minmax(0, 1fr); color: inherit; }
.vehicle-thumb { width: 92px; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; background: #202733; color: #f47a25; font-size: 1.6rem; }
.vehicle-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-row-body { min-width: 0; padding: .85rem .9rem; }
.vehicle-row-body p { overflow: hidden; margin: 0 0 .45rem; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.vehicle-registration { overflow-wrap: anywhere; font-size: 1rem; }
.vehicle-row-meta { display: flex; justify-content: space-between; gap: .8rem; font-size: .75rem; }
.vehicle-row-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-form { margin-bottom: 1rem; }
.form-section { padding: 1.2rem 0; border-top: 1px solid var(--border); }
.section-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .7rem; margin-bottom: 1rem; }
.section-heading > span { display: grid; width: 32px; height: 32px; place-items: center; background: #202733; border-radius: 6px; color: #fff; font-size: .7rem; font-weight: 800; }
.section-heading h3 { margin: 0 0 .1rem; color: var(--text); font-size: .95rem; text-transform: none; }
.section-heading p { margin: 0; color: var(--muted); font-size: .77rem; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 .8rem; }
.field-wide { grid-column: 1 / -1; }
.vehicle-form textarea { min-height: 88px; font-family: inherit; font-size: 16px; }
.upload-field input { padding: .5rem; }
.form-submit { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + .8rem); z-index: 100; display: flex; justify-content: flex-end; padding: .7rem; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.scan-success { margin-bottom: .7rem; padding: .55rem .7rem; background: var(--ok-soft); border-left: 4px solid var(--ok); color: #166534; font-weight: 750; }
.vehicle-profile-head { margin: -1rem -1rem 1rem; background: #202733; color: #fff; }
.vehicle-cover { width: 100%; aspect-ratio: 16 / 8; overflow: hidden; background: #111827; }
.vehicle-cover img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-cover-empty { display: grid; width: 100%; height: 100%; place-items: center; color: #94a3b8; font-size: .8rem; }
.vehicle-profile-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1rem; }
.vehicle-profile-title h2 { margin: 0; color: #fff; font-size: 1.7rem; overflow-wrap: anywhere; }
.vehicle-profile-title p:last-child { margin: .2rem 0 0; color: #cbd5e1; }
.location-band { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: .7rem; align-items: start; margin-bottom: 1rem; padding: 1rem; background: #edf9f1; border-left: 4px solid var(--ok); }
.location-band .btn { grid-column: 2; justify-self: start; }
.location-band h3 { margin: 0 0 .25rem; color: var(--text); font-size: 1rem; text-transform: none; }
.location-band p { margin: 0; color: var(--muted); font-size: .78rem; }
.location-pulse { width: 10px; height: 10px; margin-top: .25rem; background: var(--ok); border-radius: 50%; box-shadow: 0 0 0 5px rgba(22,163,74,.14); }
.profile-grid { display: grid; gap: 1rem; }
.profile-section { margin-bottom: 1rem; padding: 1rem 0 0; border-top: 1px solid var(--border); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.section-title h3 { margin: 0; color: var(--text); font-size: .95rem; text-transform: none; }
.section-title span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.record-list { display: grid; margin: 0; }
.record-list > div { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: .8rem; padding: .62rem 0; border-bottom: 1px solid var(--border); }
.record-list dt { color: var(--muted); font-size: .74rem; }
.record-list dd { margin: 0; overflow-wrap: anywhere; text-align: right; font-size: .82rem; font-weight: 700; }
.driver-intro { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; padding: .8rem; background: #202733; color: #fff; border-radius: var(--radius); }
.driver-intro img, .driver-avatar { width: 58px; height: 58px; flex: none; border-radius: 50%; object-fit: cover; }
.driver-avatar { display: grid; place-items: center; background: var(--accent); font-size: 1.2rem; font-weight: 800; }
.driver-intro strong, .driver-intro span { display: block; }
.driver-intro span { color: #cbd5e1; font-size: .78rem; }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.document-link { display: flex; min-height: 72px; flex-direction: column; justify-content: center; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.document-link span { font-weight: 750; }
.document-link small { color: var(--accent); }
.qr-admin { display: grid; gap: 1rem; align-items: center; margin: 1rem 0; padding: 1rem; background: #fff8f2; border: 1px solid #fed7bd; border-radius: var(--radius); }
.qr-admin h3 { margin: 0 0 .3rem; color: var(--text); font-size: 1.2rem; text-transform: none; }
.qr-admin p:not(.eyebrow) { color: var(--muted); }
.qr-code { width: 256px; max-width: 100%; padding: 8px; justify-self: center; background: #fff; border: 1px solid var(--border); }
.qr-code canvas, .qr-code img { display: block; width: 100%; height: auto; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.admin-actions form .btn { width: 100%; }
.scanner-shell { max-width: 620px; margin: 0 auto; }
.scanner-copy { margin-bottom: 1rem; }
.scanner-copy h2 { margin-bottom: .25rem; font-size: 1.65rem; }
.scanner-copy p:last-child { color: var(--muted); }
.scanner-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #111827; border-radius: var(--radius); }
.scanner-stage video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 18%; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanner-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #94a3b8; }
.scanner-placeholder[hidden] { display: none; }
.scanner-status { min-height: 24px; margin: .8rem 0; color: var(--muted); text-align: center; }
.scanner-status.is-error { color: var(--danger); }
.scanner-actions { justify-content: center; }
@media (min-width: 620px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qr-admin { grid-template-columns: minmax(0, 1fr) 256px; }
    .location-band { grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; }
    .location-band .btn { grid-column: auto; }
}
@media (min-width: 860px) {
    .page { max-width: 1080px; }
    .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vehicle-profile-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); margin: 0 0 1rem; border-radius: var(--radius); overflow: hidden; }
    .vehicle-cover { aspect-ratio: 16 / 10; }
    .vehicle-profile-title { align-items: center; }
}
