/* Reprecia: estilos de la aplicación (rediseño de noviembre de 2026).
   Colores y tipografías de la guía de marca. Estructura: menú lateral oscuro + área de trabajo clara.
   Si instalas Bricolage Grotesque, Instrument Sans y JetBrains Mono en el equipo, se usan solas. */
:root {
  color-scheme: light dark;
  --surface-100: #F3F7F6; --surface-200: #FFFFFF; --surface-300: #EEF4F3;
  --ink: #0E2426; --ink-muted: #5B7073; --line: #DFE8E6;
  --brand: #0B6E6B; --brand-strong: #085553; --on-brand: #FFFFFF; --brand-tint: #E2F2EF;
  --ahorro: #F2B134; --ahorro-soft: #FDF3DC; --on-ahorro: #10272B;
  --good: #17794A; --warning: #8A5A00; --critical: #B3261E;
  --deep: #052F2F; --deep-2: #0A4A49; --on-deep: #E9F6F4; --side-ink: rgba(233,246,244,.72);
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(5,47,47,.05), 0 8px 24px -12px rgba(5,47,47,.18);
  --shadow-lg: 0 2px 6px rgba(5,47,47,.06), 0 24px 48px -20px rgba(5,47,47,.32);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI Variable Display", "Helvetica Neue", Arial, sans-serif;
  --f-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side-w: 252px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-100: #0B1719; --surface-200: #122327; --surface-300: #183034;
    --ink: #E8F0EE; --ink-muted: #9DB3B3; --line: #25404680;
    --brand: #5CD6C9; --brand-strong: #7FE3D8; --on-brand: #07201F; --brand-tint: #12383A;
    --ahorro-soft: #3A2E12;
    --good: #5CCB8D; --warning: #E5B04E; --critical: #FF8A80;
    --deep: #04191B; --deep-2: #0A3A3A;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 48px -20px rgba(0,0,0,.75);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface-100); color: var(--ink); font: 15px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; margin: 0; letter-spacing: -0.015em; line-height: 1.2; }
h2 { font-size: 18px; } h3 { font-size: 15.5px; } h4 { font-size: 13px; }
p { margin: 0 0 var(--s3); }
a { color: var(--brand); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mut { color: var(--ink-muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }

/* ---------- estructura: menú lateral + área de trabajo ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: var(--s4); padding: 22px 14px 16px;
  background: radial-gradient(120% 60% at 0% 0%, #0C5654 0%, transparent 60%), linear-gradient(180deg, #063636 0%, #042526 100%); color: var(--on-deep); }
.side-logo { padding: 2px 10px 10px; }
.logo { height: 26px; width: auto; display: block; }
.logo .lg-b { fill: var(--brand); } .logo .lg-a { fill: var(--ahorro); } .logo .lg-n { fill: var(--ink); }
.side .logo .lg-n, .logo--on-brand .lg-n { fill: #fff; } .side .logo .lg-b, .logo--on-brand .lg-b { fill: #6FE0D2; }
.side-label { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: rgba(233,246,244,.45); font-weight: 600; padding: 0 12px; margin-top: var(--s2); }
.side-label.adm { color: #E9B44C; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); font: 500 14.5px/1.2 var(--f-sans); cursor: pointer; position: relative; transition: background-color .15s, color .15s; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button:focus-visible { outline: 2px solid #6FE0D2; outline-offset: -2px; }
.nav button[aria-current="page"] { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.nav button[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ahorro); }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--ahorro); color: var(--on-ahorro); font: 600 11.5px/1.5 var(--f-mono); text-align: center; }
.nav-sub button { font-size: 13.5px; padding: 7px 12px; }
.nav button.nav-demo { margin-top: var(--s2); color: #FCE5AE; border: 1px solid rgba(242,177,52,.45); background: linear-gradient(135deg, rgba(242,177,52,.16), rgba(242,177,52,.04)); }
.nav button.nav-demo:hover { background: linear-gradient(135deg, rgba(242,177,52,.28), rgba(242,177,52,.08)); color: #fff; }
.nav button.nav-demo[aria-current="page"] { background: var(--ahorro); color: var(--on-ahorro); border-color: var(--ahorro); }
.nav button.nav-demo[aria-current="page"]::before { display: none; }
.nav-demo .tagmini { margin-left: auto; font: 600 10.5px/1 var(--f-sans); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid rgba(255,255,255,.09); }
.side-tag { margin: 0 12px; font: 600 13px/1.3 var(--f-display); color: #fff; }
.side-tag span { display: block; font: 400 12px/1.4 var(--f-sans); color: rgba(233,246,244,.55); margin-top: 2px; }
.who { display: flex; flex-direction: column; gap: var(--s2); padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.who .name { font-weight: 600; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.who .name span { display: block; font-weight: 400; font-size: 12px; color: rgba(233,246,244,.6); }
.who .row { gap: var(--s2); flex-wrap: nowrap; }
.who button, .who .langsel { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff; box-shadow: none; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.who button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.who .langsel { flex: 1; min-width: 0; } .who .langsel option { color: #10272B; background: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.pagebar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: 26px 32px 0; max-width: 1360px; width: 100%; margin: 0 auto; }
.bar-title { font-size: 27px; letter-spacing: -0.025em; }
.bar-sub { color: var(--ink-muted); margin: 4px 0 0; max-width: 72ch; }
.bar-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.sync-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-200); border: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }
main.page { max-width: 1360px; width: 100%; margin: 0 auto; padding: 22px 32px 72px; }
.stop-banner { background: var(--critical); color: #fff; text-align: center; padding: var(--s2) var(--s4); font-weight: 600; }
.panel .stop-banner, main.page .stop-banner { border-radius: var(--r-md); text-align: left; margin-bottom: var(--s3); }
@media (prefers-color-scheme: dark) { .stop-banner { color: #2a0b08; } }

/* Mensajes: aviso flotante abajo */
.msg { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(720px, calc(100vw - 32px)); margin: 0; padding: 12px 18px; border-radius: 12px; background: #0E2426; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); }
.msg:empty { display: none; }
.msg textarea { color: #10272B; }
.login .err { position: static; transform: none; background: none; box-shadow: none; padding: 0; }

/* ---------- botones y campos ---------- */
button, .btn { font: inherit; font-weight: 550; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-200); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s; }
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--ink-muted) 60%, var(--line)); box-shadow: 0 2px 8px -3px rgba(5,47,47,.25); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-gold { background: var(--ahorro); border-color: var(--ahorro); color: var(--on-ahorro); }
.btn-gold:hover { border-color: #D99A1B; background: #F5BC4C; }
.btn-danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, var(--line)); }
.btn-danger:hover { border-color: var(--critical); }
.btn-ghost { background: none; border-color: transparent; color: var(--brand); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { background: var(--brand-tint); box-shadow: none; border-color: transparent; }
.btn-lg { padding: 12px 22px; font-size: 16px; border-radius: 12px; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-200); color: var(--ink); max-width: 100%; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink-muted) 60%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--brand); flex: none; }
input[type="file"] { padding: 6px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-muted); font-weight: 550; }
label.f input, label.f select, label.f textarea { color: var(--ink); font-weight: 400; font-size: 15px; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); }
textarea.num { width: 100%; font-family: var(--f-mono); font-size: 13px; }
.langsel { width: auto; padding: 6px 8px; font-size: 14px; cursor: pointer; }

