/* ============================================================
   AcuraOnly Inventory Dashboard — style.css
   Dark premium UI — Acura red #C8102E + gold #C9A227
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base: #08090d;
  --bg-card: #0f1117;
  --bg-glass: rgba(15, 17, 23, 0.9);
  --bg-row: #111318;
  --bg-row-alt: #0f1117;
  --bg-row-hover: #171921;
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.14);
  --acura-red: #C8102E;
  --acura-red-dim: rgba(200, 16, 46, 0.18);
  --acura-red-glow: rgba(200, 16, 46, 0.35);
  --gold: #C9A227;
  --gold-dim: rgba(201, 162, 39, 0.18);
  --text-primary: #F2F3F5;
  --text-secondary: #9EA3B1;
  --text-muted: #5B6070;
  --green: #22C55E;
  --amber: #F59E0B;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  --transition: 0.18s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
}

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: #2a2d38;
  border-radius: 3px;
}

/* ─── HEADER ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--acura-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 0 14px var(--acura-red-glow);
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.logo-text span {
  color: var(--acura-red);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.updated-badge {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 20px;
}

.header-stat {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.stat-new {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.stat-used {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.stat-cpo {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.28);
}

.stat-dlrs {
  background: var(--acura-red-dim);
  color: #ff6b7a;
  border: 1px solid var(--acura-red-glow);
}

/* ─── FILTER BAR ──────────────────────────────────────── */
.filter-bar {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 62px;
  z-index: 90;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 15px;
  height: 15px;
}

#search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px 7px 32px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input:focus {
  border-color: var(--acura-red);
  box-shadow: 0 0 0 3px var(--acura-red-dim);
}

#search-input::placeholder {
  color: var(--text-muted);
}

.pill-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.pill:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.pill.active {
  border-color: var(--acura-red);
  color: var(--acura-red);
  background: var(--acura-red-dim);
}

.pill.active-new {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.pill.active-used {
  border-color: #a5b4fc;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
}

.pill.active-cpo {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.select-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 28px 6px 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6070' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--transition);
}

.select-filter:focus {
  border-color: var(--acura-red);
}

.select-filter option {
  background: #1a1d27;
}

.filter-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-compare {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-compare:hover,
.btn-compare.active {
  background: var(--gold-dim);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.2);
}

/* ─── ZIP SCORE BAR ───────────────────────────────────── */
.zip-bar {
  padding: 8px 24px;
  background: rgba(201, 162, 39, 0.06);
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.zip-bar label {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

#zip-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  width: 90px;
  outline: none;
  transition: border-color var(--transition);
}

#zip-input:focus {
  border-color: var(--gold);
}

.zip-note {
  font-size: 11px;
  color: var(--text-muted);
}

.zip-note strong {
  color: var(--text-secondary);
}

/* ─── MAIN TABLE AREA ─────────────────────────────────── */
.main-content {
  padding: 16px 24px 48px;
}

.results-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.results-count {
  font-size: 12px;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--text-primary);
}

.sort-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── TABLE ───────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead {
  background: #12151f;
  position: sticky;
  top: 130px;
  z-index: 10;
}

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

th:hover {
  color: var(--text-primary);
}

th.sorted {
  color: var(--acura-red);
}

th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  opacity: 0.4;
}

th.sorted .sort-arrow {
  opacity: 1;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: var(--bg-row-alt);
}

tbody tr:nth-child(odd) {
  background: var(--bg-row);
}

tbody tr:hover {
  background: var(--bg-row-hover);
}

tr.expanded-row-detail {
  background: #13162a !important;
  cursor: default;
}

td {
  padding: 9px 12px;
  vertical-align: middle;
  color: var(--text-secondary);
  font-size: 12.5px;
  white-space: nowrap;
}

td.td-model {
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  min-width: 140px;
}

td.td-price {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13.5px;
}

td.td-mileage {
  font-variant-numeric: tabular-nums;
}

/* ─── TYPE BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.badge-new {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-used {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-cpo {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.18), rgba(201, 162, 39, 0.10));
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.35);
}

/* ─── COLOR SWATCH ───────────────────────────────────── */
.color-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* ─── DEALER REVEAL ──────────────────────────────────── */
.dealer-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
}

.dealer-name {
  font-weight: 500;
  font-size: 12px;
}

.dealer-city {
  font-size: 10.5px;
  color: var(--text-muted);
}

.reveal-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.reveal-btn:hover {
  border-color: var(--acura-red);
  color: var(--acura-red);
  background: var(--acura-red-dim);
}

