/* =============================================================
   Complain ERP — Theme
   Palette: Black (#0d0d0d) + Red accent (#dc2626)
   Approach: mobile-first, single source of truth for every page
   ============================================================= */

:root {
    --c-black:        #0b0b0d;
    --c-black-soft:   #1a1a1c;
    --c-graphite:     #2b2b2e;
    --c-charcoal:     #3a3a3d;
    --c-red:          #e11d2e;
    --c-red-2:        #ff4757;
    --c-red-dark:     #a3121f;
    --c-red-soft:     #fdf1f1;
    --c-red-tint:     #fbe4e4;
    --c-red-border:   #f0c9c9;

    --c-gold:         #c9a24b;

    --c-text:         #161618;
    --c-text-muted:   #767680;
    --c-bg:           #eef0f3;
    --c-surface:      #ffffff;
    --c-border:       #e5e6eb;
    --c-border-dark:  #a3121f;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-xs: 0 1px 2px rgba(15,15,20,.05);
    --shadow-sm: 0 2px 8px rgba(15,15,20,.06);
    --shadow-md: 0 8px 24px rgba(15,15,20,.08);
    --shadow-lg: 0 20px 48px rgba(15,15,20,.12);
    --shadow-glow: 0 0 0 1px rgba(225,29,46,.08), 0 12px 32px rgba(225,29,46,.10);

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--c-text);
    background:
        radial-gradient(1100px 380px at 15% -10%, rgba(225,29,46,.05), transparent 60%),
        radial-gradient(900px 340px at 100% 0%, rgba(11,11,13,.04), transparent 55%),
        var(--c-bg);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--c-red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(225,29,46,.18); color: var(--c-text); }

/* =============================================================
   Top bar (matches the approved design reference exactly)
   ============================================================= */
.topbar {
    height: 76px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid #e7e7e7;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: auto; height: 60px; display: block; object-fit: contain; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy b { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.brand-copy em { font-style: italic; font-size: 12px; font-weight: 900; color: var(--c-red); letter-spacing: .22em; }
.brand-copy small { font-size: 8px; color: #777; margin-top: 3px; }
.help {
    display: grid;
    grid-template-columns: 32px auto;
    grid-template-rows: 1fr 1fr;
    column-gap: 9px;
    text-decoration: none;
    color: var(--c-text);
    font-size: 11px;
}
.help:hover { text-decoration: none; }
.help-icon {
    grid-row: 1/3;
    width: 32px; height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--c-red-soft);
    color: var(--c-red);
}
.help b { font-size: 14px; }

@media (max-width: 820px) {
    .topbar { height: 66px; padding: 0 16px; }
    .brand-mark { width: auto; height: 44px; }
    .brand-copy b { font-size: 12px; }
    .brand-copy em { font-size: 10px; }
    .brand-copy small { display: none; }
    /* Keep "Need help? + number" on phones too — compact, right-aligned, vertically centred with the logo. */
    .help { grid-template-columns: 30px auto; column-gap: 8px; align-items: center; font-size: 10px; line-height: 1.2; }
    .help-icon { width: 30px; height: 30px; font-size: 13px; }
    .help b { font-size: 13px; white-space: nowrap; }
}

/* =============================================================
   Main
   ============================================================= */
.app-main {
    flex: 1 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* =============================================================
   Page header (toolbar)
   ============================================================= */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.page-head__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--c-black);
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-head__title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: var(--c-red);
    border-radius: 2px;
    display: inline-block;
}
.page-head__sub {
    color: var(--c-text-muted);
    font-size: 13px;
    margin: 4px 0 0 12px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg, var(--c-red-2), var(--c-red)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(225,29,46,.3); }
