/* ============================================================
   NGAA CLIENT PORTAL — mobile-first stylesheet
   Palette (locked): rose #FEE5EE · peach #FFE0B9 · pink #E2A9CA
                     lavender #B295C9 · deep blue #455799
   Feels like polished Flutter: soft elevation, rounded, calm.
   Breakpoints: 360 small phone · 520 phablet · 720 tablet · 1024 laptop
   ============================================================ */

:root {
    --primary: #455799;
    --primary-700: #37457d;
    --primary-900: #2a3563;
    --primary-100: #eaedf7;
    --primary-050: #f3f5fb;
    --lavender: #b295c9;
    --pink: #e2a9ca;
    --rose: #fee5ee;
    --peach: #ffe0b9;
    --peach-deep: #e0a566;
    --ink: #2b2a40;
    --ink-soft: #5b5875;
    --muted: #8f8ba8;
    --line: #e9e6f0;
    --bg: #faf8fb;
    --card: #ffffff;
    --ok: #3f7d63;
    --ok-bg: #e7f3ee;
    --warn: #a9772f;
    --warn-bg: #fbf1de;
    --bad: #b0556a;
    --bad-bg: #f8e7ec;
    --grad: linear-gradient(135deg, var(--primary), var(--lavender));
    --grad-soft: linear-gradient(135deg, #f6f2fb, #fdeef5);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 2px 10px rgba(43, 42, 64, .06);
    --shadow: 0 10px 30px rgba(43, 42, 64, .10);
    --shadow-lg: 0 22px 55px rgba(43, 42, 64, .16);
    --appbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }   /* phones must not inflate type on rotation */
body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;                     /* a wide table can never push the shell sideways */
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.muted { color: var(--muted); }

/* Controls must inherit the font and never shrink below a comfortable tap target. */
button, input, select, textarea { font-family: inherit; }
button, a, label, input, select { -webkit-tap-highlight-color: rgba(69, 87, 153, .14); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg, canvas { max-width: 100%; height: auto; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.appbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
    padding: 12px 18px;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.appbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; min-width: 0; }
/* The mark is navy-on-transparent: never filter it, or it flattens into a white blob. */
.appbar .brand img { height: 34px; width: 34px; border-radius: 9px; }
.brand-word { font-size: 16px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.appbar .spacer { flex: 1 1 auto; }
.appbar .user-chip {
    display: inline-flex; align-items: center; gap: 8px; min-width: 0;
    background: rgba(255, 255, 255, .16); padding: 5px 10px 5px 6px;
    border-radius: 999px; font-size: 13.5px; max-width: 40vw;
}
.appbar .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    background: #fff; color: var(--primary);
    display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.appbar .icon-btn {
    background: rgba(255, 255, 255, .14); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 11px; cursor: pointer;
    display: grid; place-items: center;
}
.appbar .icon-btn img { height: 19px; filter: brightness(0) invert(1); }

/* Sign out is always a WORD, never an icon alone. */
.signout-btn {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    background: rgba(255, 255, 255, .17); color: #fff;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 11px; padding: 8px 13px; min-height: 40px;
    font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: background .15s ease;
}
.signout-btn img { height: 17px; filter: brightness(0) invert(1); }
.signout-btn:hover { background: rgba(255, 255, 255, .3); }
.signout-btn:disabled { opacity: .75; cursor: progress; }

.wrap {
    width: 100%; max-width: 960px; margin: 0 auto; padding: 18px 16px 96px;
    flex: 1 1 auto; min-width: 0; overflow-wrap: break-word;
}

/* bottom nav (mobile-first) */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    display: flex; justify-content: space-around; align-items: stretch;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(43, 42, 64, .06);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 7px 4px; border-radius: 12px; color: var(--muted);
    font-size: 11.5px; font-weight: 600; text-align: center;
}
.tabbar a img { height: 21px; opacity: .8; }
.tabbar a.is-active { color: var(--primary); background: var(--primary-050); }
.tabbar a.is-active img { filter: none; opacity: 1; }

@media (min-width: 720px) {
    .wrap { padding: 26px 24px 40px; }
    /* On a laptop the tabs belong under the app bar, not at the foot of the page. */
    .app > .tabbar { order: 2; position: sticky; top: var(--appbar-h); z-index: 19; }
    .app > .wrap { order: 3; }
    .tabbar {
        max-width: 960px; margin: 0 auto; border: 1px solid var(--line);
        border-radius: 16px; box-shadow: var(--shadow-sm); padding: 8px;
        background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px);
    }
    .tabbar a { flex: 1; flex-direction: row; gap: 8px; min-height: 44px; padding: 10px 16px; font-size: 13.5px; }
    .tabbar a img { height: 19px; }
}

/* ---------- Cards ---------- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
    margin-bottom: 16px; min-width: 0;
}
.card.soft { background: var(--grad-soft); border-color: transparent; }
.card-flat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 22px; }
.page-head .desc { color: var(--ink-soft); font-size: 14.5px; margin: 4px 0 0; }

.hero-greet {
    background: var(--grad); color: #fff; border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.hero-greet h2 { color: #fff; font-size: 23px; }
.hero-greet p { margin: 4px 0 0; opacity: .92; font-size: 14.5px; }

/* KPI stats — always at least one column that fits the screen, so nothing overflows */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat .label { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }
.stat.rose { background: var(--rose); border-color: transparent; }
.stat.peach { background: var(--peach); border-color: transparent; }
.stat.lav { background: #efe6f6; border-color: transparent; }

@media (min-width: 720px) { .stat .num { font-size: 34px; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; cursor: pointer; font-weight: 650; font-size: 15px;
    padding: 12px 18px; min-height: 44px; border-radius: 13px;
    transition: transform .08s ease, box-shadow .15s ease, background .15s;
    background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(69, 87, 153, .28);
    text-align: center;
}
.btn:hover { background: var(--primary-700); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.soft { background: var(--primary-050); color: var(--primary); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--primary); box-shadow: none; }
.btn.danger { background: var(--bad); box-shadow: 0 6px 16px rgba(176, 85, 106, .26); }
.btn.pink { background: var(--pink); color: #4a2b3d; box-shadow: none; }
.btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; min-height: 40px; }
.btn img { height: 18px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 400px) {
    /* Long action rows were the main source of sideways scroll on small phones. */
    .wrap .btn-row > .btn { flex: 1 1 100%; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }
.field .req { color: var(--bad); }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: 16px; min-height: 46px; color: var(--ink); background: #fff;
    transition: border .15s, box-shadow .15s; max-width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(178, 149, 201, .22);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.error-text { font-size: 12.5px; color: var(--bad); margin-top: 5px; min-height: 0; }
.field .error-text { font-size: 12.5px; color: var(--bad); margin-top: 5px; min-height: 0; }

/* Set by shared/js/validation.js, so an invalid field reads as invalid at a
   glance and not only through the sentence printed underneath it. */
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--bad); }
/* 16px inputs stop iOS/Android from zooming in on focus. */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; min-width: 0; }

/* Show / hide password (added by js/api.js). The input keeps its full width and
   just leaves room on the right for the eye button. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
    position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; cursor: pointer; color: var(--muted);
    border-radius: 9px; padding: 0;
}
.pw-toggle:hover { color: var(--primary); background: rgba(69, 87, 153, .08); }
.pw-toggle.on { color: var(--primary); }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Cooldown state for the "Resend code" links. */
.auth-alt a.is-busy { pointer-events: none; opacity: .55; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-soft); }
.checkbox input { width: auto; margin-top: 3px; flex: none; }