/* ---------- paneles ---------- */
.panel { background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: var(--s4); box-shadow: var(--shadow); }
.panel > h2 { margin-bottom: var(--s2); }
.panel.danger { box-shadow: var(--shadow), inset 4px 0 0 var(--critical); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.empty { text-align: center; padding: 36px 24px; color: var(--ink-muted); border: 1.5px dashed var(--line); border-radius: var(--r-md); background: var(--surface-300); }
.empty h3 { color: var(--ink); margin-bottom: var(--s1); }
.empty .btn-primary { margin-top: var(--s3); }
.detail.empty { border-style: dashed; box-shadow: none; }
details.help, details.manual { color: var(--ink-muted); }
details > summary { cursor: pointer; }
details.manual > summary { font-weight: 600; font-size: 15px; padding: 4px 0; color: var(--ink); }
details.manual[open] > summary { margin-bottom: var(--s3); }
.note { color: var(--ink-muted); font-size: 13px; max-width: 70ch; }
.page-head { margin: 0 0 var(--s4); } .page-head h1 { font-size: 22px; }

/* ---------- cifras ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; box-shadow: var(--shadow); }
.kpi-l { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; letter-spacing: .01em; }
.kpi-v { font-size: 26px; font-weight: 600; line-height: 1.25; margin-top: 4px; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.kpi--ahorro { background: linear-gradient(135deg, #FBD68A 0%, var(--ahorro) 70%); border-color: transparent; color: var(--on-ahorro); }
.kpi--ahorro .kpi-l { color: var(--on-ahorro); opacity: .8; }
.chip-ahorro { display: inline-block; background: var(--ahorro); color: var(--on-ahorro); border-radius: var(--r-pill); padding: 2px 10px; font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-mejora { display: inline-block; background: color-mix(in srgb, var(--good) 13%, var(--surface-200)); color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); border-radius: var(--r-pill); padding: 1px 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ---------- estados ---------- */
.pill { --c: var(--ink-muted); display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--surface-200)); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); white-space: nowrap; }
.pill.p-brand { --c: var(--brand); } .pill.p-good { --c: var(--good); } .pill.p-warn { --c: var(--warning); } .pill.p-bad { --c: var(--critical); }
.pill.p-gold { color: var(--on-ahorro); background: var(--ahorro); border-color: transparent; }
.ok { color: var(--good); font-weight: 700; } .ko { color: var(--critical); font-weight: 700; } .ko-text { color: var(--critical); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-muted); flex: none; opacity: .5; }
.dot.good { background: var(--good); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); } .dot.warn { background: var(--ahorro); opacity: 1; } .dot.bad { background: var(--critical); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 20%, transparent); }

