:root {
  color-scheme: light;
  --bg: #f5f6f9; --surface: #ffffff; --ink: #14213d; --muted: #5c6784; --line: #e2e6ee;
  --brand: #14284b; --brand-ink: #ffffff; --soft: #e9eff8; --focus: #2b6cd9;
  --ok: #23824f; --ok-soft: #e4f4ea; --warn: #94640f; --warn-soft: #fbf0d8; --bad: #b23a3a; --bad-soft: #fae8e8; --info: #2b5c8f;
  --r: 14px; --shadow: 0 1px 2px rgba(20,33,61,.05), 0 8px 24px rgba(20,33,61,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1321; --surface: #151d30; --ink: #eef1f7; --muted: #9aa6c0; --line: #25304a;
    --brand: #8fb5ec; --brand-ink: #0d1321; --soft: #1b2740; --focus: #7fb0ff;
    --ok: #5cc48a; --ok-soft: #14301f; --warn: #e6b455; --warn-soft: #33290f; --bad: #ee8585; --bad-soft: #381c1c; --info: #8fb5ec;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1321; --surface: #151d30; --ink: #eef1f7; --muted: #9aa6c0; --line: #25304a;
  --brand: #8fb5ec; --brand-ink: #0d1321; --soft: #1b2740; --focus: #7fb0ff;
  --ok: #5cc48a; --ok-soft: #14301f; --warn: #e6b455; --warn-soft: #33290f; --bad: #ee8585; --bad-soft: #381c1c; --info: #8fb5ec;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estructura ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 80px; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; color: var(--brand); }
nav.main { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
nav.main a { padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
nav.main a:hover { background: var(--soft); color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
.spacer { flex: 1; }
.demo-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px 0 22px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.crumb { color: var(--muted); font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.crumb:hover { color: var(--ink); }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 42px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--soft); color: var(--info); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.mut { background: var(--line); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.kpi { padding: 18px 20px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .n { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.kpi .d { font-size: 12.5px; margin-top: 2px; color: var(--muted); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }

/* ---------- Lista de clientes ---------- */
.list .head, .list .row { display: grid; grid-template-columns: 2.2fr 1.4fr 1fr 1fr 1.1fr 28px; gap: 14px; align-items: center; padding: 14px 20px; }
.list .head { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; border-bottom: 1px solid var(--line); }
.list a.row { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.list a.row:last-child { border-bottom: 0; }
.list a.row:hover { background: var(--soft); }
.list .who b { display: block; }
.list .go { color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); color: var(--info); display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.who span { min-width: 0; }

/* ---------- Formulario guiado ---------- */
.wiz { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stepper { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.stepper li { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.stepper ol { display: contents; margin: 0; padding: 0; }
.stepper .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.stepper li[aria-current="step"] { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.stepper li[aria-current="step"] .num { background: rgba(255,255,255,.22); color: inherit; }
.stepper li.done .num { background: var(--ok); color: #fff; }
.why { background: var(--soft); border-radius: 12px; padding: 14px 16px; margin: 0 0 20px; font-size: 14px; }
.why b { display: block; margin-bottom: 2px; }
.field { margin-bottom: 18px; }
.field > label, .lbl { display: block; font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.err { color: var(--bad); font-size: 13px; margin-top: 5px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
input.bad, textarea.bad { border-color: var(--bad); }
textarea { min-height: 88px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.person { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: var(--bg); }
.person .top { display: grid; grid-template-columns: 1fr 200px auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; min-height: 22px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.plan { border: 2px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); cursor: pointer; text-align: left; display: block; width: 100%; }
.plan:hover { border-color: var(--muted); }
.plan[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.plan .nm { font-weight: 700; font-size: 16px; }
.plan .pr { font-size: 24px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.02em; }
.plan ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.side { position: sticky; top: 84px; }
.side h3 { margin-bottom: 12px; }
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.meter.over i { background: var(--bad); }
.checks { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; }
.checks li { display: flex; gap: 8px; padding: 4px 0; color: var(--muted); }
.checks li.ok { color: var(--ink); }
.checks .mk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px; display: grid; place-items: center; font-size: 11px; line-height: 1; }
.checks li.ok .mk { background: var(--ok); border-color: var(--ok); color: #fff; }
.pay-box { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; background: var(--bg); }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; }
.sum dt { color: var(--muted); font-size: 13px; margin-top: 12px; }
.sum dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- Detalle de cliente ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 650; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.t tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inst h3 { margin: 22px 0 6px; }
.inst ul { margin: 6px 0; padding-left: 20px; }
.inst li { margin: 4px 0; }

/* ---------- Informe (vista del cliente) ---------- */
.rep-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.rep-bar .in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero { background: var(--brand); color: var(--brand-ink); border-radius: 20px; padding: 32px; margin: 24px 0 18px; }
:root[data-theme="dark"] .hero, :root:not([data-theme="light"]) .hero { }
.hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; font-weight: 650; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); margin: 10px 0 6px; }
.hero .meta { opacity: .85; font-size: 14px; }
.sema { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; margin-top: 16px; background: rgba(255,255,255,.16); }
.sema i { width: 12px; height: 12px; border-radius: 50%; background: #f2b632; display: inline-block; }
.sema.rojo i { background: #e25b5b; } .sema.verde i { background: #4cc07d; }
.jugada { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.12); }
.jugada small { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: 11.5px; opacity: .8; font-weight: 650; }
.jugada b { font-size: 18px; }
.rep { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.toc a:hover, .toc a.on { background: var(--soft); color: var(--ink); }
.sec { margin-bottom: 40px; scroll-margin-top: 80px; }
.sec > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.sec > header .n { color: var(--info); font-weight: 700; }
.sec > .lead { color: var(--muted); margin-bottom: 16px; max-width: 70ch; }
.bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line); }
.bar i { display: block; height: 100%; }
.c-pos { background: var(--ok); } .c-neu { background: #9aa4b8; } .c-neg { background: var(--bad); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend b { color: var(--ink); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.tema { display: grid; grid-template-columns: 170px 1fr 56px; gap: 12px; align-items: center; padding: 8px 0; }
.spark { width: 100%; height: 64px; }
.fact { padding: 18px; }
.fact .red { margin-bottom: 8px; }
blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.means { background: var(--soft); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-top: 10px; }
.means b { color: var(--info); }
.gal { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.thumb { aspect-ratio: 4 / 3; border-radius: 12px 12px 0 0; background: linear-gradient(135deg, var(--soft), color-mix(in srgb, var(--info) 22%, var(--soft))); display: grid; place-items: center; color: var(--info); position: relative; }
.thumb svg { width: 34px; height: 34px; opacity: .7; }
.thumb .net { position: absolute; top: 10px; left: 10px; }
.gal .cap { padding: 12px 14px; font-size: 13.5px; }
.jug { padding: 20px; }
.jug .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.jug dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 14px; }
.jug dt { color: var(--muted); }
.jug dd { margin: 0; }
.banner { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: var(--brand); color: var(--brand-ink); padding: 11px 18px; border-radius: 12px; font-weight: 650; box-shadow: var(--shadow); z-index: 50; max-width: 92vw; }
.foot { color: var(--muted); font-size: 13px; padding: 30px 0; }

body[data-modo="informe"] nav.main, body[data-modo="informe"] .demo-pill { display: none; }

@media (max-width: 900px) {
  .wiz { grid-template-columns: 1fr; }
  .side { position: static; }
  .rep { grid-template-columns: 1fr; }
  .toc { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .toc a { white-space: nowrap; }
}
@media (max-width: 720px) {
  .list .head { display: none; }
  .list .row { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .list .row .who { grid-column: 1 / -1; }
  .list .go { display: none; }
  .row2, .two { grid-template-columns: 1fr; }
  .person .top { grid-template-columns: 1fr; }
  .tema { grid-template-columns: 1fr 56px; }
  .tema .bar { grid-column: 1 / -1; order: 3; }
  .jug dl { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .wrap { padding: 0 16px 80px; }
}
@media print {
  body { background: #fff; }
  .topbar, .rep-bar, .toc, .toast, .no-print { display: none !important; }
  .rep { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  .sec { break-inside: avoid-page; }
  .hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
