/* =====================================================================
   PREVINTEC · EVALUACIÓN PSICOSOCIAL · Design System
   Dark-first · glassmorphism · microinteracciones · accesible (AA)
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Paleta Previntec */
  --pv-indigo: #312e81;
  --pv-indigo-deep: #2d276d;
  --pv-amber: #e99915;
  --pv-green: #39b54a;
  --pv-mist: #f1f5f8;
  --pv-lavender: #cbcadc;

  --bg-0: #07061a;
  --bg-1: #0b0a22;
  --bg-2: #110f2c;
  --bg-3: #17143a;

  --surface: rgba(23, 20, 58, .74);
  --surface-2: rgba(30, 26, 72, .88);
  --surface-solid: #14112f;
  --border: rgba(203, 202, 220, .16);
  --border-strong: rgba(203, 202, 220, .3);

  --text: #f1f5f8;
  --text-soft: #c2bede;
  --text-mute: #8f8ab5;

  --accent: #e99915;
  --accent-2: #7c74d8;
  --accent-3: #9d95e0;
  --accent-glow: rgba(233, 153, 21, .35);
  --accent-ink: #1a1030;

  --ok: #39b54a;
  --warn: #e99915;
  --danger: #f97316;
  --critical: #ef4444;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-2: 0 24px 60px -24px rgba(0,0,0,.85);
  --shadow-glow: 0 0 0 1px rgba(34,211,238,.22), 0 18px 50px -22px rgba(34,211,238,.35);

  --sidebar-w: 268px;
  --topbar-h: 68px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Outfit", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .32s;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f1f5f8;
  --bg-1: #e8edf4;
  --bg-2: #ffffff;
  --bg-3: #ffffff;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(255, 255, 255, .97);
  --surface-solid: #ffffff;
  --border: rgba(49, 46, 129, .12);
  --border-strong: rgba(49, 46, 129, .22);
  --text: #14112f;
  --text-soft: #3d3865;
  --text-mute: #6b6690;
  --accent: #312e81;
  --accent-2: #e99915;
  --accent-3: #7c74d8;
  --accent-glow: rgba(49, 46, 129, .2);
  --accent-ink: #ffffff;
  --shadow-1: 0 1px 2px rgba(20,17,47,.06), 0 8px 24px -14px rgba(20,17,47,.2);
  --shadow-2: 0 24px 60px -30px rgba(20,17,47,.3);
  --shadow-glow: 0 0 0 1px rgba(49,46,129,.18), 0 18px 50px -26px rgba(49,46,129,.3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fondo ambiental */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(34, 211, 238, .16), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(900px 600px at 50% 110%, rgba(168, 85, 247, .10), transparent 65%),
    var(--bg-0);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .35;
  background-image:
    linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(8, 145, 178, .12), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(79, 70, 229, .10), transparent 62%),
    var(--bg-0);
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem); }
h3 { font-size: 1.08rem; }
h4 { font-size: .96rem; }

