/* ============================================================
   Rei International Trading — design system v2
   Tokens · light/dark themes · motion · components
   ============================================================ */

:root {
  --brand: #f26a1b;
  --brand-dark: #d4520a;
  --brand-light: #ff8f45;
  --brand-soft: #fff1e6;
  --brand-ring: rgba(242, 106, 27, .22);
  --brand-grad: linear-gradient(135deg, #f26a1b 0%, #ff9248 100%);

  --ink: #0b1220;
  --ink-2: #1c2638;
  --slate: #475266;
  --muted: #6b7689;
  --faint: #98a2b3;

  --bg: #f4f6fa;
  --card: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --line: #e5e8ef;
  --line-soft: #eef0f5;
  --glass: rgba(255, 255, 255, .78);
  --nav-bg: #0b1220;

  --ok: #12803f;       --ok-soft: #e6f6ec;
  --warn: #b25a07;     --warn-soft: #fff3df;
  --bad: #c0262d;      --bad-soft: #fdeaea;
  --info: #2457d6;     --info-soft: #e8efff;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05), 0 3px 10px rgba(11, 18, 32, .04);
  --shadow: 0 2px 4px rgba(11, 18, 32, .04), 0 12px 32px -6px rgba(11, 18, 32, .10);
  --shadow-lg: 0 24px 64px -12px rgba(11, 18, 32, .28);
  --shadow-brand: 0 8px 22px -6px rgba(242, 106, 27, .55);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Manrope', var(--font);
  --ease: cubic-bezier(.22, .8, .28, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  color-scheme: light;
}

html[data-theme='dark'] {
  --brand-soft: rgba(242, 106, 27, .14);
  --brand-ring: rgba(242, 106, 27, .35);
  --ink: #eaeff7;
  --ink-2: #d5dcea;
  --slate: #aab5c8;
  --muted: #8794ab;
  --faint: #5f6b80;
  --bg: #090d16;
  --card: #111827;
  --surface-2: #0e1420;
  --surface-3: #172033;
  --line: #1f2a3d;
  --line-soft: #182234;
  --glass: rgba(14, 20, 32, .78);
  --nav-bg: #0b111d;
  --ok: #4ade80;   --ok-soft: rgba(74, 222, 128, .12);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --bad: #f87171;  --bad-soft: rgba(248, 113, 113, .12);
  --info: #7aa2ff; --info-soft: rgba(122, 162, 255, .13);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 3px 10px rgba(0, 0, 0, .25);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1, h2, h3, h4, h5 { font-family: var(--display); margin: 0; line-height: 1.18; letter-spacing: -.025em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-4 { gap: 4px } .gap-6 { gap: 6px } .gap-8 { gap: 8px } .gap-10 { gap: 10px } .gap-12 { gap: 12px }
.gap-14 { gap: 14px } .gap-16 { gap: 16px } .gap-24 { gap: 24px }
.spacer { flex: 1 }
.muted { color: var(--muted) }
.small { font-size: 13px }
.tiny { font-size: 12px }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' }
.center { text-align: center }
.hide { display: none !important }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- motion primitives ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-4px) } to { opacity: 1; transform: none } }
@keyframes shimmer { to { background-position: -200% 0 } }
@keyframes floaty { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 var(--brand-ring) } 100% { box-shadow: 0 0 0 10px transparent } }
@keyframes grow { from { width: 0 } }
@keyframes kenburns { from { transform: scale(1.02) } to { transform: scale(1.12) translate(-1%, -1%) } }

html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
html.js .reveal.in { opacity: 1; transform: none; }
.page-in { animation: fadeUp .55s var(--ease) both; }
.stagger > * { animation: fadeUp .6s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .02s } .stagger > *:nth-child(2) { animation-delay: .07s }
.stagger > *:nth-child(3) { animation-delay: .12s } .stagger > *:nth-child(4) { animation-delay: .17s }
.stagger > *:nth-child(5) { animation-delay: .22s } .stagger > *:nth-child(6) { animation-delay: .27s }
.stagger > *:nth-child(n+7) { animation-delay: .32s }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- top utility bar ---------- */
.topbar { background: var(--nav-bg); color: #b9c6d8; font-size: 12.5px; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 38px; }
.topbar a { color: #b9c6d8; transition: color .15s; }
.topbar a:hover { color: #fff; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.topbar .sep { opacity: .25; }

/* ---------- public header ---------- */
.site-head {
  background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; transition: box-shadow .25s, background .25s;
}
.site-head.scrolled { box-shadow: 0 10px 30px -14px rgba(11, 18, 32, .25); }
.site-head .wrap { display: flex; align-items: center; gap: 22px; height: 74px; }

.logo { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.logo-img { display: block; height: 38px; width: auto; transition: transform .35s var(--ease-spring); }
.logo:hover .logo-img { transform: scale(1.03); }
.side-head .logo-img { height: 32px; }
.site-foot .logo-img { height: 46px; }
.app .side-head .logo-img { height: 30px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 13px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 16px;
  letter-spacing: -.03em; box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .35s var(--ease-spring);
}
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text b { font-family: var(--display); font-size: 15.5px; letter-spacing: -.02em; }
.logo-text span { font-size: 10px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a { position: relative; padding: 9px 13px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--slate); transition: color .18s, background .18s; }
.main-nav a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--brand-grad); transform: scaleX(0); transition: transform .3s var(--ease); }
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }
.main-nav a.active { color: var(--brand-dark); }
html[data-theme='dark'] .main-nav a.active { color: var(--brand-light); }

.head-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.head-search { position: relative; }
.head-search input {
  width: 200px; height: 40px; border-radius: 12px; border: 1px solid var(--line); padding: 0 40px 0 14px;
  background: var(--surface-2); color: var(--ink); transition: width .3s var(--ease), border-color .2s, box-shadow .2s, background .2s;
}
.head-search input:focus { outline: none; border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 4px var(--brand-ring); width: 260px; }
.head-search button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--brand-grad); color: #fff; cursor: pointer; display: grid; place-items: center; }
.icon-link, .icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--slate); position: relative; cursor: pointer; transition: .2s var(--ease);
}
.icon-link:hover, .icon-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-link .dot, .icon-btn .dot {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand-grad);
  color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--card);
}
.nav-toggle { display: none; }