.btn--primary:hover { box-shadow: 0 10px 22px rgba(225,29,46,.4); }
.btn--ghost { background: transparent; color: var(--c-black); border-color: var(--c-border); }
.btn--ghost:hover { background: var(--c-black); color: #fff; border-color: var(--c-black); }
.btn--dark { background: var(--c-black); color: #fff; border-color: var(--c-black); }
.btn--dark:hover { background: var(--c-graphite); }

/* =============================================================
   LIST PAGE
   ============================================================= */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.search-box {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    color: var(--c-text);
}
.search-box:focus {
    outline: 2px solid var(--c-red);
    outline-offset: -1px;
    border-color: var(--c-red);
}

.cs-table-wrap {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
}
.cs-table {
    width: 100%;
    font-size: 13px;
}
.cs-table thead th {
    background: var(--c-black);
    color: #fff;
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-right: 1px solid var(--c-graphite);
}
.cs-table thead th:last-child { border-right: none; }
.cs-table tbody td {
    padding: 11px 14px;
    border-top: 1px solid var(--c-border);
    vertical-align: middle;
}
.cs-table tbody tr:hover { background: var(--c-red-soft); }
.cs-table tbody tr:hover td { border-top-color: var(--c-red-border); }
.cs-link {
    color: var(--c-red-dark);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.cs-link:hover { color: var(--c-red); }
.tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--c-red-tint);
    color: var(--c-red-dark);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.empty-row td {
    text-align: center;
    color: var(--c-text-muted);
    padding: 28px 14px;
    font-style: italic;
}

/* =============================================================
   VOUCHER (preview page) — A4-like card
   ============================================================= */
.voucher {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: voucherBoom .55s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes voucherBoom {
    0%   { opacity: 0; transform: scale(.9) translateY(18px); }
    60%  { opacity: 1; transform: scale(1.015) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Hero decorative spinning wheel (subtle, workshop-branded) */
.voucher__hero-wheel {
    position: absolute;
    right: 18px; top: 50%;
    transform: translateY(-50%);
    width: 46px; height: 46px;
    opacity: .35;
    color: var(--c-gold);
    animation: heroWheelSpin 9s linear infinite;
    z-index: 1;
}
@keyframes heroWheelSpin { to { transform: translateY(-50%) rotate(360deg); } }

/* Staggered reveal for sections once the voucher lands */
.voucher-section, .annexure {
    animation: sectionRise .5s cubic-bezier(.2,.9,.3,1) both;
}
.voucher-section:nth-of-type(1) { animation-delay: .08s; }
.voucher-section:nth-of-type(2) { animation-delay: .16s; }
.voucher-section:nth-of-type(3) { animation-delay: .24s; }
.voucher-section:nth-of-type(4) { animation-delay: .32s; }
.voucher-section:nth-of-type(5) { animation-delay: .4s; }
.annexure { animation-delay: .28s; }
@keyframes sectionRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.voucher__quickglance { animation: qgDrop .5s .2s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes qgDrop {
    from { opacity: 0; transform: translateY(-14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.qg-item { animation: qgFade .4s ease both; }
.qg-item:nth-child(1) { animation-delay: .32s; }
.qg-item:nth-child(2) { animation-delay: .38s; }
.qg-item:nth-child(3) { animation-delay: .44s; }
.qg-item:nth-child(4) { animation-delay: .5s; }
@keyframes qgFade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .voucher, .voucher-section, .annexure, .voucher__quickglance, .qg-item,
    .loader__wheel svg, .loader__progress::after, .sk, .loader__ellipsis i, .voucher__hero-wheel {
        animation: none !important;
    }
}

/* =============================================================
   Async UI states — loader, error, empty
   ============================================================= */
.loader {
    padding: 8px 0 40px;
    color: var(--c-text-muted);
    transition: opacity .18s ease;
}
.loader.is-fading-out { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .loader { transition: none; }
}
.loader__card {
    position: relative;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(11,11,13,.07);
    padding: 22px;
    overflow: hidden;
}

/* Indeterminate progress bar riding the top edge of the card. */
.loader__progress {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--c-border);
    overflow: hidden;
}
.loader__progress::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 38%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--c-red-2), var(--c-red));
    animation: loaderProgress 1.4s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes loaderProgress {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

/* ---- Head: spinning wheel + status copy ---- */
.loader__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--c-border);
}
.loader__wheel { flex: none; width: 44px; height: 44px; display: block; }
.loader__wheel svg { width: 44px; height: 44px; animation: loaderSpin 1.15s linear infinite; }
.loader__wheel-rim { fill: none; stroke: var(--c-border); stroke-width: 3.5; }
.loader__wheel-arc {
    fill: none;
    stroke: var(--c-red);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 34 86;
}
.loader__wheel-hub { fill: var(--c-red); }
@keyframes loaderSpin { to { transform: rotate(360deg); } }

.loader__head-text { display: block; min-width: 0; }
.loader__head-text b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: .1px;
}
.loader__head-text em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 12px;
    color: var(--c-text-muted);
}
.loader__ellipsis i {
    font-style: normal;
    opacity: 0;
    animation: loaderDots 1.2s steps(1, end) infinite;
}
.loader__ellipsis i:nth-child(2) { animation-delay: .2s; }
.loader__ellipsis i:nth-child(3) { animation-delay: .4s; }
@keyframes loaderDots { 0%, 20% { opacity: 0; } 30%, 100% { opacity: 1; } }

/* ---- Skeleton blocks shaped like the sheet that is loading ---- */
.sk {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, #eceef1 25%, #f6f7f9 37%, #eceef1 63%);
    background-size: 400% 100%;
    animation: loaderShimmer 1.4s ease-in-out infinite;
}
@keyframes loaderShimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.sk--tile { height: 58px; border-radius: 10px; }
.sk--line { height: 11px; }
.sk--row  { height: 34px; border-radius: 8px; }
.sk--w35 { width: 35%; } .sk--w40 { width: 40%; } .sk--w45 { width: 45%; }
.sk--w50 { width: 50%; } .sk--w55 { width: 55%; } .sk--w60 { width: 60%; }
.sk--w65 { width: 65%; } .sk--w70 { width: 70%; }

.loader__tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.loader__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 22px;
    margin-bottom: 22px;
}
.loader__rows { display: grid; gap: 10px; }

/* Stagger the shimmer so it sweeps down the card instead of pulsing as one block. */
.loader__tiles .sk:nth-child(2), .loader__grid .sk:nth-child(2) { animation-delay: .08s; }
.loader__tiles .sk:nth-child(3), .loader__grid .sk:nth-child(3) { animation-delay: .16s; }
.loader__tiles .sk:nth-child(4), .loader__grid .sk:nth-child(4) { animation-delay: .24s; }
.loader__grid .sk:nth-child(n+5) { animation-delay: .32s; }
.loader__rows .sk:nth-child(2) { animation-delay: .12s; }
.loader__rows .sk:nth-child(3) { animation-delay: .24s; }

@media (max-width: 640px) {
    .loader__card { padding: 16px; }
    .loader__tiles { grid-template-columns: repeat(2, 1fr); }
    .loader__grid  { grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
}

.error-state {
    max-width: 440px;
    margin: 40px auto;
    padding: 36px 28px;
    text-align: center;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: sectionRise .4s cubic-bezier(.2,.9,.3,1) both;
}
.error-state__icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: var(--c-red-soft);
    border-radius: 50%;
}
.error-state__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--c-text);
}
.error-state__text {
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--c-text-muted);
    line-height: 1.6;
}
.error-state__text code {
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* =============================================================
   "No CS number specified" — animated radar/search state
   ============================================================= */
.nocs-state {
    max-width: 460px;
    margin: 48px auto;
    padding: 44px 32px 36px;
    text-align: center;
    position: relative;
    background:
        radial-gradient(420px 220px at 50% -10%, rgba(225,29,46,.07), transparent 65%),
        var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: voucherBoom .55s cubic-bezier(.2,1.4,.4,1) both;
}
.nocs-state::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--c-red), var(--c-gold), var(--c-red), transparent);
    background-size: 200% 100%;
    animation: nocsSheen 3.2s linear infinite;
}