.reveal-btn.revealed {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

/* ─── DAYS / PRICE CHIP ──────────────────────────────── */
.days-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

.days-chip.fresh {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
}

.days-chip.mid {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
}

.days-chip.aging {
  background: rgba(200, 16, 46, 0.12);
  color: #ff6b7a;
}

.price-drop-chip {
  font-size: 10.5px;
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

.price-drop-chip.drop {
  color: var(--green);
}

/* ─── CONFIDENCE BAR ─────────────────────────────────── */
.conf-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conf-bar {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acura-red), var(--gold));
  transition: width 0.4s ease;
}

.conf-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* ─── SCORE ICON ─────────────────────────────────────── */
.score-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.score-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.score-btn.warning {
  border-color: var(--acura-red);
  color: var(--acura-red);
  background: var(--acura-red-dim);
}

/* ─── ROW EXPAND CHEVRON ─────────────────────────────── */
.chevron-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), color var(--transition);
  font-size: 16px;
}

.chevron-btn:hover {
  color: var(--text-primary);
}

.chevron-btn.open {
  transform: rotate(90deg);
  color: var(--acura-red);
}

/* ─── EXPANDED DETAIL ROW ────────────────────────────── */
.detail-panel {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 20px;
  align-items: start;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.detail-photo {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1a1d27;
}

.detail-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.spec-item label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.spec-item span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--acura-red);
  color: #fff;
}

.btn-primary:hover {
  background: #a50d24;
  box-shadow: 0 0 16px var(--acura-red-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.btn-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.35);
}

.btn-gold:hover {
  background: rgba(201, 162, 39, 0.3);
}

/* ─── SCORE TOOLTIP ──────────────────────────────────── */
.score-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.score-overlay.open {
  display: flex;
}

.score-card {
  background: #14172a;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.score-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.score-card .sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.score-row:last-of-type {
  border-bottom: none;
}

.score-row .metric {
  color: var(--text-secondary);
}

.score-row .value {
  font-weight: 600;
  color: var(--text-primary);
}

.score-row .value.good {
  color: var(--green);
}

.score-row .value.ok {
  color: var(--amber);
}

.score-row .value.risk {
  color: #ff6b7a;
}

.service-warning {
  margin-top: 16px;
  background: var(--acura-red-dim);
  border: 1px solid var(--acura-red-glow);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 11.5px;
  color: #ffb3bc;
  line-height: 1.6;
  display: none;
}

.service-warning.visible {
  display: block;
}

.score-close {
  display: block;
  margin-top: 16px;
  width: 100%;
  padding: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition);
}

.score-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ─── COMPARE MODE ───────────────────────────────────── */
.compare-banner {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.08), transparent);
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--gold);
  display: none;
}

.compare-banner.visible {
  display: block;
}

tr.compare-highlight-a {
  background: rgba(99, 102, 241, 0.07) !important;
}

tr.compare-highlight-b {
  background: rgba(34, 197, 94, 0.05) !important;
}

/* ─── NO RESULTS ─────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.no-results .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.no-results h3 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.no-results p {
  font-size: 13px;
}

/* ─── FOOTER ─────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.site-footer a {
  color: var(--acura-red);
  text-decoration: none;
}

/* ─── VIEW TOGGLE ────────────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.view-btn {
  background: none;
  border: none;
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ─── SORT CONTROL (card view) ───────────────────────── */
.sort-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.sort-control label {
  color: var(--text-muted);
}

#card-sort-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 26px 5px 9px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B6070' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: border-color var(--transition);
}

#card-sort-select:focus {
  border-color: var(--acura-red);
}

#card-sort-select option {
  background: #1a1d27;
}

.sort-dir-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.sort-dir-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

/* ─── CARD / TILE GRID ───────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.car-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.22s ease;
}

.car-tile:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* accent top bar by type */
.car-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.car-tile.tile-new::before {
  background: var(--green);
}

.car-tile.tile-used::before {
  background: #818cf8;
}

.car-tile.tile-cpo::before {
  background: var(--gold);
}

/* ── tile header row ── */
.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tile-badge-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tile-score-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
}

.tile-score-btn:hover {
  color: var(--gold);
}

/* ── vehicle identity ── */
.tile-model {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
}

.tile-trim {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── sparkline ── */
.tile-sparkline {
  width: 100%;
  height: 42px;
  margin-bottom: 10px;
  display: block;
}

/* ── price + delta ── */
.tile-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.tile-price {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.tile-delta {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

.tile-delta.drop {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
}

.tile-delta.same {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ── metrics row ── */
.tile-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  margin-bottom: 10px;
}

.tile-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tile-metric-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.tile-metric-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── color & drive row ── */
.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 9px;
  gap: 6px;
}

.tile-color-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  overflow: hidden;
}

.tile-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.tile-color-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.tile-dealer-wrap {
  flex-shrink: 0;
}

.tile-reveal-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}