/* theme icon swap */
.theme-toggle .i-sun { display: none; }
html[data-theme='dark'] .theme-toggle .i-sun { display: block; }
html[data-theme='dark'] .theme-toggle .i-moon { display: none; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s, background .2s, border-color .2s, color .2s, filter .2s; white-space: nowrap;
  background: var(--card); color: var(--ink);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(242, 106, 27, .65), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { border-color: var(--line); color: var(--ink-2); background: var(--card); box-shadow: var(--shadow-xs); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); transform: translateY(-1px); }
html[data-theme='dark'] .btn-outline:hover { color: var(--brand-light); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.btn-success { background: var(--ok); color: #fff; }
html[data-theme='dark'] .btn-success { color: #052e16; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; background: #0a1220; isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(242, 106, 27, .45), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(36, 87, 214, .35), transparent 60%),
    linear-gradient(100deg, rgba(8, 14, 26, .92) 0%, rgba(8, 14, 26, .72) 48%, rgba(8, 14, 26, .35) 100%);
}
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 1; background: linear-gradient(to top, rgba(8,14,26,.7), transparent); }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 24s ease-in-out infinite alternate; }
.hero-inner { position: relative; z-index: 2; padding: 84px 0 96px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(10px); margin-bottom: 22px;
  animation: fadeUp .7s var(--ease) both;
}
.hero-badge svg { color: var(--brand-light); }
.hero h1 { font-size: clamp(34px, 5vw, 62px); max-width: 800px; font-weight: 800; letter-spacing: -.035em; line-height: 1.04; animation: fadeUp .8s .08s var(--ease) both; }
.hero p.lead { margin-top: 20px; max-width: 580px; color: #cbd6e6; font-size: 17px; animation: fadeUp .8s .16s var(--ease) both; }
.hero .row { animation: fadeUp .8s .24s var(--ease) both; }
.hero-stats { display: flex; gap: 14px; margin-top: 42px; flex-wrap: wrap; animation: fadeUp .8s .34s var(--ease) both; }
.hero-stats div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px 20px; backdrop-filter: blur(10px); min-width: 138px; transition: transform .3s var(--ease), background .3s; }
.hero-stats div:hover { transform: translateY(-3px); background: rgba(255,255,255,.12); }
.hero-stats div b { display: block; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.hero-stats div span { font-size: 12.5px; color: #aebdd1; }

.search-card {
  position: relative; z-index: 5; margin-top: -50px; background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 20px 22px 22px; border: 1px solid var(--line-soft); animation: fadeUp .8s .4s var(--ease) both;
}
.search-tabs { display: flex; gap: 6px; margin-bottom: 14px; align-items: center; }
.search-tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.search-tabs button.on { background: var(--brand-soft); color: var(--brand-dark); }
html[data-theme='dark'] .search-tabs button.on { color: var(--brand-light); }
.search-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--slate); }
.input, .select, .textarea {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; background: var(--card); color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--faint) 60%, var(--line)); }
.textarea { height: auto; min-height: 108px; padding: 12px 13px; resize: vertical; line-height: 1.5; }
.select { 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='%238794ab' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.field-hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--slate); }
.checkline input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------- sections / cards ---------- */
.section { padding: 56px 0; }
.section.tight { padding: 34px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(23px, 2.6vw, 31px); font-weight: 800; letter-spacing: -.03em; }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.section-head .more { font-size: 13.5px; font-weight: 700; color: var(--brand-dark); display: inline-flex; align-items: center; gap: 6px; transition: gap .25s var(--ease); white-space: nowrap; }
html[data-theme='dark'] .section-head .more, html[data-theme='dark'] .panel-head .more { color: var(--brand-light); }
.section-head .more:hover { gap: 11px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: box-shadow .3s var(--ease), border-color .3s, transform .3s var(--ease); }
.card-pad { padding: 24px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { font-size: 15.5px; font-weight: 800; }
.panel-head .more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brand-dark); transition: transform .2s; }
.panel-head .more:hover { transform: translateX(3px); }