/* ----- Radar / magnifying glass ----- */
.nocs-state__radar {
    position: relative;
    width: 96px; height: 96px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nocs-state__ring {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--c-red);
    border-radius: 50%;
    opacity: 0;
    animation: nocsPing 2.6s cubic-bezier(.2,.7,.4,1) infinite;
}
.nocs-state__ring--2 { animation-delay: .7s; }
.nocs-state__ring--3 { animation-delay: 1.4s; }
@keyframes nocsPing {
    0%   { transform: scale(.55); opacity: 0; }
    15%  { opacity: .55; }
    100% { transform: scale(1.35); opacity: 0; }
}
.nocs-state__beam {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(225,29,46,.28), transparent 35%);
    animation: nocsSweep 2.4s linear infinite;
}
@keyframes nocsSweep { to { transform: rotate(360deg); } }
.nocs-state__glass {
    position: relative;
    z-index: 2;
    width: 58px; height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--c-red-2), var(--c-red));
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(225,29,46,.35);
    animation: nocsBob 2.4s ease-in-out infinite;
}
@keyframes nocsBob {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-6px) rotate(6deg); }
}

.nocs-state__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--c-text);
    animation: sectionRise .45s .1s cubic-bezier(.2,.9,.3,1) both;
}
.nocs-state__text {
    margin: 0 0 22px;
    font-size: 13.5px;
    color: var(--c-text-muted);
    line-height: 1.6;
    animation: sectionRise .45s .18s cubic-bezier(.2,.9,.3,1) both;
}
.nocs-state__text code {
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.nocs-state__hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--c-black);
    color: #d8d8dc;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    box-shadow: var(--shadow-sm);
    animation: sectionRise .45s .26s cubic-bezier(.2,.9,.3,1) both;
}
.nocs-state__hint svg { color: var(--c-red-2); flex-shrink: 0; }
.nocs-state__hint-accent { color: var(--c-red-2); font-weight: 700; }
.nocs-state__caret {
    display: inline-block;
    width: 6px; height: 13px;
    margin-left: 1px;
    background: var(--c-red-2);
    vertical-align: -2px;
    animation: nocsCaret 1s step-end infinite;
}
@keyframes nocsCaret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes nocsSheen { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .nocs-state, .nocs-state__ring, .nocs-state__beam, .nocs-state__glass,
    .nocs-state__title, .nocs-state__text, .nocs-state__hint, .nocs-state__caret,
    .nocs-state::before {
        animation: none !important;
    }
}

/* Components with their own display (.btn is inline-flex) would otherwise
   beat the UA [hidden] rule — keep hidden meaning hidden. */
[hidden] { display: none !important; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-text-muted);
}
.empty-state__icon { font-size: 48px; margin-bottom: 14px; opacity: 0.5; }
.empty-state h3 { margin: 0 0 6px; color: var(--c-black); font-size: 18px; }
.empty-state p  { margin: 0; font-size: 13px; }

/* Small button variant for inline actions */
.btn--sm { padding: 5px 10px; font-size: 12px; }

.voucher__toolbar {
    background: var(--c-black);
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.voucher__toolbar-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.voucher__toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.voucher__toolbar-actions .btn { padding: 6px 12px; font-size: 12px; }

/* ----- Sticky mini-header (appears once the hero scrolls out of view) ----- */
.voucher__stickybar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--c-black);
    color: #fff;
    padding: 10px 20px;
    border-bottom: 2px solid var(--c-red);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}
.voucher__stickybar.is-visible { transform: translateY(0); opacity: 1; }
.voucher__stickybar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12.5px;
}
.voucher__stickybar-cs {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--c-red-2);
    flex-shrink: 0;
}
.voucher__stickybar-sep { color: rgba(255,255,255,.35); flex-shrink: 0; }
.voucher__stickybar-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.voucher__stickybar-call {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-red);
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .voucher__stickybar-name { display: none; }
    .voucher__stickybar-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .voucher__stickybar { transition: none; }
}

/* ----- Voucher header (workshop + title) ----- */
.voucher__hero {
    background:
        radial-gradient(500px 220px at 100% 0%, rgba(225,29,46,.25), transparent 60%),
        linear-gradient(155deg, #1a1a1c, var(--c-black) 70%);
    color: #fff;
    padding: 18px 28px;
    position: relative;
    overflow: hidden;
}
.voucher__hero::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c-red-2), var(--c-gold));
}
.voucher__hero::after {
    content: "";
    position: absolute;
    right: -20px; top: 50%;
    transform: translateY(-50%);
    width: 140px; height: 140px;
    background: radial-gradient(circle, var(--c-red) 0%, transparent 70%);
    opacity: 0.25;
    border-radius: 50%;
}
.voucher__workshop {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--c-gold);
    font-weight: 700;
    margin-bottom: 6px;
}
.voucher__title {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: #fff;
    letter-spacing: -0.6px;
}
.voucher__title-accent {
    background: linear-gradient(135deg, var(--c-red-2), var(--c-red));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ----- Status badge (received / pending / delivered / locked) ----- */
.voucher__status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
}
.voucher__status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.voucher__status--received .voucher__status-dot {
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74,222,128,.18);
    animation: statusPulse 2s ease-in-out infinite;
}
.voucher__status--pending .voucher__status-dot { background: #ffc93d; box-shadow: 0 0 0 4px rgba(255,201,61,.18); }
.voucher__status--delivered .voucher__status-dot { background: #38bdf8; box-shadow: 0 0 0 4px rgba(56,189,248,.18); }
.voucher__status--locked .voucher__status-dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.18); }
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
    .voucher__status-dot { animation: none; }
}

