:root {
  color-scheme: light;
  --ink: #0b1526;
  --ink-2: #1e293b;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e4e9f2;
  --line-2: #eef2f8;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --brand: #1d4ed8;
  --brand-2: #2563eb;
  --brand-soft: #eef4ff;
  --teal: #0f766e;
  --teal-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --green: #047857;
  --green-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px rgba(15, 23, 42, .07);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sidebar: 258px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hide-sm { display: inline; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
strong { font-weight: 650; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  background: linear-gradient(180deg, #0a1428 0%, #0c1a33 55%, #0a162b 100%);
  color: #cbd5e1; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 4px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8); color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .32);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: #fff; font-size: 15.5px; letter-spacing: .1px; }
.brand-text span { color: #7c8ca7; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px;
  background: transparent; border: 0; border-radius: 10px; color: #9fb0c9; text-align: left;
  font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.nav-item.is-active { background: rgba(59,130,246,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(96,165,250,.18); }
.nav-item.is-active svg { color: #93c5fd; }
.nav-badge {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: #cbd5e1; font-size: 10.5px; font-weight: 600; text-align: center;
}
.nav-item.is-active .nav-badge { background: rgba(59,130,246,.25); color: #dbeafe; }
.sidebar-note {
  margin-top: auto; padding: 13px; border-radius: 13px;
  background: rgba(15, 118, 110, .1); border: 1px solid rgba(45, 212, 191, .14);
}
.sidebar-note-head { display: flex; align-items: center; gap: 7px; color: #a7f3d0; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.sidebar-note p { color: #94a3b8; font-size: 11.8px; line-height: 1.45; margin: 9px 0 11px; }
.sidebar-note .btn { color: #d1fae5; border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.08); }
.sidebar-note .btn:hover { background: rgba(52,211,153,.16); }
.sidebar-foot { display: flex; justify-content: space-between; gap: 8px; color: #54677f; font-size: 10.5px; padding: 0 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 13px 30px; background: rgba(244,246,251,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(228,233,242,.9);
}
.topbar-title { min-width: 0; }
.topbar-title span { display: block; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.topbar-title h1 { margin: 1px 0 0; font-size: 17px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-search {
  display: flex; align-items: center; gap: 7px; width: 290px; padding: 0 10px; height: 36px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm);
}
.topbar-search svg { width: 16px; height: 16px; color: var(--faint); }
.topbar-search input { border: 0; outline: 0; width: 100%; background: transparent; font-size: 12.5px; }
.topbar-search kbd { font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.icon-btn.mobile-menu { display: none; }
.view { padding: 26px 30px 56px; max-width: 1500px; width: 100%; margin: 0 auto; outline: none; }

/* ---------- Generic ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-2); border-color: #d5deea; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, #2563eb, #1d4ed8); border-color: #1d4ed8; color: #fff; box-shadow: 0 5px 14px rgba(37,99,235,.22); }
.btn-primary:hover { background: linear-gradient(180deg, #1d4ed8, #1e40af); border-color: #1e40af; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f8; color: var(--ink); border-color: transparent; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border-color: #dbe7ff; }
.btn-soft:hover { background: #e3edff; border-color: #cbdcff; }
.btn-danger { color: var(--red); border-color: #f3d4d4; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 21px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: #eef2f8; color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.15px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 16px 20px 20px; }
.card-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.badge svg { width: 12px; height: 12px; }
.badge-blue { background: var(--brand-soft); border-color: #dbe7ff; color: var(--brand); }
.badge-green { background: var(--green-soft); border-color: #c7f0e2; color: var(--green); }
.badge-amber { background: var(--amber-soft); border-color: #fde9b8; color: var(--amber); }
.badge-red { background: var(--red-soft); border-color: #f5d5d5; color: var(--red); }
.badge-teal { background: var(--teal-soft); border-color: #c9f1e5; color: var(--teal); }
.badge-dark { background: #0f1d36; border-color: #0f1d36; color: #dbeafe; }

.type-mark {
  display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 23px;
  border-radius: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: .04em;
  background: #eef2f8; color: #475569;
}
.type-mark[data-type="AT"] { background: #eef4ff; color: #1d4ed8; }
.type-mark[data-type="CVT"] { background: #ecfdf5; color: #047857; }
.type-mark[data-type="DCT"] { background: #fff7ed; color: #c2410c; }
.type-mark[data-type="AMT"] { background: #f5f3ff; color: #6d28d9; }

/* ---------- Search page ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 34px 38px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(56,189,248,.2), transparent 60%),
    radial-gradient(700px 400px at 10% 110%, rgba(16,185,129,.14), transparent 60%),
    linear-gradient(125deg, #0a1730 0%, #0d2247 52%, #0a2a3a 100%);
  color: #e2e8f0; box-shadow: 0 18px 44px rgba(9, 20, 40, .18);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background-image: linear-gradient(rgba(148,163,184,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.14) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(600px 300px at 75% 20%, #000, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 36px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: #7dd3fc; }
.hero-eyebrow span { width: 18px; height: 1px; background: #38bdf8; display: inline-block; }
.hero h1 { margin: 12px 0 10px; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.08; letter-spacing: -.9px; color: #fff; max-width: 620px; }
.hero h1 em { font-style: normal; color: #7dd3fc; }
.hero-sub { margin: 0 0 22px; color: #a8b8cd; font-size: 13.5px; line-height: 1.55; max-width: 560px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; color: #93a6bf; font-size: 12px; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; }
.hero-points svg { width: 14px; height: 14px; color: #34d399; }
.vin-form { display: flex; flex-direction: column; gap: 9px; }
.vin-input-wrap {
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 15px; border-radius: 14px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(148,163,184,.28); backdrop-filter: blur(8px);
  transition: border-color .15s, box-shadow .15s;
}
.vin-input-wrap:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(59,130,246,.18); }
.vin-input-wrap > svg { width: 20px; height: 20px; color: #7dd3fc; flex: none; }
.vin-input {
  flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: #fff;
  font-size: 17px; font-weight: 650; letter-spacing: .12em;
}
.vin-input::placeholder { color: #647a97; font-weight: 500; letter-spacing: .06em; }
.vin-input-wrap .btn { height: 42px; border-radius: 10px; }
.vin-hint { display: flex; justify-content: space-between; gap: 12px; color: #6f86a4; font-size: 11px; padding: 0 4px; }
.vin-hint b { color: #93a6bf; font-weight: 600; }
.vin-error { margin: 2px 0 0; padding: 8px 11px; border-radius: 8px; background: rgba(127,29,29,.35); border: 1px solid rgba(248,113,113,.3); color: #fecaca; font-size: 12px; }
.vin-error[hidden] { display: none; }
.vin-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.vin-chip {
  border: 1px solid rgba(148,163,184,.24); background: rgba(255,255,255,.05); color: #b9c8da;
  border-radius: 999px; padding: 5px 10px; font-size: 10.5px; transition: background .15s, border-color .15s;
}
.vin-chip:hover { background: rgba(255,255,255,.1); border-color: rgba(148,163,184,.45); color: #fff; }
.vin-chip b { color: #e2e8f0; font-weight: 600; }
.hero-aside { display: flex; flex-direction: column; gap: 10px; }
.hero-mini {
  padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.16); backdrop-filter: blur(8px);
}
.hero-mini span { display: block; color: #7f93ad; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.hero-mini strong { display: block; color: #fff; font-size: 15px; margin-top: 3px; letter-spacing: -.2px; }
.hero-mini small { display: block; color: #93a6bf; font-size: 11px; margin-top: 2px; }
.hero-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-mini-row svg { width: 18px; height: 18px; color: #7dd3fc; }

.search-below { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .5fr); gap: 16px; margin-top: 18px; align-items: start; }
.steps-card { padding: 18px 20px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
.step { display: flex; gap: 10px; }
.step-num { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 750; }
.step strong { display: block; font-size: 12.5px; }
.step p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.stats-card { padding: 18px 20px; background: linear-gradient(160deg, #fff, #f6f9ff); }
.stat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { color: var(--muted); font-size: 12px; }
.stat-line b { font-size: 18px; letter-spacing: -.4px; }
.type-strip { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.type-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.type-pill b { color: var(--ink); }
.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); }
.recent-row:last-child { border-bottom: 0; }
.recent-code { width: 74px; flex: none; font-weight: 700; font-size: 12.5px; }
.recent-main { min-width: 0; flex: 1; }
.recent-main strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sum { font-weight: 700; font-size: 13px; white-space: nowrap; }
.empty-line { padding: 18px 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- Result ---------- */
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: none; border: 0; padding: 0; font-size: 12px; font-weight: 600; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 15px; height: 15px; }
.vehicle-card { display: flex; align-items: stretch; gap: 22px; padding: 20px 22px; }
.vehicle-main { min-width: 0; flex: 1; }
.vehicle-kicker { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.vehicle-kicker .vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: .06em; color: #475569; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }
.vehicle-title { margin: 6px 0 3px; font-size: 23px; letter-spacing: -.55px; line-height: 1.2; }
.vehicle-meta { color: var(--muted); font-size: 12.5px; }
.vehicle-meta b { color: var(--ink-2); font-weight: 600; }
.transmission-block { display: flex; align-items: center; gap: 16px; padding-left: 22px; border-left: 1px solid var(--line); min-width: 260px; }
.code-big { font-size: 28px; font-weight: 750; letter-spacing: -.9px; line-height: 1; color: var(--ink); }
.code-sub { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.confidence { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650; }
.confidence::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.confidence.high { color: var(--green); background: var(--green-soft); }
.confidence.medium { color: var(--amber); background: var(--amber-soft); }
.confidence.low { color: var(--red); background: var(--red-soft); }

.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.quote-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.quote-summary { position: sticky; top: 84px; }
.summary-card { padding: 20px; background: linear-gradient(180deg, #fff, #fbfdff); }
.summary-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-title h2 { margin: 0; font-size: 15px; letter-spacing: -.15px; }
.summary-rows { display: flex; flex-direction: column; gap: 2px; margin: 15px 0 12px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.summary-row span { color: var(--muted); }
.summary-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.summary-total span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.summary-total strong { font-size: 26px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1; }
.summary-note { color: var(--faint); font-size: 10.5px; line-height: 1.4; }
.margin-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.margin-cell { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 9px; }
.margin-cell span { display: block; color: var(--faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.margin-cell b { display: block; font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.markup-row { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.markup-row label { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.markup-row input[type="range"] { flex: 1; accent-color: var(--brand); height: 4px; }
.markup-row .mini-input { width: 58px; }
.readiness { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); margin-top: 12px; }
.readiness svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.readiness.ok { background: var(--green-soft); border-color: #c7f0e2; color: var(--green); }
.readiness.warn { background: var(--amber-soft); border-color: #fde9b8; color: var(--amber); }
.readiness strong { display: block; font-size: 11.5px; }
.readiness small { display: block; font-size: 10.5px; color: inherit; opacity: .8; margin-top: 1px; }

.panel-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 14px; letter-spacing: -.1px; }
.panel-head .badge { margin-left: 0; }
.panel-head .card-actions { margin-left: auto; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.profile-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.profile-row + .profile-row { margin-top: 8px; }
.profile-row.is-selected { border-color: #93c5fd; background: #f5f9ff; }
.profile-row .badge { margin-top: 2px; }
.profile-name { font-weight: 650; font-size: 13px; }
.profile-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.profile-volume { margin-left: auto; text-align: right; flex: none; }
.profile-volume b { display: block; font-size: 15px; }
.profile-volume span { color: var(--faint); font-size: 10px; }

.op-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 2px; border-bottom: 1px solid var(--line-2); }
.op-row:last-child { border-bottom: 0; }
.op-check { margin-top: 2px; }
.op-main { flex: 1; min-width: 0; }
.op-main strong { display: block; font-size: 13px; }
.op-main small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.op-price { display: flex; align-items: center; gap: 5px; flex: none; }
.op-price span { color: var(--faint); font-size: 11px; }
.labor-input { width: 92px; text-align: right; }

.parts-table { display: flex; flex-direction: column; }
.part-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(210px, 260px) 82px 100px; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.part-row:last-child { border-bottom: 0; }
.part-row.is-off { opacity: .55; }
.part-row.is-off .part-controls { pointer-events: none; }
.part-check { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.part-main { min-width: 0; }
.part-name { font-weight: 600; font-size: 12.8px; line-height: 1.35; }
.part-name .verify { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-left: 5px; vertical-align: middle; }
.part-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 10.8px; }
.part-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: #475569; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.part-note { margin-top: 4px; color: var(--faint); font-size: 10.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.part-controls { min-width: 0; }
.offer-select { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 7px; font-size: 11px; color: var(--ink-2); }
.offer-select:focus { outline: 2px solid #bfdbfe; border-color: #93c5fd; }
.offer-hint { margin-top: 3px; color: var(--faint); font-size: 9.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty-input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; text-align: right; padding: 0 8px; font-size: 12px; background: #fff; color: var(--ink-2); }
.qty-input:focus { outline: 2px solid #bfdbfe; border-color: #93c5fd; }
html[data-theme="light"] { color-scheme: light; }
.part-sum { text-align: right; font-weight: 650; font-size: 12.8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.part-sum small { display: block; color: var(--faint); font-size: 9.5px; font-weight: 500; }
.fluid-packs { margin-top: 3px; color: var(--teal); font-size: 9.8px; }
.parts-warning { margin: 12px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--amber-soft); border: 1px solid #fde9b8; color: #92400e; font-size: 11px; }
.parts-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

.procedure-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 18px; }
.proc-list { margin: 0; padding: 0 0 0 20px; color: var(--ink-2); font-size: 12.3px; line-height: 1.55; }
.proc-list li { margin: 0 0 7px; }
.proc-list li::marker { color: var(--brand); font-weight: 700; }
.torque-list { display: flex; flex-direction: column; gap: 7px; }
.torque { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; font-size: 11.5px; }
.torque span { color: var(--muted); }
.torque b { white-space: nowrap; }
.warning-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.warning-list li { display: flex; gap: 7px; color: #92400e; font-size: 11px; line-height: 1.45; }
.warning-list svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
details.procedure { border-top: 1px solid var(--line-2); }
details.procedure summary { list-style: none; cursor: pointer; padding: 13px 18px; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.procedure summary::-webkit-details-marker { display: none; }
details.procedure summary svg { width: 14px; height: 14px; transition: transform .15s; }
details.procedure[open] summary svg { transform: rotate(90deg); }
details.procedure .procedure-grid { padding: 0 18px 18px; }

.alternatives { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alt-pill { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 10.5px; color: var(--muted); }
.alt-pill:hover { border-color: #bfdbfe; color: var(--brand); background: var(--brand-soft); }
.alt-pill b { color: var(--ink-2); }
.alt-note { color: var(--faint); font-size: 10.5px; margin-top: 5px; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: none; width: 100%; height: 100%; margin: 0; }
.modal::backdrop { background: rgba(8, 15, 30, .55); backdrop-filter: blur(3px); }
.modal[open] { display: grid; place-items: center; padding: 22px; }
.modal-card {
  position: relative; width: min(980px, 100%); max-height: calc(100vh - 44px); overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(2, 8, 23, .35);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-card.modal-wide { width: min(1120px, 100%); }
.modal-card.modal-narrow { width: min(680px, 100%); }
.modal-close { position: absolute; right: 12px; top: 12px; z-index: 2; background: #fff; }
.modal-head { padding: 22px 24px 0; }
.modal-head h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 20px 24px 24px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 20px 20px; }
.modal-actions .spacer { flex: 1; }

.message-grid { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; }
.message-options { display: flex; flex-direction: column; gap: 12px; }
.message-preview { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.message-text {
  width: 100%; min-height: 430px; resize: vertical; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 15px; font-size: 12.4px; line-height: 1.52; color: var(--ink-2); background: #fcfdff;
  font-family: var(--font); outline: 0;
}
.message-text:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px #e0edff; }
.message-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.message-toolbar .badge { margin-right: auto; }
.preview-rendered { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; font-size: 12.4px; line-height: 1.55; min-height: 430px; overflow: auto; color: var(--ink-2); }
.preview-rendered b { color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.field .hint { color: var(--faint); font-size: 10.5px; line-height: 1.4; }
.input, .select, .textarea {
  width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  padding: 0 10px; font-size: 12.5px; outline: 0; color: var(--ink-2);
}
.textarea { height: auto; min-height: 86px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px #e0edff; }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.mini-input { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; text-align: right; outline: 0; background: #fff; }
.mini-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px #e0edff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: span 2; }
.inline-fields { display: flex; gap: 8px; align-items: center; }
.inline-fields .input { flex: 1; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.check-line input { accent-color: var(--brand); width: 16px; height: 16px; }

.settings-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.settings-nav button { text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.settings-nav button.is-active { background: var(--brand-soft); color: var(--brand); }
.section-block + .section-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.section-block h3 { margin: 0 0 4px; font-size: 14.5px; letter-spacing: -.15px; }
.section-block > p { margin: 0 0 14px; color: var(--muted); font-size: 11.8px; line-height: 1.5; }
.supplier-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px 15px; background: #fff; }
.supplier-card + .supplier-card { margin-top: 10px; }
.supplier-head { display: flex; align-items: flex-start; gap: 11px; }
.supplier-logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: -.02em; flex: none; }
.supplier-logo.rossko { background: #ecfdf5; color: #047857; }
.supplier-logo.abcp { background: #eff6ff; color: #1d4ed8; }
.supplier-logo.demo { background: #f5f3ff; color: #6d28d9; }
.supplier-logo.own { background: #fff7ed; color: #c2410c; }
.supplier-logo.autoeuro { background: #fef2f2; color: #b91c1c; }
.supplier-name { font-weight: 700; font-size: 13px; }
.supplier-desc { color: var(--muted); font-size: 11px; margin-top: 2px; line-height: 1.4; }
.supplier-status { margin-left: auto; }
.supplier-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.supplier-fields .span-2 { grid-column: span 2; }
.supplier-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.supplier-result { font-size: 11px; color: var(--muted); }
.supplier-result.ok { color: var(--green); }
.supplier-result.err { color: var(--red); }

.oil-table { display: flex; flex-direction: column; gap: 8px; }
.oil-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 120px 74px 86px 90px 34px; gap: 8px; align-items: end; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.oil-row .field > label { font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.oil-row .input { height: 31px; font-size: 11.5px; background: #fff; }

/* ---------- Catalog ---------- */
.catalog-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.chip:hover { border-color: #cbd5e1; color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.catalog-toolbar .search-box { margin-left: auto; display: flex; align-items: center; gap: 7px; width: 280px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0 10px; }
.catalog-toolbar .search-box svg { width: 16px; height: 16px; color: var(--faint); }
.catalog-toolbar .search-box input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.catalog-card { padding: 17px 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.catalog-card:hover { transform: translateY(-2px); border-color: #cbd8ea; box-shadow: var(--shadow); }
.catalog-top { display: flex; align-items: flex-start; gap: 10px; }
.catalog-code { font-size: 18px; font-weight: 750; letter-spacing: -.4px; line-height: 1.1; }
.catalog-name { color: var(--muted); font-size: 11px; margin-top: 3px; }
.catalog-top .type-mark { margin-left: auto; }
.catalog-makes { display: flex; flex-wrap: wrap; gap: 4px; }
.make-tag { font-size: 10px; color: #475569; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; }
.catalog-spec { color: var(--muted); font-size: 11px; line-height: 1.4; min-height: 31px; }
.catalog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.catalog-foot small { color: var(--faint); font-size: 10px; }
.catalog-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- History ---------- */
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { text-align: left; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.history-table td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 12px; vertical-align: middle; }
.history-table tr:last-child td { border-bottom: 0; }
.history-table tr:hover td { background: #fbfdff; }
.history-code { font-weight: 700; }
.history-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-actions { display: flex; gap: 5px; justify-content: flex-end; }
.history-empty { padding: 52px 20px; text-align: center; }
.history-empty svg { width: 38px; height: 38px; color: #cbd5e1; }
.history-empty h3 { margin: 12px 0 4px; font-size: 15px; }
.history-empty p { margin: 0 0 15px; color: var(--muted); font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100;
  background: #0f1d36; color: #e2e8f0; padding: 10px 16px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(2,8,23,.28); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  max-width: min(560px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7f1d1d; color: #fee2e2; }

.skeleton { position: relative; overflow: hidden; background: #eef2f8; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.loading-line { height: 14px; margin: 8px 0; width: 60%; }
.loading-line.wide { width: 90%; }
.loading-line.short { width: 35%; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .quote-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .part-row { grid-template-columns: 22px minmax(0, 1fr) minmax(190px, 230px) 74px 92px; gap: 9px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 20px 50px rgba(2,8,23,.35); }
  .sidebar.is-open { transform: none; }
  .icon-btn.mobile-menu { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .view { padding: 18px 16px 48px; }
  .hero { padding: 26px 22px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-aside { display: grid; grid-template-columns: repeat(2, 1fr); }
  .search-below { grid-template-columns: 1fr; }
  .quote-layout { grid-template-columns: 1fr; }
  .quote-summary { position: static; order: -1; }
  .summary-card { padding: 16px; }
  .summary-total strong { font-size: 23px; }
  .vehicle-card { flex-direction: column; }
  .transmission-block { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; min-width: 0; }
  .message-grid { grid-template-columns: 1fr; }
  .message-text, .preview-rendered { min-height: 300px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow: auto; }
  .procedure-grid { grid-template-columns: 1fr; }
  .part-row { grid-template-columns: 22px minmax(0, 1fr) 84px; gap: 8px; }
  .part-controls { grid-column: 2 / 4; }
  .part-sum { grid-column: 3; grid-row: 1; }
  .qty-input { width: 76px; }
  .oil-row { grid-template-columns: 1fr 1fr; }
  .oil-row .field:first-child { grid-column: span 2; }
}
@media (max-width: 680px) {
  .topbar-search { display: none !important; }
  .hide-sm { display: none; }
  .hero { border-radius: 18px; padding: 22px 16px; }
  .hero h1 { font-size: 27px; }
  .vin-input { font-size: 14px; letter-spacing: .08em; }
  .vin-input-wrap .btn { padding: 0 12px; }
  .hero-aside { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .supplier-fields .span-2 { grid-column: span 1; }
  .supplier-fields { grid-template-columns: 1fr; }
  .vehicle-title { font-size: 19px; }
  .code-big { font-size: 24px; }
  .summary-total strong { font-size: 22px; }
  .part-meta { font-size: 10px; }
  .catalog-toolbar .search-box { width: 100%; margin-left: 0; }
  .history-table th:nth-child(2), .history-table td:nth-child(2) { display: none; }
  .modal[open] { padding: 8px; }
  .modal-card { border-radius: 16px; max-height: calc(100vh - 16px); }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-actions { padding: 12px 16px; border-radius: 0 0 16px 16px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .modal-actions, .modal-close, .message-options, .message-toolbar { display: none !important; }
  .modal[open] { position: static; display: block; padding: 0; }
  .modal::backdrop { background: none; }
  .modal-card { width: 100%; max-height: none; box-shadow: none; border-radius: 0; }
  .message-grid { display: block; }
  .preview-rendered { border: 0; padding: 0; min-height: 0; }
  .message-text { display: none; }
}

/* ---------- Auth ---------- */
.app.is-locked { grid-template-columns: 1fr; }
.app.is-locked .sidebar,
.app.is-locked .topbar { display: none !important; }
.app.is-locked .main { min-height: 100vh; }
.app.is-locked .view { padding: 0; max-width: none; }
.auth-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 18px;
  background:
    radial-gradient(800px 420px at 80% 0%, rgba(56,189,248,.18), transparent 60%),
    radial-gradient(700px 420px at 10% 100%, rgba(16,185,129,.12), transparent 60%),
    linear-gradient(135deg, #081326 0%, #0c1f3d 55%, #0a2634 100%);
}
.auth-card {
  width: min(430px, 100%); background: #fff; border-radius: 22px; padding: 30px;
  box-shadow: 0 30px 80px rgba(2, 8, 23, .38);
}
.auth-card.auth-card-wide { width: min(480px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.auth-brand-text strong { display: block; font-size: 15px; letter-spacing: -.1px; }
.auth-brand-text span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.5px; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .field > label { font-size: 11.5px; }
.auth-form .input { height: 42px; font-size: 13px; }
.auth-form .btn { margin-top: 4px; }
.auth-error {
  margin: 0; padding: 9px 11px; border-radius: 9px; background: var(--red-soft);
  border: 1px solid #f5d5d5; color: var(--red); font-size: 11.5px; line-height: 1.4;
}
.auth-hint {
  margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft);
  border: 1px solid #dbe7ff; color: #1e40af; font-size: 11px; line-height: 1.5;
}
.auth-hint code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.auth-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em;
  text-transform: uppercase; font-weight: 700;
}
.auth-foot { margin: 18px 0 0; color: var(--faint); font-size: 10.5px; line-height: 1.5; text-align: center; }
.auth-security { display: flex; align-items: flex-start; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.auth-security svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--green); }
.auth-loading { min-height: 100vh; display: grid; place-items: center; background: #0a1428; }
.auth-loading .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(148,163,184,.25); border-top-color: #60a5fa; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- User chip ---------- */
.user-slot { margin-left: 3px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 3px 9px 3px 4px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm);
}
.user-chip:hover { border-color: #cbd5e1; background: var(--surface-2); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #2563eb, #0f766e); color: #fff; font-size: 10.5px; font-weight: 750;
  letter-spacing: .02em;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta b { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.user-meta small { color: var(--faint); font-size: 9.5px; margin-top: 2px; }
.user-menu-head { display: flex; align-items: center; gap: 12px; }
.user-menu-head .user-avatar { width: 46px; height: 46px; border-radius: 13px; font-size: 16px; }
.user-menu-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.user-menu-actions .btn { justify-content: flex-start; }

/* ---------- Users ---------- */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px; border-bottom: 1px solid var(--line-2); font-size: 12px; vertical-align: middle; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table tr:hover td { background: #fbfdff; }
.users-table .user-name { font-weight: 650; }
.users-table .user-email { color: var(--muted); font-size: 11px; }
.users-table .user-self { color: var(--faint); font-size: 10px; }
.users-table .user-actions { display: flex; gap: 4px; justify-content: flex-end; }
.role-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 650; }
.role-badge.admin { background: var(--brand-soft); color: var(--brand); }
.role-badge.master { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--green); }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-dot.off { color: var(--red); }
.users-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 680px) {
  .user-meta { display: none; }
  .user-chip { padding-right: 4px; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .auth-card h1 { font-size: 21px; }
  .users-table th:nth-child(2), .users-table td:nth-child(2) { display: none; }
  .users-table th:nth-child(5), .users-table td:nth-child(5) { display: none; }
}

/* ---------- Theme switch ---------- */
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
.theme-toggle { flex: none; }
.theme-fab {
  display: none; position: fixed; top: 18px; right: 18px; z-index: 80;
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(148,163,184,.3);
  background: rgba(255,255,255,.08); color: #dbeafe; backdrop-filter: blur(8px);
}
.theme-fab:hover { background: rgba(255,255,255,.16); color: #fff; }
.theme-fab svg { width: 19px; height: 19px; }
.app.is-locked ~ .theme-fab { display: grid; place-items: center; }
.user-menu-actions [data-theme-label] { margin-left: 2px; }

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7eefb;
  --ink-2: #cbd5e1;
  --muted: #9aa9bd;
  --faint: #6f8199;
  --line: #22314a;
  --line-2: #1a273c;
  --bg: #0a1220;
  --surface: #111c2e;
  --surface-2: #162235;
  --brand: #60a5fa;
  --brand-2: #3b82f6;
  --brand-soft: #14284a;
  --teal: #5eead4;
  --teal-soft: #102d2b;
  --amber: #fbbf24;
  --amber-soft: #2b2414;
  --red: #f87171;
  --red-soft: #2b1618;
  --green: #34d399;
  --green-soft: #10291f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.28), 0 2px 10px rgba(0,0,0,.18);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 18px 44px rgba(0,0,0,.32);
}
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] .topbar { background: rgba(10, 18, 32, .88); border-bottom-color: rgba(34,49,74,.9); }
html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] .btn,
html[data-theme="dark"] .user-chip,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .offer-select,
html[data-theme="dark"] .qty-input,
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea,
html[data-theme="dark"] .mini-input,
html[data-theme="dark"] .supplier-card,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .alt-pill,
html[data-theme="dark"] .catalog-toolbar .search-box,
html[data-theme="dark"] .preview-rendered {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}
html[data-theme="dark"] .topbar-search input,
html[data-theme="dark"] .catalog-toolbar .search-box input,
html[data-theme="dark"] .offer-select,
html[data-theme="dark"] .qty-input,
html[data-theme="dark"] .mini-input,
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea { color: var(--ink); }
html[data-theme="dark"] .topbar-search kbd { background: var(--surface-2); border-color: var(--line); color: var(--faint); }
html[data-theme="dark"] .btn:hover { background: var(--surface-2); border-color: #2b3d59; }
html[data-theme="dark"] .btn-ghost { background: transparent; color: var(--muted); }
html[data-theme="dark"] .btn-ghost:hover { background: #1b2a40; color: var(--ink); }
html[data-theme="dark"] .btn-danger { background: var(--surface); border-color: #4a2b31; color: var(--red); }
html[data-theme="dark"] .btn-danger:hover { background: var(--red-soft); }
html[data-theme="dark"] .icon-btn:hover { background: #1b2a40; color: var(--ink); }
html[data-theme="dark"] .badge { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .badge-blue { background: var(--brand-soft); border-color: #1d3b66; color: #93c5fd; }
html[data-theme="dark"] .badge-green { background: var(--green-soft); border-color: #1b4a39; color: var(--green); }
html[data-theme="dark"] .badge-amber { background: var(--amber-soft); border-color: #4a3a18; color: var(--amber); }
html[data-theme="dark"] .badge-red { background: var(--red-soft); border-color: #4a2b31; color: var(--red); }
html[data-theme="dark"] .badge-teal { background: var(--teal-soft); border-color: #1d4a45; color: var(--teal); }
html[data-theme="dark"] .type-mark { background: #1b2a40; color: #cbd5e1; }
html[data-theme="dark"] .type-mark[data-type="AT"] { background: #14284a; color: #93c5fd; }
html[data-theme="dark"] .type-mark[data-type="CVT"] { background: #102d2b; color: #6ee7b7; }
html[data-theme="dark"] .type-mark[data-type="DCT"] { background: #33210f; color: #fdba74; }
html[data-theme="dark"] .type-mark[data-type="AMT"] { background: #241a45; color: #c4b5fd; }
html[data-theme="dark"] .stats-card { background: linear-gradient(160deg, #111c2e, #0f1b2d); }
html[data-theme="dark"] .summary-card { background: linear-gradient(180deg, #111c2e, #0e192a); }
html[data-theme="dark"] .hero { box-shadow: 0 18px 44px rgba(0,0,0,.35); }
html[data-theme="dark"] .vehicle-kicker .vin { color: #cbd5e1; background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .part-meta code { color: #cbd5e1; background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .parts-warning { color: #fcd34d; border-color: #4a3a18; }
html[data-theme="dark"] .warning-list li { color: #fcd34d; }
html[data-theme="dark"] .profile-row.is-selected { border-color: #3b82f6; background: #14284a; }
html[data-theme="dark"] .message-text { background: #0d1727; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .message-text:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px #14284a; }
html[data-theme="dark"] .input:focus, html[data-theme="dark"] .select:focus,
html[data-theme="dark"] .textarea:focus, html[data-theme="dark"] .mini-input:focus,
html[data-theme="dark"] .offer-select:focus, html[data-theme="dark"] .qty-input:focus {
  border-color: #3b82f6; box-shadow: 0 0 0 3px #14284a;
}
html[data-theme="dark"] .modal-close { background: var(--surface); }
html[data-theme="dark"] .settings-nav button.is-active { background: var(--brand-soft); color: #93c5fd; }
html[data-theme="dark"] .oil-row { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .oil-row .input { background: var(--surface); }
html[data-theme="dark"] .chip.is-active { background: #dbeafe; border-color: #dbeafe; color: #0b1526; }
html[data-theme="dark"] .make-tag { color: #cbd5e1; background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .history-table tr:hover td,
html[data-theme="dark"] .users-table tr:hover td { background: #142033; }
html[data-theme="dark"] .history-empty svg { color: #334155; }
html[data-theme="dark"] .skeleton { background: #1b2a40; }
html[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
html[data-theme="dark"] .auth-card { background: #111c2e; }
html[data-theme="dark"] .auth-error { background: var(--red-soft); border-color: #4a2b31; }
html[data-theme="dark"] .auth-hint { background: var(--brand-soft); border-color: #1d3b66; color: #93c5fd; }
html[data-theme="dark"] .auth-security { border-top-color: var(--line-2); }
html[data-theme="dark"] .supplier-logo.rossko { background: #102d2b; color: #6ee7b7; }
html[data-theme="dark"] .supplier-logo.abcp { background: #14284a; color: #93c5fd; }
html[data-theme="dark"] .supplier-logo.demo { background: #241a45; color: #c4b5fd; }
html[data-theme="dark"] .supplier-logo.own { background: #33210f; color: #fdba74; }
html[data-theme="dark"] .supplier-logo.autoeuro { background: #3a1414; color: #fca5a5; }
html[data-theme="dark"] .role-badge.master { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
html[data-theme="dark"] .theme-fab { background: rgba(17,28,46,.9); border-color: var(--line); color: #dbeafe; }
html[data-theme="dark"] .theme-fab:hover { background: #1b2a40; }
html[data-theme="dark"] .recent-row:hover { background: #142033; }
html[data-theme="dark"] .profile-row { background: var(--surface-2); }
html[data-theme="dark"] .margin-cell { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme="dark"] .readiness { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme="dark"] .readiness.ok { background: var(--green-soft); border-color: #1b4a39; color: var(--green); }
html[data-theme="dark"] .readiness.warn { background: var(--amber-soft); border-color: #4a3a18; color: var(--amber); }
html[data-theme="dark"] .summary-total { border-top-color: var(--line); }
html[data-theme="dark"] .step-num { background: var(--brand-soft); color: #93c5fd; }
html[data-theme="dark"] .type-pill { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .type-pill b { color: var(--ink); }
html[data-theme="dark"] .stat-line { border-bottom-color: var(--line-2); }
html[data-theme="dark"] .search-below .card, html[data-theme="dark"] .catalog-card { background: var(--surface); }
html[data-theme="dark"] .catalog-card:hover { border-color: #334a6b; }
html[data-theme="dark"] .alt-pill:hover { background: var(--brand-soft); border-color: #1d3b66; color: #93c5fd; }
html[data-theme="dark"] .modal-actions { background: var(--surface-2); border-top-color: var(--line-2); }
html[data-theme="dark"] .card-head p, html[data-theme="dark"] .panel-note, html[data-theme="dark"] .step p { color: var(--muted); }
html[data-theme="dark"] .summary-note { color: var(--faint); }
html[data-theme="dark"] .summary-total strong, html[data-theme="dark"] .code-big, html[data-theme="dark"] .vehicle-title { color: var(--ink); }
html[data-theme="dark"] .auth-foot { color: var(--faint); }
html[data-theme="dark"] .auth-sub { color: var(--muted); }

@media (max-width: 680px) {
  .topbar .theme-toggle { display: none; }
  .theme-fab { top: 12px; right: 12px; width: 36px; height: 36px; }
}

html[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 5px 14px rgba(37,99,235,.25);
}
html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  border-color: #1e40af;
}
html[data-theme="dark"] .btn-soft {
  background: var(--brand-soft);
  color: #93c5fd;
  border-color: #1d3b66;
}
html[data-theme="dark"] .btn-soft:hover { background: #1a3155; border-color: #244a7d; }