::selection { background: var(--accent-glow); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Utilidades ---------- */
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 24px; }
.container-wide { max-width: 1480px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.muted { color: var(--text-mute); }
.soft { color: var(--text-soft); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.mono { font-family: var(--font-mono); font-size: .86em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 34px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.gap-1 { gap: 8px } .gap-2 { gap: 16px } .gap-3 { gap: 24px }
.hide { display: none !important; }

/* ---------- Iconos (stroke) ---------- */
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 26px; height: 26px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: transparent; position: relative; overflow: hidden; flex: none;
}
.brand-mark img { width: 40px; height: 40px; border-radius: 12px; display: block; object-fit: contain; }
.brand-mark svg { width: 21px; height: 21px; stroke-width: 2.2; }

/* Logotipo Previntec: variante según el fondo del tema */
.brand-logo { height: 26px; width: auto; display: block; }
.brand-logo-lg { height: 38px; width: auto; display: block; }
.logo-for-dark-bg  { display: block; }
.logo-for-light-bg { display: none; }
[data-theme="light"] .logo-for-dark-bg  { display: none; }
[data-theme="light"] .logo-for-light-bg { display: block; }

/* Marca en encabezados de documentos e informes */
.doc-brand { display: flex; align-items: center; gap: 14px; }
.doc-brand img { height: 44px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.02rem; }
.brand-text span { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-mute); font-weight: 600; }

/* ---------- Glass ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-1);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
}
[data-theme="light"] .card { background: var(--surface-solid); }

.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-title { font-family: var(--font-display); font-size: 1rem; font-weight: 640; letter-spacing: -.01em; }
.card-sub { font-size: .8rem; color: var(--text-mute); margin-top: 3px; }
.card-pad-0 { padding: 0; overflow: hidden; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .88rem; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .24s var(--ease), background .24s var(--ease), border-color .24s var(--ease);
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--text); }
.btn:active { transform: translateY(0) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent; font-weight: 700;
  box-shadow: 0 10px 30px -14px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 16px 40px -14px var(--accent-glow); color: var(--accent-ink); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-100%); transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(100%); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-soft); }
.btn-ghost:hover { background: rgba(148,163,184,.08); color: var(--text); }
.btn-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.2); color: #fecaca; border-color: var(--critical); }
.btn-sm { padding: 7px 13px; font-size: .8rem; border-radius: 10px; }
.btn-xs { padding: 5px 10px; font-size: .74rem; border-radius: 8px; gap: 6px; }
.btn-lg { padding: 14px 26px; font-size: .96rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; border-radius: 10px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; letter-spacing: .02em;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-ok { color: var(--ok); }
.badge-warn { color: var(--warn); }
.badge-danger { color: var(--danger); }
.badge-critical { color: var(--critical); }
.badge-muted { color: var(--text-mute); }
.badge-info { color: var(--accent); }
.badge-neutral { color: var(--text-soft); border-color: var(--border-strong); background: rgba(148,163,184,.08); }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px; font-size: .78rem;
  background: rgba(148,163,184,.08); border: 1px solid var(--border); color: var(--text-soft);
}

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.label { font-size: .78rem; font-weight: 620; letter-spacing: .01em; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--critical); }
.hint { font-size: .74rem; color: var(--text-mute); line-height: 1.45; }

.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  background: rgba(5, 10, 20, .5); border: 1px solid var(--border-strong);
  color: var(--text); font-size: .9rem; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  min-height: 44px;
}
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea { background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--text-mute); opacity: .8; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(5, 10, 20, .7);
}
[data-theme="light"] .input:focus, [data-theme="light"] .select:focus, [data-theme="light"] .textarea:focus { background: #fff; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8aa5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; }

/* Checkbox / switch */
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .88rem; }
.check input[type="checkbox"], .check input[type="radio"] {
  appearance: none; width: 19px; height: 19px; flex: 0 0 auto; margin-top: 2px;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: rgba(5,10,20,.5);
  cursor: pointer; position: relative; transition: all .2s var(--ease);
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.check input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5.5px; top: 1.5px; width: 5px; height: 10px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input[type="radio"]:checked::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent-ink);
}
.check span { color: var(--text-soft); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 44px; height: 25px; border-radius: 999px; background: rgba(148,163,184,.22);
  border: 1px solid var(--border-strong); position: relative; transition: background .25s var(--ease);
  flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--text-mute); transition: transform .25s var(--ease), background .25s var(--ease);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Alertas / flashes ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: 13px; border: 1px solid; font-size: .87rem; line-height: 1.5;
  animation: slideDown .35s var(--ease);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.alert-ok { background: rgba(34,197,94,.09); border-color: rgba(34,197,94,.32); color: #86efac; }
.alert-warn { background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.32); color: #fcd34d; }
.alert-error { background: rgba(239,68,68,.09); border-color: rgba(239,68,68,.34); color: #fca5a5; }
.alert-info { background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.3); color: #a5f3fc; }
[data-theme="light"] .alert-ok { color: #15803d; }
[data-theme="light"] .alert-warn { color: #b45309; }
[data-theme="light"] .alert-error { color: #b91c1c; }
[data-theme="light"] .alert-info { color: #0e7490; }
.alert .ico { margin-top: 1px; }

/* ---------- Layout con sidebar ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: fixed; inset-block: 0; left: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(12,19,34,.94), rgba(8,13,23,.97));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 20px 14px;
  transition: transform .34s var(--ease);
}
[data-theme="light"] .sidebar { background: rgba(255,255,255,.92); }

.sidebar-head { padding: 4px 8px 18px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.22); border-radius: 99px; }

.nav-group { margin-bottom: 18px; }
.nav-group-title {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--text-mute); font-weight: 700; padding: 0 12px 8px;
}
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 11px; color: var(--text-soft); font-size: .87rem; font-weight: 520;
  text-decoration: none; position: relative; margin-bottom: 2px;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-link:hover { background: rgba(148,163,184,.09); color: var(--text); transform: translateX(2px); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(34,211,238,.15), rgba(99,102,241,.07));
  color: var(--text); font-weight: 620;
}
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent-glow);
}
.nav-link .ico { width: 18px; height: 18px; opacity: .85; }
.nav-link .count {
  margin-left: auto; font-size: .7rem; font-weight: 700; padding: 1px 7px;
  border-radius: 999px; background: rgba(34,211,238,.16); color: var(--accent);
}

.sidebar-foot { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 12px;
  transition: background .2s var(--ease);
}
.user-chip:hover { background: rgba(148,163,184,.08); }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: .78rem; font-weight: 750;
  background: linear-gradient(135deg, rgba(34,211,238,.28), rgba(99,102,241,.28));
  border: 1px solid var(--border-strong); color: var(--text); letter-spacing: .02em;
}
.user-chip .meta { min-width: 0; }
.user-chip b { display: block; font-size: .83rem; font-weight: 620; }
.user-chip span { display: block; font-size: .7rem; color: var(--text-mute); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  background: rgba(8,13,23,.72); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
}
[data-theme="light"] .topbar { background: rgba(255,255,255,.82); }

.page { padding: 28px 26px 60px; max-width: 1480px; width: 100%; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 5px; }
.page-head p { color: var(--text-mute); font-size: .89rem; max-width: 76ch; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-mute); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .45; }

.menu-toggle { display: none; }
.scrim { display: none; }

/* ---------- KPI tiles ---------- */
.kpi {
  position: relative; overflow: hidden; padding: 20px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(255,255,255,.05), rgba(255,255,255,0) 55%), var(--surface);
  backdrop-filter: blur(14px);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
[data-theme="light"] .kpi { background: var(--surface-solid); }
.kpi:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
  opacity: .8;
}
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 650;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 12px; }
.kpi-value { font-family: var(--font-display); font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem);
  font-weight: 700; line-height: 1; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 6px; }
.kpi-value small { font-size: .9rem; font-weight: 600; color: var(--text-mute); letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: .78rem; color: var(--text-mute); }
.trend-up { color: var(--ok); } .trend-down { color: var(--critical); }

.kpi-spark { position: absolute; right: 14px; top: 14px; width: 72px; height: 34px; opacity: .5; }

/* ---------- Progreso ---------- */
.progress { height: 8px; border-radius: 999px; background: rgba(148,163,184,.16); overflow: hidden; position: relative; }
.progress-bar {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1s var(--ease);
  position: relative;
}
.progress-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: flow 2.4s linear infinite;
}
@keyframes flow { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-sm { height: 5px; }
.progress-lg { height: 12px; }

/* Anillo de progreso */
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); position: relative; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .track { stroke: rgba(148,163,184,.16); }
.ring .fill {
  stroke: url(#ringGrad); stroke-dasharray: 0 999;
  transition: stroke-dasharray 1.1s var(--ease);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.ring .label {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em;
}
.ring .label b { font-size: 1.5rem; line-height: 1; }
.ring .label span { font-size: .65rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .1em; display: block; margin-top: 3px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 640px; }
table.data thead th {
  text-align: left; padding: 12px 16px; font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute);
  background: rgba(148,163,184,.05); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; backdrop-filter: blur(10px);
}
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid rgba(148,163,184,.07); vertical-align: middle; }
table.data tbody tr { transition: background .16s var(--ease); }
table.data tbody tr:hover { background: rgba(148,163,184,.05); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .82rem; }
table.data .actions { text-align: right; white-space: nowrap; }

.empty {
  padding: 52px 24px; text-align: center; color: var(--text-mute);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty .ico { width: 42px; height: 42px; opacity: .35; }
.empty h4 { color: var(--text-soft); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; margin-bottom: 22px; }
.tab {
  padding: 11px 16px; font-size: .86rem; font-weight: 600; color: var(--text-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease);
  text-decoration: none;
}
.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 4px;
  border-bottom: 1px solid rgba(148,163,184,.07);
}
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { font-size: .88rem; font-weight: 600; display: block; }

/* ---------- Heatmap ---------- */
.heatmap { overflow-x: auto; }
.heatmap table { border-collapse: separate; border-spacing: 4px; font-size: .76rem; min-width: 100%; }
.heatmap th { font-weight: 600; color: var(--text-mute); padding: 6px 10px; text-align: left; white-space: nowrap; font-size: .72rem; }
.heatmap th.vert { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 130px; text-align: right; }
.heatmap td.cell {
  min-width: 62px; text-align: center; padding: 9px 6px; border-radius: 8px;
  font-family: var(--font-mono); font-size: .76rem; font-weight: 600;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  cursor: default;
}
.heatmap td.cell:hover { transform: scale(1.06); box-shadow: 0 8px 20px -8px rgba(0,0,0,.7); }
.heatmap td.rowlabel { font-weight: 600; text-align: left; white-space: nowrap; padding-right: 12px; color: var(--text-soft); }

/* ---------- Charts ---------- */
.chart-box { position: relative; width: 100%; height: 280px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 190px; }

/* ---------- Dimension bars ---------- */
.dim-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 13px 0; border-bottom: 1px solid rgba(148,163,184,.07); }
.dim-row:last-child { border-bottom: 0; }
.dim-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.dim-name { display: flex; align-items: center; gap: 9px; font-size: .87rem; font-weight: 600; min-width: 0; }
.dim-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 10px currentColor; }
.dim-track { height: 9px; border-radius: 999px; background: rgba(148,163,184,.12); position: relative; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 999px; transition: width 1.1s var(--ease); position: relative; }
.dim-fill::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 26px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5));
}
.dim-meta { display: flex; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-visual {
  position: relative; overflow: hidden; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 600px at 20% 10%, rgba(34,211,238,.16), transparent 60%),
              radial-gradient(700px 500px at 90% 90%, rgba(99,102,241,.18), transparent 60%);
  border-right: 1px solid var(--border);
}
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 8px; }
.auth-card > p { color: var(--text-mute); font-size: .9rem; margin-bottom: 28px; }