/* ----- Top info row (CS No, Receive Time, Car ID, Received By) ----- */
.voucher__meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fbfbfc;
    border-bottom: 1px solid var(--c-border);
}
.voucher__meta-cell {
    padding: 10px 20px;
    border-right: 1px solid var(--c-border);
}
.voucher__meta-cell:last-child { border-right: none; }
.voucher__meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}
.voucher__meta-value {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c-text);
    word-break: break-word;
}
.voucher__meta-value--mono { font-family: var(--font-mono); color: var(--c-red-dark); }
.copy-btn {
    background: none;
    border: none;
    padding: 2px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: .55;
    vertical-align: middle;
    transition: opacity .15s ease, transform .15s ease;
}
.copy-btn:hover { opacity: 1; transform: scale(1.1); }

/* ----- Toast (tiny transient message) ----- */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translate(-50%, 12px);
    background: var(--c-black);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.app-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
    .app-toast { transition: none; }
}

/* ----- Quick-glance strip (at-a-glance summary chips) ----- */
.voucher__quickglance {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 18px;
    margin: -18px 20px 12px;
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--c-border);
}
.qg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.qg-item--btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background .15s ease, transform .15s ease;
}
.qg-item--btn:hover { background: var(--c-red-soft); transform: translateY(-1px); }
.qg-item__icon {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--c-red-soft);
    border-radius: var(--radius-sm);
}
.qg-item > div { min-width: 0; display: flex; flex-direction: column; }
.qg-item__label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-text-muted);
    font-weight: 700;
}
.qg-item__value {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- Sections (always expanded) ----- */
.voucher-section { margin-bottom: 14px; }
.voucher-section:last-of-type { margin-bottom: 0; }

/* ----- Section heading (small bar above each block) ----- */
.voucher__section-title {
    background: transparent;
    color: var(--c-text);
    padding: 0 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 2px solid var(--c-black);
    display: flex;
    align-items: center;
    gap: 9px;
}
.voucher__section-icon {
    font-size: 13px;
    flex-shrink: 0;
    width: 26px; height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-red-2), var(--c-red));
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(225,29,46,.28);
}
.voucher__section-count {
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 2px;
}

/* ----- Show/Hide toggle on a section title (e.g. Customer Info) ----- */
.section-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f7f7f9;
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.section-toggle:hover { background: var(--c-red-soft); color: var(--c-red-dark); }

/* ----- Computer-generated notice ----- */
.voucher__notice {
    background: #fff2f2;
    color: var(--c-red-dark);
    border-bottom: 1px solid var(--c-red-border);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    padding: 7px 12px;
}

