@import url("assets/fonts/fonts.css");

:root {
  --navy: #082e67;
  --navy-900: #051c40;
  --navy-800: #0a2656;
  --navy-line: rgba(255, 255, 255, .1);
  --ink: #0b1830;
  --muted: #5a6780;
  --line: #dde3ec;
  --papel: #f2f4f8;
  --surface: #ffffff;
  --gold: #c9a15a;
  --ok: #178a52;
  --ok-50: #e4f4ec;
  --warn: #b7791f;
  --warn-50: #fdf3e2;
  --bad: #c53030;
  --w-comercial: #082e67;
  --w-catalogo: #1d4f91;
  --w-convenios: #2b6a66;
  --w-flotas: #0f3d7a;
  --w-renting: #8a6a3a;
  --w-enlaces: #4b5d7a;
  --w-metricas: #35598a;
  --bronze: #8a6a3a;
  --ai-grad: var(--navy);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(5, 28, 64, .06), 0 10px 30px -14px rgba(5, 28, 64, .22);
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--papel); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.1; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--navy) 256px, var(--papel) 256px); }
.app[data-mode="portal"] { grid-template-columns: minmax(0, 1fr); background: var(--papel); }
.app[data-mode="portal"] .sidebar { display: none; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: var(--navy-900); color: #fff; position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--navy-line); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 22px; width: auto; display: block; }
.brand-sep { width: 1px; height: 28px; background: var(--navy-line); }
.brand-title { font-weight: 700; font-size: 14px; line-height: 1.15; white-space: nowrap; }
.brand-title small { display: block; font-weight: 500; color: #9fb1cf; font-size: 12px; }
.spacer { flex: 1; }
.mode { display: flex; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 4px; gap: 4px; }
.mode button { border: 0; background: transparent; color: #c6d3ea; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 9px; white-space: nowrap; }
.mode button[aria-pressed="true"] { background: #fff; color: var(--navy-900); }
.synthetic { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(240, 180, 60, .45); padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #fff; color: var(--navy-900); flex: none; }
.me-txt { font-size: 13px; font-weight: 700; line-height: 1.2; }
.me-txt small { display: block; color: #9fb1cf; font-weight: 500; font-size: 11.5px; }
.menu-btn { display: none; background: transparent; border: 0; color: #fff; padding: 6px; }

.sidebar { background: var(--navy); color: #fff; padding: 18px 14px 24px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.nav-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8ea3c6; padding: 14px 10px 6px; }
.nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; color: #dce5f4; padding: 10px 10px; border-radius: 11px; font-weight: 600; font-size: 14.5px; }
.nav-btn:hover { background: rgba(255, 255, 255, .07); }
.nav-btn[aria-current="page"] { background: #fff; color: var(--navy-900); }
.nav-btn .dot { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.08); color: #c9d6ec; }
.nav-btn[aria-current="page"] .dot { background: var(--papel); color: var(--navy); }
.nav-btn .dot svg { width: 15px; height: 15px; }
.nav-btn .count { margin-left: auto; font-family: var(--mono); font-size: 12px; background: rgba(255, 255, 255, .12); padding: 2px 8px; border-radius: 999px; }
.nav-btn[aria-current="page"] .count { background: var(--papel); }
.side-card { margin-top: auto; background: var(--navy-800); border: 1px solid var(--navy-line); border-radius: 14px; padding: 14px; font-size: 13px; color: #c6d3ea; }
.side-card b { color: #fff; display: block; margin-bottom: 4px; font-size: 14px; }
.side-card button { margin-top: 10px; width: 100%; border: 0; border-radius: 8px; padding: 10px; font-weight: 700; background: #fff; color: var(--navy-900); }

.main { padding: 28px clamp(16px, 3vw, 36px) 110px; min-width: 0; outline: none; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--c, var(--muted)); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.eyebrow i { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--muted)); }
.head h1 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.015em; }
.head p { margin: 8px 0 0; color: var(--muted); max-width: 66ch; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-p { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-c { background: var(--c); color: #fff; border-color: var(--c); }
.btn-ai { background: var(--ai-grad); color: #fff; border: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; color: inherit; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(0, 0, 0, .06); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 16px; font-weight: 700; }
.card-h small { color: var(--muted); font-size: 13px; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi span { font-size: 12.5px; color: var(--muted); display: block; }
.kpi b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-feature-settings: "tnum"; display: block; margin-top: 2px; }
.kpi small { font-size: 12px; color: var(--ok); font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--papel); color: var(--ink); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.warn { background: var(--warn-50); color: var(--warn); }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c, var(--navy)); flex: none; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8f9fc; white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-feature-settings: "tnum"; white-space: nowrap; }
.t tr.flash td { animation: flash 1.8s ease; }
@keyframes flash { 0% { background: #fff4d6; } 100% { background: transparent; } }
.t-wrap { overflow-x: auto; }
.t tr.sel td { background: #eef2f8; }
.model-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.model-cell .thumb { width: 72px; height: 43px; flex: none; }
.model-cell .thumb img { width: 100%; height: 100%; object-fit: contain; }
.model-cell b { display: block; font-size: 14px; }
.model-cell small { color: var(--muted); font-size: 12px; }
.price-in { width: 150px; text-align: right; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font-family: var(--mono); font-size: 13.5px; }
.price-in:hover, .price-in:focus { border-color: var(--line); background: #fff; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #c9d1de; border: 0; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- Mundos home ---------- */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 22px; }
.hello h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700;  letter-spacing: -.03em; }
.hello p { margin: 8px 0 0; color: var(--muted); }
.cmd { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow); margin-bottom: 24px; }
.cmd .ai-orb { width: 26px; height: 26px; }
.cmd input { flex: 1; border: 0; outline: none; font-size: 16px; min-width: 0; background: transparent; }
.cmd .chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -12px 0 22px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -12px 0 24px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip:hover { color: var(--ink); border-color: #b9c4d6; }
.worlds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.world { position: relative; text-align: left; border: 0; border-radius: 0; padding: 22px 22px 20px; min-height: 200px; color: var(--ink); background: var(--surface); display: flex; flex-direction: column; gap: 6px; transition: background .2s ease; }
.world::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.world:hover { background: #f7f9fc; }
.world:hover::before { transform: none; }
.world .w-top { display: flex; justify-content: space-between; align-items: center; }
.world .w-ic { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); color: var(--c); display: grid; place-items: center; background: #f7f9fc; }
.world .w-ic svg { width: 19px; height: 19px; }
.world .w-k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.world h3 { font-size: 19px; font-weight: 700; margin-top: 12px; }
.world p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 30ch; }
.world .w-stat { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.world .w-stat b { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-feature-settings: "tnum"; color: var(--navy); }
.world .w-stat span { font-size: 12.5px; color: var(--muted); }
.world.ai-world { background: var(--navy); color: #fff; }
.world.ai-world:hover { background: var(--navy-800); }
.world.ai-world .w-ic { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: var(--gold); }
.world.ai-world p, .world.ai-world .w-k, .world.ai-world .w-stat span { color: #b9c7de; }
.world.ai-world .w-stat { border-top-color: rgba(255,255,255,.15); }
.world.ai-world .w-stat b { color: #fff; }
.hello-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: stretch; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.hello-card .txt { padding: 28px 30px; }
.hello-card .txt h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 700; letter-spacing: -.02em; }
.hello-card .txt p { color: var(--muted); margin: 10px 0 18px; max-width: 52ch; }
.fleet-pic { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding: 18px 16px 0; background: linear-gradient(180deg, #fff 55%, #e9edf3); }
.fleet-pic img { width: 50%; height: auto; mix-blend-mode: multiply; }
.portfolio { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.portfolio figure { margin: 0; background: #fff; padding: 10px 12px 12px; }
.portfolio img { width: 100%; height: auto; display: block; }
.portfolio figcaption { font-size: 12.5px; color: var(--muted); }
.portfolio figcaption b { display: block; color: var(--ink); font-size: 13.5px; }
.home-low { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed li i { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; background: var(--c); }
.feed li small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.feed li.new { animation: flash 2s ease; }

/* ---------- Comercial ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: #eceff4; border-radius: 10px; padding: 10px; min-height: 380px; }
.lane-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.lane-h span { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.lead { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; margin-bottom: 8px; border-left: 4px solid var(--c); }
.lead:hover { border-color: #b7c2d4; border-left-color: var(--c); }
.lead b { display: block; font-size: 14px; }
.lead .co { font-size: 12.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .ln { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; font-size: 12px; color: var(--muted); }
.lead.new-lead { animation: pop .6s ease; box-shadow: 0 0 0 3px rgba(240, 180, 60, .6); }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 13px; font-size: 13px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; }
.fbtn i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.fbtn[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Drawer / dialog ---------- */
dialog { border: 0; padding: 0; border-radius: 14px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 40px 90px -30px rgba(5, 28, 64, .6); color: var(--ink); }
dialog::backdrop { background: rgba(5, 28, 64, .5); backdrop-filter: blur(3px); }
.dlg-h { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-h h2 { font-size: 22px; font-weight: 700; }
.dlg-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dlg-b { padding: 20px 24px; display: grid; gap: 18px; }
.dlg-f { padding: 14px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
dl.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0; }
dl.kv div { background: #fff; padding: 11px 14px; }
dl.kv dt { font-size: 12px; color: var(--muted); }
dl.kv dd { margin: 2px 0 0; font-weight: 700; font-size: 14.5px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 12px; font-size: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--navy)); border: 2px solid #fff; }
.timeline small { color: var(--muted); display: block; font-size: 12px; }
.stage-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-row button { border: 1px solid var(--line); background: #fff; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.stage-row button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
label.f input, label.f select, label.f textarea { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-weight: 500; font-size: 15px; background: #fff; width: 100%; }
.form-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.consent { display: flex; gap: 10px; align-items: start; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.consent input { margin-top: 3px; }

/* ---------- Catálogo ---------- */
.drop { border: 2px dashed #b9c4d6; border-radius: 16px; padding: 18px; display: flex; gap: 16px; align-items: center; background: #f8fafd; margin-bottom: 16px; }
.drop .d-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.drop b { display: block; }
.drop span { color: var(--muted); font-size: 13.5px; }
.drop .btn { margin-left: auto; }
.diff { display: grid; gap: 8px; }
.diff-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.diff-row s { color: var(--muted); }
.diff-row .up { color: var(--bad); font-weight: 700; }
.diff-row .down { color: var(--ok); font-weight: 700; }
.scan { height: 6px; border-radius: 3px; background: #e5eaf2; overflow: hidden; }
.scan i { display: block; height: 100%; width: 0; background: var(--c); transition: width 1.4s ease; }

/* ---------- Convenios / QR ---------- */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.conv { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.conv-top { padding: 16px 18px; display: flex; gap: 14px; align-items: start; border-bottom: 1px solid var(--line); }
.conv-top h3 { font-size: 16.5px; font-weight: 700; }
.conv-top small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 3px; }
.qr { width: 84px; height: 84px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.conv-mid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.conv-mid div { background: #fff; padding: 10px 14px; }
.conv-mid b { display: block; font-size: 17px; font-weight: 700; font-feature-settings: "tnum"; }
.conv-mid span { font-size: 11.5px; color: var(--muted); }
.conv-bot { padding: 12px 18px; display: flex; gap: 8px; justify-content: space-between; align-items: center; font-size: 13px; }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--papel); padding: 4px 8px; border-radius: 7px; }
.conv.new-conv { animation: pop .6s ease; box-shadow: 0 0 0 3px rgba(30, 158, 90, .45); }
.qr-big { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; }
.qr-card { background: var(--navy); color: #fff; border-radius: 12px; padding: 18px; text-align: center; }
.qr-card img { height: 18px; margin: 0 auto 12px; display: block; }
.qr-card .qr { width: 100%; height: auto; aspect-ratio: 1; border: 0; }
.qr-card b { display: block; margin-top: 12px; font-size: 14px; }
.qr-card small { color: #b8c7e2; font-size: 12px; }

/* ---------- Flotas / Renting ---------- */
.stage { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--papel); }
.stage.s-Ganado { background: var(--ok-50); color: var(--ok); }
.stage.s-Negociación { background: var(--warn-50); color: var(--warn); }
.calc-fleet { display: grid; gap: 14px; }
.calc-fleet .res { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calc-fleet .res span { font-size: 12px; color: #b8c7e2; display: block; }
.calc-fleet .res b { font-size: 20px; font-weight: 700; font-feature-settings: "tnum"; }
input[type=range] { width: 100%; accent-color: var(--c, var(--navy)); }
.term-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.term { border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; background: #fff; }
.term[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.term span { font-size: 12px; color: var(--muted); display: block; }
.term b { font-size: 19px; font-weight: 700; font-feature-settings: "tnum"; }

/* ---------- Métricas ---------- */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 54px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row .track { height: 12px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 6px; background: var(--c); }
.bar-row b { text-align: right; font-feature-settings: "tnum"; }
.funnel { display: grid; gap: 8px; }
.funnel div { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; padding: 12px 16px; border-radius: 10px; background: var(--navy); margin: 0 auto; font-size: 14px; }
.spark { width: 100%; height: 150px; display: block; }

/* ---------- Asistente ---------- */
.ai-orb { width: 30px; height: 30px; border-radius: 8px; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a15a' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z'/%3E%3C/svg%3E") center / 60% no-repeat; display: inline-block; flex: none; }
.ai { position: fixed; right: 16px; bottom: 16px; top: 80px; width: min(420px, calc(100vw - 32px)); background: #fff; border-radius: 14px; box-shadow: 0 40px 90px -30px rgba(5, 28, 64, .55), 0 0 0 1px var(--line); z-index: 60; display: flex; flex-direction: column; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--line); }
.ai-head b { display: block; font-size: 16px; }
.ai-head small { color: var(--muted); font-size: 12.5px; }
.ai-head .icon-btn { margin-left: auto; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fafbfd; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 15px; font-size: 14px; line-height: 1.45; }
.msg.u { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.msg.a { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.a .done { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ok); font-weight: 700; }
.msg.a .done button { margin-left: auto; border: 0; background: var(--papel); border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 700; color: var(--ink); }
.msg.typing { color: var(--muted); font-style: italic; }
.ai-sug { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; }
.ai-sug button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; }
.ai-sug button:hover { color: var(--ink); }
.ai-form { display: flex; gap: 8px; padding: 12px 14px 14px; }
.ai-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 14.5px; }
.ai-send { border: 0; border-radius: 12px; width: 46px; background: var(--ai-grad); color: #fff; display: grid; place-items: center; }
.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 55; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 8px 18px 8px 8px; background: var(--navy-900); color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 20px 40px -16px rgba(5, 28, 64, .7); }
.ai-fab[aria-expanded="true"] { display: none; }

/* ---------- Portal público ---------- */
.portal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.portal-bar .note { font-size: 13px; color: var(--muted); }
.device { margin: 0 auto; transition: max-width .35s ease; max-width: 1180px; }
.device.phone { max-width: 400px; border: 12px solid #111827; border-radius: 44px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(5, 28, 64, .6); }
.site { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); container-type: inline-size; }
.device.phone .site { border-radius: 0; border: 0; max-height: 780px; overflow-y: auto; }
.s-nav { display: flex; align-items: center; gap: 18px; padding: 16px 30px; background: var(--navy-900); color: #fff; border-bottom: 1px solid var(--navy-line); }
.s-nav img { height: 20px; }
.s-nav nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; font-weight: 600; color: #c6d3ea; }
.s-hero { background: var(--navy); color: #fff; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; }
.s-hero .txt { padding: 44px 30px 34px; }
.s-hero .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.s-hero h2 { font-size: clamp(28px, 4.2cqi, 46px); font-weight: 700; letter-spacing: -.025em; margin-top: 12px; max-width: 17ch; line-height: 1.05; }
.s-hero p { color: #c6d3ea; max-width: 52ch; margin: 14px 0 0; }
.s-hero .pic { background: linear-gradient(180deg, #fff 60%, #e9edf3); display: grid; place-items: end center; padding: 20px 10px 0; }
.s-hero .pic img { width: 100%; max-width: 520px; height: auto; mix-blend-mode: multiply; }
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); background: #fff; }
.door { text-align: left; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink); padding: 20px 24px; display: grid; gap: 4px; position: relative; }
.door:last-child { border-right: 0; }
.door::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--c); transform: scaleX(0); transition: transform .2s; }
.door small { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.door b { font-size: 18px; font-weight: 700; }
.door span { font-size: 13.5px; color: var(--muted); }
.door em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--c); margin-top: 6px; }
.door:hover { background: #f7f9fc; }
.door[aria-pressed="true"] { background: #f4f7fb; }
.door[aria-pressed="true"]::after { transform: none; }
.conv-banner { display: flex; align-items: center; gap: 14px; margin: 18px 26px 0; padding: 14px 16px; border-radius: 14px; background: #e8f6ee; border: 1px solid #bfe6cf; font-size: 14px; }
.conv-banner b { color: var(--w-convenios); }
.conv-banner form { margin-left: auto; display: flex; gap: 8px; }
.conv-banner input { border: 1px solid #bfe6cf; border-radius: 10px; padding: 8px 10px; width: 140px; font-family: var(--mono); text-transform: uppercase; }
.s-body { padding: 22px 26px 30px; }
.s-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.car { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; text-align: left; padding: 0; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.car:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.car-img { background: #fff; aspect-ratio: 5 / 3; display: grid; place-items: center; position: relative; border-bottom: 1px solid var(--line); }
.car-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.car-img .tag { position: absolute; left: 10px; top: 10px; }
.car-b { padding: 12px 14px 14px; display: grid; gap: 2px; }
.car-b small { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.car-b b { font-size: 16px; }
.car-p { margin-top: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.car-p s { color: var(--muted); font-size: 12.5px; }
.car-p strong { font-size: 17px; font-weight: 700; font-feature-settings: "tnum"; }
.car-p span { font-size: 11.5px; color: var(--c); font-weight: 700; }
.s-foot { background: var(--navy-900); color: #9fb1cf; padding: 18px 26px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.car-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.car-detail .car-img { border: 1px solid var(--line); border-radius: 10px; }
.pricebox { background: var(--papel); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.pricebox div { display: flex; justify-content: space-between; font-size: 14px; }
.pricebox .big { font-size: 22px; font-weight: 700; }

@container (max-width: 560px) {
  .doors, .s-hero { grid-template-columns: minmax(0, 1fr); }
  .door { border-right: 0; border-bottom: 1px solid var(--line); }
  .s-hero .txt { padding: 28px 16px 22px; }
  .s-nav nav { display: none; }
  .conv-banner { flex-wrap: wrap; margin-inline: 16px; }
  .conv-banner form { margin-left: 0; }
  .s-body { padding-inline: 16px; }
  .cars { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -16px rgba(5, 28, 64, .7); animation: pop .3s ease; display: flex; gap: 10px; align-items: center; }
.toast i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-txt { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); background: var(--papel); }
  .sidebar { position: fixed; left: 0; top: 64px; bottom: 0; width: 280px; z-index: 45; transform: translateX(-100%); transition: transform .25s ease; height: auto; }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .5); }
  .menu-btn { display: block; }
  .app[data-mode="portal"] .menu-btn { display: none; }
  .brand-title, .brand-sep, .synthetic { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .home-low, .g2, .g3, .hello, .car-detail, .qr-big, .hello-card { grid-template-columns: minmax(0, 1fr); }
  .portfolio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand img { height: 16px; }
  .mode button { padding: 7px 9px; font-size: 12px; }
  .me { display: none; }
  .worlds { grid-template-columns: minmax(0, 1fr); }
  .world { min-height: 0; }
  .portfolio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-g, dl.kv { grid-template-columns: minmax(0, 1fr); }
  .term-cards { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) 44px; }
  .drop { flex-wrap: wrap; }
  .drop .btn { margin-left: 0; }
  .ai-fab { right: 12px; bottom: 12px; }
  .diff-row { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