.orb {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 380px; height: 380px; background: rgba(34,211,238,.35); top: -80px; right: -60px; }
.orb-2 { width: 300px; height: 300px; background: rgba(99,102,241,.35); bottom: -60px; left: -40px; animation-delay: -5s; }
.orb-3 { width: 220px; height: 220px; background: rgba(168,85,247,.28); top: 45%; left: 40%; animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(24px,-28px) scale(1.08); }
}

.auth-features { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; }
.auth-feature { display: flex; gap: 13px; align-items: flex-start; }
.auth-feature .ico-wrap {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.25); color: var(--accent);
}
.auth-feature b { display: block; font-size: .88rem; margin-bottom: 2px; }
.auth-feature span { font-size: .8rem; color: var(--text-mute); line-height: 1.5; }

/* ---------- Landing ---------- */
.hero { position: relative; padding: 88px 0 70px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 999px;
  background: rgba(34,211,238,.09); border: 1px solid rgba(34,211,238,.26);
  font-size: .76rem; font-weight: 620; color: var(--accent); letter-spacing: .04em; margin-bottom: 22px;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,211,238,.5); }
  70% { box-shadow: 0 0 0 12px rgba(34,211,238,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}
.hero h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem); letter-spacing: -.04em; line-height: 1.06; margin-bottom: 20px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.06rem; color: var(--text-soft); max-width: 56ch; line-height: 1.65; margin-bottom: 30px; }