/* ---------- car cards ---------- */
.car-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.car-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.car-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; position: relative; animation: fadeUp .6s var(--ease) both;
}
.car-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.car-media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(110deg, var(--surface-3) 8%, var(--surface-2) 18%, var(--surface-3) 33%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; overflow: hidden; }
.car-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); position: relative; }
.car-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,14,26,.35), transparent 45%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.car-card:hover .car-media img { transform: scale(1.07); }
.car-card:hover .car-media::after { opacity: 1; }
.car-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 2; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; padding: 5px 10px; border-radius: 8px; letter-spacing: .05em; text-transform: uppercase; background: var(--ink); color: var(--bg); }
.tag.brand { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 12px -2px rgba(242,106,27,.5); }
.tag.ok { background: var(--ok); color: #fff; }
html[data-theme='dark'] .tag.ok { color: #052e16; }
.tag.dark { background: rgba(11,18,32,.82); color: #fff; backdrop-filter: blur(6px); }
.tag.points { background: rgba(255,255,255,.95); color: var(--brand-dark); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.car-fav { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.95); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--slate); box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 2; transition: transform .3s var(--ease-spring), color .2s; }
.car-fav:hover { transform: scale(1.15); color: #e11d48; }
.car-fav.on { color: #e11d48; }
.car-fav.on svg { fill: currentColor; }
.car-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.car-body h3 { font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.car-body h3 a { transition: color .2s; }
.car-body h3 a:hover { color: var(--brand); }
.car-specs { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--muted); font-size: 12.5px; }
.car-specs span { display: inline-flex; align-items: center; gap: 5px; }
.car-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.car-price b { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.car-price s { font-size: 12.5px; color: var(--muted); }
.car-price .save { font-size: 11.5px; font-weight: 800; color: var(--brand-dark); background: var(--brand-soft); padding: 2px 8px; border-radius: 7px; }
html[data-theme='dark'] .car-price .save { color: var(--brand-light); }
.car-grid > .car-card:nth-child(1) { animation-delay: .02s } .car-grid > .car-card:nth-child(2) { animation-delay: .08s }
.car-grid > .car-card:nth-child(3) { animation-delay: .14s } .car-grid > .car-card:nth-child(4) { animation-delay: .2s }
.car-grid > .car-card:nth-child(5) { animation-delay: .26s } .car-grid > .car-card:nth-child(6) { animation-delay: .32s }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-3); color: var(--slate); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
html[data-theme='dark'] .badge.brand { color: var(--brand-light); }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.badge.lg { font-size: 12.5px; padding: 6px 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--slate); transition: .2s var(--ease); }
.pill:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); transform: translateY(-1px); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }

/* ---------- trust / tiles ---------- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; transition: .35s var(--ease); }
.trust-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.trust-item .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; flex-shrink: 0; transition: .35s var(--ease-spring); }
html[data-theme='dark'] .trust-item .ic { color: var(--brand-light); }
.trust-item:hover .ic { background: var(--brand-grad); color: #fff; transform: rotate(-6deg) scale(1.08); }
.trust-item b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.trust-item span { font-size: 13px; color: var(--muted); line-height: 1.5; display: block; }

.tile-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: .3s var(--ease); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tile:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.tile svg { color: var(--slate); transition: .3s var(--ease-spring); }
.tile:hover svg { color: var(--brand); transform: scale(1.15); }

/* ---------- listing ---------- */
.list-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.filter-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 94px; box-shadow: var(--shadow-xs); }
.filter-group { border-bottom: 1px solid var(--line-soft); padding: 16px 20px; }
.filter-group:last-child { border-bottom: 0; }
.filter-group h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 11px; font-weight: 800; }
.filter-group label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 5px 0; color: var(--ink-2); cursor: pointer; transition: color .15s; }
.filter-group label:hover { color: var(--brand); }
.filter-group input[type=checkbox], .filter-group input[type=radio] { accent-color: var(--brand); }
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.list-toolbar .count { font-size: 13.5px; color: var(--muted); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 34px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 700; padding: 0 12px; transition: .2s var(--ease); }
.pagination a:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-2px); }
.pagination .on { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.pagination .off { opacity: .4; pointer-events: none; }
.result-empty { padding: 70px 20px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- car detail ---------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 18px 0; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand); }
.detail-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 30px; align-items: start; }
.gallery-main { border-radius: 22px; overflow: hidden; background: var(--surface-3); aspect-ratio: 16 / 10; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s, transform .8s var(--ease); }
.gallery-main:hover img { transform: scale(1.03); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--surface-3); aspect-ratio: 4/3; opacity: .72; transition: .25s var(--ease); }
.gallery-thumbs button:hover { opacity: 1; transform: translateY(-2px); }
.gallery-thumbs button.on { border-color: var(--brand); opacity: 1; box-shadow: 0 0 0 3px var(--brand-ring); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.spec-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.spec-table div { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; display: flex; justify-content: space-between; gap: 10px; }
.spec-table div:nth-child(odd) { background: var(--surface-2); }
.spec-table span:first-child { color: var(--muted); }
.spec-table span:last-child { font-weight: 700; text-align: right; }

.price-box { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); position: sticky; top: 94px; }
.price-box .big { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -.04em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-box .est { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.price-rows { display: flex; flex-direction: column; gap: 9px; margin: 18px 0; padding: 16px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: 13px; }
.price-rows div { display: flex; justify-content: space-between; }
.dealer-box { display: flex; gap: 12px; align-items: center; padding: 13px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 14px; margin-top: 16px; }
.dealer-box b { font-size: 13.5px; display: block; }
.dealer-box span { font-size: 12px; color: var(--muted); }

/* ---------- auth ---------- */
.auth-shell { min-height: calc(100vh - 74px); min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card); }
.auth-aside { position: relative; padding: 64px 60px; color: #fff; display: flex; flex-direction: column; justify-content: center; background: #0a1220; overflow: hidden; isolation: isolate; }
.auth-aside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .42; z-index: -2; animation: kenburns 24s ease-in-out infinite alternate; }
.auth-aside::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 400px at 0% 0%, rgba(242,106,27,.4), transparent 60%), linear-gradient(160deg, rgba(8,14,26,.82), rgba(14,32,58,.9)); }
.auth-aside .inner { position: relative; z-index: 2; max-width: 440px; animation: fadeUp .8s var(--ease) both; }
.auth-aside h2 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: -.035em; }
.auth-aside p { color: #c3d2e5; margin-top: 16px; font-size: 15px; }
.auth-aside ul { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-aside li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: #dbe6f3; }
.auth-aside li svg { flex-shrink: 0; margin-top: 2px; color: var(--brand-light); background: rgba(242,106,27,.18); border-radius: 50%; padding: 3px; width: 20px; height: 20px; }
.auth-main { display: grid; place-items: center; padding: 44px 32px; background: radial-gradient(800px 400px at 50% -10%, var(--brand-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 36px 34px; box-shadow: var(--shadow); animation: fadeUp .7s .1s var(--ease) both; }
.auth-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--surface-3); padding: 5px; border-radius: 14px; margin-bottom: 4px; }
.role-switch button { height: 38px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: .2s; }
.role-switch button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-foot { margin-top: 22px; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--brand-dark); font-weight: 700; }
html[data-theme='dark'] .auth-foot a { color: var(--brand-light); }
.demo-note { margin-top: 18px; border: 1px dashed var(--line); border-radius: 12px; padding: 13px 15px; background: var(--surface-2); font-size: 12.5px; color: var(--slate); }
.demo-note code { background: var(--card); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.alert { padding: 12px 15px; border-radius: 12px; font-size: 13.5px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; animation: fadeUp .4s var(--ease) both; }
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); }

