/* =========================================================================
   Excise Data Portal - Public site theme
   Palette: deep register-green + brass accent (civic/official register feel,
   not the cream/terracotta or dark/neon defaults). Monospace is reserved
   specifically for FIR/registration/chassis/engine numbers - the actual
   material of this application - so they read as record identifiers, not
   ordinary text.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --color-bg: #f4f6f4;
    --color-surface: #ffffff;
    --color-primary: #0e4034; /* deep register-green */
    --color-primary-dark: #0a2f27;
    --color-accent: #c08a2e; /* brass / seal-gold */
    --color-text: #22261f;
    --color-muted: #6b756a;
    --color-border: #dde2dc;
    --color-recovered: #2f7a4d;
    --color-outstanding: #a8412f;
    --font-display: 'Source Serif 4', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
}

h1, h2, h3, .brand-heading {
    font-family: var(--font-display);
    color: var(--color-primary-dark);
    letter-spacing: -0.01em;
}

a {
    color: var(--color-primary);
}

    a:hover {
        color: var(--color-accent);
    }

/* ---------- Header ---------- */
.site-header {
    background: var(--color-primary);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

    .site-header .navbar-brand {
        color: #fff;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 1.25rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.brand-icons i + i {
    margin-left: 0.15rem;
}

.site-header .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

    .site-header .nav-link:hover {
        color: #fff;
    }

.site-header .nav-user {
    color: #fff;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* The mobile nav is a true offcanvas panel now (see _Layout.cshtml) - as a
   fixed-position overlay it doesn't visually inherit .site-header's background
   the way an inline dropdown did, even though it's still a DOM descendant (so
   .site-header .nav-link above already colors its links correctly - only the
   panel's own background needs setting here). Scoped below md so this can't
   affect the desktop navbar, where Bootstrap's own offcanvas-md reset already
   makes the panel transparent/inline again. */
@media (max-width: 767.98px) {
    #mainNav.offcanvas {
        background: var(--color-primary);
        /* Bootstrap's default offcanvas width is a fixed 400px - wider than most
           phone screens, which is why it was filling the whole viewport instead
           of reading as a drawer. ~60% + a sane cap either side so it stays a
           drawer on both small and large phones. */
        width: 60%;
        min-width: 260px;
        max-width: 320px;
    }
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.4);
}

/* ---------- Footer ---------- */
.site-footer {
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
    margin-top: 3rem;
}

/* ---------- Cards / surfaces ---------- */
.card, .surface-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

/* ---------- Record identifiers: the signature typographic move ---------- */
.record-id {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-primary-dark);
    background: #eef2ee;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* ---------- Status badges ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap; /* pill badges + wrapped text don't mix - this was the main "breaking" bug */
}

    .status-badge.recovered {
        background: rgba(47, 122, 77, 0.12);
        color: var(--color-recovered);
    }

    .status-badge.outstanding {
        background: rgba(168, 65, 47, 0.10);
        color: var(--color-outstanding);
    }

/* ---------- Filter panel ---------- */
.filter-panel {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

    .filter-panel label {
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--color-muted);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .filter-panel .form-control, .filter-panel .form-select {
        border-color: var(--color-border);
    }

        .filter-panel .form-control:focus, .filter-panel .form-select:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 0.2rem rgba(14, 64, 52, 0.12);
        }

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

    .btn-primary:hover, .btn-primary:focus {
        background: var(--color-primary-dark);
        border-color: var(--color-primary-dark);
    }

/* ---------- Record table (desktop) / cards (mobile) ---------- */
.record-table {
    font-size: 0.85rem;
}

    .record-table thead th {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-muted);
        border-bottom: 2px solid var(--color-border);
        white-space: nowrap;
    }

    .record-table th, .record-table td {
        padding: 0.5rem 0.65rem;
        vertical-align: middle;
        white-space: nowrap;
    }

    .record-table tbody tr:hover {
        background: #f7faf7;
    }

    /* Light green tint for recovered rows/cards - subtle enough not to fight the
   status badge for attention, distinct enough to scan the list at a glance.
   Same --color-recovered green used by .status-badge.recovered, just much
   lower opacity since it's covering a whole row/card rather than a small pill. */
    .record-table tbody tr.row-recovered {
        background: rgba(47, 122, 77, 0.07);
    }

        .record-table tbody tr.row-recovered:hover {
            background: rgba(47, 122, 77, 0.13);
        }

.record-card.row-recovered {
    background: rgba(47, 122, 77, 0.07);
    border-color: rgba(47, 122, 77, 0.3);
}

.record-table .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.record-table .record-id {
    padding: 0.05rem 0.3rem;
}

/* Only the Name/Address columns are allowed to be genuinely long free text -
   cap and truncate them so one long address can't blow out every row's height
   or drag the table absurdly wide; everything else stays nowrap above.
   Scoped to .record-table-vehicles specifically (not just .record-table, which
   the calls table also uses with a completely different column layout - the
   12th/13th columns mean something different there). */
.record-table-vehicles td:nth-child(12),
.record-table-vehicles td:nth-child(13) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hint only matters where the table is visible but likely narrower than its
   natural content width (roughly tablet range) - on wide desktops the table
   commonly fits without scrolling, and on phones the cards take over instead. */
.scroll-hint {
    display: none;
}

@media (min-width: 768px) and (max-width: 1400px) {
    .scroll-hint {
        display: block;
    }
}

.record-card {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--color-surface);
}

    .record-card .field-label {
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--color-muted);
    }

/* Hide table on small screens, show cards; inverse on md+ */
@media (max-width: 767.98px) {
    .record-table-wrapper {
        display: none;
    }
}

@media (min-width: 768px) {
    .record-cards-wrapper {
        display: none;
    }
}

/* ---------- Auth screens ---------- */
.auth-panel {
    max-width: 440px;
    margin: 2rem auto;
    padding: 2rem;
}

    .auth-panel h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

.auth-subtitle {
    color: var(--color-muted);
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.qr-wrapper {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    display: inline-block;
}

.manual-key {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    background: #eef2ee;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    word-break: break-all;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