/* ---------- tablas ---------- */
.w { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th.r, td.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
table.sel { min-width: 560px; }
table.sel td:first-child { min-width: 170px; }
td .altp { color: var(--brand); font-weight: 600; font-size: 13.5px; }
table.sel tbody tr { cursor: pointer; transition: background-color .12s; }
table.sel tbody tr:hover td { background: var(--surface-300); }
table.sel tbody tr[aria-selected="true"] td { background: var(--brand-tint); }
table.sel tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
td .ref { font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; color: var(--ink-muted); }
td.num { white-space: nowrap; }
td .sub { display: block; font-size: 12.5px; color: var(--ink-muted); }
td .hn { font-weight: 600; }
.strike { text-decoration: line-through; color: var(--ink-muted); }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.search { flex: 1; min-width: 170px; }
.panel-head .toolbar { flex-basis: 100%; flex-wrap: nowrap; }
table.sel th, table.sel td { padding-left: 8px; padding-right: 8px; }

/* ---------- reservas: lista + detalle ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
@media (min-width: 1180px) { .split { grid-template-columns: minmax(0, 1fr) 470px; } .detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; } }
.detail.panel { box-shadow: var(--shadow-lg); }
.detail .meta { color: var(--ink-muted); font-size: 13px; margin: var(--s1) 0 var(--s3); }
.detail .verdict { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s3); }
.saving { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s3) 0; background: var(--ahorro-soft); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.saving .label { color: var(--ink-muted); font-size: 13px; font-weight: 600; }
.saving .chip-ahorro { font-size: 20px; padding: 3px 12px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.checks { margin: var(--s2) 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.checks td, .checks th { padding: 8px 10px; font-size: 13.5px; }
.checks td:last-child { width: 34px; text-align: center; }
.checks tr.bad td { background: color-mix(in srgb, var(--critical) 7%, transparent); }
/* comparación original / alternativa */
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); align-items: stretch; margin: var(--s3) 0 0; }
.cmp-col { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface-300); min-width: 0; }
.cmp-col.alt { background: var(--surface-200); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 3px var(--brand-tint); }
.cmp-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.cmp-col.alt .cmp-h { color: var(--brand); }
.cmp-price { font: 600 24px/1.2 var(--f-mono); letter-spacing: -0.03em; margin: 6px 0 2px; overflow-wrap: anywhere; }
.cmp-col.orig .cmp-price { color: var(--ink-muted); }
.cmp-sup { font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.cmp-rows { margin: 0; display: grid; font-size: 13px; }
.cmp-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; } .cmp-rows div:nth-child(n+4) { grid-column: 1 / -1; } .cmp-rows dt { color: var(--ink-muted); font-size: 11.5px; } .cmp-rows dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.cmp-arrow { display: grid; place-items: center; color: var(--brand); font-size: 18px; }
.savebar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin: var(--s3) 0; padding: 14px 18px; border-radius: var(--r-md); background: linear-gradient(135deg, #FBD68A 0%, var(--ahorro) 75%); color: var(--on-ahorro); }
.savebar .l { font-weight: 650; font-size: 13px; } .savebar .l span { display: block; font-weight: 400; opacity: .8; }
.savebar .v { font: 650 28px/1 var(--f-mono); letter-spacing: -0.03em; }
.approve { margin-top: var(--s4); padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-300); }
.approve h3 { margin-bottom: 2px; } .approve .actions { margin-top: var(--s3); } .approve .actions .btn-lg { flex: 1; }
.sec-t { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin: var(--s4) 0 var(--s2); font-family: var(--f-sans); }