/* ---------- portal content primitives ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--display); color: #fff; background: var(--brand-grad); flex-shrink: 0; box-shadow: 0 4px 12px -2px rgba(242,106,27,.45); }
.avatar.dark { background: linear-gradient(140deg, #1c2a44, #3a5a8c); box-shadow: 0 4px 12px -2px rgba(30,60,120,.5); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; animation: fadeUp .5s var(--ease) both; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; transition: .35s var(--ease); animation: fadeUp .6s var(--ease) both; }
.stat::before { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft); opacity: .8; transition: transform .6s var(--ease); }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.stat:hover::before { transform: scale(1.5); }
.stat .lab { position: relative; font-size: 11.5px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 8px; }
.stat .lab svg { color: var(--brand); }
.stat .val { position: relative; font-family: var(--display); font-size: 31px; font-weight: 800; margin-top: 10px; letter-spacing: -.04em; line-height: 1.1; }
.stat .sub { position: relative; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat-grid > .stat:nth-child(1) { animation-delay: .02s } .stat-grid > .stat:nth-child(2) { animation-delay: .08s }
.stat-grid > .stat:nth-child(3) { animation-delay: .14s } .stat-grid > .stat:nth-child(4) { animation-delay: .2s }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; padding: 12px 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.data td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; transition: background .15s; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s, box-shadow .2s; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.data td .cell-title { font-weight: 700; }
table.data td .cell-sub { font-size: 12px; color: var(--muted); }
table.data .t-right { text-align: right; }
.row-thumb { display: flex; align-items: center; gap: 12px; }
.row-thumb img { width: 62px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-3); box-shadow: var(--shadow-xs); }

.progress { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--brand-grad); animation: grow 1.1s var(--ease) both; position: relative; overflow: hidden; }
.progress > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; }

.empty-state { padding: 52px 20px; text-align: center; }
.empty-state .ic { width: 62px; height: 62px; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; margin: 0 auto 16px; animation: floaty 4s ease-in-out infinite; }
.empty-state b { display: block; font-size: 15.5px; }
.empty-state p { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 360px; margin-inline: auto; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.kv > div { min-width: 0; }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; }
.kv .v { font-size: 14px; font-weight: 600; margin-top: 3px; word-break: break-word; }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -28px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); }
.tl-item.done::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-item.cur::before { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 4px var(--brand-soft); animation: pulseRing 1.8s ease-out infinite; }
.tl-item b { font-size: 14px; display: block; }
.tl-item .when { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tl-item p { font-size: 13px; color: var(--slate); margin-top: 4px; }

/* ---------- dialogs ---------- */
dialog.modal { border: 0; border-radius: 22px; padding: 0; max-width: 580px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); background: var(--card); color: var(--ink); }
dialog.modal[open] { animation: pop .3s var(--ease-spring) both; }
dialog.modal::backdrop { background: rgba(8, 14, 26, .6); backdrop-filter: blur(4px); animation: fadeIn .25s both; }
dialog.modal .modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
dialog.modal .modal-head h3 { font-size: 17px; font-weight: 800; }
dialog.modal .modal-body { padding: 22px 24px; max-height: 66vh; overflow-y: auto; }
dialog.modal .modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.x-btn { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; transition: .2s; }
.x-btn:hover { color: var(--ink); background: var(--surface-3); transform: rotate(90deg); }