.tile-reveal-btn:hover {
  border-color: var(--acura-red);
  color: var(--acura-red);
  background: var(--acura-red-dim);
}

.tile-reveal-btn.revealed {
  border-color: var(--green);
  color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

/* ── lot age bar ── */
.tile-lot-bar {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  margin-top: 9px;
  overflow: hidden;
}

.tile-lot-fill {
  height: 100%;
  border-radius: 2px;
  max-width: 100%;
}

/* hide/show views */
.view-table .card-grid {
  display: none;
}

.view-cards .table-wrap {
  display: none;
}

.view-cards .compare-banner {
  display: none !important;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    padding: 0 14px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-meta {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .filter-bar {
    padding: 10px 14px;
    position: static;
  }

  .main-content {
    padding: 12px 14px 40px;
  }

  .table-wrap {
    border-radius: var(--radius);
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }

  .btn-compare {
    margin-left: 0;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }
}

/* ─────────────────────────────────────────────────────────────
   DEALER PORTAL BUTTON (header)
───────────────────────────────────────────────────────────── */
.btn-dealer-portal {
  background: linear-gradient(135deg, var(--acura-red), #a00025);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-dealer-portal:hover {
  opacity: 0.88;
  box-shadow: 0 0 14px var(--acura-red-glow);
}

/* ─────────────────────────────────────────────────────────────
   FAVORITES BUTTON (header) + badge
───────────────────────────────────────────────────────────── */
.btn-favorites-open {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.btn-favorites-open:hover {
  color: #f43f5e;
  border-color: #f43f5e;
}

.btn-favorites-open.has-favs {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}

.fav-badge {
  background: #f43f5e;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  line-height: 1.4;
  min-width: 16px;
  text-align: center;
}

/* ❤ heart toggle on each tile */
.tile-heart-btn {
  position: absolute;
  top: 9px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.1s;
  color: var(--text-muted);
  z-index: 3;
}

.tile-heart-btn:hover,
.tile-heart-btn.liked {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
}

.tile-heart-btn.liked {
  color: #f43f5e;
}

.tile-heart-btn:active {
  transform: scale(1.25);
}

/* pill-fav-filter */
.pill-fav-filter {
  color: var(--text-secondary);
}

.pill-fav-filter.active {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.08);
}

/* ─────────────────────────────────────────────────────────────
   SHARED MODAL OVERLAY / CARD
───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #13151e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.modal-card-wide {
  max-width: 820px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ─────────────────────────────────────────────────────────────
   DEALER PORTAL — PIN input
───────────────────────────────────────────────────────────── */
.dp-pin-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#dp-pin-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 20px;
  font-family: monospace;
  letter-spacing: 0.25em;
  padding: 10px 14px;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}

#dp-pin-input:focus {
  border-color: var(--acura-red);
}

.dp-pin-btn {
  background: var(--acura-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.dp-pin-btn:hover {
  opacity: 0.85;
}

.dp-error {
  color: #f43f5e;
  font-size: 12px;
  margin-top: 6px;
}

.dp-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ─────────────────────────────────────────────────────────────
   DEALER PORTAL — KPI strip
───────────────────────────────────────────────────────────── */
.dp-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.dp-kpi {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.dp-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.dp-kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dp-kpi-val.up {
  color: var(--green);
}

.dp-kpi-val.down {
  color: #f43f5e;
}

.dp-kpi-val.gold {
  color: var(--gold);
}

/* ─────────────────────────────────────────────────────────────
   DEALER PORTAL — rankings table
───────────────────────────────────────────────────────────── */
.dp-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.dp-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dp-rank-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.dp-rank-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.dp-rank-table tr.my-dealer td {
  background: rgba(200, 16, 46, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.dp-rank-table tr.my-dealer td:first-child {
  border-left: 3px solid var(--acura-red);
}

.rank-trophy {
  font-size: 15px;
}

/* ─────────────────────────────────────────────────────────────
   DEALER PORTAL — my listings mini-grid
───────────────────────────────────────────────────────────── */
.dp-my-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.dp-my-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 11.5px;
}

.dp-my-tile .dmt-model {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.dp-my-tile .dmt-trim {
  color: var(--text-muted);
  font-size: 10.5px;
  margin-bottom: 8px;
}

.dp-my-tile .dmt-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.dp-my-tile .dmt-age {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────────
   FAVORITES PANEL — grid
───────────────────────────────────────────────────────────── */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.fav-tile {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 10px;
  padding: 14px;
  position: relative;
}

.fav-tile .ft-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

.fav-tile .ft-remove:hover {
  color: #f43f5e;
}

.fav-tile .ft-model {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fav-tile .ft-trim {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.fav-tile .ft-price {
  font-size: 18px;
  font-weight: 700;
  color: #f2f3f5;
}

.fav-tile .ft-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}