/* ----- Customer/Vehicle grid (label-value cells) ----- */
.kv-grid {
    width: 100%;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--c-border);
    margin-top: 8px;
}
.kv-grid td {
    border: 1px solid var(--c-border);
    padding: 6px 12px;
    vertical-align: top;
}
.kv-grid tr:nth-child(even) .kv-value { background: #fafafb; }
.kv-label {
    background: #f7f7f9;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    width: 14%;
    white-space: nowrap;
}
.kv-value {
    color: var(--c-text);
    background: #fff;
    word-break: break-word;
    font-weight: 600;
}
.kv-value--empty { color: #b4b4bb; font-style: italic; font-weight: 400; }

/* ----- Service row (ODO, JC No, Document Status, etc.) ----- */
.service-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.service-cell {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: box-shadow .18s ease, transform .18s ease;
}
.service-cell:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.service-cell--full { grid-column: span 3; }
.service-cell--highlight {
    background: var(--c-red-soft);
    border-color: var(--c-red-border);
}
.service-label {
    font-size: 9.5px;
    text-transform: uppercase;
    color: var(--c-text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.service-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--c-text);
}
.relative-time {
    font-weight: 600;
    font-size: 11px;
    color: var(--c-text-muted);
}

/* ----- Fuel gauge ----- */
.fuel-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.fuel-gauge__bar {
    flex: 1;
    height: 10px;
    background: #ececef;
    position: relative;
    border-radius: 999px;
    overflow: hidden;
}
.fuel-gauge__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #e11d2e, #ff8a3d, #ffc93d);
    transition: width .3s ease;
}
.fuel-gauge__marks {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 700;
    color: var(--c-text-muted);
    width: 100%;
    margin-top: 3px;
}

/* ----- Complaints table ----- */
.concern-table {
    width: 100%;
    font-size: 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 8px;
}
.concern-table thead th {
    background: var(--c-black);
    color: #fff;
    padding: 9px 12px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}
.concern-table thead th.sl-col { width: 50px; text-align: center; }

.concern-cat td {
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--c-border);
}
.concern-row td {
    padding: 9px 12px;
    border-top: 1px solid var(--c-border);
    vertical-align: top;
}
.concern-row:hover td { background: #fbfbfc; }
.concern-row td.sl {
    text-align: center;
    font-weight: 700;
    color: #fff;
    width: 50px;
}
.concern-row td.sl span,
.concern-row td.sl {
    color: var(--c-red-dark);
}
.concern-name { display: inline; }
.concern-tags { display: inline-flex; gap: 5px; margin-left: 8px; vertical-align: middle; }
.concern-tag {
    display: inline-flex;
    align-items: center;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
}
.concern-tag--priority {
    background: #fff4e0;
    color: #a35b00;
    border: 1px solid #ffe0a3;
}
.concern-tag--rework {
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    border: 1px solid var(--c-red-border);
}
.concern-remarks {
    margin-top: 4px;
    font-size: 11.5px;
    font-style: italic;
    color: var(--c-text-muted);
}

/* ----- Annexure ----- */
.annexure {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--c-red);
    background: #fff;
    padding: 10px 16px;
    margin: 0 0 14px;
    box-shadow: var(--shadow-xs);
}
.annexure__label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--c-red-dark);
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}
.annexure__body {
    font-size: 13px;
    color: var(--c-text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ----- Previous CS history ----- */
.history-table {
    width: 100%;
    font-size: 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 8px;
}
.history-table th {
    background: var(--c-black);
    color: #fff;
    padding: 9px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
}
.history-table td {
    padding: 9px 10px;
    border-top: 1px solid var(--c-border);
}
.history-empty td {
    text-align: center;
    padding: 22px;
}
.history-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    margin: 0 auto 8px;
    font-size: 17px;
    background: var(--c-red-soft);
    border-radius: 50%;
}
.history-empty__text {
    display: block;
    color: var(--c-text-muted);
    font-weight: 600;
    font-size: 12.5px;
}

/* ----- Terms ----- */
.terms-box {
    background: #fafafb;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 11.5px;
    color: #555;
    text-align: justify;
    line-height: 1.55;
}

/* ----- Signatures ----- */
.signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 18px;
    padding-top: 4px;
}
.signature {
    text-align: center;
}
.signature__line {
    border-top: 1.5px solid var(--c-border);
    margin-bottom: 8px;
    padding-top: 26px;
}
.signature__label {
    font-size: 11px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

/* ----- Voucher inner padding (mobile adjusts) ----- */
.voucher__body {
    padding: 16px 24px 18px;
}

/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* Tablet & below */
@media (max-width: 900px) {
    .voucher__meta { grid-template-columns: repeat(2, 1fr); }
    .voucher__meta-cell:nth-child(2) { border-right: none; }
    .voucher__meta-cell:nth-child(1),
    .voucher__meta-cell:nth-child(2) { border-bottom: 1px solid var(--c-border); }
    .kv-label { width: 22%; }
}

/* Mobile */
@media (max-width: 640px) {
    .page-head__title { font-size: 17px; }
    .page-head__title::before { height: 18px; }
    .page-head__sub { font-size: 12px; margin-left: 12px; }

    .voucher__toolbar { padding: 8px 12px; }
    .voucher__toolbar-title { font-size: 12px; }

    .voucher__hero { padding: 20px 16px 24px; }
    .voucher__title { font-size: 21px; }
    .voucher__workshop { font-size: 10px; letter-spacing: 1.5px; }

    .voucher__meta { grid-template-columns: 1fr; }
    .voucher__meta-cell {
        border-right: none !important;
        border-bottom: 1px solid var(--c-border);
        padding: 10px 14px;
    }
    .voucher__meta-cell:last-child { border-bottom: none; }

    .voucher__body { padding: 14px; }

    .voucher__quickglance {
        grid-template-columns: repeat(2, 1fr);
        margin: -18px 12px 16px;
        padding: 12px;
        gap: 12px 8px;
    }
    .qg-item:nth-child(-n+2) { padding-bottom: 10px; border-bottom: 1px solid var(--c-border); }
    .qg-item:nth-child(n+3) { padding-top: 2px; }

    .voucher__section-title { font-size: 11px; }

    /* KV grid becomes a compact label/value row list on mobile — easier to scan than stacked blocks.
       Each <tr> holds 3 label/value pairs (6 <td>s); a 2-col grid lets them fall into place naturally. */
    .kv-grid, .kv-grid tbody { display: block; width: 100% !important; }
    .kv-grid tr {
        display: grid;
        grid-template-columns: 42% 1fr;
        width: 100%;
    }
    .kv-grid td {
        border: none !important;
        border-bottom: 1px solid var(--c-border) !important;
        padding: 8px 14px !important;
    }
    .kv-label {
        width: auto !important;
        background: transparent !important;
        white-space: normal;
        font-size: 10px;
        display: flex;
        align-items: center;
    }
    .kv-value {
        text-align: right;
        font-weight: 600;
    }

    .service-row { grid-template-columns: 1fr; }
    .service-cell--full { grid-column: span 1; }

    .concern-table thead { display: none; }
    .concern-table, .concern-table tbody, .concern-table tr, .concern-table td {
        display: block; width: 100% !important;
    }
    .concern-table tr {
        border: 1px solid var(--c-border);
        margin-bottom: 6px;
        border-radius: var(--radius-sm);
    }
    .concern-row td.sl {
        text-align: left;
        background: var(--c-red-soft);
        color: var(--c-red-dark);
        font-size: 10.5px;
        text-transform: uppercase;
        padding: 4px 12px;
    }
    .concern-row td:not(.sl)::before {
        content: "Concern: ";
        font-size: 10.5px;
        color: var(--c-red-dark);
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.4px;
        display: block;
        margin-bottom: 2px;
    }
    .concern-cat td { padding: 5px 12px; font-size: 11px; }

    .signatures { grid-template-columns: 1fr; gap: 16px; margin-top: 22px; }

    .history-table thead { display: none; }
    .history-table, .history-table tbody, .history-table tr, .history-table td {
        display: block; width: 100% !important;
    }
    .history-table tr {
        border: 1px solid var(--c-border);
        margin-bottom: 8px;
        border-radius: var(--radius-sm);
    }
    .history-table td {
        border: none;
        border-bottom: 1px solid var(--c-border);
        padding: 6px 10px;
    }
    .history-table td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: var(--c-red-dark);
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        margin-right: 4px;
    }
    .history-empty td::before { content: none; }

    /* List table → card view */
    .cs-table thead { display: none; }
    .cs-table, .cs-table tbody, .cs-table tr, .cs-table td { display: block; width: 100% !important; }
    .cs-table tbody tr {
        border: 1px solid var(--c-border);
        margin-bottom: 10px;
        border-radius: var(--radius-md);
        padding: 4px 0;
        background: #fff;
        position: relative;
    }
    .cs-table tbody tr:hover { background: var(--c-red-soft); }
    .cs-table tbody td {
        border: none;
        border-bottom: 1px solid var(--c-border);
        padding: 8px 14px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        text-align: right;
    }
    .cs-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--c-red-dark);
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        text-align: left;
    }
    .cs-table tbody td:last-child { border-bottom: none; }
    .cs-table tbody td.cs-link-cell { justify-content: flex-end; }
    .cs-table tbody td.cs-link-cell::before { flex: 1; }

    /* Hide less-critical columns on small phones to keep cards compact */
    .cs-table tbody td[data-label="Reg. No"],
    .cs-table tbody td[data-label="By"],
    .cs-table tbody td[data-label="Received"] {
        display: none;
    }

    /* The Action cell becomes a sticky bottom row of the card */
    .cs-table tbody td.cs-link-cell {
        background: #fafafa;
        padding: 10px 14px;
        border-top: 1px solid var(--c-border);
    }
    .cs-table tbody td.cs-link-cell .btn { width: 100%; justify-content: center; }
}

