/* ===== Tokens ===== */
:root {
  --brand: #1f3d9c;
  --brand-strong: #172e78;
  --cyan: #18b4e6;
  --accent: #f5c518;
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --text: #0c1330;
  --muted: #5a6486;
  --border: #e1e6f1;
  --ok: #12a46b;
  --warn: #d98a00;
  --danger: #d6455d;
  --shadow: 0 1px 2px rgb(12 19 48 / .05), 0 8px 24px -8px rgb(12 19 48 / .12);
  --radius: 18px;
  --radius-sm: 12px;
  --hero-from: #0b1a4d;
  --hero-to: #1f3d9c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5b7dff; --brand-strong: #7d98ff; --cyan: #3cc6f2; --accent: #ffd23f;
    --bg: #060a1a; --surface: #0e1430; --surface-2: #151d40; --text: #edf0fb;
    --muted: #96a0c6; --border: #222b55;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .6);
    --hero-from: #050a1f; --hero-to: #142a73;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #5b7dff; --brand-strong: #7d98ff; --cyan: #3cc6f2; --accent: #ffd23f;
  --bg: #060a1a; --surface: #0e1430; --surface-2: #151d40; --text: #edf0fb;
  --muted: #96a0c6; --border: #222b55;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .6);
  --hero-from: #050a1f; --hero-to: #142a73;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, .price, .kpi b, .hero-stats strong, .brand { font-stretch: 118%; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }

/* Logo según tema */
.logo { height: 34px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.on-dark .logo-light { display: none !important; }
.on-dark .logo-dark { display: block !important; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px var(--brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-accent { background: var(--accent); color: #0c1330; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-glass { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .25); color: #fff; backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgb(255 255 255 / .18); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; gap: 24px; height: 72px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column;
         background: var(--surface); padding: 12px 16px 20px; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .menu-btn { display: grid; }
  .header .btn-accent { display: none; }
  .header .container { gap: 12px; }
  .header-actions { margin-left: auto; }
}

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(60% 80% at 85% 10%, rgb(24 180 230 / .35), transparent 60%),
    radial-gradient(40% 60% at 10% 100%, rgb(245 197 24 / .18), transparent 60%),
    linear-gradient(135deg, var(--hero-from), var(--hero-to));
}
.hero .container > * { min-width: 0; }
.hero .container { position: relative; z-index: 1; padding-block: 88px 112px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p.lead { font-size: 19px; color: rgb(255 255 255 / .78); margin-top: 20px; max-width: 600px; }
.hero .ctas { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 28px; font-weight: 800; }
.hero-stats span { font-size: 14px; color: rgb(255 255 255 / .65); }
@media (max-width: 900px) {
  .hero .container { padding-block: 56px 72px; }
}

/* ===== Secciones ===== */
.section { padding-block: 88px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-top: 8px; }
.section-head p { max-width: 520px; margin-top: 10px; }
@media (max-width: 700px) { .section { padding-block: 56px; } }

/* Marcas */
.brands { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.brand {
  aspect-ratio: 3 / 2; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 800; font-size: 18px; letter-spacing: .06em; color: var(--muted);
  transition: all .2s ease;
}
.brand:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
@media (max-width: 900px) { .brands { grid-template-columns: repeat(3, 1fr); } }

/* Imagen de auto (placeholder) */
.car-img {
  --h: 225;
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 90'%3E%3Cpath d='M14 62c0-6 3-10 10-12l26-6 26-18c6-4 13-6 21-6h40c8 0 15 3 21 8l18 16 26 4c8 1 13 6 13 13v5c0 3-2 5-5 5h-18a20 20 0 0 0-38 0H73a20 20 0 0 0-38 0H19c-3 0-5-2-5-5z' fill='white' fill-opacity='.92'/%3E%3Cpath d='M82 30l-18 14h50V26H97c-6 0-11 1-15 4zm40-4v18h46l-14-12c-4-4-9-6-14-6z' fill='%230c1330' fill-opacity='.35'/%3E%3Ccircle cx='54' cy='72' r='14' fill='%230c1330'/%3E%3Ccircle cx='54' cy='72' r='6' fill='%23cfd6ea'/%3E%3Ccircle cx='168' cy='72' r='14' fill='%230c1330'/%3E%3Ccircle cx='168' cy='72' r='6' fill='%23cfd6ea'/%3E%3C/svg%3E") center 62% / 78% no-repeat,
    radial-gradient(80% 60% at 50% 100%, hsl(var(--h) 70% 70% / .55), transparent 70%),
    linear-gradient(160deg, hsl(var(--h) 55% 32%), hsl(calc(var(--h) + 30) 60% 18%));
}
.car-img .tag { position: absolute; top: 12px; left: 12px; }

/* Tarjetas de vehículo */
.grid-cars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1000px) { .grid-cars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-cars { grid-template-columns: 1fr; } }
.car {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; transition: transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column;
}
.car:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.car-body { padding: 14px 8px 8px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.car-body h3 { font-size: 19px; }
.car-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.car-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.price { font-size: 22px; font-weight: 800; }
.price small { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }

/* Chips y badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-new { background: var(--accent); color: #0c1330; }
.badge-new::before { display: none; }
.badge-used { background: rgb(255 255 255 / .9); color: #0c1330; }
.badge-used::before { display: none; }
.b-agendada { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.b-confirmada { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.b-taller { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.b-listo { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.b-cancelada { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services { grid-template-columns: 1fr; } }
.service { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.service .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.service h3 { font-size: 18px; }
.service .from { margin-top: auto; padding-top: 10px; font-weight: 700; }

/* Banda postventa */
.band {
  border-radius: 28px; padding: 48px; color: #fff; display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
  background: radial-gradient(70% 120% at 100% 0%, rgb(24 180 230 / .45), transparent 60%), linear-gradient(135deg, var(--hero-from), var(--hero-to));
}
.band h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.band p { color: rgb(255 255 255 / .75); margin-top: 12px; }
.steps-mini { display: grid; gap: 12px; }
.steps-mini div { display: flex; gap: 14px; align-items: center; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); padding: 14px 16px; border-radius: 14px; font-weight: 600; }
.steps-mini b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #0c1330; font-size: 14px; flex: none; }
@media (max-width: 800px) { .band { grid-template-columns: 1fr; padding: 28px; } }

/* Footer */
.footer { border-top: 1px solid var(--border); padding-block: 48px; margin-top: 40px; }
.footer .container { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer h4 { margin: 0 0 12px; font-size: 14px; }
.footer a, .footer p { display: block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
@media (max-width: 800px) { .footer .container { grid-template-columns: 1fr 1fr; } }

/* ===== Catálogo ===== */
.page-head { padding-block: 48px 24px; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; margin-top: 8px; }
.catalog { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; padding-bottom: 64px; }
.filters { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: grid; gap: 20px; }
.filters h4 { margin: 0 0 10px; font-size: 14px; }
.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; height: 36px; border: 0; background: transparent; border-radius: 9px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.checks { display: grid; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--brand); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-toggle { display: none; }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { display: none; position: static; }
  .filters.open { display: grid; }
  .filter-toggle { display: inline-flex; }
}

/* ===== Formularios ===== */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.input, .select, textarea.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== Asistente de agenda ===== */
.wizard { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; padding-bottom: 72px; }
@media (max-width: 960px) { .wizard { grid-template-columns: 1fr; } }
.stepper { display: flex; gap: 8px; margin-bottom: 24px; }
.stepper .s { flex: 1; display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper .bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.stepper .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--cyan)); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.stepper .s.done .bar i, .stepper .s.on .bar i { transform: scaleX(1); }
.stepper .s.on, .stepper .s.done { color: var(--text); }
@media (max-width: 600px) { .stepper .s span { display: none; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.panel h2 { font-size: 24px; margin-bottom: 6px; }
.panel > p.muted { margin-bottom: 24px; }
.step { display: none; }
.step.on { display: block; animation: in .3s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 600px) { .options { grid-template-columns: 1fr; } }
.opt { position: relative; display: flex; gap: 14px; padding: 16px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
.opt:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.opt input { position: absolute; opacity: 0; }
.opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.opt .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: none; }
.opt strong { display: block; }
.opt small { color: var(--muted); font-size: 13px; }
.opt .p { margin-left: auto; font-weight: 700; white-space: nowrap; font-size: 14px; }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { display: grid; place-items: center; gap: 2px; padding: 10px 0; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.day small { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.day b { font-size: 18px; }
.day[disabled] { opacity: .35; cursor: not-allowed; }
.day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.on small { color: rgb(255 255 255 / .8); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 600px) { .slots { grid-template-columns: repeat(3, 1fr); } .days { gap: 4px; } }
.slot { height: 44px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.slot[disabled] { text-decoration: line-through; opacity: .35; cursor: not-allowed; }
.slot.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 10px; }

.summary { position: sticky; top: 92px; display: grid; gap: 16px; }
.summary .panel { padding: 22px; }
.summary h3 { font-size: 17px; margin-bottom: 14px; }
.sum-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.sum-row:first-of-type { border-top: 0; padding-top: 0; }
.sum-row .k { color: var(--muted); width: 90px; flex: none; }
.sum-row .v { font-weight: 600; }
.help { display: flex; gap: 12px; align-items: center; font-size: 14px; }

.success { text-align: center; padding: 24px 0; }
.success .check { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.success .check svg { width: 36px; height: 36px; }
.code { display: inline-block; margin: 16px 0; padding: 12px 22px; border-radius: 12px; background: var(--surface-2); font: 800 26px/1 ui-monospace, monospace; letter-spacing: .12em; }

/* ===== Ficha ===== */
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; padding-bottom: 64px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: 10px; }
.gallery .car-img { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.thumbs .car-img { aspect-ratio: 4 / 3; cursor: pointer; opacity: .7; }
.thumbs .car-img.on { opacity: 1; outline: 2px solid var(--brand); outline-offset: 2px; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.spec { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.spec small { display: block; font-size: 12px; color: var(--muted); }
.spec b { font-size: 15px; }
.buy { position: sticky; top: 92px; }
.buy .price { font-size: 34px; }

/* Seguimiento */
.timeline { display: grid; gap: 0; margin-top: 8px; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.tl::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; }
.tl.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl.done::before { background: var(--ok); }
.tl.now .dot { border-color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 18%, transparent); }
.tl.now .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.tl .dot svg { width: 14px; height: 14px; }
.tl strong { display: block; }
.tl small { color: var(--muted); }

/* ===== Admin ===== */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: #0a1235; color: #c8d0ef; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .logo { height: 28px; margin: 6px 10px 24px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.side a:hover { background: rgb(255 255 255 / .06); color: #fff; }
.side a.on { background: linear-gradient(90deg, rgb(91 125 255 / .35), rgb(24 180 230 / .12)); color: #fff; }
.side .count { margin-left: auto; background: var(--accent); color: #0c1330; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.side .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6c78a8; margin: 18px 12px 6px; font-weight: 700; }
.main { padding: 28px 32px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font-size: 28px; font-weight: 800; }
.topbar .search { margin-left: auto; position: relative; }
.topbar .search input { width: 280px; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); padding: 0 16px 0 40px; font: inherit; color: var(--text); }
.topbar .search svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--cyan)); color: #fff; display: grid; place-items: center; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.kpi small { color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi b { display: block; font-size: 34px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.kpi .delta { font-size: 13px; font-weight: 700; color: var(--ok); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-head h2 { font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th, td { padding-inline: 10px; }
td { padding-block: 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
.plate { font: 700 13px ui-monospace, monospace; background: var(--surface-2); padding: 4px 8px; border-radius: 6px; letter-spacing: .06em; }
.bays { display: grid; gap: 12px; }
.bay { display: grid; gap: 6px; }
.bay-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--cyan)); }
.tabs-admin { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.tabs-admin button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs-admin button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.admin-menu { display: none; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0 30% 0 0; z-index: 60; }
  .side.open { display: flex; }
  .admin-menu { display: grid; }
  .main { padding: 20px 16px 40px; }
  .topbar .search { order: 3; width: 100%; margin-left: 0; }
  .topbar .search input { width: 100%; }
}
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi b { font-size: 26px; } }

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

/* ===== Fase 1: catálogo real ===== */
/* Fotos de producto (fondo blanco de origen): recuadro blanco en ambos temas */
.car-photo {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden;
  background: #fff; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 60%, transparent);
}
.car-photo img { width: 88%; height: 88%; object-fit: contain; transition: transform .35s ease; }
.car:hover .car-photo img { transform: scale(1.04); }
.car-photo .tag { position: absolute; top: 12px; left: 12px; }
.car-photo .car-img-fallback { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.car-photo-lg { aspect-ratio: 16 / 9; border-radius: var(--radius); }

/* Tiles de marca con conteo de modelos */
.brand { display: grid; place-items: center; align-content: center; gap: 4px; }
.brand small { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); font-stretch: 100%; }

/* Formulario de filtros */
.filters fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.filters legend, .filters label[for] { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.filters .field { gap: 0; }
.filters .select { height: 44px; }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg label input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label span { display: grid; place-items: center; height: 36px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg label input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg label input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 1px; }
.select-sm { height: 36px; width: auto; border-radius: 999px; padding: 0 12px; font-size: 14px; }

/* Lista de versiones en la ficha */
.versiones { display: grid; gap: 10px; }
.version {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.version:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.version input { position: absolute; opacity: 0; }
.version:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.version:has(input:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 2px; }
.version-info { display: grid; gap: 8px; min-width: 0; }
.version-info strong { font-size: 15px; }
.version-precio { margin-left: auto; text-align: right; display: grid; white-space: nowrap; }
.version-precio s { font-size: 13px; }
.version-precio b { font-size: 17px; }
@media (max-width: 560px) { .version { flex-wrap: wrap; } .version-precio { margin-left: 0; text-align: left; } }

/* ===== Panel admin ===== */
.side-pronto { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: #6c78a8; cursor: default; }
.side-pronto small { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; border: 1px solid #2a3566; padding: 2px 6px; border-radius: 6px; }
.topbar-acciones { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar a { color: inherit; }
.usuario { display: flex; align-items: center; gap: 10px; }
.usuario-datos { display: grid; line-height: 1.2; font-size: 14px; }
.usuario-datos small { font-size: 12px; }
@media (max-width: 860px) { .usuario-datos { display: none; } .topbar-acciones { margin-left: auto; } }
a.kpi { color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--brand); transform: translateY(-2px); }
.alerta { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alerta ul { margin: 6px 0 0; padding-left: 18px; }
.alerta-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.alerta-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.filtros-admin { flex-wrap: wrap; justify-content: flex-start; }
.input-sm { height: 36px; border-radius: 999px; width: min(320px, 100%); font-size: 14px; }
.celda-larga { white-space: normal; min-width: 220px; }
tr.fila-resaltada td { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.check-linea { display: flex; align-items: center; gap: 10px; height: 48px; font-weight: 600; cursor: pointer; }
.check-linea input { width: 18px; height: 18px; accent-color: var(--brand); }
.label-falso { font-size: 14px; font-weight: 600; }
.field small { font-size: 12px; }
.lista-ayuda { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.lista-ayuda b { color: var(--text); }
.cols > form.card { min-width: 0; }

/* Login */
.login-fondo { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(60% 80% at 85% 10%, rgb(24 180 230 / .3), transparent 60%),
  linear-gradient(135deg, var(--hero-from), var(--hero-to)); }
.login { width: min(400px, 100% - 32px); display: grid; gap: 24px; justify-items: center; padding-block: 40px; }
.login .logo { height: 40px; }
.login-card { width: 100%; display: grid; gap: 16px; }
.login-card h1 { font-size: 24px; }
.login-volver { color: rgb(255 255 255 / .7); font-size: 14px; font-weight: 600; }
.field { align-content: start; }
.side-pronto { white-space: nowrap; }
.side-pronto small { font-size: 9px; padding: 1px 5px; }

/* ===== Fase 2: agenda y Mi cuenta ===== */
.plan-mant { display: grid; gap: 20px; margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--border); }
.plan-mant fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.plan-mant legend { margin-bottom: 8px; padding: 0; }
.opt .p { align-self: start; }
.input-codigo { font: 700 28px ui-monospace, monospace; letter-spacing: .5em; text-align: center; height: 64px; }
.titulo-seccion { font-size: 22px; margin-bottom: 14px; }
.vacio { color: var(--muted); }
.vacio a { color: var(--brand); font-weight: 700; }
.lista-citas { display: grid; gap: 10px; }
.tarjeta-cita { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; color: inherit; transition: border-color .15s, transform .15s; }
.tarjeta-cita:hover { border-color: var(--brand); transform: translateY(-1px); }
.tc-fecha { display: grid; }
.tc-detalle { display: grid; gap: 4px; min-width: 0; }
.tc-detalle .muted { font-size: 14px; }
@media (max-width: 640px) { .tarjeta-cita { grid-template-columns: 1fr; gap: 8px; } }
.lista-vehiculos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .lista-vehiculos { grid-template-columns: 1fr; } }
.historial { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.historial li { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--cyan); font-size: 14px; }
.historial .muted { font-size: 13px; }
.fila-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fila-form .input-sm { width: 130px; }
.kpis-mini { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.kpis-mini .kpi { padding: 14px; }
.kpis-mini .kpi b { font-size: 28px; }
@media (max-width: 560px) { .kpis-mini { grid-template-columns: 1fr; } }

/* ===== Mantenimiento: próximo, plan e historial ===== */
.lista-vehiculos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.vehiculo-card { display: flex; flex-direction: column; }
.vc-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.vc-acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; }
.proximo { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 10px; border: 1px solid transparent; }
.proximo-vencido { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--surface-2)); }
.proximo-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.proximo-head small { display: block; font-size: 12px; font-weight: 600; }
.proximo-km { font-size: 26px; font-weight: 800; font-stretch: 118%; letter-spacing: -.02em; }
.tareas-mini { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.detalle-vehiculo { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; padding-bottom: 72px; }
@media (max-width: 960px) { .detalle-vehiculo { grid-template-columns: 1fr; } }
.proximo-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
@media (max-width: 560px) { .proximo-datos { grid-template-columns: 1fr; } }
.tareas-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
@media (max-width: 640px) { .tareas-cols { grid-template-columns: 1fr; } }
.tareas-titulo { font-size: 15px; margin-bottom: 10px; }
.tareas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.tareas li { position: relative; padding-left: 24px; }
.tareas li::before { content: ""; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 22%, transparent); border: 1.5px solid var(--brand); }
.tareas-insp li::before { border-radius: 50%; background: transparent; border-color: var(--cyan); }
.tareas-hechas li::before { background: var(--ok); border-color: var(--ok); }
.historial-completo { list-style: none; margin: 18px 0 0; padding: 0; display: grid; }
.hc-item { display: grid; grid-template-columns: 22px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.hc-item::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.hc-item:last-child::before { display: none; }
.hc-punto { width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 20%, var(--surface)); border: 2px solid var(--ok); }
.hc-correctivo .hc-punto { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.hc-cuerpo { display: grid; gap: 6px; min-width: 0; }
.hc-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hc-meta { font-size: 13px; }
.hc-obs { font-size: 14px; background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.hc-cuerpo details summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand); }
.hc-cuerpo details .tareas { margin-top: 10px; }
.recomendaciones { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.recomendaciones b { color: var(--text); }

/* ===== Sucursales, contacto, WhatsApp y mapa ===== */
.sucursales-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: stretch;
}
.sucursales-lista {
  display: grid;
  gap: 14px;
}
.sucursal-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.sucursal-item:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.sucursal-item.on {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent), var(--shadow);
}
.sucursal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.sucursal-ciudad {
  height: 24px;
  font-size: 12px;
  margin-bottom: 6px;
}
.sucursal-item.on .sucursal-ciudad {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
}
.sucursal-top h3 {
  font-size: 19px;
}
.sucursal-item.on .sucursal-ver-mapa {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.sucursal-dir {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.sucursal-dir svg.i {
  width: 17px;
  height: 17px;
  color: var(--cyan);
  margin-top: 2px;
}
.sucursal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
}
.sucursal-dato {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.sucursal-dato svg.i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
a.sucursal-dato:hover {
  color: var(--brand);
}
.sucursal-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.btn-whatsapp {
  background: #12a46b;
  color: #fff;
  box-shadow: 0 8px 18px -8px rgb(18 164 107 / .65);
}
.btn-whatsapp:hover {
  filter: brightness(1.07);
}
.sucursales-mapa-box {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  min-height: 480px;
}
.sucursales-mapa-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.sucursales-mapa-head h3 {
  font-size: 20px;
  margin-top: 6px;
}
.sucursales-mapa-head p {
  font-size: 13.5px;
  margin-top: 2px;
}
.sucursales-mapa-frame {
  flex: 1;
  min-height: 390px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.sucursales-mapa-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 390px;
  border: 0;
  display: block;
}
@media (max-width: 960px) {
  .sucursales-panel {
    grid-template-columns: 1fr;
  }
  .sucursales-mapa-box {
    position: static;
    min-height: 380px;
  }
}

/* Admin: gestión de sucursales */
.admin-sucursales {
  display: grid;
  gap: 18px;
}
.admin-sucursal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.admin-sucursal-grid .full {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .admin-sucursal-grid {
    grid-template-columns: 1fr;
  }
}