/* ---------- panel principal ---------- */
.heroband { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s6); align-items: center; padding: 28px 30px; margin-bottom: var(--s4); border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(90% 140% at 100% 0%, #11807C 0%, transparent 55%), linear-gradient(135deg, #052F2F 0%, #0A4A49 100%); box-shadow: var(--shadow-lg); }
.heroband::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 220px; height: 220px; border-radius: 40px; transform: rotate(18deg); background: rgba(242,177,52,.13); pointer-events: none; }
.heroband .k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #F8D58A; }
.heroband .big { font: 650 clamp(34px, 4.6vw, 52px)/1.05 var(--f-mono); letter-spacing: -0.04em; margin: 8px 0 6px; overflow-wrap: anywhere; }
.heroband p { color: rgba(233,246,244,.8); margin: 0; max-width: 46ch; }
.heroband .actions { margin-top: var(--s4); }
.heroband .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); } .heroband .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-side { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.hstat { padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(4px); }
.hstat .l { font-size: 12.5px; color: rgba(233,246,244,.7); } .hstat .v { font: 600 22px/1.2 var(--f-mono); letter-spacing: -0.03em; margin-top: 2px; overflow-wrap: anywhere; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: var(--s4); background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.stage { padding: 16px 18px; border-left: 1px solid var(--line); position: relative; }
.stage:first-child { border-left: 0; }
.stage:not(:first-child)::before { content: "›"; position: absolute; left: -9px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-200); border: 1px solid var(--line); color: var(--ink-muted); font-size: 12px; line-height: 1; z-index: 1; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: color-mix(in srgb, var(--brand) 25%, transparent); }
.stage-potential::after { background: color-mix(in srgb, var(--ink-muted) 35%, transparent); }
.stage-verified::after { background: color-mix(in srgb, var(--brand) 45%, transparent); }
.stage-approved::after { background: color-mix(in srgb, var(--brand) 70%, transparent); }
.stage-executed::after { background: var(--brand); } .stage-achieved::after { background: var(--ahorro); }
.stage-n { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-muted); }
.stage-t { font-weight: 650; margin: 2px 0 var(--s2); }
.stage-v { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; overflow-wrap: anywhere; }
.stage-c { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.stage-d { font-size: 12.5px; color: var(--ink-muted); margin-top: var(--s2); line-height: 1.4; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid2 > .panel { margin-bottom: var(--s4); }
.dlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.ditem { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; background: var(--surface-200); }
.ditem:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.ditem .hn { font-weight: 600; } .ditem .sub { font-size: 12.5px; color: var(--ink-muted); }
.tierbar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-300); margin: var(--s3) 0; gap: 2px; }
.tb-high { background: var(--critical); } .tb-medium { background: var(--ahorro); } .tb-low { background: var(--brand); } .tb-not_eligible { background: var(--ink-muted); opacity: .4; }
.dot.tb-high, .dot.tb-medium, .dot.tb-low { opacity: 1; }
.legend, .health { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.legend li, .health li { display: flex; align-items: center; gap: var(--s2); }
.legend li span.num { margin-left: auto; }
.health li { padding: 8px 0; border-bottom: 1px solid var(--line); } .health li:last-child { border-bottom: 0; }
.health .hl { flex: 1; min-width: 0; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; font-weight: 550; }

/* ---------- informe ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); margin-bottom: var(--s4); }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.hero-money { background: linear-gradient(145deg, #FBD68A 0%, var(--ahorro) 60%, #E5A01E 100%); color: var(--on-ahorro); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s8); display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6); min-height: 220px; }
.hero-money .l { font-weight: 650; } .hero-money .v { font-size: clamp(36px, 6vw, 56px); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; } .hero-money .s { font-size: 13px; opacity: .85; max-width: 34ch; }
.steps { display: flex; align-items: flex-end; gap: var(--s4); height: 300px; padding: var(--s4) 0 0; }
.step { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s1); text-align: left; }
.step .n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 500; }
.step .bar { display: block; background: linear-gradient(180deg, #11837F, var(--brand)); border-radius: var(--r-sm) var(--r-sm) 0 0; min-height: 6px; transform-origin: bottom; }
.step.last .bar { background: var(--ahorro); }
.step .t { font-size: 12px; color: var(--ink-muted); line-height: 1.25; min-height: 30px; }
@media (prefers-reduced-motion: no-preference) { .step .bar { animation: sube .6s cubic-bezier(.2, .7, .2, 1) both; } .step:nth-child(2) .bar { animation-delay: .06s; } .step:nth-child(3) .bar { animation-delay: .12s; } .step:nth-child(4) .bar { animation-delay: .18s; } .step:nth-child(5) .bar { animation-delay: .24s; } }
@keyframes sube { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.reasons li:last-child { border-bottom: 0; }

/* ---------- ajustes ---------- */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); margin: var(--s3) 0; }
.danger { border-color: color-mix(in srgb, var(--critical) 40%, var(--line)); }
.secret { font-family: var(--f-mono); font-size: 17px; letter-spacing: .04em; word-break: break-all; user-select: all; background: var(--surface-300); border-radius: var(--r-md); padding: var(--s3); }
.steps-list { padding-left: 20px; margin: var(--s2) 0 var(--s3); } .steps-list li { margin-bottom: var(--s2); }
.setnav { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.set-sec { scroll-margin-top: 16px; }
.set-h { display: flex; align-items: center; gap: 10px; margin: var(--s6) 0 var(--s3); } .set-h:first-of-type { margin-top: 0; }
.set-h h2 { font-size: 20px; } .set-h .ico { color: var(--brand); width: 20px; height: 20px; }

/* ---------- acceso ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.login-brand { position: relative; background: radial-gradient(80% 90% at 100% 100%, #11807C 0%, transparent 60%), linear-gradient(150deg, #052F2F 0%, #0A4A49 100%); color: #fff; --on-brand: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s8); overflow: hidden; }
.login-brand h1 { font-size: clamp(32px, 4.4vw, 54px); max-width: 15ch; line-height: 1.05; letter-spacing: -0.03em; }
.login-brand p { font-size: 17px; max-width: 44ch; color: rgba(233,246,244,.85); margin: var(--s4) 0 0; }
.login-brand .logo { height: 30px; align-self: flex-start; }
.login-points { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: 10px; color: rgba(233,246,244,.9); }
.login-points li { display: flex; gap: 10px; align-items: baseline; } .login-points li::before { content: "✓"; color: var(--ahorro); font-weight: 700; }
.cascade { display: flex; align-items: flex-start; gap: var(--s3); height: 130px; }
.cascade i { display: block; width: 44px; background: rgba(255,255,255,.9); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.cascade i:last-child { background: var(--ahorro); width: 44px; height: 44px; border-radius: var(--r-sm); }
@media (prefers-reduced-motion: no-preference) { .cascade i { animation: baja2 .7s cubic-bezier(.2, .7, .2, 1) both; transform-origin: top; } .cascade i:nth-child(2) { animation-delay: .08s; } .cascade i:nth-child(3) { animation-delay: .16s; } .cascade i:nth-child(4) { animation-delay: .24s; } .cascade i:nth-child(5) { animation-delay: .32s; } }
@keyframes baja2 { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.login-form { position: relative; display: flex; align-items: center; justify-content: center; padding: var(--s8) var(--s4); background: var(--surface-100); }
.login-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--s4); background: var(--surface-200); padding: 34px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-form .btn-primary { padding: 11px 14px; }
.login-form .err { min-height: 22px; color: var(--critical); font-weight: 500; margin: 0; }
.login-lang { position: absolute; top: var(--s4); right: var(--s4); }
.topbar { background: var(--deep); color: #fff; } .topbar-in { max-width: 1280px; margin: auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.topbar .logo .lg-n { fill: #fff; } .topbar .logo .lg-b { fill: #6FE0D2; } .topbar .who { flex-direction: row; align-items: center; background: none; }

/* ---------- ejecución, mejoras, vouchers ---------- */
.execbox { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; background: var(--surface-200); }
.execbox.bad { border-color: var(--critical); } .execbox p { margin: 8px 0 0; font-size: 14px; }
.ex-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-step { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-muted); }
.ex-n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.ex-step.ok { color: var(--ink); } .ex-step.ok .ex-n { background: var(--good); border-color: var(--good); color: #fff; }
.ex-step.ko { color: var(--critical); } .ex-step.ko .ex-n { border-color: var(--critical); color: var(--critical); }
.benefits { border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 7%, var(--surface-200)); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: var(--s3) 0; }
.benefits ul { margin: 6px 0 0; padding-left: 20px; } .benefits li { margin: 2px 0; }
.vcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin: var(--s3) 0; background: var(--surface-200); }
.vcard-on { border-color: var(--brand); }
.vpick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.vnotes { margin: 8px 0; padding-left: 20px; font-size: 14px; } .vn-bad { color: var(--critical); } .vn-doubt { color: var(--warning); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); margin-top: 8px; }
.vf-bad input { border-color: var(--critical); } .vf-doubt input { border-color: var(--warning); }
.guestrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; } .guestrow b { grid-column: 1 / -1; }
.srcbox { margin-top: var(--s4); }