/* Very small phones */
@media (max-width: 380px) {
    .voucher__title { font-size: 17px; }
}

/* =============================================================
   Mobile floating action dock (Call / WhatsApp)
   ============================================================= */
.action-dock { display: none; }

@media (max-width: 820px) {
    .app-main { padding-bottom: 84px; }

    .action-dock:not([hidden]) {
        position: fixed;
        z-index: 60;
        bottom: 12px;
        left: 16px;
        right: 16px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        padding: 7px;
        border: 1px solid rgba(20,24,34,.09);
        border-radius: 17px;
        background: rgba(255,255,255,.94);
        box-shadow: 0 10px 35px rgba(17,23,39,.18);
        backdrop-filter: blur(12px);
    }
    .action-btn {
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 11px;
        text-decoration: none;
        font-size: 12px;
        font-weight: 800;
    }
    .phone-action { border: 1px solid #d9dde5; background: #fff; color: var(--c-text); }
    .whatsapp-action { background: #20b866; color: #fff; box-shadow: 0 6px 18px rgba(32,184,102,.24); }
}

/* =============================================================
   PRINT STYLES
   ============================================================= */
@media print {
    body { background: #fff; }
    .topbar, .page-head__actions,
    .btn, .list-toolbar, .loader, .error-state, .nocs-state, .action-dock
    { display: none !important; }
    #listView, #voucherView { display: block !important; }
    .app-main { padding: 0; }
    .voucher { border: none; box-shadow: none; border-radius: 0; }
    .voucher__hero { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .voucher__meta-cell, .kv-label, .service-cell, .concern-cat td,
    .history-table th, .annexure, .terms-box {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    a[href]:after { content: ""; }
}

/* =============================================================
   VOUCHER — "page-shell" design (matches the approved reference:
   MBW_Complaint_Sheet_Responsive.html). Bare-name selectors below
   (.field, .panel, .content, .icon) are scoped under .page-shell
   so they can't leak into other parts of the site.
   ============================================================= */
.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 26px auto 50px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(18,23,38,.12);
    border-radius: 22px;
    overflow: hidden;
}

/* ----- Hero ----- */
.page-shell .hero {
    min-height: 176px;
    background:
        radial-gradient(circle at 87% 10%, rgba(239,51,64,.24), transparent 34%),
        linear-gradient(125deg, #121317, #1c1013);
    padding: 38px 42px 68px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}
.page-shell .hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--c-red) 0 72%, var(--c-gold) 72%);
}
.page-shell .hero p {
    margin: 0 0 7px;
    text-transform: uppercase;
    letter-spacing: .19em;
    color: var(--c-gold);
    font-size: 11px;
    font-weight: 800;
}
.page-shell .hero h1 {
    font-size: 38px;
    line-height: 1;
    margin: 0 0 12px;
    letter-spacing: -.04em;
    font-weight: 800;
}
.page-shell .hero h1 span { color: var(--c-red); }
.page-shell .hero small { color: #b9bcc4; font-size: 13px; }
.page-shell .hero small .time-ago { color: #7c7f88; }
.page-shell .status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 99px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.page-shell .status i {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #55d287;
    box-shadow: 0 0 0 4px rgba(85,210,135,.15);
    animation: statusPulse 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .page-shell .status i { animation: none; }
}

/* ----- Quick-glance cards ----- */
.page-shell .quick-grid {
    display: grid;
    grid-template-columns: 1.3fr .8fr 1fr .75fr;
    gap: 10px;
    margin: -42px 22px 0;
    position: relative;
    z-index: 2;
}
.page-shell .quick-card {
    min-height: 86px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 15px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(20,25,40,.08);
    text-align: left;
    font: inherit;
    color: inherit;
}
.page-shell .quick-card .icon {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--c-red-soft);
    color: var(--c-red);
    display: grid;
    place-items: center;
    font-size: 18px;
}
.page-shell .quick-card small {
    display: block;
    text-transform: uppercase;
    color: #858996;
    font-weight: 750;
    font-size: 9px;
    letter-spacing: .07em;
    margin-bottom: 4px;
}
.page-shell .quick-card strong { display: block; font-size: 14px; line-height: 1.25; }
.page-shell .quick-card strong.is-empty { color: var(--c-text-muted); font-weight: 600; font-style: italic; }
.page-shell .quick-card span { font-size: 11px; color: var(--c-text-muted); }
/* The tappable card must read as tappable: red border, warm tint, chevron.
   (.page-shell prefix needed — the base .page-shell .quick-card border would otherwise win.) */
.page-shell button.quick-card {
    position: relative;
    width: 100%;
    cursor: pointer;
    border: 1.5px solid var(--c-red);
    background: linear-gradient(180deg, #fff, #fff6f6);
    box-shadow: 0 0 0 3px rgba(225,29,46,.08), 0 8px 25px rgba(20,25,40,.08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.page-shell button.quick-card::after {
    content: "›";
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--c-red);
}
.page-shell button.quick-card span { color: var(--c-red-dark); font-weight: 700; }
.page-shell button.quick-card:hover { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(225,29,46,.14), 0 10px 28px rgba(20,25,40,.1); }
.page-shell button.quick-card:active { transform: scale(.98); }
.page-shell button.quick-card:focus-visible { outline: 2px solid var(--c-red); outline-offset: 2px; }
.page-shell .mini-fuel {
    width: 90px; height: 5px;
    border-radius: 4px;
    background: #e9eaed;
    margin-top: 7px;
    overflow: hidden;
}
.page-shell .mini-fuel i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--c-red), #ffbd3d);
}

/* ----- Identity strip ----- */
.page-shell .identity-strip {
    display: grid;
    grid-template-columns: .75fr 1.4fr;
    border-bottom: 1px solid var(--c-border);
    padding: 22px 30px 20px;
}
.page-shell .identity-strip .field { padding: 0 22px; border-right: 1px solid var(--c-border); }
.page-shell .identity-strip .field:first-child { padding-left: 0; }
.page-shell .identity-strip .field:last-child { border: 0; }
.page-shell .field { min-width: 0; }
.page-shell .field > label {
    display: block;
    text-transform: uppercase;
    color: #838793;
    font-size: 9px;
    font-weight: 780;
    letter-spacing: .055em;
    margin-bottom: 7px;
}
.page-shell .field > strong { font-size: 13px; line-height: 1.45; display: block; overflow-wrap: anywhere; }
.page-shell .accent { color: var(--c-red-dark); font-size: 15px; }

/* ----- Content / panels ----- */
.page-shell .content { padding: 4px 30px 34px; }
.page-shell .panel { padding: 24px 0 4px; scroll-margin-top: 20px; }
.page-shell .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #17181b;
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.page-shell .section-title .icon {
    width: 29px; height: 29px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ff5660, var(--c-red));
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 5px 12px rgba(239,51,64,.25);
    font-size: 14px;
}
.page-shell .section-title h2 { font-size: 15px; letter-spacing: -.01em; margin: 0; text-transform: uppercase; }
.page-shell .section-title b {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--c-red-soft);
    color: var(--c-red-dark);
    font-size: 11px;
}

/* ----- Customer/Vehicle info grid ----- */
.page-shell .info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: hidden;
}
.page-shell .info-grid .field {
    padding: 13px 14px;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    background: #fff;
}
.page-shell .info-grid .wide { grid-column: span 2; }
.page-shell .info-grid .field:nth-child(3),
.page-shell .info-grid .field:nth-child(5),
.page-shell .info-grid .field:nth-child(8),
.page-shell .info-grid .field:nth-child(11),
.page-shell .info-grid .field:nth-child(14) { border-right: 0; }
.page-shell .info-grid .field:nth-child(12),
.page-shell .info-grid .field:nth-child(13),
.page-shell .info-grid .field:nth-child(14) { border-bottom: 0; }