.hero-mock {
  position: relative; border-radius: 20px; border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(17,26,44,.9), rgba(8,13,23,.95));
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(34,211,238,.1);
  overflow: hidden; transform: perspective(1400px) rotateY(-6deg) rotateX(3deg);
  transition: transform .6s var(--ease);
}
.hero-mock:hover { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg) translateY(-4px); }
.mock-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
}
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(148,163,184,.28); }
.mock-bar i:first-child { background: #ff5f57; } .mock-bar i:nth-child(2) { background: #febc2e; } .mock-bar i:nth-child(3) { background: #28c840; }
.mock-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-kpi { padding: 12px; border-radius: 11px; background: rgba(148,163,184,.06); border: 1px solid var(--border); }
.mock-kpi b { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -.03em; }
.mock-kpi span { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); }
.mock-chart { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 8px; }
.mock-chart i {
  flex: 1; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), rgba(99,102,241,.55));
  animation: growBar .9s var(--ease) backwards;
}
@keyframes growBar { from { transform: scaleY(.05); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }

.section { padding: 76px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-bottom: 12px; letter-spacing: -.03em; }
.section-head p { color: var(--text-mute); font-size: .98rem; }

.feature-card { padding: 26px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,.045), transparent 60%), var(--surface);
  backdrop-filter: blur(12px); transition: all var(--dur) var(--ease); position: relative; overflow: hidden; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(34,211,238,.34); box-shadow: var(--shadow-glow); }