.banner { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.banner.err { background: var(--bad-bg); color: var(--bad); border: 1px solid #ecccd5; }
.banner.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cfe8de; }
.banner.info { background: var(--primary-050); color: var(--primary-700); border: 1px solid var(--line); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0dcc0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-mut { background: #efedf4; color: var(--ink-soft); }
.badge-primary { background: var(--primary-050); color: var(--primary); }

/* ---------- Number plate chip ---------- */
.plate {
    font-family: "Consolas", ui-monospace, monospace; font-weight: 800; letter-spacing: .5px;
    background: var(--ink); color: #fff; padding: 7px 11px; border-radius: 10px; font-size: 15px;
    display: inline-block; white-space: nowrap; border: 2px solid #3a3958;
}

/* ---------- Vehicle list ---------- */
.vehicle-card {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 15px; box-shadow: var(--shadow-sm); margin-bottom: 12px; min-width: 0;
}
.vehicle-card .plate { font-size: 16px; }
.vehicle-card .meta { flex: 1; min-width: 0; }
.vehicle-card .meta .name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.vehicle-card .meta .sub { color: var(--muted); font-size: 13px; }
.vehicle-card .actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
@media (max-width: 560px) {
    .vehicle-card { flex-wrap: wrap; }
    .vehicle-card .meta { flex: 1 1 60%; }
    .vehicle-card .actions { flex-direction: row; width: 100%; }
    .vehicle-card .actions .btn { flex: 1; }
}

/* ---------- Auth (single column, mobile-first) ---------- */
.auth {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px 18px;
    background:
        radial-gradient(1000px 460px at 100% -8%, var(--rose), transparent 60%),
        radial-gradient(760px 460px at -6% 108%, var(--peach), transparent 55%),
        var(--bg);
}
.auth-brand { text-align: center; margin-bottom: 18px; max-width: 420px; }
.auth-brand img { height: 66px; margin: 0 auto 10px; }
.auth-brand .tagline { color: var(--ink-soft); font-size: 15.5px; font-weight: 600; margin: 0; }
.auth-card {
    width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
    border-radius: 22px; padding: 24px 22px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.auth-alt { text-align: center; color: var(--ink-soft); font-size: 14px; margin-top: 16px; }
.auth-alt a { font-weight: 700; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.form-aux { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; font-size: 13.5px; }
@media (min-width: 720px) {
    .auth-card, .auth-brand { max-width: 480px; }
    .auth-card { padding: 30px 32px; }
}

/* OTP boxes */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 8px 0 4px; flex-wrap: wrap; }
.otp-row input {
    width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 800;
    border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
}
.otp-row input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(178, 149, 201, .22); }
@media (max-width: 360px) { .otp-row input { width: 38px; height: 48px; font-size: 20px; } }

.dev-code { margin-top: 12px; }
.dev-code code { background: var(--primary-050); color: var(--primary-700); padding: 3px 9px; border-radius: 8px; font-size: 18px; font-weight: 800; letter-spacing: 3px; }

/* ---------- QR card ---------- */
.qr-shell { max-width: 420px; margin: 0 auto; min-width: 0; }
.qr-card {
    background: #fff; border: 1px solid var(--line); border-radius: 22px;
    box-shadow: var(--shadow-lg); overflow: hidden; text-align: center;
}
.qr-card .qr-top { background: var(--grad); color: #fff; padding: 18px 18px 22px; }
.qr-card .qr-top .plate-big {
    font-family: "Consolas", ui-monospace, monospace; font-weight: 800; letter-spacing: 2px;
    background: #fff; color: var(--ink); display: inline-block; padding: 8px 18px;
    border-radius: 12px; font-size: 24px; border: 2px solid #d9d3ea; max-width: 100%;
}
.qr-card .qr-top .facility { font-size: 13px; opacity: .92; margin-top: 10px; }
.qr-card .qr-body { padding: 22px 18px 8px; }
.qr-card .qr-body canvas, .qr-card .qr-body img { margin: 0 auto; border-radius: 12px; max-width: 240px; width: 100%; height: auto; display: block; }
.qr-card .qr-meta { padding: 6px 18px 20px; color: var(--muted); font-size: 12.5px; }
.qr-secure { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
@media (max-width: 400px) { .qr-card .qr-top .plate-big { font-size: 20px; letter-spacing: 1px; } }

/* ---------- Loading / empty ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 46px 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 14px; margin: 0; }
.empty-state.error { color: var(--bad); }
.empty-state img { width: 130px; margin: 0 auto 14px; opacity: .9; }

/* ---------- Steps ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 18px; }
.steps .dot-step { width: 30px; height: 6px; border-radius: 999px; background: var(--line); }
.steps .dot-step.done { background: var(--primary); }
.steps .dot-step.cur { background: var(--pink); }

/* ---------- Lists ---------- */
.rows { display: flex; flex-direction: column; min-width: 0; }
.rows .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.rows .row:last-child { border-bottom: none; }
.rows .row .k { color: var(--ink-soft); flex: none; }
.rows .row .v { font-weight: 650; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Movement history: search + filters ---------- */
.card.filters { padding: 14px; margin-bottom: 14px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 12px; width: 18px; opacity: .55; pointer-events: none; }
.search-wrap input[type="search"], .search-wrap input[type="text"] {
    width: 100%; padding: 13px 74px 13px 40px; font-size: 16px; min-height: 48px;
    border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
    appearance: none; -webkit-appearance: none;
}
.search-wrap input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(178, 149, 201, .22); }
.search-clear {
    position: absolute; right: 9px; border: none; background: var(--primary-050); color: var(--primary);
    font-size: 12.5px; font-weight: 750; padding: 7px 11px; border-radius: 999px; cursor: pointer;
}
.filters-toggle { margin-top: 10px; }
.filters-body { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.filters-body[hidden] { display: none; }
.filters-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 750; color: var(--ink-soft); letter-spacing: .02em; min-width: 0; }
.fld input, .fld select {
    width: 100%; padding: 11px 12px; font-size: 16px; min-height: 44px;
    border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink);
}
.fld input:focus, .fld select:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(178, 149, 201, .22); }
.filters-actions { margin-top: 12px; }
.mv-summary { color: var(--ink-soft); font-size: 13.5px; margin: 0 2px 10px; }

@media (min-width: 720px) {
    .card.filters { padding: 16px 18px; }
    .filters-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .filters-toggle { display: none; }
    .filters-body { border-top: none; margin-top: 0; padding-top: 12px; }
}

/* ---------- Movement history: table (reflows into cards on phones) ---------- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 0; }
.tbl thead th {
    text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted); font-weight: 750; padding: 10px 12px; background: var(--primary-050);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:nth-child(even) { background: #fcfbfe; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .at { color: var(--muted); }
.tbl .who-x { color: var(--muted); font-weight: 400; }

/* Below the tablet width a 7-column table cannot be read, so each row becomes a card. */
@media (max-width: 719px) {
    .mv-table { font-size: 15px; }
    .mv-table thead { display: none; }
    .mv-table, .mv-table tbody, .mv-table tr, .mv-table td { display: block; width: 100%; }
    .mv-table tbody tr {
        background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow-sm); padding: 6px 14px; margin-bottom: 12px;
    }
    .mv-table tbody tr:nth-child(even) { background: #fff; }
    .mv-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        border-bottom: 1px dashed var(--line); padding: 9px 0; text-align: right;
    }
    .mv-table tbody tr td:last-child { border-bottom: none; }
    .mv-table td::before {
        content: attr(data-label); flex: none;
        color: var(--muted); font-size: 11.5px; font-weight: 750;
        letter-spacing: .05em; text-transform: uppercase; text-align: left;
    }
    .mv-table td > * { max-width: 100%; overflow-wrap: anywhere; }
}

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pg-btn {
    border: 1px solid var(--line); background: #fff; color: var(--primary);
    padding: 9px 14px; min-height: 42px; border-radius: 10px; font-weight: 650; font-size: 14px; cursor: pointer;
}
.pg-btn:hover:not(:disabled) { background: var(--primary-050); }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-nums { display: flex; align-items: center; gap: 5px; }
.pg-num {
    min-width: 42px; height: 42px; padding: 0 6px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--primary); font-weight: 700; font-size: 14px; cursor: pointer;
}
.pg-num:hover:not(:disabled) { background: var(--primary-050); }
.pg-num.is-current { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.pg-info { color: var(--ink-soft); font-size: 13.5px; width: 100%; text-align: center; }
@media (min-width: 720px) { .pg-info { width: auto; } }

/* ---------- 320-360px phones (the narrowest Androids in the field) ---------- */
@media (max-width: 400px) {
    .appbar { padding: 10px 12px; gap: 8px; }
    .appbar .brand img { height: 26px; }
    .brand-word { display: none; }          /* the mark alone carries the brand here */
    .appbar .user-name { display: none; }   /* avatar stays; the sign-out WORD always stays */
    .signout-btn { padding: 7px 10px; font-size: 12.5px; }
    .wrap { padding: 14px 12px 96px; }
    .page-head h2, .hero-greet h2 { font-size: 20px; }
    .card, .vehicle-card, .stat { padding: 14px; }
    .tabbar a { font-size: 10.5px; }
}

/* ---------- Print (client QR / PDF fallback) ---------- */
@media print {
    .appbar, .tabbar, .no-print, .btn, .signout-btn, .filters, .pager { display: none !important; }
    body { background: #fff; }
    .wrap { padding: 0; }
    .qr-card { box-shadow: none; border: 1px solid #ccc; }
    /* A scan-friendly pass, not a poster: ~84mm keeps it easily readable from a car
       window while leaving comfortable white space on the sheet (was 145mm, which
       filled the whole A4 page). */
    .qr-card .qr-body canvas, .qr-card .qr-body img { width: 84mm !important; max-width: 84mm !important; height: auto !important; }
}
