:root {
    --navy: #07172d;
    --navy-2: #0d2546;
    --blue: #0e58b7;
    --blue-bright: #0b75e5;
    --red: #e1192d;
    --red-dark: #b81021;
    --white: #ffffff;
    --ink: #102038;
    --muted: #68758a;
    --line: #dfe6ef;
    --surface: #f5f8fc;
    --surface-2: #edf2f8;
    --success: #0b8f62;
    --warning: #c77b00;
    --danger: #c52e3b;
    --info: #1769c2;
    --shadow: 0 18px 50px rgba(8, 27, 52, .10);
    --shadow-sm: 0 8px 24px rgba(8, 27, 52, .08);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar: 272px;
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--surface);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
svg.icon { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.app-shell { min-height: 100vh; }
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform .25s ease;
}
.app-main { min-height: 100vh; margin-left: var(--sidebar); }
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 30px;
    border-bottom: 1px solid rgba(216, 225, 237, .85);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
}
.app-content { padding: 30px; max-width: 1640px; margin: 0 auto; }
.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(4, 15, 30, .55);
    backdrop-filter: blur(3px);
}

.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-logo-full { width: 176px; height: 48px; object-fit: contain; object-position: left center; }
.brand-mark { width: 42px; height: 42px; object-fit: contain; }
.sidebar-brand { padding: 24px 24px 18px; }
.sidebar-label {
    margin: 20px 22px 8px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .58;
    font-weight: 800;
}
.sidebar-nav { display: grid; gap: 4px; padding: 0 14px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 13px;
    border-radius: 12px;
    font-weight: 650;
    font-size: 14px;
    transition: .18s ease;
}
.sidebar-nav a .nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}
.sidebar-bottom { margin-top: auto; padding: 16px 14px 22px; }
.user-mini {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border-radius: 14px;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.user-mini strong { display: block; font-size: 13px; }
.user-mini span { display: block; font-size: 11px; opacity: .68; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

.topbar-title strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.topbar-title span { color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--ink);
}
.icon-button:hover { border-color: #b8c7db; transform: translateY(-1px); }
.icon-button .dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 3px #fff;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.page-head h1 { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.15; letter-spacing: -.045em; }
.page-head p { margin: 7px 0 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: 750;
    font-size: 14px;
    transition: .16s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(14, 88, 183, .18); }
.btn-primary:hover { background: #0b4c9e; }
.btn-danger { color: #fff; background: var(--red); }
.btn-success { color: #fff; background: var(--success); }
.btn-dark { color: #fff; background: var(--navy); }
.btn-ghost { color: var(--ink); background: #fff; border-color: var(--line); }
.btn-ghost:hover { border-color: #aebdd0; }
.btn-soft { color: var(--blue); background: #eaf3ff; }
.btn-sm { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; transform: none; }

.card {
    background: #fff;
    border: 1px solid rgba(217, 226, 238, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 22px; }
.card-foot { padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi-card {
    position: relative;
    min-height: 146px;
    overflow: hidden;
    padding: 20px;
    background: #fff;
    border: 1px solid rgba(217, 226, 238, .95);
    border-radius: 17px;
    box-shadow: var(--shadow-sm);
    transition: .18s ease;
}
a.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c6d4e6; }
.kpi-card::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -38px;
    width: 115px;
    height: 115px;
    border: 15px solid rgba(14, 88, 183, .06);
    border-radius: 50%;
}
.kpi-card.kpi-danger::after { border-color: rgba(225, 25, 45, .07); }
.kpi-card.kpi-warning::after { border-color: rgba(199, 123, 0, .08); }
.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: #eaf3ff;
    margin-bottom: 18px;
}
.kpi-danger .kpi-icon { color: var(--red); background: #fff0f2; }
.kpi-warning .kpi-icon { color: var(--warning); background: #fff7e8; }
.kpi-success .kpi-icon { color: var(--success); background: #eaf9f3; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { margin-top: 3px; font-size: 30px; line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.kpi-note { margin-top: 8px; color: var(--muted); font-size: 12px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { color: #087852; background: #e7f7f1; }
.badge-danger { color: #b81f31; background: #fdecef; }
.badge-warning { color: #9a6200; background: #fff4dc; }
.badge-info { color: #115ba8; background: #e8f2ff; }
.badge-neutral { color: #536176; background: #eef2f7; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 12px 15px;
    text-align: left;
    color: #758196;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
    font-weight: 850;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}
td { padding: 15px; border-bottom: 1px solid #e9eef5; vertical-align: middle; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.table-primary { font-weight: 800; }
.table-secondary { margin-top: 3px; color: var(--muted); font-size: 12px; }
.table-actions { display: flex; justify-content: flex-end; gap: 7px; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: #edf4fd; color: var(--blue); }
.empty-state h3 { color: var(--ink); margin: 0 0 5px; }
.empty-state p { margin: 0 auto 18px; max-width: 440px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; color: #39475d; }
.required::after { content: " *"; color: var(--red); }
.input, .select, .textarea {
    width: 100%;
    border: 1px solid #ccd7e5;
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: .16s ease;
}
.input, .select { height: 45px; padding: 0 13px; }
.textarea { min-height: 105px; padding: 12px 13px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(14, 88, 183, .10); }
.input::placeholder, .textarea::placeholder { color: #a2adbc; }
.help { color: var(--muted); font-size: 11px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 11px 0 0 11px; }
.input-group .btn { border-radius: 0 11px 11px 0; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--blue); }

.filter-card { margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(150px, .7fr)) auto; gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; }

.flash-stack { position: fixed; z-index: 100; right: 22px; top: 90px; width: min(420px, calc(100vw - 32px)); display: grid; gap: 9px; }
.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 15px;
    border-radius: 13px;
    color: #fff;
    box-shadow: 0 14px 36px rgba(8, 22, 43, .22);
    animation: slideIn .25s ease both;
}
.flash button { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; opacity: .7; }
.flash-success { background: #087d58; }
.flash-danger { background: #b81f31; }
.flash-warning { background: #a76a00; }
.flash-info { background: #115ca8; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 15, 30, .62);
    backdrop-filter: blur(6px);
}
.modal.is-open { display: flex; }
.modal-card { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 20px; box-shadow: 0 32px 90px rgba(0,0,0,.28); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-close { border: 0; background: #eef2f7; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.segmented { display: inline-flex; padding: 4px; border-radius: 12px; background: #edf2f7; gap: 3px; }
.segmented a, .segmented button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented .active { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(8, 27, 52, .08); }

.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); font-size: 13px; }
.stat-row strong { font-size: 14px; }

.list { display: grid; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #edf4fd; color: var(--blue); flex: 0 0 auto; }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; font-size: 13px; }
.list-main p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.list-meta { color: #8994a5; font-size: 11px; white-space: nowrap; }

.progress-track { width: 100%; height: 8px; border-radius: 999px; background: #e9eef5; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.breakdown-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; margin: 13px 0; }
.breakdown-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breakdown-value { text-align: right; font-size: 12px; font-weight: 800; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.detail-item { padding: 14px; border-radius: 13px; background: #f7f9fc; border: 1px solid #e7edf5; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.detail-item strong { font-size: 13px; }

.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px; background: #e2e8f1; }
.timeline-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 10px 0; }
.timeline-dot { z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eaf3ff; color: var(--blue); border: 4px solid #fff; box-shadow: 0 0 0 1px #dce5f0; }
.timeline-main { padding-top: 3px; }
.timeline-main strong { display: block; font-size: 13px; }
.timeline-main p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.timeline-main time { color: #94a0b0; font-size: 11px; }

.vehicle-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vehicle-option { position: relative; }
.vehicle-option input { position: absolute; opacity: 0; pointer-events: none; }
.vehicle-option label {
    min-height: 126px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 10px;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: .16s ease;
}
.vehicle-option label:hover { border-color: #a8bfdc; transform: translateY(-2px); }
.vehicle-option img { width: 100%; height: 76px; object-fit: contain; }
.vehicle-option span { font-size: 12px; font-weight: 800; }
.vehicle-option input:checked + label { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14, 88, 183, .11); background: #f7fbff; }
.vehicle-option input:checked + label::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue); font-size: 12px; font-weight: 900; }

.quote-table input { min-width: 100px; }
.quote-row-remove { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #fff0f2; color: var(--red); display: grid; place-items: center; }
.quote-total-box { margin-left: auto; width: min(360px, 100%); padding: 16px 18px; border-radius: 14px; background: var(--navy); color: #fff; }
.quote-total-box .row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.quote-total-box strong { font-size: 23px; }

.split-panel { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 20px; }
.sticky-card { position: sticky; top: 98px; align-self: start; }

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    background: #fff;
}
.login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(30px, 5vw, 70px);
    color: #fff;
    background: var(--navy);
}
.login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(14, 117, 229, .36), transparent 34%),
        radial-gradient(circle at 12% 88%, rgba(225, 25, 45, .25), transparent 33%),
        linear-gradient(135deg, transparent 0 46%, rgba(255,255,255,.025) 46% 48%, transparent 48% 100%);
}
.login-visual > * { position: relative; z-index: 1; }
.login-visual-logo { width: 210px; padding: 12px 16px; border-radius: 14px; background: #fff; }
.login-copy { max-width: 610px; }
.login-copy .eyebrow { color: #8fc7ff; font-size: 12px; letter-spacing: .13em; text-transform: uppercase; font-weight: 900; }
.login-copy h1 { margin: 13px 0 16px; font-size: clamp(42px, 6vw, 76px); line-height: .96; letter-spacing: -.065em; }
.login-copy p { margin: 0; max-width: 520px; color: #b8c8dd; font-size: 16px; }
.login-metric { display: flex; gap: 26px; color: #c5d3e5; font-size: 12px; }
.login-metric strong { display: block; color: #fff; font-size: 19px; }
.login-form-side { display: grid; place-items: center; padding: 30px; background: #fff; }
.login-card { width: min(450px, 100%); }
.login-mark { width: 58px; height: 58px; object-fit: contain; margin-bottom: 28px; }
.login-card h2 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.04em; }
.login-card > p { margin: 0 0 28px; color: var(--muted); }
.login-card .field { margin-bottom: 17px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 48px; }
.password-toggle { position: absolute; right: 6px; top: 5px; width: 35px; height: 35px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.login-foot { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 14px; }

.notice { padding: 13px 14px; border-radius: 12px; font-size: 13px; border: 1px solid; }
.notice-info { color: #135a9e; background: #edf6ff; border-color: #cfe5fb; }
.notice-warning { color: #8d5a00; background: #fff8e8; border-color: #f2dcaa; }
.notice-danger { color: #a12231; background: #fff0f2; border-color: #f4ccd2; }
.notice-success { color: #087550; background: #eaf9f3; border-color: #c5ebde; }

@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-actions { grid-column: 1 / -1; }
    .vehicle-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop.is-open { display: block; }
    .app-main { margin-left: 0; }
    .mobile-menu { display: inline-flex; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { min-height: 340px; }
    .login-metric { display: none; }
    .split-panel { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}

@media (max-width: 760px) {
    .app-topbar { height: 66px; padding: 0 16px; }
    .app-content { padding: 20px 16px 30px; }
    .topbar-title span { display: none; }
    .page-head { flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .kpi-grid, .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3, .detail-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .kpi-card { min-height: 122px; }
    .filter-grid { grid-template-columns: 1fr; }
    .vehicle-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-head, .card-body { padding: 17px; }
    .table-wrap.mobile-cards { overflow: visible; }
    .table-wrap.mobile-cards table, .table-wrap.mobile-cards thead, .table-wrap.mobile-cards tbody, .table-wrap.mobile-cards tr, .table-wrap.mobile-cards th, .table-wrap.mobile-cards td { display: block; }
    .table-wrap.mobile-cards thead { display: none; }
    .table-wrap.mobile-cards tr { padding: 15px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 7px 18px rgba(8, 27, 52, .06); }
    .table-wrap.mobile-cards td { position: relative; padding: 8px 0 8px 43%; min-height: 34px; border: 0; }
    .table-wrap.mobile-cards td::before { content: attr(data-label); position: absolute; left: 0; top: 8px; width: 39%; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
    .table-wrap.mobile-cards .table-actions { justify-content: flex-start; }
    .login-visual { padding: 30px 22px; min-height: 300px; }
    .login-copy h1 { font-size: 42px; }
    .login-form-side { padding: 34px 20px; align-items: start; }
    .flash-stack { right: 16px; top: 76px; }
}

@media (max-width: 440px) {
    .vehicle-picker { grid-template-columns: 1fr 1fr; gap: 9px; }
    .vehicle-option label { min-height: 110px; }
    .vehicle-option img { height: 63px; }
    .topbar-title strong { font-size: 15px; }
    .topbar-actions .btn { display: none; }
}
.qr-box{display:grid;place-items:center;padding:10px;border:1px solid var(--line);border-radius:16px;background:#fff}.qr-box img{width:min(220px,100%);height:auto}.stack{display:grid;gap:8px}.detail-grid>div{display:flex;flex-direction:column;gap:4px;padding:14px;border-radius:14px;background:#f7f9fc}.detail-grid span,.detail-grid small{color:var(--muted)}.timeline-item{display:block;padding:12px 0 12px 24px;border-left:2px solid #e2e8f1}.timeline-item:before{content:"";position:absolute;left:9px;width:12px;height:12px;border-radius:50%;background:var(--blue);border:3px solid white;box-shadow:0 0 0 1px #dce5f0}.timeline-item p{margin:4px 0;color:var(--muted)}.timeline-item small{color:#94a0b0}.btn-whatsapp{background:#0f9f68;color:#fff;border-color:#0f9f68}.btn-whatsapp:hover{background:#0b8657}.disabled{pointer-events:none;opacity:.5}


/* Headrest 2026-08-01 fixes */
.timeline { position: relative; display: grid; gap: 0; padding-left: 0; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 26px; bottom: 26px; width: 2px; background: #e2e8f1; }
.timeline .timeline-item { position: relative; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 14px; padding: 12px 0; border-left: 0; }
.timeline .timeline-item::before { content: none; }
.timeline .timeline-dot { position: relative; left: auto; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: #eaf3ff; border: 7px solid #fff; box-shadow: 0 0 0 1px #dce5f0; }
.timeline .timeline-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--blue); }
.timeline .timeline-main { min-width: 0; padding-top: 1px; }
.timeline .timeline-main strong { display: block; line-height: 1.25; }
.timeline .timeline-main p { margin: 5px 0; color: var(--muted); }
.timeline .timeline-main time { color: #94a0b0; }


/* Headrest production refinement v3 */
html,body{max-width:100%;overflow-x:hidden}.card,.card-head,.card-body,.field,.table-wrap{min-width:0}.optional-label{font-size:11px;font-weight:650;color:var(--muted);margin-left:5px}.session-submit-card{margin-top:20px}.session-submit-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.vehicle-option label{justify-content:center;min-width:0;overflow:hidden}.vehicle-option img{display:block;max-width:100%;height:82px;object-fit:contain}.quote-table{table-layout:auto}.quote-table td,.quote-table th{vertical-align:middle}.timeline .timeline-item{grid-template-columns:38px minmax(0,1fr);gap:16px}.timeline::before{left:18px}.timeline .timeline-dot{width:36px;height:36px}.timeline .timeline-main{padding-left:2px}.timeline .timeline-main strong{overflow-wrap:anywhere}
@media(max-width:760px){
  .app-content{padding:18px 14px 28px}.page-head{gap:14px;margin-bottom:18px}.page-head h1{font-size:30px}.page-head p{font-size:15px}.card{border-radius:16px}.card-head{align-items:flex-start;gap:12px}.card-head>div{min-width:0}.card-head h2{font-size:20px}.card-head p{font-size:13px;overflow-wrap:anywhere}.card-head>.btn{flex:0 0 auto}.vehicle-picker{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.vehicle-option label{min-height:118px;padding:9px}.vehicle-option img{height:72px}.vehicle-option span{font-size:12px}.session-submit-actions{display:grid;grid-template-columns:1fr}.session-submit-actions .btn{width:100%;min-height:50px}.session-submit-actions .btn-primary{order:0}.session-submit-actions .btn-ghost{order:1}
  .quote-table,.quote-table tbody,.quote-table tr,.quote-table td{display:block;width:100%}.quote-table thead{display:none}.quote-table tbody{display:grid;gap:12px}.quote-table tr{padding:14px;border:1px solid var(--line);border-radius:14px;background:#f9fbfe}.quote-table td{padding:0 0 11px;border:0}.quote-table td:last-child{padding:0}.quote-table td::before{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.quote-table td:nth-child(1)::before{content:'Item / service'}.quote-table td:nth-child(2)::before{content:'Description'}.quote-table td:nth-child(3)::before{content:'Quantity'}.quote-table td:nth-child(4)::before{content:'Unit charge'}.quote-table td:nth-child(5)::before{content:'Line total'}.quote-table .input{width:100%;min-width:0}.quote-row-remove{margin-left:auto}.quote-total-box{width:100%;margin:0}.quote-total-box .row{align-items:flex-end}.quote-total-box strong{font-size:20px}.timeline .timeline-item{grid-template-columns:34px minmax(0,1fr);gap:14px}.timeline::before{left:16px}.timeline .timeline-dot{width:32px;height:32px}.timeline .timeline-main strong{font-size:16px}
}
@media(max-width:390px){.vehicle-picker{grid-template-columns:1fr 1fr}.vehicle-option label{min-height:106px}.vehicle-option img{height:62px}.page-head h1{font-size:27px}.topbar-title strong{font-size:14px}}

/* Headrest v4: compact responsive merchant experience */
.vehicle-category-select{
    display:grid;
    grid-template-columns:minmax(0,1fr) 180px;
    align-items:end;
    gap:18px;
    max-width:760px;
}
.vehicle-category-preview{
    min-height:92px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    padding:10px 14px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#f8fbff;
}
.vehicle-category-preview[hidden]{display:none}
.vehicle-category-preview img{width:104px;height:64px;object-fit:contain}
.vehicle-category-preview span{font-size:13px;font-weight:800}
.session-submit-actions{gap:14px}
.session-submit-actions .btn + .btn{margin-left:0}

@media(max-width:1180px){
  .table-wrap.mobile-cards{overflow:visible}
  .table-wrap.mobile-cards table,.table-wrap.mobile-cards thead,.table-wrap.mobile-cards tbody,.table-wrap.mobile-cards tr,.table-wrap.mobile-cards th,.table-wrap.mobile-cards td{display:block;width:100%}
  .table-wrap.mobile-cards thead{display:none}
  .table-wrap.mobile-cards tbody{display:grid;gap:12px;padding:14px}
  .table-wrap.mobile-cards tr{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:12px 18px;padding:16px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 7px 18px rgba(8,27,52,.06)}
  .table-wrap.mobile-cards td{padding:0;border:0;min-width:0}
  .table-wrap.mobile-cards td::before{content:attr(data-label);display:block;margin-bottom:4px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
  .table-wrap.mobile-cards .table-actions{justify-content:flex-start}
  .session-vehicle{align-items:flex-start;min-width:0}
  .session-vehicle>span{min-width:0}
  .session-vehicle strong,.session-vehicle span{overflow-wrap:anywhere}
}

@media(max-width:760px){
  .app-topbar{width:100%;max-width:100vw}
  .app-content{width:100%;max-width:100%;padding:16px 12px 28px}
  .page-head h1{font-size:27px}
  .page-head p{font-size:14px}
  .card-head,.card-body{padding:15px}
  .form-grid{gap:14px}
  .input,.select{height:44px}
  .vehicle-category-select{grid-template-columns:1fr;gap:12px;max-width:none}
  .vehicle-category-preview{min-height:82px;justify-content:flex-start}
  .vehicle-category-preview img{width:96px;height:58px}
  .session-submit-card{margin-top:14px}
  .session-submit-actions{display:grid;grid-template-columns:1fr;gap:12px}
  .session-submit-actions .btn{width:100%;min-height:48px;white-space:normal;text-align:center}
  .table-wrap.mobile-cards tbody{padding:12px}
  .table-wrap.mobile-cards tr{grid-template-columns:1fr;gap:12px;padding:14px}
  .table-wrap.mobile-cards td{padding:0}
  .table-wrap.mobile-cards td::before{position:static;width:auto;margin-bottom:4px}
  .session-vehicle img{width:68px;height:44px}
  .badge{white-space:normal;line-height:1.25}
  .quote-table td{min-width:0}
}

/* Lightweight live-update and copy feedback */
.toast-stack{position:fixed;right:18px;bottom:18px;z-index:9999;display:grid;gap:10px;max-width:min(390px,calc(100vw - 28px));pointer-events:none}
.app-toast{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;border-radius:14px;background:#071b38;color:#fff;box-shadow:0 16px 40px rgba(4,24,54,.24);font-weight:700;opacity:0;transform:translateY(10px);transition:opacity .2s ease,transform .2s ease;pointer-events:auto}
.app-toast.is-visible{opacity:1;transform:translateY(0)}
.app-toast.is-error{background:#9f1730}
.app-toast button{border:0;background:rgba(255,255,255,.16);color:#fff;padding:7px 10px;border-radius:9px;font:inherit;cursor:pointer;white-space:nowrap}
.live-sync-indicator{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:#6e7c93;margin-top:8px}
.live-sync-indicator::before{content:"";width:7px;height:7px;border-radius:50%;background:#18a66a;box-shadow:0 0 0 4px rgba(24,166,106,.12)}
@media(max-width:640px){.toast-stack{left:14px;right:14px;bottom:88px;max-width:none}.app-toast{font-size:14px}}

/* Headrest v6: image-rich custom vehicle category dropdown */
.sr-only-select{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.vehicle-image-select{position:relative;width:min(100%,720px)}
.vehicle-image-trigger{width:100%;min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 14px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:0 1px 0 rgba(7,27,56,.02)}
.vehicle-image-trigger:hover,.vehicle-image-trigger:focus-visible{border-color:#9fc4f4;box-shadow:0 0 0 3px rgba(27,100,194,.10);outline:0}
.vehicle-trigger-placeholder{color:var(--muted)}
.vehicle-trigger-selected{display:flex;align-items:center;gap:14px;min-width:0}
.vehicle-trigger-selected[hidden]{display:none}
.vehicle-trigger-selected img{width:112px;height:58px;object-fit:contain;flex:0 0 auto}
.vehicle-trigger-selected strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vehicle-trigger-chevron{font-size:24px;line-height:1;color:var(--muted);transition:transform .18s ease}
.vehicle-image-select.is-open .vehicle-trigger-chevron{transform:rotate(180deg)}
.vehicle-image-menu{position:absolute;z-index:80;left:0;right:0;top:calc(100% + 8px);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:390px;overflow:auto;padding:10px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 20px 52px rgba(7,27,56,.18)}
.vehicle-image-menu[hidden]{display:none}
.vehicle-image-option{min-width:0;display:flex;align-items:center;gap:10px;padding:9px;border:1px solid transparent;border-radius:12px;background:#f8fbff;color:var(--ink);font:inherit;cursor:pointer;text-align:left}
.vehicle-image-option:hover,.vehicle-image-option:focus-visible{border-color:#b9d5f5;background:#eef6ff;outline:0}
.vehicle-image-option[aria-selected="true"]{border-color:var(--blue);background:#eaf3ff;box-shadow:inset 0 0 0 1px var(--blue)}
.vehicle-image-option img{width:78px;height:48px;object-fit:contain;flex:0 0 auto}
.vehicle-image-option span{font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){
  .vehicle-image-select{width:100%}
  .vehicle-image-trigger{min-height:72px;padding:8px 12px}
  .vehicle-trigger-selected img{width:92px;height:52px}
  .vehicle-image-menu{position:fixed;z-index:10000;left:12px;right:12px;top:auto;bottom:18px;grid-template-columns:repeat(2,minmax(0,1fr));max-height:min(70vh,560px);padding:12px;border-radius:18px}
  .vehicle-image-option{min-height:84px;flex-direction:column;justify-content:center;gap:4px;text-align:center}
  .vehicle-image-option img{width:108px;height:58px}
  .vehicle-image-option span{font-size:12px;white-space:normal}
  .vehicle-image-select.is-open::before{content:"";position:fixed;inset:0;z-index:9999;background:rgba(4,18,39,.38);backdrop-filter:blur(2px)}
}

/* Merchant session refinements v9 */
.input.is-calculated:disabled {
    background: #eef3f9;
    color: #52647d;
    cursor: not-allowed;
    opacity: 1;
}
.plate-lookup-field { position: relative; }
.plate-suggestions {
    position: absolute;
    z-index: 80;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid #d7e1ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(10, 35, 70, .16);
}
.plate-suggestion {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    background: #fff;
    color: #0b203d;
    text-align: left;
    cursor: pointer;
}
.plate-suggestion:last-child { border-bottom: 0; }
.plate-suggestion:hover, .plate-suggestion:focus { background: #f3f7fd; }
.plate-suggestion img { width: 52px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.plate-suggestion span { min-width: 0; display: grid; gap: 2px; }
.plate-suggestion strong { font-size: 14px; }
.plate-suggestion small { overflow: hidden; color: #6b7890; text-overflow: ellipsis; white-space: nowrap; }
.customer-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
    .customer-meta { grid-template-columns: 1fr; }
    .plate-suggestions { position: fixed; left: 16px; right: 16px; top: auto; bottom: 18px; max-height: 52vh; overflow-y: auto; }
}


/* v9.1 — keep fields aligned when one column includes helper text */
.form-grid > .field {
    align-self: start;
    align-content: start;
}
.form-grid > .field > .input,
.form-grid > .field > .select,
.form-grid > .field > .password-wrap {
    align-self: start;
}


/* Headrest v1.1.3: compact mobile dashboard session cards */
@media (max-width: 760px) {
    .dashboard-recent-sessions tbody {
        gap: 10px;
        padding: 10px;
    }

    .dashboard-recent-sessions tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "vehicle vehicle"
            "customer status"
            "quotation action";
        column-gap: 14px;
        row-gap: 13px;
        padding: 13px;
    }

    .dashboard-recent-sessions td[data-label="Vehicle"] {
        grid-area: vehicle;
        padding-bottom: 11px;
        border-bottom: 1px solid var(--line);
    }

    .dashboard-recent-sessions td[data-label="Customer"] {
        grid-area: customer;
    }

    .dashboard-recent-sessions td[data-label="Status"] {
        grid-area: status;
    }

    .dashboard-recent-sessions td[data-label="Quotation"] {
        grid-area: quotation;
    }

    .dashboard-recent-sessions td[data-label="Action"] {
        grid-area: action;
        align-self: end;
    }

    .dashboard-recent-sessions .session-vehicle {
        align-items: center;
        gap: 11px;
    }

    .dashboard-recent-sessions .session-vehicle img {
        width: 78px;
        height: 50px;
    }

    .dashboard-recent-sessions td::before {
        margin-bottom: 5px;
    }

    .dashboard-recent-sessions .table-primary {
        font-size: 15px;
        line-height: 1.25;
    }

    .dashboard-recent-sessions .table-secondary {
        font-size: 13px;
        line-height: 1.35;
    }

    .dashboard-recent-sessions .table-actions {
        justify-content: flex-end;
    }

    .dashboard-recent-sessions .table-actions .btn {
        width: auto;
        min-width: 104px;
        justify-content: center;
        padding-inline: 14px;
    }
}

@media (max-width: 390px) {
    .dashboard-recent-sessions tr {
        column-gap: 10px;
        padding: 12px;
    }

    .dashboard-recent-sessions .session-vehicle img {
        width: 70px;
        height: 46px;
    }

    .dashboard-recent-sessions .table-actions .btn {
        min-width: 92px;
        padding-inline: 11px;
    }
}