.feature-card .ico-wrap { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34,211,238,.16), rgba(99,102,241,.12));
  border: 1px solid rgba(34,211,238,.24); color: var(--accent); margin-bottom: 18px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1rem; }
.feature-card p { font-size: .87rem; color: var(--text-mute); line-height: 1.6; }

.site-header {
  position: sticky; top: 0; z-index: 50; padding: 16px 0;
  background: rgba(8,13,23,.72); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header { background: rgba(245,247,252,.85); }
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); color: var(--text-mute); font-size: .84rem; }

/* ---------- Encuesta (participante) ---------- */
.survey-body { min-height: 100vh; display: flex; flex-direction: column; }
.survey-top {
  position: sticky; top: 0; z-index: 30; padding: 14px 0;
  background: rgba(8,13,23,.86); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border);
}
[data-theme="light"] .survey-top { background: rgba(255,255,255,.9); }
.survey-progress { display: flex; align-items: center; gap: 14px; }
.survey-progress .progress { flex: 1; }
.survey-wrap { flex: 1; display: flex; justify-content: center; padding: 38px 20px 80px; }
.survey-card { width: 100%; max-width: 760px; }

.q-step-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 999px;
  font-size: .72rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.26); color: var(--accent);
  margin-bottom: 16px;
}
.q-title { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.75rem); margin-bottom: 8px; letter-spacing: -.03em; }
.q-desc { color: var(--text-mute); font-size: .9rem; margin-bottom: 28px; line-height: 1.6; }

.q-item {
  padding: 20px 22px; border-radius: 15px; border: 1px solid var(--border);
  background: rgba(148,163,184,.035); margin-bottom: 14px;
  transition: border-color .24s var(--ease), background .24s var(--ease);
  animation: riseIn .45s var(--ease) backwards;
}
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.q-item.is-answered { border-color: rgba(34,211,238,.34); background: rgba(34,211,238,.045); }
.q-text { font-size: .96rem; line-height: 1.55; margin-bottom: 15px; display: flex; gap: 11px; }
.q-num {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; color: var(--accent);
  flex: 0 0 auto; padding-top: 2px; min-width: 26px;
}
.q-help { font-size: .78rem; color: var(--text-mute); margin: -8px 0 12px 37px; }

.q-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin-left: 37px; }
.q-option { position: relative; }
.q-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.q-option label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 13px 8px; border-radius: 11px; cursor: pointer; text-align: center;
  border: 1.5px solid var(--border-strong); background: rgba(5,10,20,.4);
  font-size: .82rem; font-weight: 600; color: var(--text-soft);
  transition: all .22s var(--ease); user-select: none; min-height: 62px;
}
[data-theme="light"] .q-option label { background: #fff; }
.q-option label .kbd {
  font-family: var(--font-mono); font-size: .62rem; opacity: .45; letter-spacing: .04em;
}
.q-option label:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); background: rgba(34,211,238,.06); }
.q-option input:checked + label {
  border-color: var(--accent); color: var(--text);
  background: linear-gradient(150deg, rgba(34,211,238,.2), rgba(99,102,241,.12));
  box-shadow: 0 0 0 1px rgba(34,211,238,.4), 0 10px 26px -14px var(--accent-glow);
  transform: translateY(-2px);
}
.q-option input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.survey-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.survey-note { font-size: .76rem; color: var(--text-mute); display: flex; align-items: center; gap: 7px; }

.consent-box {
  padding: 20px 22px; border-radius: 14px; background: rgba(34,211,238,.05);
  border: 1px solid rgba(34,211,238,.2); font-size: .87rem; line-height: 1.65; color: var(--text-soft);
  max-height: 300px; overflow-y: auto; margin-bottom: 22px;
}
.consent-box h4 { color: var(--text); margin-bottom: 9px; font-size: .92rem; }
.consent-box ul { padding-left: 18px; margin: 8px 0; }
.consent-box li { margin-bottom: 6px; }