/* ----- Phone reveal/hide ----- */
.page-shell .reveal {
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 750;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.page-shell .reveal .show { font-weight: 650; color: var(--c-red); font-size: 10px; margin-left: 3px; }

/* ----- Concerns ----- */
.page-shell .section-note { color: var(--c-text-muted); font-size: 12px; margin: -5px 0 14px; }
.page-shell .concern-list { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
.page-shell .concern-group h3 {
    margin: 0;
    background: #16171a;
    color: #fff;
    padding: 10px 14px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.page-shell .concern-group ol { list-style: none; margin: 0; padding: 0; }
.page-shell .concern-group li {
    display: grid;
    grid-template-columns: 40px minmax(200px, .8fr) 1.2fr;
    align-items: center;
    min-height: 54px;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
    padding: 8px 14px;
}
.page-shell .concern-group:last-child li:last-child { border-bottom: 0; }
.page-shell .concern-group li > b { color: var(--c-red-dark); }
.page-shell .concern-group li em {
    font-style: normal;
    color: var(--c-text-muted);
    font-size: 11px;
    border-left: 1px solid var(--c-border);
    padding-left: 16px;
}
.page-shell .concern-group li em strong {
    display: block;
    margin-bottom: 2px;
    color: var(--c-red-dark);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ----- Terms & Conditions ----- */
.page-shell .terms-panel details { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
.page-shell .terms-panel summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    font-weight: 750;
}
.page-shell .terms-panel summary::-webkit-details-marker { display: none; }
.page-shell .terms-panel p {
    font-size: 11px;
    line-height: 1.75;
    color: var(--c-text-muted);
    padding: 0 16px 16px;
    margin: 0;
}

/* ----- Footer ----- */
.page-shell .document-footer {
    margin-top: 26px;
    border-top: 1px solid var(--c-border);
    padding-top: 23px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.page-shell .footer-meta { display: flex; flex-direction: column; gap: 5px; }
.page-shell .footer-meta label,
.page-shell .trust span { font-size: 10px; color: var(--c-text-muted); }
.page-shell .footer-meta b,
.page-shell .trust b { font-size: 12px; }
.page-shell .footer-meta label:nth-of-type(2) { margin-top: 12px; }
.page-shell .trust { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.page-shell .trust b { color: var(--c-red-dark); }

/* ----- Responsive ----- */
@media (max-width: 820px) {
    .page-shell { width: 100%; margin: 0; border-radius: 0; box-shadow: none; overflow: visible; padding-bottom: 70px; }
    .page-shell .hero { min-height: 132px; padding: 18px 18px 42px; position: relative; }
    .page-shell .hero p { margin-bottom: 4px; }
    .page-shell .hero h1 { margin-bottom: 0; font-size: 31px; }
    .page-shell .hero > div:first-child > small { position: absolute; left: 18px; bottom: 46px; font-size: 9px; white-space: nowrap; }
    .page-shell .status { position: absolute; right: 18px; top: 14px; margin: 0; padding: 6px 8px; font-size: 9px; white-space: nowrap; }

    .page-shell .quick-grid { grid-template-columns: 1fr 1fr; margin: -38px 12px 0; gap: 8px; }
    .page-shell .quick-card { min-height: 82px; padding: 12px; gap: 9px; }
    .page-shell .quick-card .icon { flex-basis: 34px; height: 34px; }
    .page-shell .quick-card strong { font-size: 12px; }
    .page-shell .quick-card span { font-size: 9px; }

    .page-shell .identity-strip {
        padding: 10px 14px;
        grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr);
        align-items: start;
    }
    .page-shell .identity-strip .field { padding: 0 10px; }
    .page-shell .identity-strip .field:first-child { padding-left: 0; }
    .page-shell .identity-strip .field:last-child { grid-column: auto; border-top: 0; margin-top: 0; padding: 0 0 0 10px; }
    .page-shell .identity-strip .field > label { margin-bottom: 3px; }
    .page-shell .identity-strip .field > strong { font-size: 12px; line-height: 1.25; }
    .page-shell .identity-strip .accent { font-size: 14px; }

    .page-shell .content { padding: 0 16px 24px; }
    .page-shell .panel { padding-top: 22px; }
    .page-shell .section-title h2 { font-size: 13px; }

    .page-shell .info-grid { grid-template-columns: 1fr 1fr; }
    .page-shell .customer-info .field { padding: 10px 11px; }
    .page-shell .customer-info .field > label { margin-bottom: 3px; }
    .page-shell .customer-info .field > strong { font-size: 12px; line-height: 1.3; }
    .page-shell .info-grid .field,
    .page-shell .info-grid .field:nth-child(n) { border-right: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
    .page-shell .info-grid .field:nth-child(2n),
    .page-shell .info-grid .field:nth-child(3),
    .page-shell .info-grid .field:nth-child(6),
    .page-shell .info-grid .field:nth-child(8),
    .page-shell .info-grid .field:nth-child(10),
    .page-shell .info-grid .field:nth-child(12),
    .page-shell .info-grid .field:nth-child(14) { border-right: 0; }
    .page-shell .info-grid .wide,
    .page-shell .info-grid .mobile-wide { grid-column: 1/-1; border-right: 0; }

    .page-shell .concern-group li { grid-template-columns: 32px 1fr; padding: 10px 12px; align-items: start; }
    .page-shell .concern-group li em { grid-column: 2; border: 0; padding: 4px 0 0; font-size: 10px; }

    .page-shell .document-footer { display: block; }
    .page-shell .trust { text-align: left; margin-top: 20px; }
}
@media (max-width: 470px) {
    .page-shell .hero h1 { font-size: 29px; }
    .page-shell .content { padding-left: 12px; padding-right: 12px; }
    .page-shell .panel { padding-top: 15px; }
    .page-shell .section-title { padding-bottom: 7px; margin-bottom: 9px; }

    .page-shell .quick-card { align-items: flex-start; }
    .page-shell .quick-card .icon { display: none; }

    .page-shell .info-grid { grid-template-columns: 1fr; }
    .page-shell .info-grid .wide,
    .page-shell .info-grid .mobile-wide { grid-column: auto; }
    .page-shell .info-grid .field,
    .page-shell .info-grid .field:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--c-border); }
    .page-shell .info-grid .field:last-child { border-bottom: 0; }

    /* Customer & Vehicle Info specifically stays 2-column even on small
       phones (matches the design reference) — declared after the generic
       .info-grid 1-column rule above so it wins at equal specificity. */
    .page-shell .customer-info { grid-template-columns: 1fr 1fr; }
    .page-shell .customer-info .field,
    .page-shell .customer-info .field:nth-child(n) { border-right: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
    .page-shell .customer-info .field:nth-child(2),
    .page-shell .customer-info .field:nth-child(6),
    .page-shell .customer-info .field:nth-child(8),
    .page-shell .customer-info .field:nth-child(10),
    .page-shell .customer-info .field:nth-child(12),
    .page-shell .customer-info .field:nth-child(14) { border-right: 0; }
    .page-shell .customer-info .wide,
    .page-shell .customer-info .mobile-wide { grid-column: 1/-1; border-right: 0 !important; }

    .page-shell .section-note { line-height: 1.5; }
    .page-shell .concern-group li { font-size: 12px; }
    .page-shell .document-footer { padding-bottom: 5px; }
}

@media print {
    .page-shell { box-shadow: none; border-radius: 0; }
    .page-shell .hero { background: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
