/* Dealer Listing Studio — design system (dark).
   Graphite surfaces, frosted panels, a violet→cyan accent, status pills with glowing dots. */

@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url('/assets/fonts/interdisplay-semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url('/assets/fonts/interdisplay-bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0a0b10;
  --paper: #0a0b10;
  --surface: #12131a;
  --surface-2: #171923;
  --raised: rgba(255, 255, 255, .045);
  --sunken: rgba(255, 255, 255, .06);
  --glass: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  --ink: #eceef6;
  --ink-2: #c3c7d6;
  --muted: #8b90a3;
  --faint: #5d6275;
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .06);
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --accent: var(--violet);
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4f7bff 55%, #22d3ee 100%);
  --go: #4ade80;   --go-bg: rgba(74, 222, 128, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
  --stop: #fb7185; --stop-bg: rgba(251, 113, 133, .13);
  --sky: #60a5fa;  --sky-bg: rgba(96, 165, 250, .13);
  --tag: #7c5cff;

  --display: 'Inter Display', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 10px; --r: 16px; --r-lg: 20px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -18px rgba(0,0,0,.8);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255,255,255,.08);
  --focus: 0 0 0 3px rgba(124, 92, 255, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
img { max-width: 100%; display: block; }
a { color: #a99bff; text-underline-offset: 2px; }
a:hover { color: #fff; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124, 92, 255, .45); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
[hidden] { display: none !important; }
.num, .price, .stock, .figure { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display { font-family: var(--display); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
.h1 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; letter-spacing: -.025em; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.h3 { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; }
.lede { font-size: 17px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.figure { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.grad-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink);
  font-weight: 550; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn-dark { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(124, 92, 255, .8), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover, .btn-dark:hover { background: var(--accent-grad); border-color: transparent; filter: brightness(1.1); color: #fff; }
.btn-danger { color: var(--stop); }
.btn-danger:hover { border-color: rgba(251,113,133,.4); color: #ffb3c0; background: var(--stop-bg); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: rgba(255,255,255,.07); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field > span, .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(255,255,255,.04); color: var(--ink); transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.select { background-color: #15161e; }
.select option { background: #15161e; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255,255,255,.16); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: rgba(124, 92, 255, .8); box-shadow: var(--focus); background: rgba(255,255,255,.06); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
input[type=color].input { padding: 4px; height: 40px; }
input[type=file] { font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 550; color: var(--ink); background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-right: 10px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.form-error { color: var(--stop); font-size: 13.5px; font-weight: 500; min-height: 20px; }
.form-ok { color: var(--go); font-size: 13.5px; font-weight: 500; }

/* ---------- status pills (class kept as .keytag) ---------- */
.keytag {
  --tag-bg: rgba(255,255,255,.07); --tag-fg: var(--ink-2); --dot: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; min-height: 22px; border-radius: 99px;
  background: var(--tag-bg); color: var(--tag-fg); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.2;
}
.keytag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px var(--dot); flex: none; }
.keytag.yellow { --tag-bg: rgba(124, 92, 255, .16); --tag-fg: #c4b5ff; --dot: #a78bfa; }
.keytag.green  { --tag-bg: var(--go-bg); --tag-fg: var(--go); --dot: var(--go); }
.keytag.red    { --tag-bg: var(--stop-bg); --tag-fg: var(--stop); --dot: var(--stop); }
.keytag.amber  { --tag-bg: var(--warn-bg); --tag-fg: var(--warn); --dot: var(--warn); }
.keytag.blue   { --tag-bg: var(--sky-bg); --tag-fg: var(--sky); --dot: var(--sky); }
.keytag.navy   { --tag-bg: rgba(255,255,255,.12); --tag-fg: #fff; --dot: #fff; }

/* ---------- surfaces ---------- */
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-body { padding: 18px 20px; }
.pegboard { background: transparent; }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 18px 18px 16px; display: grid; gap: 4px; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; }
a.kpi:hover { border-color: rgba(255,255,255,.16); color: var(--ink); }
.kpi > span { color: var(--muted); font-size: 13px; }
.kpi strong { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi strong small { font-size: 18px; color: var(--muted); font-weight: 500; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.kpi em.good { color: var(--go); } .kpi em.bad { color: var(--stop); }
.kpi::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--glow, rgba(124,92,255,.22)), transparent 70%); pointer-events: none; }
.kpi.k-red { --glow: rgba(251,113,133,.22); } .kpi.k-cyan { --glow: rgba(34,211,238,.18); } .kpi.k-green { --glow: rgba(74,222,128,.16); }
.meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent-grad); }


/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }

/* ---------- misc ---------- */
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-grad); color: #fff; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .02em; font-style: normal; }
.avatar.sm { width: 23px; height: 23px; font-size: 9px; letter-spacing: 0; box-shadow: 0 0 0 2px #15161e; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.toast-zone { position: fixed; z-index: 100; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { background: rgba(28, 30, 40, .92); backdrop-filter: blur(16px); border: 1px solid var(--line); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 10px var(--go); flex: none; }
.toast.error::before { background: var(--stop); box-shadow: 0 0 10px var(--stop); }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-weight: 600; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