.done-icon {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(34,211,238,.16));
  border: 1px solid rgba(34,197,94,.4); color: var(--ok); margin: 0 auto 24px;
  box-shadow: 0 0 50px -12px rgba(34,197,94,.5);
  animation: popIn .6s var(--ease);
}
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Informe ---------- */
.report-hero {
  padding: 30px; border-radius: var(--radius-lg); border: 1px solid var(--border-strong);
  background:
    radial-gradient(700px 300px at 8% 0%, rgba(34,211,238,.14), transparent 55%),
    radial-gradient(600px 260px at 95% 100%, rgba(99,102,241,.12), transparent 55%),
    linear-gradient(160deg, rgba(17,26,44,.9), rgba(8,13,23,.95));
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.report-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  border-radius: 50%; border: 1px dashed rgba(34,211,238,.22);
}
.report-sec { margin-bottom: 34px; }
.report-sec > h2 {
  font-size: 1.15rem; padding-bottom: 10px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.report-sec > h2 .n {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; color: var(--accent);
  background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.28);
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
}

.rec-card {
  padding: 18px 20px; border-radius: 13px; border: 1px solid var(--border);
  background: rgba(148,163,184,.035); border-left: 3px solid var(--accent);
}
.rec-card h4 { font-size: .92rem; margin-bottom: 7px; }
.rec-card p { font-size: .85rem; color: var(--text-soft); line-height: 1.62; }

.metric-mini {
  padding: 14px 16px; border-radius: 12px; background: rgba(148,163,184,.05);
  border: 1px solid var(--border);
}
.metric-mini span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-bottom: 5px; }
.metric-mini b { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.02em; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-2); font-size: .85rem; animation: toastIn .3s var(--ease);
  backdrop-filter: blur(16px);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast-ok { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--critical); }
.toast-warn { border-left: 3px solid var(--warn); }
.toast-info { border-left: 3px solid var(--accent); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(3,6,12,.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-2);
  transform: scale(.96) translateY(10px); transition: transform .25s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }

/* ---------- Live indicator ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--text-mute); font-weight: 600; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: pulse 2s infinite; }
.live-dot.paused i { background: var(--text-mute); animation: none; }

/* ---------- Split / preview ---------- */
.split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 22px; align-items: start; }
.split-rev { grid-template-columns: 340px minmax(0,1fr); }
.sticky-side { position: sticky; top: calc(var(--topbar-h) + 20px); }

/* ---------- Steps (wizard) ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.step-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: rgba(148,163,184,.07);
  border: 1px solid var(--border); color: var(--text-mute);
}
.step-chip.done { color: var(--ok); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.step-chip.current { color: var(--accent); border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.1); }
.step-chip .n { font-family: var(--font-mono); font-size: .7rem; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff !important; color: #111; }
  body::before, body::after { display: none; }
  .no-print, .sidebar, .topbar, .toast-stack { display: none !important; }
  .main { margin-left: 0 !important; }
  .card, .kpi, .report-hero { box-shadow: none !important; border-color: #ddd !important; background: #fff !important; }
  .page { padding: 0 !important; }
  a { color: #111 !important; }
  .report-sec { break-inside: avoid; page-break-inside: avoid; }
  .print-break { break-before: page; page-break-before: always; }
  table.data thead th { background: #f1f5f9 !important; color: #111 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .split, .split-rev { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-mock { transform: none; }
}
@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 272px; flex-basis: 272px; transform: translateX(-100%);
    box-shadow: 0 0 60px rgba(0,0,0,.7);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(3,6,12,.6);
    backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .page { padding: 20px 16px 60px; }
  .topbar { padding: 0 16px; }
  .q-options { margin-left: 0; }
  .q-help { margin-left: 0; }
  .hero { padding: 52px 0 40px; }
}
@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .kpi-value { font-size: 1.6rem; }
  .q-item { padding: 16px; }
  .q-options { grid-template-columns: repeat(2, 1fr); }
  .survey-nav { flex-direction: column-reverse; align-items: stretch; }
  .survey-nav .btn { width: 100%; }
  .btn-group { width: 100%; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Utilidades extra ---------- */
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }
.kbd {
  font-family: var(--font-mono); font-size: .72rem; padding: 2px 6px; border-radius: 5px;
  background: rgba(148,163,184,.14); border: 1px solid var(--border); color: var(--text-soft);
}
.stat-inline { display: flex; align-items: baseline; gap: 8px; }
.stat-inline b { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -.02em; }
.stat-inline span { font-size: .78rem; color: var(--text-mute); }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-mute); opacity: .5; display: inline-block; }
.scroll-x { overflow-x: auto; }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { font-family: var(--font-mono); font-size: .78rem; }

/* ---------- Spinner ---------- */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: currentColor;
  display: inline-block; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