/* ---------- footer ---------- */
.site-foot { position: relative; background: #070c16; color: #94a6bd; padding: 64px 0 0; margin-top: 30px; overflow: hidden; }
.site-foot::before { content: ''; position: absolute; top: -120px; right: -80px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(242,106,27,.18), transparent 65%); }
.foot-grid { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 44px; }
.site-foot h4 { color: #fff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.site-foot a { display: block; padding: 5px 0; font-size: 13.5px; color: #94a6bd; transition: color .2s, transform .2s; }
.site-foot a:hover { color: #fff; transform: translateX(3px); }
.site-foot .logo { display: flex; padding: 0; transform: none; }
.site-foot p { font-size: 13.5px; line-height: 1.7; }
.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid #1f3149; background: #0e1828; color: #fff; padding: 0 14px; min-width: 0; }
.newsletter input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(242,106,27,.25); }
.newsletter input::placeholder { color: #5f7690; }
.foot-bottom { position: relative; border-top: 1px solid #16253a; padding: 20px 0; display: flex; align-items: center; gap: 16px; font-size: 12.5px; flex-wrap: wrap; }
.foot-bottom .right { margin-left: auto; display: flex; gap: 20px; }
.foot-bottom .right a { padding: 0; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.notice { display: flex; gap: 12px; padding: 14px 17px; border-radius: 14px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); font-size: 13px; color: var(--warn); animation: fadeUp .5s var(--ease) both; }
.notice svg { flex-shrink: 0; margin-top: 1px; }
.notice a { color: var(--brand-dark) !important; }
html[data-theme='dark'] .notice a { color: var(--brand-light) !important; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--slate); border: 1px solid var(--line); transition: .2s; }
a.chip:hover { border-color: var(--brand); color: var(--brand); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 12px; transition: color .2s; }
.faq summary:hover { color: var(--brand); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 800; transition: transform .3s var(--ease); flex-shrink: 0; }
.faq details[open] summary::before { content: '–'; transform: rotate(180deg); }
.faq details[open] p { animation: fadeUp .35s var(--ease) both; }
.faq details p { color: var(--slate); font-size: 13.5px; margin-top: 10px; padding-left: 36px; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--bg); padding: 13px 18px 13px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .45s var(--ease-spring) both; display: flex; gap: 10px; align-items: center; border-left: 4px solid var(--faint); max-width: 380px; }
.toast.ok { border-left-color: #22c55e; }
.toast.bad { border-left-color: #ef4444; }
@keyframes toastIn { from { transform: translateX(40px) scale(.95); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- mobile drawer (public) ---------- */
.mobile-drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none; }
.mobile-drawer.open { visibility: visible; pointer-events: auto; }
.mobile-drawer .scrim { position: absolute; inset: 0; background: rgba(8,14,26,.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.mobile-drawer.open .scrim { opacity: 1; }
.mobile-drawer .sheet { position: absolute; inset: 0 auto 0 0; width: 320px; max-width: 88vw; background: var(--card); box-shadow: var(--shadow-lg); padding: 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; transform: translateX(-100%); transition: transform .4s var(--ease); }
.mobile-drawer.open .sheet { transform: none; }
.mobile-drawer .sheet > a { padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 14.5px; transition: .2s; }
.mobile-drawer .sheet > a:hover { background: var(--brand-soft); color: var(--brand-dark); padding-left: 18px; }
.mobile-drawer .sheet .x-btn { font-size: 26px; }

/* ---------- responsive (public) ---------- */
@media (max-width: 1180px) { .head-search input { width: 150px; } .head-search input:focus { width: 190px; } .main-nav a { padding: 9px 10px; } }
@media (max-width: 1080px) {
  .car-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .price-box { position: static; }
  .search-grid { grid-template-columns: 1fr 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .trust { grid-template-columns: 1fr 1fr; }
  .list-layout { grid-template-columns: 1fr; }
  .filter-card { position: static; }
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .main-nav, .head-search { display: none; }
  .nav-toggle { display: grid; }
}
@media (max-width: 760px) {
  .topbar { display: none; }
  .site-head .wrap { height: 64px; gap: 10px; }
  .car-grid, .car-grid.three { grid-template-columns: 1fr 1fr; gap: 14px; }
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { padding: 52px 0 74px; }
  .hero-stats { gap: 10px; margin-top: 28px; }
  .hero-stats div { min-width: 0; flex: 1 1 42%; padding: 12px 14px; }
  .hero-stats div b { font-size: 21px; }
  .search-grid { grid-template-columns: 1fr; }
  .search-card { margin-top: -34px; padding: 16px; }
  .section { padding: 38px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .spec-table { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .page-head h1 { font-size: 22px; }
  .kv { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
  .auth-card { padding: 28px 22px; border-radius: 20px; }
  .head-actions .btn { display: none; }
}
@media (max-width: 520px) {
  .car-grid, .car-grid.three { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
  .logo-text span { display: none; }
  .stat .val { font-size: 25px; }
}
@media print { .site-head, .topbar, .site-foot, .app-top, .side, .toast-stack { display: none !important; } }

/* ============================================================
   PORTAL APP SHELL (admin + buyer): top menu, collapsible sidebar
   ============================================================ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .18s ease both fadeOutQuick; }
::view-transition-new(root) { animation: .32s var(--ease) both fadeUp; }
@keyframes fadeOutQuick { to { opacity: 0 } }

.app { --side-w: 272px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .45s var(--ease); background: var(--bg); }
html.menu-closed .app { grid-template-columns: 0 minmax(0, 1fr); }
.app-body { min-width: 0; display: flex; flex-direction: column; }

/* sidebar */
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); overflow-y: auto; overflow-x: hidden; z-index: 70;
  background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px 20px; display: flex; flex-direction: column; gap: 3px;
  transition: transform .45s var(--ease), opacity .3s, visibility .45s; scrollbar-width: thin;
}
html.menu-closed .app .side { transform: translateX(-100%); opacity: 0; visibility: hidden; pointer-events: none; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 14px; }
.side-head .logo { flex: 1; min-width: 0; }
.side-close { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--slate); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: .25s var(--ease); }
.side-close:hover { background: var(--bad-soft); color: var(--bad); border-color: transparent; transform: rotate(90deg); }
.side-profile { display: flex; gap: 12px; align-items: center; padding: 13px; border-radius: 16px; background: linear-gradient(135deg, var(--brand-soft), transparent); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); margin-bottom: 10px; }
.side-profile b { font-size: 13.5px; display: block; line-height: 1.25; }
.side-profile span { font-size: 11.5px; color: var(--muted); }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em; color: var(--faint); font-weight: 800; padding: 16px 12px 6px; }
.side a.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--slate); transition: background .2s, color .2s, transform .2s var(--ease); }
.side a.nav-item svg { flex-shrink: 0; opacity: .8; transition: transform .3s var(--ease-spring), color .2s; }
.side a.nav-item:hover { background: var(--surface-3); color: var(--ink); transform: translateX(3px); }
.side a.nav-item:hover svg { transform: scale(1.12); color: var(--brand); }
.side a.nav-item.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
html[data-theme='dark'] .side a.nav-item.on { color: var(--brand-light); }
.side a.nav-item.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad); animation: grow .4s var(--ease); }
.side a.nav-item.on svg { color: var(--brand); opacity: 1; }
.side a.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--slate); border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center; }
.side a.nav-item.on .count { background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 2px; }