/* ---------- registro ---------- */
.chips, .cfilters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.chip { padding: 5px 12px; font-size: 13px; background: var(--surface-300); border-color: transparent; box-shadow: none; border-radius: var(--r-pill); }
.chip[aria-pressed="true"], .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip-n { margin-left: 6px; opacity: .7; font-size: 12px; font-variant-numeric: tabular-nums; }
.logday { margin-bottom: var(--s4); }
.logday-h { font-size: 14px; padding: var(--s2) 0; margin-bottom: var(--s1); border-bottom: 1px solid var(--line); }
.logday-h::first-letter { text-transform: uppercase; } .logday-h .small { font-weight: 400; }
.logl { list-style: none; margin: 0; padding: 0; }
.logi { display: grid; grid-template-columns: 48px 130px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.logi:last-child { border-bottom: 0; } .logi .pill { justify-self: start; } .logi-d { line-height: 1.45; }
.logi-d .ref { display: inline-block; background: var(--surface-300); border-radius: 6px; padding: 0 6px; margin-right: var(--s2); font-family: var(--f-mono); font-size: 12.5px; }

/* ---------- conexiones ---------- */
.conn-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s4); margin-bottom: var(--s4); }
.conn-cta { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4); padding: 24px 26px; border-radius: var(--r-lg); color: #fff; background: radial-gradient(90% 140% at 100% 0%, #11807C 0%, transparent 55%), linear-gradient(135deg, #052F2F 0%, #0A4A49 100%); box-shadow: var(--shadow-lg); }
.conn-cta h2 { font-size: 22px; } .conn-cta p { color: rgba(233,246,244,.8); margin: 6px 0 0; max-width: 52ch; }
.trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.trust li { display: flex; gap: 10px; align-items: flex-start; } .trust .ico { color: var(--brand); margin-top: 2px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--s4); }
.ccard { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: var(--s3); background: var(--surface-200); box-shadow: var(--shadow); }
.ccard.cs-error { border-color: color-mix(in srgb, var(--critical) 55%, var(--line)); } .ccard.cs-inactive { opacity: .8; }
.chead { display: flex; gap: var(--s3); align-items: center; } .chead h3 { margin: 0; font-size: 16px; } .cpills { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cmark { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font: 700 17px var(--f-display); background: linear-gradient(135deg, #11837F, #085553); color: #fff; }
.cmeta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-300); }
.cmeta dt { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; } .cmeta dd { margin: 0; font-size: 13.5px; font-weight: 550; }
.cerr { font-size: 13.5px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--critical) 8%, var(--surface-200)); border: 1px solid color-mix(in srgb, var(--critical) 30%, transparent); }
.cerr b { color: var(--critical); display: block; margin-bottom: 2px; } .cerr .raw { color: var(--ink-muted); font-size: 12.5px; margin-top: 6px; overflow-wrap: anywhere; }
.roles { display: grid; gap: 8px; }
.role { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); }
.role.on { border-style: solid; border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); } .role.na { opacity: .65; } .role .small { grid-column: 1 / -1; }
.rbadge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--ink-muted) 13%, transparent); color: var(--ink-muted); justify-self: start; }
.role.on .rbadge { background: var(--brand); color: var(--on-brand); }
.rtoggle { justify-self: end; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); }
.pcard { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-200); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pcard:hover, .pcard:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.pcard.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.pcard.req { background: var(--surface-300); } .pcard.req .cmark { background: var(--ink-muted); }
.pcard .pn { font: 650 15.5px var(--f-display); } .pcard .pd { font-size: 13px; color: var(--ink-muted); line-height: 1.4; flex: 1; }
.pcard .pf { display: flex; gap: 6px; flex-wrap: wrap; }
.onb > summary, .cat > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; list-style: none; }
.onb > summary::-webkit-details-marker, .cat > summary::-webkit-details-marker { display: none; }
.onb-t { font-family: var(--f-display); font-size: 18px; font-weight: 650; }
.checklist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s6); }
.checklist li { display: flex; align-items: center; gap: var(--s3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist li > span:nth-child(2) { flex: 1; }
.ck-i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--line); color: var(--ink-muted); flex: none; }
.ck-done .ck-i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.catalog { display: grid; gap: var(--s2); }
.cat { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); background: var(--surface-300); }
.cat[open] { background: var(--surface-200); box-shadow: var(--shadow); }
.cat-n { font-weight: 650; font-size: 15px; } .cat-b { display: flex; gap: var(--s1); flex-wrap: wrap; }
.cat-body { margin-top: var(--s3); display: grid; gap: var(--s3); max-width: 860px; }
.cat-body h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.cat-body ul, .cat-body ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* asistente de conexión */
.wz-back { position: fixed; inset: 0; z-index: 70; background: rgba(4,25,27,.62); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .2s both; }
.wz { width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface-200); border-radius: 22px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); overflow: hidden; animation: rise .28s cubic-bezier(.2,.8,.2,1) both; }
.wz-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 18px 26px; border-bottom: 1px solid var(--line); }
.wz-head h2 { font-size: 19px; } .wz-x { border: 0; background: none; box-shadow: none; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--ink-muted); }
.wz-steps { display: flex; gap: 6px; padding: 14px 26px; background: var(--surface-300); overflow-x: auto; scrollbar-width: none; }
.wz-st { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-muted); white-space: nowrap; padding-right: 12px; }
.wz-st i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--f-mono); border: 1.5px solid var(--line); background: var(--surface-200); }
.wz-st.on { color: var(--ink); } .wz-st.on i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.wz-st.done i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.wz-body { padding: 24px 26px; overflow-y: auto; display: grid; gap: var(--s4); align-content: start; min-height: 320px; }
.wz-body h3 { font-size: 21px; } .wz-body .lead { color: var(--ink-muted); margin: -8px 0 0; max-width: 68ch; }
.wz-foot { display: flex; justify-content: space-between; gap: var(--s3); padding: 16px 26px; border-top: 1px solid var(--line); background: var(--surface-200); }
.wz-foot .row { margin-left: auto; }
.howto { counter-reset: st; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.howto li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.howto li::before { content: counter(st); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); font: 650 13px var(--f-mono); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--brand-tint); font-size: 13.5px; } .callout .ico { color: var(--brand); margin-top: 2px; }
.callout.warn { background: var(--ahorro-soft); } .callout.warn .ico { color: var(--warning); }
.keyfield { position: relative; display: flex; } .keyfield input { flex: 1; padding-right: 64px; font-family: var(--f-mono); }
.keyfield button { position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; box-shadow: none; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; font-size: 14px; line-height: 1.5; }
.consent:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.optrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.optrow b { display: block; } .optrow span { font-size: 13px; color: var(--ink-muted); } .optrow.na { opacity: .6; cursor: default; }
.vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vi { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-muted); }
.vi .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); font-size: 13px; }
.vi.run { color: var(--ink); border-color: var(--brand); } .vi.run .st { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.vi.ok { color: var(--ink); } .vi.ok .st { background: var(--good); border-color: var(--good); color: #fff; }
.vi.ko { color: var(--ink); border-color: var(--critical); } .vi.ko .st { background: var(--critical); border-color: var(--critical); color: #fff; }
.vi small { display: block; color: var(--ink-muted); font-size: 12.5px; }
.result { text-align: center; padding: 12px 0; } .result .rico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: var(--good); box-shadow: 0 0 0 10px color-mix(in srgb, var(--good) 15%, transparent); animation: pop .4s cubic-bezier(.2,1.4,.4,1) both; }
.result.pend .rico { background: var(--ahorro); color: var(--on-ahorro); box-shadow: 0 0 0 10px var(--ahorro-soft); }
.result h3 { font-size: 23px; margin-bottom: 6px; } .result p { color: var(--ink-muted); max-width: 56ch; margin: 0 auto var(--s3); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- demo: portada, cinta y tour guiado ---------- */
.demo-ribbon { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: var(--s3); flex-wrap: wrap; padding: 7px 16px; background: repeating-linear-gradient(135deg, #F2B134 0 14px, #F5BC4C 14px 28px); color: var(--on-ahorro); font-size: 13px; font-weight: 600; }
.demo-ribbon b { letter-spacing: .1em; } .demo-ribbon button { padding: 3px 12px; font-size: 12.5px; border-radius: var(--r-pill); background: #10272B; color: #fff; border-color: #10272B; box-shadow: none; }
.demo-cover { position: relative; overflow: hidden; border-radius: 24px; padding: clamp(28px, 5vw, 60px); color: #fff; margin-bottom: var(--s4);
  background: radial-gradient(70% 90% at 100% 0%, #13908B 0%, transparent 60%), radial-gradient(60% 80% at 0% 100%, rgba(242,177,52,.22) 0%, transparent 60%), linear-gradient(135deg, #042526 0%, #0A4A49 100%); box-shadow: var(--shadow-lg); }
.demo-cover .k { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: var(--r-pill); background: rgba(242,177,52,.18); border: 1px solid rgba(242,177,52,.45); color: #FCE5AE; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.demo-cover h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; letter-spacing: -0.035em; max-width: 16ch; margin: 18px 0 14px; }
.demo-cover h1 em { font-style: normal; color: var(--ahorro); }
.demo-cover p { font-size: 18px; color: rgba(233,246,244,.85); max-width: 56ch; margin: 0; }
.demo-cover .actions { margin-top: 28px; align-items: center; } .demo-cover .hint { color: rgba(233,246,244,.6); font-size: 13px; }
.demo-cover .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); } .demo-cover .btn-ghost:hover { background: rgba(255,255,255,.12); }
.demo-cover .bars { position: absolute; right: 6%; bottom: 0; display: flex; align-items: flex-end; gap: 14px; height: 60%; pointer-events: none; opacity: .9; }
.demo-cover .bars i { width: 46px; border-radius: 10px 10px 0 0; background: rgba(255,255,255,.1); animation: sube .9s cubic-bezier(.2,.7,.2,1) both; transform-origin: bottom; }
.demo-cover .bars i:nth-child(2) { animation-delay: .1s; } .demo-cover .bars i:nth-child(3) { animation-delay: .2s; } .demo-cover .bars i:nth-child(4) { animation-delay: .3s; background: var(--ahorro); }
.chapters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.chap { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-200); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.chap:hover, .chap:focus-visible { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-lg); }
.chap .cn { font: 600 12px var(--f-mono); color: var(--brand); } .chap .ct { font: 650 16px var(--f-display); } .chap .cd { font-size: 13px; color: var(--ink-muted); line-height: 1.4; }
.tour-hole { position: fixed; z-index: 80; border-radius: 16px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(3,20,22,.74), 0 0 0 3px var(--ahorro), 0 0 40px 6px rgba(242,177,52,.35); transition: top .45s cubic-bezier(.3,.8,.2,1), left .45s cubic-bezier(.3,.8,.2,1), width .45s cubic-bezier(.3,.8,.2,1), height .45s cubic-bezier(.3,.8,.2,1), opacity .25s; }
.tour-hole.off { opacity: 0; }
.tour-tag { position: fixed; z-index: 82; pointer-events: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--ahorro); color: var(--on-ahorro); font: 700 12px/1.3 var(--f-sans); letter-spacing: .04em; box-shadow: 0 6px 18px -6px rgba(0,0,0,.5); transition: top .45s cubic-bezier(.3,.8,.2,1), left .45s cubic-bezier(.3,.8,.2,1), opacity .25s; animation: bob 1.6s ease-in-out infinite; }
.tour-tag.off { opacity: 0; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tour-dock { position: fixed; z-index: 84; left: 50%; transform: translateX(-50%); width: min(760px, calc(100vw - 28px)); border-radius: 20px; background: #06292A; color: #fff; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); padding: 18px 22px 16px; transition: top .35s ease, bottom .35s ease; }
.tour-dock.at-bottom { bottom: 22px; } .tour-dock.at-top { top: 22px; }
.tour-dock.at-left { left: calc(var(--side-w) + 30px); transform: none; width: min(560px, calc(100vw - var(--side-w) - 560px)); }
.tour-dock.center { top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 28px)); padding: 34px 34px 26px; text-align: center; }
.tour-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tour-kicker { font: 700 11.5px var(--f-sans); letter-spacing: .1em; text-transform: uppercase; color: #F8D58A; }
.tour-count { margin-left: auto; font: 600 12.5px var(--f-mono); color: rgba(233,246,244,.6); }
.tour-x { all: unset; cursor: pointer; padding: 2px 8px; border-radius: 8px; color: rgba(233,246,244,.7); font-size: 13px; } .tour-x:hover { background: rgba(255,255,255,.1); color: #fff; }
.tour-dock h2 { font-size: 23px; letter-spacing: -0.02em; margin-bottom: 6px; }
.tour-dock.center h2 { font-size: 32px; margin: 10px 0 10px; }
.tour-dock p { color: rgba(233,246,244,.86); margin: 0; font-size: 15.5px; line-height: 1.5; }
.tour-pts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tour-pts li { padding: 4px 11px; border-radius: var(--r-pill); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: rgba(233,246,244,.9); }
.tour-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.tour-dock.center .tour-foot { justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.tour-prog { flex: 1; display: flex; gap: 5px; } .tour-prog i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.15); cursor: pointer; transition: background-color .3s; } .tour-prog i.done { background: rgba(242,177,52,.55); } .tour-prog i.on { background: var(--ahorro); }
.tour-dock button.tb { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
.tour-dock button.tb:hover { background: rgba(255,255,255,.16); } .tour-dock button.tb:disabled { opacity: .35; }
.tour-keys { font-size: 12px; color: rgba(233,246,244,.45); margin-top: 8px; text-align: right; }
body.touring .msg { display: none; }

/* ---------- pantallas pequeñas ---------- */
@media (max-width: 1100px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stage { border-left: 0; border-top: 1px solid var(--line); } .stage:not(:first-child)::before { display: none; } .grid2, .checklist, .conn-top, .heroband { grid-template-columns: 1fr; } .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: var(--s2); }
  .side-logo { padding: 0 6px; } .side-label, .side-tag { display: none; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; width: 100%; order: 3; }
  .nav button { width: auto; white-space: nowrap; } .nav button[aria-current="page"]::before { display: none; } .nav button.nav-demo { margin-top: 0; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; } .who { flex-direction: row; align-items: center; padding: 4px 6px; } .who .name { display: none; }
  .pagebar { padding: 18px 16px 0; } .bar-title { font-size: 23px; } main.page { padding: 16px 16px 64px; }
  .panel { padding: 16px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-v { font-size: 21px; }
  .cmp { grid-template-columns: 1fr; gap: 8px; } .cmp-arrow { transform: rotate(90deg); } .cgrid { grid-template-columns: 1fr; }
  .logi { grid-template-columns: 44px minmax(0, 1fr); } .logi-d { grid-column: 1 / -1; } .steps { height: 240px; gap: var(--s2); }
  .wz-body, .wz-head, .wz-foot, .wz-steps { padding-left: 16px; padding-right: 16px; } .demo-cover .bars { display: none; } .chapters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Menú por áreas: pestañas de cada área (CRM, Clientes, Dinero, Mercado, Sistema) sobre la pantalla */
.areabar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 16px 32px 0; max-width: 1360px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.areabar .area-name { font: 600 11px/1 var(--f-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-right: 8px; }
.areabar button { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 14px; border-radius: var(--r-pill); font: 600 13.5px/1.2 var(--f-sans); color: var(--ink-muted); border: 1px solid var(--line); background: var(--surface-200); transition: background-color .15s, color .15s, border-color .15s; }
.areabar button:hover { color: var(--ink); border-color: var(--brand); }
.areabar button[aria-current="page"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.areabar button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-areas button { font-size: 14.5px; padding: 9px 12px; }
@media (max-width: 860px) { .areabar { padding: 12px 16px 0; } .areabar .area-name { display: none; } }

.guestrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; } .guestrow b { grid-column: 1 / -1; }

/* Cadena de rebooks: el rebook, debajo de la original, con su localizador destacado */
.chain { margin-top: 16px; }
.chain h3 { margin: 0 0 4px; }
.chain-t td { vertical-align: top; }
.chain-t tr.chain-replaced td, .chain-t tr.chain-cancelled td { opacity: .62; }
.chain-t tr.chain-replaced .loc-new, .chain-t tr.chain-cancelled b { text-decoration: line-through; }
.chain-t tr.chain-pending_cancel td { background: color-mix(in srgb, var(--bad, #c0392b) 8%, transparent); }
.loc-new { color: var(--bad, #c0392b); }
