/* Honda AutoQuoteAI — desktop dashboard styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --honda-red: #cc0000; /* Betsy 8/14: all Honda reds are RGB 204,0,0 */
    --honda-red-dark: #990000;
    --primary: #1a56db;
    --primary-dark: #1a3f9f;
    --success: #16a34a;
    --danger: #cc0000;
    --warn: #d97706;
    --secondary: #64748b;
    --bg: #f5f6fa;
    --surface: #fff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
}

/* Item 8.1: bump base font size 2pt for legibility on every page. */
html { font-size: 17px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ---- Nav ---- */
.nav {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 50;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--honda-red); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px;
}
.nav-title { font-weight: 700; font-size: 15px; white-space: nowrap; }
.nav-links { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; min-width: 0; }
.nav-link {
    padding: 8px 8px; border-radius: 8px; text-decoration: none;
    color: var(--text-muted); font-weight: 500; font-size: 17.5px; /* was 14px; +25% per honda-feedback */
    white-space: nowrap; /* a label never breaks mid-word (Referral Registry made corporate 8 links, 11/23) */
}
.nav-link:hover { background: #f1f5f9; color: var(--text); }
.nav-link.active { background: #fee2e2; color: var(--honda-red); }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }
.nav-username { color: var(--text-muted); }
.nav-signout { color: var(--honda-red); text-decoration: none; font-weight: 600; }

/* ---- Page / Section ---- */
.page { padding: 24px; max-width: 1400px; margin: 0 auto; }
.section-head { margin-bottom: 20px; }
.section-head h1 { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.section > .card + .card { margin-top: 16px; }

.pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: #eef2ff; color: var(--primary); font-size: 12px; font-weight: 600;
}

.back-link { color: var(--primary); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 8px; }

/* ---- Flash ---- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.flash-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* ---- Cards ---- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 15px; margin-top: 10px; margin-bottom: 8px; }
.card-actions { margin-top: 14px; display: flex; gap: 10px; }
.count { background: var(--border); color: var(--text-muted); font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

.dealer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dealer-head h2 { margin: 0; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.veh { padding: 14px 0; border-top: 1px dashed var(--border); }
.veh:first-child { border-top: 0; padding-top: 0; }
.veh-head {
    display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px;
    align-items: center; margin-bottom: 10px; font-size: 14px;
}

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { background: #f8fafc; font-weight: 600; color: var(--text-muted); font-size: 13px; text-transform: none; }
.tbl-striped tbody tr:nth-child(odd) { background: #fafbfc; }
.tbl tbody tr:hover { background: #eff6ff; }
.tbl .center { text-align: center; }
.tbl .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Currency columns are right-justified on every dashboard -- templates put
   .right on both the th and its tds (any table class, incl. .table). */
th.right, td.right { text-align: right; }
.empty { padding: 24px; text-align: center; color: var(--text-muted); background: #f8fafc; border-radius: var(--radius); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* ---- Admin Tracking Dashboard (honda-feedback Task 9) ---- */
/* Both scrollbars: overflow: auto on the wrapper, no-wrap cells so the table
   grows past viewport width -- the sticky thead below relies on this same
   wrapper being the scroll container, not the page body. */
.tracking-scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); }
.tracking-table { white-space: nowrap; }
.tracking-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #f8fafc; cursor: pointer; user-select: none;
}
.tracking-table thead th:hover { background: #eef2ff; }
.tracking-table td.pink { background: #fde3e9; }
/* .section-wide (Tracking + Billing): break the WHOLE section -- header,
   filter toolbar, and table wrapper -- out of .page's 1400px cap to the full
   viewport (24px gutters), so the wide table has room before it has to
   scroll horizontally, and tighten cells so more columns fit. The margin
   calc is 0 whenever the viewport is already narrower than the cap. */
.section-wide {
    margin-left: calc(50% - 50vw + 24px);
    margin-right: calc(50% - 50vw + 24px);
}
.section-wide .tracking-table th,
.section-wide .tracking-table td { padding: 8px 8px; font-size: 13px; }
/* Betsy 8/14 feedback #2: wrap/condense headers so every column through
   "Final Vehicle Status" fits on screen without horizontal scrolling. With
   headers allowed to wrap, each column shrinks to its widest data value
   (cells stay nowrap) instead of its longest header label. */
.section-wide .tracking-table thead th {
    white-space: normal;
    vertical-align: bottom;
    font-size: 12px;
    line-height: 1.25;
}
/* Betsy 8/15: black vertical lines between every tracking column. */
.tracking-table.col-lines th + th,
.tracking-table.col-lines td + td { border-left: 1px solid #000; }
/* Long free-text columns (Resolution Next Steps Notes) wrap inside a capped
   width instead of stretching the row -- keeps everything through "Final
   Vehicle Status" on screen. */
.tracking-table td.wrap { white-space: normal; max-width: 230px; min-width: 150px; }

/* ---- Admin Billing Tab (honda-feedback Task 10) ---- */
/* Inline per-row Notes edit form -- reuses .tracking-scroll/.tracking-table
   above for the sticky-header scroll wrapper (fully generic, not actually
   tracking-specific). */
.notes-form { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.notes-form input[type="text"] { width: 180px; padding: 4px 6px; font-size: 13px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #cc0000; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-listed { background: #dbeafe; color: #1e40af; }
.badge-withdrawn { background: #f1f5f9; color: #475569; }
.badge-pending-payment { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-needs-resolution { background: #fee2e2; color: #991b1b; }
.badge-won-final { background: #dcfce7; color: #166534; }
.badge-lost { background: #f1f5f9; color: #475569; }
.badge-awaiting-bids { background: #dbeafe; color: #1e40af; }
.badge-ended-no-bids { background: #f1f5f9; color: #475569; }
.badge-ended-awaiting-award { background: #fef3c7; color: #92400e; }
.badge-awarded { background: #fef3c7; color: #92400e; }
.badge-complete { background: #dcfce7; color: #166534; }

/* §3.1.1.2 — flashing red unread counter on the Local Vehicles nav link. */
.badge-unread {
    margin-left: 6px; padding: 2px 8px;
    background: var(--honda-red); color: #fff;
    font-weight: 700; font-size: 11px;
    animation: pulse-red 1.4s ease-in-out infinite;
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); opacity: 1; }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
    .badge-unread { animation: none; }
}

/* ---- Forms ---- */
.field { display: block; margin-bottom: 12px; font-size: 13px; }
.field > span { display: block; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit;
    background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.field-wide { grid-column: 1 / -1; }
.chk-row { display: flex; align-items: center; gap: 8px; }
.chk-row > span { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row .field { flex: 1; margin-bottom: 0; }

.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-right: 4px; }

/* Item 5: line up Primary / Secondary radios with their labels. */
.radio-row { display: inline-flex; gap: 18px; align-items: center; }
.radio-row .radio-opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-row .radio-opt input[type="radio"] { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--honda-red); }
.radio-row .radio-opt input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--honda-red); }
.radio-row .radio-opt > span { font-weight: 500; color: var(--text); }

/* Admin item 1.c: "+ Add New Contact" Notes field sharing its row with the
   Send Welcome Email / Send Training Video buttons (spec mock image1). */
.notes-actions-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 12px; }
.notes-actions-row .field { flex: 1 1 260px; max-width: 50%; margin-bottom: 0; }
.notes-actions-row .btn { white-space: nowrap; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--text); font-size: 14px; font-weight: 500;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #f8fafc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-secondary { background: #f1f5f9; }

/* ---- Checkboxes ---- */
.chk { position: relative; display: inline-block; width: 18px; height: 18px; }
.chk input { opacity: 0; position: absolute; }
.chk span { position: absolute; inset: 0; border: 1.5px solid #94a3b8; border-radius: 4px; background: #fff; }
.chk input:checked + span { background: var(--honda-red); border-color: var(--honda-red); }
.chk input:checked + span::after {
    content: ''; position: absolute; left: 4px; top: 1px; width: 6px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---- Toolbar ---- */
.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 14px;
}

/* ---- Auth ---- */
.auth-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
    background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.auth-logo {
    width: 56px; height: 56px; border-radius: 50%; background: var(--honda-red);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900; margin: 0 auto 14px;
    display: flex;
}
.auth-demo { margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-demo code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.auth-demo ul { margin-top: 8px; padding-left: 18px; }

/* ---- Modal ---- */
dialog.modal {
    /* margin: auto restores the UA's centered placement for showModal()
       dialogs — the universal `* { margin: 0 }` reset at the top of this
       file otherwise wipes it and pins every dialog to the top-left. */
    margin: auto;
    border: none; border-radius: 14px; padding: 0; max-width: 700px; width: 95%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
dialog.modal::backdrop { background: rgba(0,0,0,0.4); }
.modal-body { padding: 24px; max-height: 85vh; overflow-y: auto; }
.modal-body h2 { margin-bottom: 14px; font-size: 18px; }
.modal-close { position: absolute; top: 8px; right: 10px; font-size: 24px; border: 0; background: transparent; cursor: pointer; color: var(--text-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* Sell Vehicle (Task 8) -- longer form than the other modals. */
dialog.modal.modal-lg { max-width: 900px; }
.bare-fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.bare-fieldset legend { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 6px; padding: 0; }
.checklist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 16px; margin-bottom: 10px; }
@media (max-width: 700px) { .checklist-grid { grid-template-columns: 1fr; } }
.sv-photo-hint { margin-top: 4px; }

/* ---- Current Vehicles parent/child table (honda-feedback Task 6) ---- */
/* Line-item font +25% over the base .tbl 14px; header row a bit larger + bold. */
.current-vehicles-tbl td { font-size: 17.5px; }
.current-vehicles-tbl th { font-size: 15px; font-weight: 700; color: var(--text); }
.current-vehicles-tbl .next-action-col { min-width: 220px; } /* Next Action: double the other columns' width */
/* Status pill: centred in its column and centred *within* the pill (the label
   wraps to two lines when the column is tight), and sized up from the global
   .badge 12px so it doesn't read as fine print next to the 17.5px row text. */
.current-vehicles-tbl .status-col { text-align: center; }
.current-vehicles-tbl .status-col .badge {
    text-align: center; font-size: 14.5px; padding: 4px 12px; line-height: 1.3;
}
/* Next Action control — Semantic UI "selection dropdown" look. Stays a native
   <select> (keyboard/mobile behaviour, no JS); appearance:none strips the UA
   chrome and the background SVG stands in for Semantic's .dropdown.icon
   caret. Metrics/colours below are Semantic's own .ui.selection.dropdown. */
.current-vehicles-tbl .next-action-select {
    width: 100%;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    cursor: pointer;
    min-height: 2.714em;
    padding: 0.714em 2.1em 0.714em 1em;
    font-family: inherit; font-size: 15px; line-height: 1.2em;
    color: rgba(0,0,0,0.87);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23000' fill-opacity='0.7' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1em center;
    background-size: 10px 6px;
    border: 1px solid rgba(34,36,38,0.15);
    border-radius: 4px; /* Semantic's .28571429rem, in px — this app's root is 17px, not 14px */
    box-shadow: none;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.current-vehicles-tbl .next-action-select:hover { border-color: rgba(34,36,38,0.35); }
.current-vehicles-tbl .next-action-select:focus {
    outline: 0; border-color: #96c8da; box-shadow: none;
}
.current-vehicles-tbl .next-action-select option { color: rgba(0,0,0,0.87); }
.current-vehicles-tbl tr.child-row { background: #fbfbfd; }
.current-vehicles-tbl tr.child-row:hover { background: #f1f5f9; }
/* No extra indent on child-row offer cells: the Offer column is
   right-justified and child offers must line up with the parent's. */
/* Auction ended, not yet awarded — distinct background to call it out. */
.current-vehicles-tbl tr.row-ended { background: #fef3c7; }
.current-vehicles-tbl tr.row-ended:hover { background: #fde8a8; }
/* Brief highlight when "Award Vehicle" scrolls to a parent's bid rows. */
.current-vehicles-tbl tr.flash-highlight { background: #fef9c3 !important; transition: background 0.3s; }

/* ---- Misc ---- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.facts dt { color: var(--text-muted); }
.facts dd { color: var(--text); }
.add-dealer { margin-top: 10px; }
.add-dealer > summary { cursor: pointer; color: var(--primary); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.is-accepted { background: #dcfce7 !important; }
.is-selected { background: #fef3c7 !important; }

/* ---- Corporate Reports (honda-feedback Task 11) ---- */

/* Daily metrics table needs BOTH axes frozen (365+ date columns x 14 metric
   rows) -- .tracking-table above only froze the header row. Reuses the same
   .tracking-scroll/.tracking-table pair Tasks 9/10 already use (that
   comment already calls them "fully generic, not actually tracking-
   specific") and adds a second sticky axis on the first column. */
.kpi-daily-table thead th:first-child {
    left: 0; z-index: 4;
}
.kpi-daily-table tbody th.kpi-row-label {
    position: sticky; left: 0; z-index: 2;
    background: #f8fafc; text-align: left; font-weight: 600;
    white-space: nowrap;
}
/* Every value cell is numeric (counts, %, $) -- right-justify the lot so the
   currency rows read right-aligned like the rest of the dashboards. */
.kpi-daily-table tbody td { text-align: right; }

/* Betsy 8/14: VIN-level Data Category group header -- a merged row pinned
   above the sticky label row (fixed 30px so the label row's sticky offset is
   exact), with dark vertical lines at every category boundary. */
.vin-level-table thead tr.vin-group-row th {
    top: 0; height: 30px; padding: 4px 8px;
    text-align: center; font-weight: 700; color: var(--text);
    background: #eef2f7; cursor: default;
}
.vin-level-table thead tr.vin-group-row th:hover { background: #eef2f7; }
.vin-level-table thead tr:last-child th { top: 30px; }
.vin-level-table th.vin-group-start,
.vin-level-table td.vin-group-start { border-left: 2px solid #334155; }

/* Betsy 8/14: Reports curated sections (Open Issues / Process Improvements) */
.report-item-date-col { width: 110px; }
.report-item-status-col { width: 300px; }
.report-item-notes-col { width: 320px; }
.report-item-add { margin-top: 12px; display: flex; gap: 8px; }
.report-item-add input[type="text"] { flex: 1; max-width: 640px; padding: 6px 10px; }
/* Betsy 8/15: Active/Historical tabs inside each curated section */
.report-tabs { display: flex; gap: 6px; margin: 10px 0 12px; }
.report-tab {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
    background: #f8fafc; cursor: pointer; font-size: 13px; font-weight: 600;
    color: var(--text-muted);
}
.report-tab.active { background: #eef2ff; color: var(--primary); border-color: #c7d2fe; }

/* Betsy 8/15: Admin KPIs grid -- "Yes" gets a light green background + bold */
.kpis-table td { vertical-align: top; }
.kpis-table .kpi-category-col { font-weight: 600; white-space: nowrap; }
.kpi-met-yes { background: #dcfce7; font-weight: 700; }
/* Light-yellow highlight (same #fef9c3 as .flash-highlight/.is-selected
   above) on the two spec-called-out metric rows -- covers the sticky label
   too, overriding its default gray. */
.kpi-daily-table tbody tr.kpi-highlight td,
.kpi-daily-table tbody tr.kpi-highlight th.kpi-row-label {
    background: #fef9c3;
}

/* ---- Weekly bar-chart grid ---- */
.kpi-filter-form .field { margin-bottom: 0; }
.kpi-chart-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px; margin-top: 16px;
}
.kpi-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow);
}
.kpi-panel h3 { font-size: 14px; margin-bottom: 10px; }
.kpi-panel canvas { max-height: 220px; }
.kpi-panel-highlight { background: #fef9c3; }
.kpi-panel-na {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 180px; text-align: center; color: var(--text-muted);
}
.kpi-panel-na .kpi-na-badge { font-size: 13px; font-weight: 700; color: var(--secondary); margin-top: 6px; }

/* ---- Dual Reports: flip switch, export row, live-refresh stamp
   (honda-feedback Betsy 8/8 M3) ---- */
.reports-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.reports-head-controls { display: flex; align-items: center; gap: 16px; }
.reports-updated { white-space: nowrap; }
.reports-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); user-select: none; }
/* Styled checkbox/slider -- same "input(opacity:0) + sibling span" trick
   .chk above uses, just shaped like an iOS-style toggle instead of a box.
   The input itself covers the whole 40x22 switch (not 0-sized) so its own
   hit target IS the visible slider, not just the wrapping <label> text. */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-slider {
    position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px;
    transition: background 0.15s; cursor: pointer;
}
.switch-slider::before {
    content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%; transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--primary); outline-offset: 2px; }
.reports-export-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* honda-feedback Betsy 8/8 M4: real browser print (Ctrl+P) safety net.
   scripts/render_report_pdf.js's ?print=1 capture already gets a
   server-rendered chrome-free page (reports_body.html.twig's `print` flag
   omits these elements outright, and the Graphs section is never `hidden`
   in that render) -- this is a fallback for anyone printing the live page
   directly, since Chrome's print dialog (and Puppeteer's own page.pdf(),
   which defaults to emulating the 'print' media type) both apply it. */
@media print {
    [data-testid="main-nav"],
    .reports-head-controls,
    .reports-export-row,
    .kpi-filter-form,
    [data-testid="export-vin-level"] { display: none !important; }
    .reports-view[hidden] { display: block !important; }
}

/* ---- Satisfaction Surveys (honda-feedback Task 12) ---- */

/* Dealer interstitial: pure-CSS 1-5 star rating. Each row is a flat run of
   (input, label) pairs in *descending* value order (5,4,3,2,1) so the
   general sibling combinator can highlight "this value and everything
   lower" on :checked -- flex-direction: row-reverse then re-displays them
   ascending left-to-right (1..5) for the user. Same trick AVAI's recycler
   interstitial uses (templates/aq_survey.html). */
.survey-card { max-width: 760px; margin: 0 auto; }
.survey-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9em 0; border-bottom: 1px solid var(--border); gap: 1em; flex-wrap: wrap;
}
.survey-row:last-of-type { border-bottom: none; }
.survey-row-label { flex: 1 1 320px; font-weight: 600; }
.star-rating-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-rating-input label { cursor: pointer; }
.star-rating-input .star-icon { font-size: 1.8em; line-height: 1; color: #d5d5d5; transition: color 0.1s; }
.star-rating-input input:checked ~ label .star-icon,
.star-rating-input label:hover .star-icon,
.star-rating-input label:hover ~ label .star-icon { color: #f2a71b; }
.survey-comment { margin-top: 1.5em; }
.survey-comment textarea { width: 100%; min-height: 90px; }
.survey-actions { margin-top: 1.5em; display: flex; gap: 0.75em; justify-content: flex-end; }

/* Results tables (partials/survey_results.html.twig): one table per
   category, plus a Totals block summing per-star counts across categories. */
.survey-results-block { margin-top: 18px; }
.survey-results-block:first-child { margin-top: 0; }
.survey-results-totals { border-top: 2px solid var(--border); padding-top: 14px; margin-top: 26px; }
.survey-results-table th.center, .survey-results-table td.center { text-align: center; }
.survey-cell-hasnames { position: relative; cursor: help; font-weight: 700; }
.survey-popover {
    display: none; position: absolute; z-index: 20; left: 50%; top: 100%;
    transform: translateX(-50%); margin-top: 4px; background: #1f2937; color: #fff;
    border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 400;
    white-space: nowrap; text-align: left; box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.survey-popover ul { list-style: none; margin: 0; padding: 0; }
.survey-cell-hasnames:hover .survey-popover,
.survey-cell-hasnames:focus .survey-popover { display: block; }
.kpi-panel-na .kpi-na-note { font-size: 12px; margin-top: 6px; }

/* Unread message badge (Kathy 8/28): the count button goes amber when the
   thread holds messages newer than this dealership's last read. Cleared on
   open (js/messages_live.js) and repainted by the 60s poll. */
.btn.msg-unread { background: #f59e0b; border-color: #d97706; color: #fff; font-weight: 600; }
.btn.msg-unread:hover { background: #d97706; }

/* Referral Registry (Betsy 11/23): 15 Fig 1.0 columns must fit at 1350px
   with no sideways scroll, so headers wrap and cells are tight. */
.referral-toolbar { flex-wrap: wrap; gap: 12px; }
.referral-visibility-form, .referral-import-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.referral-import-help { margin: -6px 0 14px; }
.referral-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tbl-registry, .tbl-registry-log { font-size: 13px; }
.tbl-registry th, .tbl-registry td, .tbl-registry-log th, .tbl-registry-log td { padding: 6px 5px; }
.tbl-registry th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.tbl-registry td { vertical-align: top; }
.tbl-registry .num, .referral-key .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-registry .nowrap, .tbl-registry-log .nowrap { white-space: nowrap; }
.tbl-registry .break, .tbl-registry-log .break { word-break: break-word; overflow-wrap: anywhere; }
.referral-key summary { cursor: pointer; font-weight: 600; }
.referral-key .tbl { margin: 10px 0; max-width: 760px; }