/* admin = dark navy sidebar */
.app.admin .side { background: linear-gradient(180deg, #0c1424 0%, #0a101c 100%); border-right: 1px solid #16223a; }
.app.admin .side .side-label { color: #4d6482; }
.app.admin .side a.nav-item { color: #9db0c8; }
.app.admin .side a.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.app.admin .side a.nav-item.on { background: linear-gradient(90deg, rgba(242,106,27,.22), rgba(242,106,27,.05)); color: #ffb98a; }
.app.admin .side a.nav-item .count { background: rgba(255,255,255,.09); color: #a9bdd2; }
.app.admin .side a.nav-item.on .count { background: var(--brand); color: #fff; }
.app.admin .side-profile { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.09); }
.app.admin .side-profile b { color: #fff; }
.app.admin .side-profile span { color: #7f97b3; }
.app.admin .side-close { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #b9c8dc; }
.app.admin .side-foot { border-color: rgba(255,255,255,.08); }
.app.admin .logo-text b { color: #fff; }
.app.admin .logo-text span { color: #7f97b3; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--brand-light); }
.admin-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

.app-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(8,14,26,.55); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }

/* top bar */
.app-top {
  position: sticky; top: 0; z-index: 55; display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 26px;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line);
}
.menu-btn { height: 42px; padding: 0 14px 0 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; font-size: 13.5px; transition: .25s var(--ease); flex-shrink: 0; box-shadow: var(--shadow-xs); }
.menu-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.burger { position: relative; width: 18px; height: 14px; display: block; }
.burger i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease), width .3s; }
.burger i:nth-child(1) { top: 0 } .burger i:nth-child(2) { top: 6px; width: 70% } .burger i:nth-child(3) { top: 12px }
.menu-btn:hover .burger i:nth-child(2) { width: 100%; }
.menu-btn[aria-expanded='true'] .burger i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-btn[aria-expanded='true'] .burger i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded='true'] .burger i:nth-child(3) { top: 6px; transform: rotate(-45deg); }
.menu-btn .menu-lbl { display: inline; }

.top-crumb { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; margin: 0 6px 0 4px; }
.top-crumb small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.top-crumb b { font-family: var(--display); font-size: 15px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-menu { display: flex; align-items: center; gap: 2px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.top-menu a { position: relative; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--slate); transition: .2s; white-space: nowrap; }
.top-menu a:hover { color: var(--ink); background: var(--surface-3); }
.top-menu a.on { color: var(--brand-dark); background: var(--brand-soft); }
html[data-theme='dark'] .top-menu a.on { color: var(--brand-light); }
.top-menu a .n { margin-left: 6px; font-size: 10.5px; font-weight: 800; background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 7px; }

.top-search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; min-width: 210px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13.5px; transition: .25s var(--ease); }
.top-search:hover { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 4px var(--brand-ring); }
.top-search kbd { margin-left: auto; font-family: inherit; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 7px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }

/* dropdown */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 80; visibility: hidden; opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top right; transition: .22s var(--ease); }
.dd.open > .dd-menu { visibility: visible; opacity: 1; transform: none; }
.dd-menu a, .dd-menu button.dd-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; text-align: left; transition: .18s; }
.dd-menu a:hover, .dd-menu button.dd-item:hover { background: var(--surface-3); color: var(--ink); }
.dd-menu a svg, .dd-menu button svg { color: var(--muted); }
.dd-menu a.danger:hover { background: var(--bad-soft); color: var(--bad); }
.dd-menu a.danger:hover svg { color: var(--bad); }
.dd-menu .dd-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.dd-menu .dd-head { padding: 10px 12px 12px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.dd-menu .dd-head b { font-size: 13.5px; display: block; line-height: 1.25; }
.dd-menu .dd-head span { font-size: 12px; color: var(--muted); word-break: break-all; }
.dd-menu .dd-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 800; padding: 8px 12px 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 5px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: .25s var(--ease); box-shadow: var(--shadow-xs); color: var(--ink); }
.user-chip:hover, .dd.open .user-chip { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.user-chip .who { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip .who b { font-size: 13px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.user-chip > svg { color: var(--muted); transition: transform .25s var(--ease); }
.dd.open .user-chip > svg { transform: rotate(180deg); }

.portal-main { padding: 30px 30px 70px; min-width: 0; flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; animation: fadeUp .55s var(--ease) both; }

/* command palette */
dialog.palette { border: 0; padding: 0; width: min(620px, calc(100% - 28px)); margin: 12vh auto auto; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.palette[open] { animation: pop .28s var(--ease-spring) both; }
dialog.palette::backdrop { background: rgba(8,14,26,.6); backdrop-filter: blur(5px); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; height: 58px; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.palette-list a small { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.palette-list a.hl, .palette-list a:hover { background: var(--brand-soft); color: var(--brand-dark); }
html[data-theme='dark'] .palette-list a.hl { color: var(--brand-light); }
.palette-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.palette-foot kbd { font-family: inherit; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); }

/* pipeline / flow */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.flow-step { position: relative; padding: 4px 10px 0; text-align: center; animation: fadeUp .6s var(--ease) both; }
.flow-step:nth-child(2) { animation-delay: .08s } .flow-step:nth-child(3) { animation-delay: .16s } .flow-step:nth-child(4) { animation-delay: .24s } .flow-step:nth-child(5) { animation-delay: .32s }
.flow-step::before { content: ''; position: absolute; top: 25px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.flow-step:first-child::before { display: none; }
.flow-step.done::before, .flow-step.cur::before { background: var(--brand-grad); }
.flow-dot { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); color: var(--muted); transition: .35s var(--ease-spring); }
.flow-step.done .flow-dot { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.flow-step.cur .flow-dot { border-color: var(--brand); color: var(--brand); animation: pulseRing 1.8s ease-out infinite; }
.flow-step:hover .flow-dot { transform: translateY(-3px) scale(1.06); }
.flow-step b { display: block; font-family: var(--display); font-size: 21px; letter-spacing: -.03em; line-height: 1.1; }
.flow-step span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.flow-step a { position: absolute; inset: 0; z-index: 2; }

/* cash flow bars */
.cashflow { display: flex; flex-direction: column; gap: 16px; }
.cf-row .cf-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 7px; }
.cf-row .cf-top span { color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.cf-row .cf-top b { font-family: var(--display); font-size: 17px; letter-spacing: -.02em; }
.cf-bar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.cf-bar i { display: block; height: 100%; border-radius: 6px; animation: grow 1.2s var(--ease) both; }
.cf-in i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.cf-out i { background: var(--brand-grad); }
.cf-tot i { background: linear-gradient(90deg, #2457d6, #7aa2ff); }
.cf-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* responsive portal */
@media (max-width: 1280px) { .top-menu { display: none; } }
@media (max-width: 1000px) {
  .app, html.menu-closed .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); visibility: hidden; opacity: 1; box-shadow: var(--shadow-lg); width: 300px; max-width: 86vw; }
  html.menu-closed .app .side { opacity: 1; }
  .app.open .side { transform: none; visibility: visible; pointer-events: auto; }
  .app.open .app-scrim { opacity: 1; visibility: visible; }
  .app-top { padding: 0 16px; }
  .portal-main { padding: 22px 16px 56px; }
  .top-search { min-width: 0; width: 42px; padding: 0; justify-content: center; }
  .top-search span, .top-search kbd { display: none; }
  .user-chip .who { display: none; }
  .user-chip { padding-right: 8px; }
}
@media (max-width: 560px) { .menu-btn .menu-lbl { display: none; } .menu-btn { padding: 0 12px; } .top-crumb small { display: none; } .flow { grid-template-columns: repeat(5, 1fr); } .flow-dot { width: 40px; height: 40px; } .flow-step::before { top: 19px; } .flow-step b { font-size: 17px; } .flow-step span { font-size: 10.5px; } }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* ---- top bar width budget fixes ---- */
.main-nav a { white-space: nowrap; }
table.data td .mono, table.data td a.mono { white-space: nowrap; }
.app-top > * { flex-shrink: 0; }
.app-top .spacer { flex: 1 1 0; min-width: 0; flex-shrink: 1; }
.top-crumb { flex-shrink: 1; }
.top-menu { flex-shrink: 1; min-width: 0; overflow: hidden; }
@media (min-width: 1281px) { .top-crumb { display: none; } }
@media (max-width: 1720px) {
  .top-search { min-width: 0; width: 42px; padding: 0; justify-content: center; }
  .top-search span, .top-search kbd { display: none; }
}
@media (max-width: 1560px) { .user-chip .who { display: none; } .user-chip { padding-right: 8px; } }
@media (max-width: 1480px) { .top-menu a { padding: 8px 9px; font-size: 13px; } }
/* when the side menu is closed there is more room: show full search + names again */
@media (min-width: 1281px) {
  html.menu-closed .top-search { min-width: 210px; width: auto; padding: 0 12px; justify-content: flex-start; }
  html.menu-closed .top-search span { display: inline; }
  html.menu-closed .top-search kbd { display: inline; }
}

/* dark-mode polish */
html[data-theme='dark'] .stat::before { background: rgba(242,106,27,.07); }
html[data-theme='dark'] .hero-stats div, html[data-theme='dark'] .search-card { border-color: rgba(255,255,255,.08); }
html[data-theme='dark'] .head-search input { background: var(--surface-2); }
html[data-theme='dark'] .car-fav { background: rgba(17,24,39,.92); color: var(--slate); }
html[data-theme='dark'] .tag.points { background: rgba(17,24,39,.92); color: var(--brand-light); }
html[data-theme='dark'] .logo-text b { color: var(--ink); }
html[data-theme='dark'] .site-foot .logo-text b { color: #fff; }
html[data-theme='dark'] table.data tbody tr:hover { background: rgba(242,106,27,.06); }
.car-price .save { white-space: nowrap; }
.car-price { flex-wrap: wrap; }

/* ---------------- hero slider ---------------- */
.hero-slides { display: grid; position: relative; }
.hero-slide { grid-area: 1 / 1; position: relative; opacity: 0; transition: opacity .8s var(--ease); pointer-events: none; }
.hero-slide.on { opacity: 1; pointer-events: auto; }
.hero-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 4; display: flex; gap: 8px; }
.hero-dot { width: 26px; height: 5px; border-radius: 99px; border: 0; background: rgba(255,255,255,.35); cursor: pointer; transition: .3s var(--ease); padding: 0; }
.hero-dot.on { background: var(--brand); width: 40px; }
@media (prefers-reduced-motion: reduce) { .hero-media img { animation: none; } .hero-slide { transition: none; } }

/* ---------------- dashboard graphs (CSS-only) ---------------- */
.chart-bars { display: flex; align-items: stretch; gap: 12px; height: 190px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-track { position: relative; width: 100%; max-width: 56px; flex: 1; border-radius: 10px; background: #eef2f8; overflow: hidden; }
html[data-theme='dark'] .bar-track { background: rgba(255,255,255,.07); }
.bar-track i { position: absolute; bottom: 0; left: 0; right: 0; transition: height .6s var(--ease); }
.bar-due { background: linear-gradient(180deg, #ffa065, #f26a1b); }
.bar-paid { background: linear-gradient(180deg, #34d399, #16a34a); opacity: .92; }
.bar-col small { font-size: 11px; color: var(--muted); font-weight: 700; }
.chart-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-hole { position: absolute; inset: 18px; background: var(--card); border-radius: 50%; display: grid; place-items: center; text-align: center; }
.donut-hole b { font-size: 26px; font-family: var(--display); letter-spacing: -.03em; }
.donut-hole span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.donut-legend { list-style: none; display: grid; gap: 9px; font-size: 13.5px; min-width: 140px; flex: 1; }
.donut-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.donut-legend b { float: right; }
@media (max-width: 760px) { .dash-grid[style*="1.55fr"] { grid-template-columns: 1fr !important; } .donut-wrap { justify-content: center; } }

/* ---------------- admin image optimizer ---------------- */
.opt-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #f6f8fb; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
html[data-theme='dark'] .opt-box { background: rgba(255,255,255,.04); }
.opt-toggle { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.opt-select { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; }
.opt-quality { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.opt-quality input { width: 110px; accent-color: var(--brand); }
