/* ===== Identidad visual: cambia estos valores para ajustar colores/tipografía de marca ===== */
:root {
  --brand: #0b5fff;          /* color principal */
  --brand-dark: #0847bd;
  --brand-soft: #e8f0ff;
  --ink: #14181f;
  --muted: #5b6573;
  --line: #dfe4ec;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #0a7d3c; --ok-bg: #e3f6ea;
  --warn: #8a5a00; --warn-bg: #fff1d6;
  --bad: #b3261e; --bad-bg: #fde8e6;
  --info: #0b5fff; --info-bg: #e8f0ff;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid #ffb703; outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }

.topbar { background: var(--ink); color: #fff; }
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: .2px; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: inline-grid; place-items: center; font-size: .8rem; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topbar nav a, .topbar nav button { color: #dbe3f0; text-decoration: none; padding: 8px 12px; border-radius: 8px; background: none; border: 0; font: inherit; cursor: pointer; }
.topbar nav a:hover, .topbar nav a.active, .topbar nav button:hover { background: rgba(255,255,255,.12); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; min-height: 44px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .95rem; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; min-height: 44px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #b9c2d0; border-radius: 10px; }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 20px; min-height: 20px; height: 20px; margin: 0 8px 0 0; vertical-align: middle; }
label.check { font-weight: 400; display: flex; align-items: flex-start; gap: 4px; }
[aria-invalid=true] { border-color: var(--bad); background: #fff8f7; }
.err { color: var(--bad); font-size: .875rem; margin: 4px 0 0; }
.hint { color: var(--muted); display: block; margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: #eceff3; color: var(--muted); }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); color: #5c3b00; border: 1px solid #f1d39a; margin-bottom: 16px; }
.notice.ok { background: var(--ok-bg); color: #064d25; border-color: #a9dcb9; }

.state { text-align: center; padding: 32px 16px; color: var(--muted); }
.state.error { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius); }
.spinner { display: inline-block; width: 18px; height: 18px; margin-right: 8px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price .total { font-size: 1.8rem; font-weight: 800; }
.price .old { text-decoration: line-through; color: var(--muted); }
.price .off { background: var(--ok-bg); color: var(--ok); font-weight: 700; border-radius: 6px; padding: 1px 8px; font-size: .85rem; }

table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th { text-align: left; background: #eef1f6; padding: 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.t td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f7f9fc; }
.tablewrap { overflow-x: auto; }
/* En teléfonos las tablas se convierten en tarjetas */
@media (max-width: 720px) {
  table.t.stackable thead { display: none; }
  table.t.stackable, table.t.stackable tbody, table.t.stackable tr, table.t.stackable td { display: block; width: 100%; }
  table.t.stackable tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; padding: 6px 0; }
  table.t.stackable td { border: 0; padding: 4px 12px; }
  table.t.stackable td::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; color: var(--muted); }
}

.kpi { text-align: center; } .kpi .n { font-size: 2rem; font-weight: 800; } .kpi .l { color: var(--muted); font-size: .9rem; }
.meter { height: 10px; background: #e6eaf0; border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); }
.meter.excellent > i { background: #0a7d3c; } .meter.good > i { background: #4aa564; } .meter.risk > i { background: #e3a008; } .meter.critical > i { background: #c62828; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button[aria-selected=true] { color: var(--brand); border-color: var(--brand); }

.modal-wrap { position: fixed; inset: 0; background: rgba(10,15,25,.55); display: grid; place-items: center; padding: 12px; z-index: 50; overflow: auto; }
.modal { position: relative; background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; }
.modal .x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--muted); }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 10px; color: #fff; background: #1f6f3d; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 8px 0 8px 16px; border-left: 3px solid var(--line); }
footer.site { color: var(--muted); font-size: .85rem; padding: 32px 0; text-align: center; }
main { padding: 24px 0 40px; }
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; margin-bottom: 12px; }
.filters .field { margin: 0; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; }
.legal { white-space: pre-wrap; }

dd { margin: 0 0 10px; }
