:root {
    --dx-navy: #0A1F38;
    --dx-blue: #1677FF;
    --dx-cyan: #0EA5E9;
    --dx-green: #12A866;
    --dx-red: #E5484D;
    --dx-orange: #F5A524;
    --dx-purple: #1677FF;
    --dx-bg: #F0F5FA;
    --dx-card: #FFFFFF;
    --dx-text: #0F1F38;
    --dx-muted: #5B6B7C;
    --dx-border: #E2EAF2;
    --navy: #0A1F38;
    --navy-2: #12304F;
    --navy-3: #1677FF;
    --gold: #1677FF;
    --gold-2: #0EA5E9;
    --gold-soft: rgba(22, 119, 255, .12);
    --bg: #F0F5FA;
    --bg-2: #E6EEF6;
    --card: #FFFFFF;
    --text: #0F1F38;
    --muted: #5B6B7C;
    --line: #E2EAF2;
    --ok: #12A866;
    --ok-bg: #E6F7EF;
    --warn: #B7791F;
    --warn-bg: #FFF7E8;
    --bad: #E5484D;
    --bad-bg: #FDECEE;
    --info: #1677FF;
    --info-bg: #E8F1FF;
    --sidebar: #0A1F38;
    --sidebar-2: #12304F;
    --sidebar-text: #A8B8C9;
    --sidebar-w: 260px;
    --topbar-h: 60px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 31, 56, .04), 0 4px 16px rgba(15, 31, 56, .05);
    --shadow-lg: 0 4px 12px rgba(15, 31, 56, .06), 0 16px 36px rgba(15, 31, 56, .08);
    --focus: 0 0 0 3px rgba(22, 119, 255, .22);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 480px at 10% -10%, rgba(22, 119, 255, .07), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(14, 165, 233, .05), transparent 50%),
        var(--bg);
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.app { padding-bottom: calc(72px + var(--safe-b)); }
a { color: var(--navy-3); text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
.ico { width: 1.15em; height: 1.15em; flex-shrink: 0; display: block; }
.ico-lg { width: 22px; height: 22px; }

/* ----- App shell ----- */
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(10, 31, 56, .48);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: min(var(--sidebar-w), 86vw);
    max-width: 320px;
    background: linear-gradient(180deg, #12304F 0%, #0A1F38 48%, #071828 100%);
    color: #fff;
    display: flex; flex-direction: column;
    transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.22, 1, .36, 1);
    padding: calc(12px + var(--safe-t)) 12px calc(14px + var(--safe-b));
    box-shadow: 10px 0 32px rgba(0, 0, 0, .28);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.sidebar.open { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    margin-bottom: 6px;
}
.drawer-close {
    flex: none;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.08); color: #fff;
}
.drawer-close:hover { background: rgba(255,255,255,.14); }
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    left: 0; right: 0;
    width: 100%;
    touch-action: none;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    color: #fff; padding: 8px 8px 14px; flex: 1; min-width: 0;
}
.brand-mark, .logo-lg {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    background: transparent;
    box-shadow: 0 8px 18px rgba(22, 119, 255, .28);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.brand-mark img, .logo-lg img {
    width: 100%; height: 100%; display: block; object-fit: contain;
}
.sidebar-brand strong { display: block; font-size: 16px; letter-spacing: -.01em; }
.sidebar-brand small { display: block; color: var(--sidebar-text); font-size: 11px; font-weight: 500; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; padding-right: 2px; }
.nav-label {
    margin: 16px 12px 6px; font-size: 10px; font-weight: 800;
    letter-spacing: .1em; color: #6E849C; text-transform: uppercase;
}
.side-link {
    display: flex; align-items: center; gap: 11px;
    min-height: 44px; padding: 0 12px; border-radius: 11px;
    color: var(--sidebar-text); font-weight: 600; font-size: 14px;
    transition: background .15s ease, color .15s ease;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active {
    background: linear-gradient(135deg, #1677FF 0%, #0B63E5 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 119, 255, .28);
}
.side-link.active .ico { color: #fff; }
.side-cta {
    margin: 12px 0 6px;
    justify-content: center;
    background: #1677FF; color: #fff;
    font-weight: 800;
}
.side-cta:hover, .side-cta.active { background: #0EA5E9; color: #fff; }
.sidebar-foot { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 10px; color: #fff;
}
.side-user strong { display: block; font-size: 14px; }
.side-user small { display: block; color: #A8B8C9; font-size: 12px; }
.side-link.danger { color: #f0b4ae; }
.side-link.danger:hover { background: rgba(180, 35, 24, .18); color: #fff; }

.shell { min-height: 100dvh; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    min-height: var(--topbar-h);
    padding: calc(6px + var(--safe-t)) 14px 6px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(226, 234, 242, .9);
}
.icon-btn {
    width: 42px; height: 42px; border: 0; border-radius: 11px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--bg-2); color: var(--navy);
    transition: background .15s ease, box-shadow .15s ease;
}
.icon-btn:hover { background: #DCE7F2; }
.icon-btn:hover, .icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
    margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.top-search {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 12px; padding: 0 12px; min-height: 42px; width: auto; max-width: 520px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.top-search:focus-within {
    border-color: #1677FF;
    box-shadow: var(--focus);
    background: #fff;
}
.top-search .ico { color: var(--muted); }
.top-search input {
    border: 0; background: transparent; min-height: 40px; padding: 0; font-size: 14px;
}
.top-search input:focus { outline: none; box-shadow: none; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 4px 4px; border-radius: 999px;
    background: var(--bg);
    border: 1px solid transparent;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(145deg, #1677FF, #0EA5E9); color: #fff;
    display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.user-meta { display: none; }
.user-meta strong { display: block; font-size: 13px; line-height: 1.2; }
.user-meta small { color: var(--muted); font-size: 11px; }

.content { width: 100%; margin: 0; padding: 14px 16px 18px; }
.content > .card + .card,
.content > .grid + .card,
.content > .page-head + .card,
.content > .muted + .card,
.content > .card + .grid { margin-top: 12px; }
.stack { display: grid; gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.page-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; margin: 0 0 12px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.03em; font-weight: 800; }
.page-head h2 { margin: 0; font-size: 16px; }
.page-head .muted { margin: 0; font-size: 13px; }
.muted { color: var(--muted); }
.kicker {
    font-size: 11px; font-weight: 800; color: var(--gold);
    text-transform: uppercase; letter-spacing: .08em; margin: 0 0 2px;
}

.grid { display: grid; gap: 12px; }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.two { grid-template-columns: 1fr; gap: 12px; }
.dash-grid { grid-template-columns: 1fr; gap: 12px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.card-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 8px; font-size: 15px; font-weight: 800;
}
.section-title .ico { width: 18px; height: 18px; }

.kpi {
    display: flex; gap: 10px; align-items: center;
    min-width: 0;
    padding: 12px 14px;
    text-decoration: none; color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi > span { min-width: 0; flex: 1; }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: inherit; border-color: #C9DAEB; }
.kpi-icon {
    width: 36px; height: 36px; border-radius: 11px;
    display: grid; place-items: center; flex-shrink: 0;
}
.kpi-icon .ico { width: 16px; height: 16px; }
.kpi-navy { background: var(--info-bg); color: var(--info); }
.kpi-gold, .kpi-purple { background: #E8F1FF; color: #1677FF; }
.kpi-blue { background: #E8F1FF; color: #1677FF; }
.kpi-cyan { background: #E6F6FB; color: #0284C7; }
.kpi-orange { background: #FFF7E8; color: #D48806; }
.kpi-red { background: #FDECEE; color: #E5484D; }
.kpi-ok { background: var(--ok-bg); color: var(--ok); }
.kpi-warn { background: var(--warn-bg); color: var(--warn); }
a.kpi.pick-on { outline: 2px solid var(--navy-3); outline-offset: 0; }
.kpi h3 {
    margin: 0; font-size: 11px; color: var(--muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.kpi p { margin: 3px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.spark { width: 74px; height: 28px; flex: none; }
.fleet-tile small { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--muted); }
.kpi .sub { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 11px;
    border: 0; font-weight: 700; cursor: pointer; font-size: 14px;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary, .btn-gold {
    background: linear-gradient(180deg, #2B85FF 0%, #1677FF 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 119, 255, .28);
}
.btn-primary:hover, .btn-gold:hover { background: #0B63E5; }
.btn-ok { background: #12A866; color: #fff; }
.btn-ok:hover { background: #0E8F57; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); border-color: #C9DAEB; }
.btn-print {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-print:hover { background: var(--bg); }
.btn-pdf {
    background: #fff;
    color: var(--ok);
    border: 1.5px solid #22C55E;
}
.btn-pdf:hover { background: var(--ok-bg); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: #f8d4d0; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled, .btn[aria-disabled="true"] {
    opacity: .45; cursor: not-allowed; pointer-events: none;
    box-shadow: none; transform: none;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.flash {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600;
    border: 1px solid transparent;
}
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(18, 168, 102, .18); }
.flash-bad { background: var(--bad-bg); color: var(--bad); border-color: rgba(229, 72, 77, .18); }

label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; color: var(--navy); }
.field { margin-top: 4px; }
.field > label:first-child { margin-top: 0; }
input, select, textarea {
    width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 11px;
    border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235c6b7c' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: #1677FF; box-shadow: var(--focus);
}
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; gap: 12px; }
.field-row {
    display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap;
}
.field-row select { flex: 1 1 160px; min-width: 0; }
.field-row .btn {
    flex: 0 0 auto; min-height: 46px; padding: 0 14px; white-space: nowrap;
}
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-section {
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--line);
}
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h2 { margin: 0 0 4px; font-size: 16px; }
.form-section > .help { margin: 0 0 12px; }

.list { display: grid; gap: 0; }
.item, .list-row {
    display: grid; gap: 4px; padding: 12px 4px;
    background: transparent; border: 0; border-bottom: 1px solid var(--line);
    border-radius: 0;
}
.item:last-child, .list-row:last-child { border-bottom: 0; }
a.item:hover, a.list-row:hover { background: #F7FAFD; }
.item h3, .list-row h3 { margin: 0; font-size: 14px; font-weight: 800; }
.list-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 8px;
}
.list-row .list-main { min-width: 0; color: inherit; text-decoration: none; }
.list-row a.list-main:hover { color: inherit; }
.list-row .list-main .meta { margin-top: 2px; }
.list-row .list-notes {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
}
.list-row .row-actions { grid-column: 1 / -1; gap: 6px; }
.list-row .row-actions .btn { min-height: 44px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.badge {
    display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: capitalize;
}
.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-navy { background: var(--info-bg); color: var(--info); }
.badge-gold { background: #E8F1FF; color: #0B63E5; }
.badge-info { background: var(--info-bg); color: var(--info); }

.toolbar, .search {
    display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.search input, .toolbar input { flex: 1; min-width: 140px; }
.search input[type="date"] { flex: 0 1 160px; min-width: 140px; }
.search select, .toolbar select { max-width: 180px; }
.suggest-wrap {
    position: relative;
    flex: 1 1 180px;
    min-width: 160px;
}
.suggest-wrap input { width: 100%; }
.suggest-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    z-index: 30; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto;
}
.suggest-list li {
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    min-height: 44px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.suggest-list li[aria-selected="true"], .suggest-list li:active { background: var(--gold-soft); }
.suggest-list li span { color: var(--muted); font-size: 12px; font-weight: 500; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0 0 8px; padding: 6px 8px 6px 12px;
    border-radius: 999px; background: var(--navy); color: #fff;
    font-size: 13px; font-weight: 700; max-width: 100%;
}
.filter-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip-x {
    display: grid; place-items: center; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 999px; color: #fff;
    background: rgba(255,255,255,.14);
}
.filter-chip-x .ico { width: 14px; height: 14px; }

.pay-tabs {
    display: flex; gap: 6px; margin: 0 0 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.pay-tabs a {
    flex: 1 0 auto; text-align: center; min-height: 40px;
    padding: 8px 12px; border-radius: 999px;
    font-weight: 800; font-size: 13px; color: var(--muted);
    background: var(--bg); white-space: nowrap;
}
.pay-tabs a.active { background: var(--navy); color: #fff; }
.pay-tabs a.active.paid { background: var(--ok); color: #fff; }
.pay-tabs a.active.unpaid { background: var(--bad); color: #fff; }
.pay-tabs a.active.rest { background: var(--warn); color: #fff; }

.pay-choice { display: flex; gap: 6px; margin: 0 0 8px; }
.pay-choice label {
    position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 8px 10px; border-radius: 999px;
    font-weight: 800; font-size: 13px; color: var(--muted); background: var(--bg); cursor: pointer;
}
.pay-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pay-choice label:has(input:checked) { background: var(--navy); color: #fff; }
.pay-choice label:has(input[value="paid"]:checked) { background: var(--ok); color: #fff; }
.pay-choice label:has(input[value="unpaid"]:checked) { background: var(--bad); color: #fff; }
.pay-choice label:has(input[value="rest"]:checked) { background: var(--warn); color: #fff; }

.pay-set { display: flex; gap: 4px; flex-wrap: wrap; }
.pay-set .btn.is-on.paid { background: var(--ok); color: #fff; }
.pay-set .btn.is-on.unpaid { background: var(--bad); color: #fff; }
.pay-set .btn.is-on.rest { background: var(--warn); color: #fff; }

.report-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 2px solid var(--navy);
}
.receipt-sheet .sheet-top { border-bottom-color: var(--gold); }

.table-wrap {
    overflow-x: auto;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 800; background: #F5F9FC;
}
.table tbody tr:hover { background: #F6FAFF; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table a.row-link { font-weight: 800; color: var(--navy); }
.table .btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.hide-desktop { display: block; }
.hide-desktop.list { display: grid; }
.hide-mobile { display: none; }
/* Mobile-first chrome: desk widgets off until ≥960px */
.desk-only { display: none !important; }
.mobile-only { display: block; }
.mobile-only.row-actions,
.mobile-only.inline { display: flex; }

.line-card {
    border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 12px;
    background: #F7FAFD;
}
.line-card h3 { margin: 0; font-size: 15px; }
.line-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px;
}
.type-fields { display: none; }
.type-fields.show { display: block; }
.crew-picks {
    display: grid; gap: 6px; max-height: 220px; overflow: auto;
    margin: 0 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.crew-picks label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 700; margin: 0; }
.crew-picks label span:first-of-type { flex: 1; }
.crew-cut, .driver-cut { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ok); }
.driver-pay { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.driver-pay select { flex: 1; min-width: 160px; }
.driver-pay .nopay { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: 13px; }
.driver-pay .nopay input { width: auto; min-height: 0; }
.person-pays { display: grid; gap: 6px; margin-top: 8px; }
.person-pay {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    padding: 8px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 700;
}
.person-pay strong { font-variant-numeric: tabular-nums; }
.crew-picks input { width: 18px; height: 18px; }

.line-sum, .invoice-live-total {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 800;
}
.line-sum { background: #fff; border: 1px solid var(--line); color: var(--navy); }
.invoice-live-total { background: var(--navy); color: #fff; }
.line-sum strong, .invoice-live-total strong {
    font-size: 22px; font-variant-numeric: tabular-nums;
}
.fuel-fields { display: none; }
.fuel-fields.show { display: block; }
.table tfoot th { border-top: 2px solid var(--navy); padding-top: 10px; }
.totals { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; font-weight: 700; }
.totals .grand { font-size: 20px; color: var(--navy); }

.invoice-sheet,
.receipt-sheet.dx-voucher {
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.dx-voucher {
    --dx-voucher-blue: #1677FF;
    --dx-voucher-navy: #0B4F9C;
    --dx-voucher-line: #C9DEFF;
    --dx-voucher-soft: #EAF4FF;
    --dx-voucher-bar: #E8F3FF;
}
.dx-wave-top,
.dx-wave-footer svg { display: block; width: 100%; line-height: 0; }
.dx-wave-top svg { width: 100%; height: 36px; }
.dx-wave-footer svg { width: 100%; height: 22px; }
.dx-voucher-head {
    text-align: center;
    padding: 2px 22px 6px;
}
.dx-voucher .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 6px;
    box-shadow: 0 8px 18px rgba(22, 119, 255, .2);
}
.dx-brand-name {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: #0A1F38;
    line-height: 1.1;
}
.dx-doc-label {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #8A97A8;
}
.dx-contact-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2px 22px 10px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--dx-voucher-bar);
    color: var(--dx-voucher-navy);
    font-weight: 800;
    font-size: 12px;
}
.dx-contact-ico {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--dx-voucher-blue);
    color: #fff;
    flex-shrink: 0;
}
.dx-contact-ico .ico { width: 13px; height: 13px; }
.dx-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 22px 10px;
}
.dx-info-label {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--dx-voucher-blue);
}
.dx-info-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-height: 0;
    padding: 8px 10px;
    border: 1px solid #BFD9FF;
    border-radius: 10px;
    background: #fff;
}
.dx-info-ico {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--dx-voucher-blue);
    color: #fff;
    flex-shrink: 0;
}
.dx-info-ico .ico { width: 15px; height: 15px; }
.dx-info-card strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    color: #0A1F38;
}
.dx-info-sub {
    margin-top: 1px;
    color: var(--muted);
    font-size: 12px;
}
.dx-meta-card {
    display: grid;
    gap: 5px;
    align-content: center;
}
.dx-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.dx-meta-ico { display: grid; color: var(--dx-voucher-blue); }
.dx-meta-ico .ico { width: 14px; height: 14px; }
.dx-meta-k { color: var(--dx-voucher-blue); font-weight: 700; }
.dx-meta-v { color: #0A1F38; font-weight: 700; }
.dx-table-wrap {
    margin: 0 22px;
    width: calc(100% - 44px);
    max-width: none;
    overflow-x: auto;
}
.dx-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--dx-voucher-line);
    min-width: 480px;
}
.dx-table th,
.dx-table td {
    border: 1px solid var(--dx-voucher-line);
    padding: 5px 8px;
    vertical-align: middle;
    font-size: 12px;
    text-align: left;
    line-height: 1.25;
}
.dx-table thead th {
    background: var(--dx-voucher-navy);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    padding: 6px 8px;
}
.dx-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dx-col-no {
    width: 40px;
    text-align: center !important;
    background: #EAF3FF;
    color: var(--dx-voucher-navy);
    font-weight: 800;
}
.dx-table thead .dx-col-no {
    background: var(--dx-voucher-navy);
    color: #fff;
}
.dx-empty-row td { height: 18px; padding-top: 4px; padding-bottom: 4px; }
.dx-line-detail {
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
}
.dx-totals-row {
    display: grid;
    grid-template-columns: 1.25fr .95fr;
    gap: 10px;
    margin: 10px 22px 4px;
    align-items: start;
}
.dx-words {
    background: var(--dx-voucher-soft);
    border-radius: 8px;
    padding: 9px 12px;
}
.dx-words strong {
    display: block;
    margin-bottom: 4px;
    color: var(--dx-voucher-blue);
    font-size: 12px;
}
.dx-words p {
    margin: 0;
    line-height: 1.35;
    color: #0A1F38;
    font-size: 12px;
}
.dx-sum { display: grid; gap: 4px; }
.dx-sum-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    font-weight: 700;
    font-size: 12px;
}
.dx-sum-row > span {
    background: var(--dx-voucher-navy);
    color: #fff;
    padding: 6px 10px;
    border-radius: 5px 0 0 5px;
}
.dx-sum-row > strong {
    min-width: 100px;
    padding: 6px 10px;
    text-align: right;
    background: #fff;
    border: 1px solid var(--dx-voucher-line);
    border-left: 0;
    border-radius: 0 5px 5px 0;
    font-variant-numeric: tabular-nums;
}
.dx-sum-total > span { background: var(--dx-voucher-blue); }
.dx-sum-total > strong {
    background: var(--dx-voucher-soft);
    border-color: #9fc4ff;
    color: #0A1F38;
}
.dx-sum-total em {
    font-style: normal;
    color: #5EBEFF;
    margin-right: 4px;
    font-weight: 800;
}
.dx-sign-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 12px 22px 10px;
}
.dx-sign { min-width: 160px; }
.dx-sign-caption {
    margin-bottom: 18px;
    font-size: 11px;
    color: var(--muted);
}
.dx-sign-line {
    border-top: 1px solid #9aa8b8;
    margin-bottom: 6px;
}
.dx-sign strong { font-size: 14px; color: #0A1F38; }
.dx-stamp {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 3px double var(--dx-voucher-blue);
    display: grid;
    place-items: center;
    color: var(--dx-voucher-blue);
    transform: rotate(-10deg);
    flex-shrink: 0;
    background:
        radial-gradient(circle at center, rgba(22, 119, 255, .06), transparent 62%);
}
.dx-stamp-ring {
    width: 76px;
    height: 76px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: grid;
    grid-template-columns: 12px 1fr 12px;
    grid-template-rows: 16px 1fr 16px;
    align-items: center;
    justify-items: center;
    text-align: center;
    padding: 4px;
}
.dx-stamp-top,
.dx-stamp-bot {
    grid-column: 1 / -1;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
}
.dx-stamp-mid {
    grid-column: 2;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .02em;
}
.dx-stamp-star {
    font-size: 9px;
    line-height: 1;
    align-self: center;
}
.dx-stamp-partial { color: #B7791F; border-color: #B7791F; }
.dx-stamp-unpaid { color: #E5484D; border-color: #E5484D; }
.dx-wave-footer { margin-top: 2px; }
.dx-footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: var(--dx-voucher-blue);
    color: #fff;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 600;
}
.dx-footer-bar .ico {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
}
.dx-footer-sep { opacity: .7; }
.bill-grid { display: grid; gap: 12px; margin-bottom: 18px; }
.bill-box { background: transparent; border: 0; border-radius: 0; padding: 0; }
.bill-box h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bill-box strong { font-size: 18px; line-height: 1.3; }
.fine-print { margin-top: 16px; font-size: 12px; }
.pl-page { display: grid; gap: 14px; }
.pl-top { margin: 0; align-items: flex-start; }
.pl-top h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -.02em;
}
.pl-top .muted { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.pl-top .row-actions { gap: 10px; }
.pl-top .btn-print,
.pl-top .btn-pdf {
    min-height: 40px;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
}
.pl-filter {
    padding: 16px 18px;
    background: var(--bg-2);
}
.card.pl-filter {
    background: var(--card);
}
.card.pl-filter .pl-filter-form select,
.card.pl-filter .pl-filter-form input {
    background: var(--bg);
}
.pl-filter-form {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}
.pl-filter-form label {
    display: grid;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: var(--navy);
    font-weight: 700;
}
.pl-filter-form select,
.pl-filter-form input {
    min-height: 44px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 8px 12px;
}
.pl-filter-form .btn-primary {
    min-height: 44px;
    border-radius: 11px;
    padding: 0 26px;
    font-weight: 700;
}
.pl-sheet {
    padding: 26px 28px 32px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.pl-title { margin-bottom: 8px; }
.pl-title h2 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -.02em;
    color: var(--text);
    font-weight: 800;
}
.pl-title p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.pl-head {
    margin: 26px 0 12px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
}
.pl-head.inc { color: var(--ok); }
.pl-head.exp { color: var(--bad); }
.pl-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
}
.pl-table th, .pl-table td {
    border: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}
.pl-table thead th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: #F5F9FC;
}
.pl-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-empty {
    text-align: center;
    color: var(--muted);
    padding: 18px 14px;
    font-weight: 500;
}
.pl-total-inc th {
    color: var(--text);
    background: var(--ok-bg);
    font-weight: 800;
}
.pl-table-exp td:first-child,
.pl-table-exp th:first-child { width: 70%; }
.pl-total-exp th {
    color: var(--text);
    background: var(--info-bg);
    font-weight: 800;
    border-bottom: 3px solid var(--dx-blue);
}
@media (max-width: 719px) {
    .pl-filter-form { grid-template-columns: 1fr; }
    .pl-title h2 { font-size: 24px; }
    .pl-top h1 { font-size: 22px; }
    .pl-sheet { padding: 16px 14px 20px; }
    .pl-top { flex-direction: column; align-items: stretch; }
    .pl-top .row-actions .btn { flex: 1; }
}
.pay-stat {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 12px 14px; border-radius: 12px; background: var(--bg); margin-bottom: 12px;
}
.pay-stat strong { font-size: 20px; }
.pay-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.pay-history h4 {
    margin: 0 0 8px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
}

.quick-list { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.quick-link {
    display: flex; align-items: center; gap: 8px;
    min-height: 42px; padding: 8px 12px; border-radius: 11px;
    background: var(--bg); color: var(--text); font-weight: 700; font-size: 13px;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}
.quick-link:hover { background: var(--bg-2); border-color: var(--line); }
.quick-link .q-ico {
    width: 28px; height: 28px; border-radius: 8px;
    display: grid; place-items: center; background: #fff; color: var(--navy);
    border: 1px solid var(--line);
}
.quick-link .q-ico .ico { width: 14px; height: 14px; }
.quick-link > .ico:last-child { display: none; }
.tip-card {
    background: linear-gradient(135deg, var(--navy) 0%, #1677FF 100%);
    color: #fff; border: 0; padding: 12px 16px;
}
.tip-card h2 { color: #fff; font-size: 14px; margin: 0 0 2px; }
.tip-card .muted { color: #c5d3e0; margin: 0; font-size: 12px; }

.empty, .empty-state {
    text-align: center; padding: 22px 14px; color: var(--muted);
}
.empty-state .empty-icon {
    width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 10px;
    display: grid; place-items: center; background: var(--bg-2); color: var(--navy);
}
.empty-state h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty-state p { margin: 0 0 10px; font-size: 13px; }

/* ----- Modal ----- */
body.modal-open { overflow: hidden; padding-bottom: 0; }
body.modal-open .bottom-nav { display: none; }
.modal {
    display: none;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(10, 31, 56, .52);
    align-items: flex-end; justify-content: center;
    padding: 0;
}
.modal.is-open { display: flex; }
.modal-sheet {
    background: var(--card);
    width: 100%;
    max-height: min(94dvh, 100%);
    overflow: auto;
    border-radius: 18px 18px 0 0;
    padding: 14px 16px calc(16px + var(--safe-b));
    box-shadow: var(--shadow-lg);
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px;
    position: sticky; top: 0; background: var(--card); z-index: 1;
    padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-sheet .help { margin: 0 0 8px; }
.modal-sheet textarea { min-height: 72px; }
.modal-actions { display: grid; gap: 8px; margin-top: 14px; }

.install-banner {
    position: fixed; z-index: 45;
    left: 12px; right: 12px;
    bottom: calc(80px + var(--safe-b));
    display: flex; align-items: center; gap: 10px;
    background: var(--navy); color: #fff;
    border-radius: 16px; padding: 12px 12px 12px 14px;
    box-shadow: 0 12px 30px rgba(11, 28, 46, .28);
}
.install-banner[hidden] { display: none !important; }
.install-banner strong { display: block; font-size: 14px; }
.install-banner p { margin: 2px 0 0; font-size: 12px; color: #d5dee6; }
.install-banner .icon-btn { color: #fff; flex: none; }
@media (min-width: 980px) {
    .install-banner { left: auto; width: min(420px, calc(100% - 32px)); right: 16px; bottom: 16px; }
}

.bottom-nav.personal-nav { grid-template-columns: repeat(3, 1fr); }
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(16px) saturate(1.15);
    border-top: 1px solid rgba(226, 234, 242, .95);
    padding: 6px 2px calc(6px + var(--safe-b));
    box-shadow: 0 -8px 24px rgba(15, 31, 56, .06);
}
.bottom-nav a,
.bottom-nav .nav-menu-btn {
    min-height: 56px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700;
    border: 0; background: transparent; cursor: pointer; font: inherit; padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.bottom-nav .ico { width: 20px; height: 20px; }
.bottom-nav a.active,
.bottom-nav .nav-menu-btn.active { color: var(--navy); }
.bottom-nav a.active .ico,
.bottom-nav .nav-menu-btn.active .ico { color: #1677FF; }
.bottom-nav .nav-new { color: var(--navy); }
.bottom-nav .nav-new .ico-wrap {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(180deg, #2B85FF, #1677FF); color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 6px 14px rgba(22, 119, 255, .35);
    margin-top: -6px;
}
.bottom-nav .nav-new .ico { width: 16px; height: 16px; color: inherit; }
.bottom-nav .nav-new span:last-child { font-size: 10px; }

/* ----- Auth ----- */
body.auth {
    min-height: 100dvh;
    background: var(--navy);
    padding: 0;
}
.auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}
.auth-hero {
    display: none;
    padding: 48px 48px 36px;
    background:
        radial-gradient(circle at 18% 8%, rgba(14,165,233,.38), transparent 36%),
        radial-gradient(circle at 88% 20%, rgba(22,119,255,.22), transparent 28%),
        linear-gradient(180deg, rgba(10,31,56,.12) 0%, rgba(10,31,56,.5) 45%, #0A1F38 80%),
        linear-gradient(165deg, #1a4b86 0%, #12304F 40%, #0A1F38 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
    background:
        linear-gradient(180deg, transparent, rgba(10,31,56,.2) 20%, #0A1F38 88%),
        radial-gradient(ellipse at 50% 100%, rgba(14,165,233,.22), transparent 55%);
    pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h1 { margin: 12px 0 8px; font-size: 38px; letter-spacing: -.03em; font-weight: 800; }
.auth-hero p { color: #b8c7d6; max-width: 420px; }
.auth-hero-kicker { color: #7DD3FC; margin: 0 0 8px; }
.auth-hero-foot { margin-top: 16px; color: #9FB4C8; }
.auth-mobile-brand .logo-lg { margin: 0; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.hero-points li {
    display: flex; align-items: center; gap: 12px;
    font-weight: 600; color: #e4ecf4;
}
.hero-points .q-ico {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(22,119,255,.22); color: #7DD3FC;
    display: grid; place-items: center;
}
.auth-panel {
    display: grid; place-items: center;
    padding: 28px 18px calc(28px + var(--safe-b));
    background:
        radial-gradient(800px 320px at 50% 0%, rgba(22,119,255,.08), transparent 60%),
        #F0F5FA;
}
.auth-panel .card {
    width: min(420px, 100%);
    padding: 28px 24px;
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}
.auth-panel .card.install-card { width: min(560px, 100%); }
.auth-panel h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.logo-lg {
    width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px;
}
.check-list { list-style: none; padding: 0; margin: 16px 0; }
.check-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.status-ok { color: var(--ok); font-weight: 800; }
.status-bad { color: var(--bad); font-weight: 800; }
.auth-mobile-brand {
    display: flex; align-items: center; gap: 12px; color: var(--text);
    margin-bottom: 18px; width: min(420px, 100%);
}
.auth-mobile-brand strong { display: block; font-size: 16px; }
.auth-mobile-brand small { color: var(--muted); }
code { font-size: 12px; background: var(--bg); padding: 1px 6px; border-radius: 6px; }

@media (max-width: 959px) {
    body.app { padding-bottom: calc(72px + var(--safe-b)); }
    .content { padding: 12px 12px 16px; }
    .page-head { flex-direction: column; align-items: stretch; margin-bottom: 10px; gap: 8px; }
    .page-head h1 { font-size: 18px; }
    .page-head .muted { font-size: 12px; }
    .page-head .row-actions { width: 100%; gap: 6px; }
    .page-head .btn { min-height: 40px; padding: 0 12px; font-size: 13px; flex: 1; }
    .page-head .desk-actions { display: none !important; }
    .month-pick { flex: 1 1 100%; }
    .month-pick input { width: 100%; min-height: 40px; }
    .spark { display: none; }
    .stats { gap: 8px; }
    .stats.kpi-primary { grid-template-columns: repeat(2, 1fr); }
    .kpi { padding: 10px; gap: 8px; }
    .kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
    .kpi h3 { font-size: 10px; letter-spacing: 0; }
    .kpi p { font-size: 16px; }
    .kpi .sub { font-size: 10px; line-height: 1.25; }
    .card { padding: 12px 14px; border-radius: 12px; }
    .card h2 { font-size: 15px; }
    /* Compact phone login — never squeeze the desktop split hero */
    body.auth { background: #F0F5FA; }
    body.auth .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none !important; }
    .auth-panel {
        min-height: 100dvh;
        align-content: center;
        padding: 24px 16px calc(24px + var(--safe-b));
        background:
            radial-gradient(600px 240px at 50% 0%, rgba(22,119,255,.1), transparent 55%),
            #F0F5FA;
    }
    .auth-panel .card { padding: 22px 18px; border-radius: 16px; }
    .table-wrap {
        margin: 0 -2px;
        padding: 0 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .table { min-width: 520px; }
    .pl-table { min-width: 360px; }
    .invoice-sheet .table,
    .receipt-sheet .table,
    .dx-table { min-width: 480px; }
    .form-grid { gap: 8px; }
    .toolbar, .search { gap: 6px; }
    .search input, .toolbar input { min-width: 0; flex: 1 1 140px; }
    .search select, .toolbar select { max-width: none; flex: 1 1 120px; }
    .field-row .btn { flex: 1 1 auto; }
    .invoice-sheet, .receipt-sheet, .report-sheet { overflow-x: visible; }
    .dx-contact-bar,
    .dx-info-grid,
    .dx-table-wrap,
    .dx-totals-row,
    .dx-sign-row { margin-left: 14px; margin-right: 14px; }
    .dx-table-wrap { width: auto; }
    .dx-info-grid { grid-template-columns: 1fr; }
    .dx-totals-row { grid-template-columns: 1fr; }
    .dx-voucher-head { padding: 2px 12px 6px; }
    .dx-voucher .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
    .dx-brand-name { font-size: 20px; }
    .dx-contact-bar { font-size: 11px; padding: 7px 10px; }
    .dx-sign-row { flex-wrap: wrap; justify-content: space-between; }
    .dx-footer-bar { font-size: 11px; text-align: center; }
    input, select, textarea { font-size: 16px; }
    .user-chip .user-meta { display: none; }
    .topbar-title { display: none; }
    .topbar { gap: 8px; padding-left: 10px; padding-right: 10px; min-height: 56px; }
    .top-search { max-width: none; }
    .pay-choice { flex-wrap: wrap; }
    .pay-choice label { flex: 1 1 30%; min-width: 88px; }
}

@media (min-width: 720px) {
    .stats:not(.kpi-primary) { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .full { grid-column: 1 / -1; }
    .user-meta { display: block; }
    .top-search { display: flex; }
    .bill-grid { grid-template-columns: 1fr 1fr; }
    .quick-list { grid-template-columns: repeat(3, 1fr); }
    .money-stats { grid-template-columns: repeat(4, 1fr); }
    .quick-link > .ico:last-child { display: block; margin-left: auto; color: var(--muted); width: 14px; height: 14px; }
    .modal { align-items: center; padding: 24px; }
    .modal-sheet {
        width: min(500px, 100%);
        border-radius: 16px;
        max-height: 90dvh;
        padding: 16px 18px 18px;
    }
    .list-row .row-actions { grid-column: auto; }
}

/* Desktop shell + full dashboard (≥960px). Below this: app drawer + bottom nav. */
@media (min-width: 960px) {
    body.app { padding-bottom: 0; }
    .bottom-nav, .sidebar-toggle, .sidebar-backdrop, .drawer-close { display: none !important; }
    .mobile-only { display: none !important; }
    .desk-only { display: block !important; }
    .desk-only.inline,
    .desk-only.desk-actions {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .desk-only.row-actions { display: flex !important; }
    .desk-only.grid,
    .desk-only.stats,
    .desk-only.dash-quad,
    .desk-only.dash-split,
    .desk-only.dash-3 { display: grid !important; }
    .card.desk-only { display: block !important; }
    .hide-desktop { display: none !important; }
    .hide-desktop.list { display: none !important; }
    .hide-mobile { display: block !important; }
    .table-wrap.hide-mobile { display: block !important; }
    .sidebar {
        transform: none !important;
        padding-top: 18px;
        padding-bottom: 16px;
        max-width: none;
        width: var(--sidebar-w);
        box-shadow: none;
        border-right: 1px solid rgba(255,255,255,.04);
    }
    .drawer-head { display: block; }
    .sidebar-brand { padding: 10px 10px 18px; }
    body.auth .auth-shell { grid-template-columns: 44% 56%; }
    .auth-hero { display: flex; flex-direction: column; justify-content: center; }
    .auth-mobile-brand { display: none !important; }
    .auth-panel { background: var(--bg); }
    .shell { margin-left: var(--sidebar-w); }
    .two {
        grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr);
        align-items: start;
        gap: 16px;
    }
    .dash-grid { grid-template-columns: 1fr; align-items: start; }
    .sticky-card { position: sticky; top: calc(var(--topbar-h) + 12px); }
    .table { min-width: 0; }
    .pl-table { min-width: 0; }
    .person-sheet .person-debt-table .table,
    .person-sheet .person-pay-table .table { min-width: 0; }
}

@media (min-width: 1200px) {
    .content { padding: 18px 22px 24px; max-width: 1400px; }
    .stats { grid-template-columns: repeat(5, 1fr); }
    .money-stats { grid-template-columns: repeat(4, 1fr); }
    .quick-list { grid-template-columns: repeat(6, 1fr); }
}

/* On-screen invoice print preview (mobile + desktop) when ?print=1 */
.print-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 12px;
    padding-top: calc(10px + var(--safe-t));
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 16px rgba(10, 31, 56, .06);
}
.print-bar .btn { flex: 1 1 calc(33.33% - 8px); min-height: 44px; justify-content: center; }
.print-bar .btn-print-now { flex: 1 1 calc(33.33% - 8px); }
.print-bar-status {
    flex: 1 1 100%;
    margin: 0;
    padding: 2px 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}
.page-head .print-bar-status {
    flex: 1 1 100%;
    width: 100%;
}
.row-actions .btn { min-height: 44px; }

body.print-preview {
    background: #fff !important;
    padding-bottom: 0 !important;
    color: #0A1F38;
}
body.print-preview .sidebar,
body.print-preview .topbar,
body.print-preview .bottom-nav,
body.print-preview .sidebar-backdrop,
body.print-preview .flash,
body.print-preview .page-head {
    display: none !important;
}
body.print-preview .shell { margin: 0; }
body.print-preview .content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
    background: #fff;
}
body.print-preview .print-grid {
    display: block;
    margin: 0;
}
body.print-preview .print-grid > .no-print {
    display: none !important;
}
body.print-preview .invoice-sheet,
body.print-preview .receipt-sheet {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    min-height: 0;
}
body.print-preview .dx-voucher .brand-mark {
    margin-left: auto;
    margin-right: auto;
}

@media print {
    .sidebar, .topbar, .bottom-nav, .no-print, .sidebar-backdrop, .modal,
    .pay-tabs, .search, .flash, .filter-chip, .print-bar { display: none !important; }
    html, body, body.app, body.print-preview {
        background: #fff !important;
        color: #000;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .shell { margin: 0 !important; }
    .content { width: 100%; margin: 0; padding: 0 !important; background: #fff !important; }
    .grid.two, .print-grid { display: block !important; }
    .card { box-shadow: none; border: 0; background: #fff; }
    .invoice-sheet, .receipt-sheet, .report-sheet {
        padding: 0; border: 0; background: #fff !important;
        max-width: none; margin: 0; min-height: 0;
    }
    .dx-voucher,
    .dx-voucher .brand-mark,
    .dx-contact-bar,
    .dx-contact-ico,
    .dx-info-card,
    .dx-info-ico,
    .dx-table thead th,
    .dx-col-no,
    .dx-words,
    .dx-sum-row > span,
    .dx-sum-row > strong,
    .dx-stamp,
    .dx-footer-bar,
    .dx-wave-top,
    .dx-wave-footer {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .dx-table thead th,
    .dx-table thead .dx-col-no {
        background: #0B4F9C !important;
        color: #fff !important;
    }
    .dx-col-no { background: #EAF3FF !important; color: #0B4F9C !important; }
    .dx-contact-bar { background: #E8F3FF !important; }
    .dx-words,
    .dx-sum-total > strong { background: #EAF4FF !important; }
    .dx-sum-row > span { background: #0B4F9C !important; color: #fff !important; }
    .dx-sum-total > span { background: #1677FF !important; }
    .dx-footer-bar { background: #1677FF !important; color: #fff !important; }
    .dx-info-grid { grid-template-columns: 1fr 1fr !important; }
    .dx-totals-row { grid-template-columns: 1.25fr .95fr !important; }
    .dx-table { min-width: 0 !important; }
    .dx-wave-top svg { height: 28px !important; }
    .dx-wave-footer svg { height: 18px !important; }
    .dx-voucher-head { padding: 0 16px 4px !important; }
    .dx-voucher .brand-mark {
        width: 48px !important;
        height: 48px !important;
        border-radius: 14px !important;
        margin-bottom: 4px !important;
    }
    .dx-brand-name { font-size: 22px !important; }
    .dx-doc-label { margin-top: 2px !important; font-size: 10px !important; }
    .dx-contact-bar,
    .dx-info-grid,
    .dx-table-wrap,
    .dx-totals-row,
    .dx-sign-row {
        margin-left: 16px !important;
        margin-right: 16px !important;
    }
    .dx-contact-bar { margin-top: 0 !important; margin-bottom: 8px !important; padding: 6px 12px !important; font-size: 11px !important; }
    .dx-info-grid { gap: 6px !important; margin-bottom: 8px !important; }
    .dx-info-card { padding: 6px 8px !important; }
    .dx-info-ico { width: 26px !important; height: 26px !important; }
    .dx-table th,
    .dx-table td { padding: 4px 6px !important; font-size: 11px !important; }
    .dx-table thead th { padding: 5px 6px !important; font-size: 10px !important; }
    .dx-empty-row td { height: 14px !important; padding-top: 2px !important; padding-bottom: 2px !important; }
    .dx-totals-row { gap: 8px !important; margin-top: 8px !important; margin-bottom: 2px !important; }
    .dx-words { padding: 7px 10px !important; }
    .dx-sum-row > span,
    .dx-sum-row > strong { padding: 5px 8px !important; }
    .dx-sign-row { margin-top: 8px !important; margin-bottom: 6px !important; }
    .dx-sign-caption { margin-bottom: 14px !important; }
    .dx-stamp { width: 78px !important; height: 78px !important; }
    .dx-stamp-ring { width: 64px !important; height: 64px !important; }
    .dx-stamp-mid { font-size: 15px !important; }
    .dx-footer-bar { padding: 6px 10px !important; font-size: 10px !important; }
    @page { margin: 6mm; size: auto; }
    .hide-desktop, .list.hide-desktop { display: none !important; }
    .hide-mobile, .table-wrap.hide-mobile { display: block !important; }
    a.row-link { color: #000; }
}

.dash-split, .dash-3 { display: grid; gap: 12px; margin-top: 12px; }
.fleet-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fleet-tile { border-radius: 12px; padding: 12px; background: #F5F9FC; border: 1px solid transparent; }
.fleet-tile strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.fleet-tile span { color: var(--muted); font-size: 12px; font-weight: 700; }
.fleet-tile.work { background: #E6F7EF; }
.fleet-tile.avail { background: #E8F1FF; }
.fleet-tile.maint { background: #FFF7E8; }
.fleet-tile.total { background: #E6F6FB; }
.dash-quad { display: grid; gap: 12px; margin-top: 12px; }
.bar-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; min-height: 150px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 140px; }
.bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 112px; width: 100%; }
.dropzone { position: relative; }
.bar-in, .bar-out { width: 8px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-in { background: #12A866; }
.bar-out { background: #E5484D; }
.bar-col small { text-align: center; font-size: 10px; color: var(--muted); }
.kpi-primary { margin-bottom: 0; }
.month-pick input { min-height: 44px; border-radius: 10px; }
.field-ico { position: relative; }
.field-ico .ico { position: absolute; left: 12px; top: 14px; color: var(--muted); width: 18px; height: 18px; }
.field-ico input { padding-left: 40px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 13px; flex-wrap: wrap; }
.auth-row .check { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; margin: 0; }
.auth-row .check input { width: auto; min-height: 0; }
.fleet-art { margin-top: 28px; color: rgba(255,255,255,.85); }
.fleet-art svg { width: min(100%, 360px); height: auto; display: block; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-no, .mini-avatar {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: #E8F1FF; color: #1677FF; font-size: 12px; font-weight: 800;
}
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-tile {
    display: flex; flex-direction: column; gap: 8px; min-height: 88px;
    padding: 14px; border-radius: 14px; color: var(--text); font-weight: 700;
    background: #F0F5FA;
    border: 1px solid transparent;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.qa-tile:hover {
    transform: translateY(-1px);
    border-color: var(--line);
    box-shadow: var(--shadow);
}
.qa-tile .ico { width: 20px; height: 20px; }
.qa-green { background: #E6F7EF; }
.qa-red { background: #FDECEE; }
.qa-blue { background: #E8F1FF; }
.qa-cyan { background: #E6F6FB; }
.qa-purple { background: #E8F1FF; }
.qa-orange { background: #FFF7E8; }
.ops-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ops-time { font-size: 12px; font-weight: 800; color: #1677FF; }
.ops-item:last-child { border-bottom: 0; }
.dropzone {
    display: grid; place-items: center; text-align: center; gap: 4px;
    min-height: 120px; border: 1.5px dashed #C5D7EA; border-radius: 14px;
    background: #F5F9FC; color: var(--muted); cursor: pointer; padding: 16px;
}
.dropzone strong { color: var(--text); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { background: #E8F1FF; color: #12304F; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 72px; }
.pass-toggle {
    position: absolute; right: 8px; top: 8px; border: 0; background: transparent;
    color: var(--muted); font-weight: 700; cursor: pointer; min-height: 30px;
}
.pf-overview { display: grid; gap: 10px; margin-top: 10px; }
.pf-panel[hidden] { display: none; }
.pf-line { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.pf-track { display: block; height: 8px; background: #F0F5FA; border-radius: 99px; overflow: hidden; }
.pf-track i { display: block; height: 100%; background: #1677FF; border-radius: 99px; }
.pf-track i.ok { background: #12A866; }
.pf-track i.bad { background: #E5484D; }
.pf-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.pf-mini div { background: #F5F9FC; border-radius: 12px; padding: 10px 12px; }
.pf-mini span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.pf-tabs { display: flex; gap: 8px; overflow: auto; margin: 12px 0; padding-bottom: 2px; }
.pf-tabs a {
    min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--text); font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap;
}
.pf-tabs a.on { background: #1677FF; color: #fff; border-color: #1677FF; }
.file-rows { display: grid; gap: 6px; margin-top: 8px; }
.file-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.file-row span { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); }
.file-row button { border: 0; background: transparent; color: #E5484D; font-weight: 700; cursor: pointer; }
.dropzone.is-over { border-color: #1677FF; background: #E8F1FF; }
.row-menu { position: relative; }
.row-menu summary { list-style: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] summary { background: #E8F1FF; color: #1677FF; }
.row-menu form, .row-menu > .btn { margin-top: 6px; }
.chart-key { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chart-key i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 4px; }
.debt-guide { display: grid; gap: 8px; margin-top: 8px; }
.debt-guide p { margin: 0; line-height: 1.5; }
.search-hit { outline: 2px solid #1677FF; scroll-margin-top: 84px; }
.search-result-head { margin-bottom: 8px; }
.search-dir-title {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--navy, #0A1F38);
}
.search-dir-title:first-of-type { margin-top: 4px; }
.money-stats.search-money-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.person-sheet { border-left: 4px solid var(--ok); }
.person-sheet.owe { border-left-color: var(--dx-orange); }
.person-sheet.person-search-result { box-shadow: 0 0 0 1px rgba(22, 119, 255, .18); }
.person-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.person-sheet-head h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.02em; }
.person-sheet-head .muted { margin: 4px 0 0; }
.person-sheet-notes { margin: 8px 0 0; max-width: 42rem; }
.person-note-bag { display: grid; gap: 10px; margin: 8px 0 4px; }
.person-note-item {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}
.person-note-item > .muted {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 2px;
}
.person-note-item .explain { margin: 0; }
.person-print-btn { flex: 0 0 auto; white-space: nowrap; }
.person-print-sheet {
    max-width: 760px;
    margin: 0 auto;
}
.person-print-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.person-print-app {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--navy, #0A1F38);
    line-height: 1.1;
}
.person-print-label {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--muted);
}
.person-print-who h2 {
    margin: 0 0 4px;
    font-size: 24px;
    letter-spacing: -.02em;
}
.person-print-who .muted { margin: 0 0 6px; }
.person-print-notes {
    margin: 8px 0;
    white-space: pre-wrap;
    line-height: 1.5;
}
.person-print-date { margin-top: 8px !important; font-size: 12px; }
.person-print-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.person-print-summary > div {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}
.person-print-summary span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.person-print-summary strong {
    display: block;
    margin: 4px 0;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}
.person-print-summary small { display: block; font-size: 12px; }
.person-print-section {
    margin: 18px 0 8px;
    font-size: 15px;
}
.person-print-table { min-width: 0; }
body.print-preview .person-print-sheet {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
}
@media print {
    .person-print-sheet {
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        max-width: none !important;
    }
    .person-print-summary > div {
        background: #f5f8fc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
.person-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.person-totals div { background: var(--bg); border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); }
.person-totals span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.person-totals strong { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.person-sheet .table-wrap { margin-top: 4px; max-width: 100%; }
.person-sheet .person-debt-table .table { min-width: 640px; }
.person-sheet .person-pay-table .table { min-width: 420px; }
.person-sheet .table td { vertical-align: top; }
.person-sheet .kicker { margin-bottom: 2px; }
.person-pay-stack { display: grid; gap: 12px; margin-top: 12px; }
.person-pay-block { display: grid; gap: 8px; max-width: 420px; }
.person-pay-label { margin: 0; font-size: 12px; font-weight: 700; }
.person-pay-history-title { margin-top: 18px; margin-bottom: 4px; }
.person-remove { margin: 0; }
.explain { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.5; color: var(--text); }
.pay-box {
    display: grid; gap: 8px; margin: 0; padding: 12px;
    border: 1px solid var(--line); border-radius: 12px; background: #F8FBFE;
    max-width: 100%; box-sizing: border-box;
}
.pay-box .pay-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-box .pay-fields input { flex: 1 1 140px; min-width: 0; max-width: 100%; }
.pay-box textarea { min-height: 88px; width: 100%; max-width: 100%; box-sizing: border-box; }
.pay-box .btn { justify-self: start; }
@media (max-width: 520px) {
    .person-pay-block { max-width: none; }
    .person-totals { grid-template-columns: 1fr; }
    .person-totals strong { font-size: 16px; }
    .person-sheet .person-debt-table .table { min-width: 560px; }
    .person-sheet .person-pay-table .table { min-width: 360px; }
    .person-print-summary { grid-template-columns: 1fr; }
    .person-sheet-head { flex-wrap: wrap; }
}
@media (min-width: 960px) {
    .dash-split { grid-template-columns: 1.45fr .75fr; }
    .dash-quad { grid-template-columns: 1fr 1.15fr .9fr .9fr; }
    .dash-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
    .qa-grid { grid-template-columns: 1fr 1fr 1fr; }
    .page-head h1 { font-size: 28px; }
    .top-search { flex: 1; width: auto; max-width: 520px; }
    .kpi-primary { grid-template-columns: repeat(6, 1fr); }
    .kpi-personal { grid-template-columns: repeat(4, 1fr); }
    .pf-overview { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .sidebar, .btn, a.kpi, .qa-tile { transition: none; }
}
