/* Ekids Dashboard: estilo "liquid glass" sobre un acuario de color.
   Paleta: naranja Ekids, amanecer, laguna, ciruela y tinta. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --orange: #ff4701;
  --orange-deep: #e03a00;
  --sun: #ff9a1f;
  --lagoon: #14a6a1;
  --plum: #7b2f8f;
  --ink: #22183a;
  --ink-2: #4e4566;
  --ink-3: #7b7393;
  --page: #f4f1fb;
  --line: rgba(34, 24, 58, 0.09);
  --glass-top: rgba(255, 255, 255, 0.66);
  --glass-bottom: rgba(255, 255, 255, 0.34);
  --glass-rim: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 18px 50px -18px rgba(70, 30, 95, 0.32), 0 2px 8px rgba(70, 30, 95, 0.06);
  --field: rgba(255, 255, 255, 0.6);
  --field-border: rgba(34, 24, 58, 0.12);
  --estimate: #b98a00;
  --ok: #128a52;
  --bad: #c62a2a;
  --radius-panel: 28px;
  --radius-control: 999px;
  --radius-chip: 12px;
  --sidebar: 248px;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #f3eefc;
  --ink-2: #c9c0dc;
  --ink-3: #988fae;
  --page: #120d24;
  --line: rgba(255, 255, 255, 0.09);
  --glass-top: rgba(46, 36, 78, 0.62);
  --glass-bottom: rgba(28, 21, 52, 0.42);
  --glass-rim: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 22px 60px -20px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
  --field: rgba(255, 255, 255, 0.07);
  --field-border: rgba(255, 255, 255, 0.14);
  --estimate: #f2c94c;
  --ok: #4cd391;
  --bad: #ff7b7b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 70%, white); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- acuario */
.aquarium { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aquarium::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 120%, rgba(20, 166, 161, 0.10), transparent 60%);
}
/* Manchas de color con degradado radial: se ven difuminadas sin usar filter: blur (más liviano) */
.blob { position: absolute; border-radius: 50%; opacity: 0.6; will-change: transform; --c: var(--orange);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 85%, transparent), color-mix(in srgb, var(--c) 35%, transparent) 55%, transparent); }
.blob.b1 { width: 62vw; height: 62vw; left: -18vw; top: -22vw; --c: var(--orange); animation: drift1 38s ease-in-out infinite alternate; }
.blob.b2 { width: 52vw; height: 52vw; right: -14vw; top: 4vh; --c: var(--lagoon); opacity: 0.42; animation: drift2 44s ease-in-out infinite alternate; }
.blob.b3 { width: 48vw; height: 48vw; left: 24vw; bottom: -24vw; --c: var(--plum); opacity: 0.36; animation: drift1 52s ease-in-out infinite alternate-reverse; }
.blob.b4 { width: 32vw; height: 32vw; left: 48vw; top: -10vw; --c: var(--sun); opacity: 0.5; animation: drift2 34s ease-in-out infinite alternate-reverse; }
:root[data-theme="dark"] .blob { opacity: 0.32; }
:root[data-theme="dark"] .blob.b2, :root[data-theme="dark"] .blob.b3 { opacity: 0.24; }
@keyframes drift1 { to { transform: translate(6vw, 5vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-5vw, 7vh) scale(0.94); } }

.bubble {
  position: absolute; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,255,255,.25) 45%, rgba(255,255,255,.05) 70%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  animation: rise linear infinite;
  opacity: 0.7;
}
@keyframes rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .7; }
  50% { transform: translateY(-55vh) translateX(14px); }
  100% { transform: translateY(-112vh) translateX(-10px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .bubble { animation: none !important; }
  .bubble { display: none; }
  * { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- vidrio */
.glass {
  position: relative;
  background: linear-gradient(150deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(24px) saturate(175%);
  backdrop-filter: blur(24px) saturate(175%);
  border-radius: var(--radius-panel);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 rgba(255,255,255,.18);
  isolation: isolate;
}
/* Borde líquido: un aro que refleja la luz arriba-izquierda y abajo-derecha */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.2px; pointer-events: none; z-index: -1;
  background: linear-gradient(140deg, rgba(255,255,255,.95), rgba(255,255,255,.18) 32%, rgba(255,255,255,0) 55%, rgba(255,255,255,.55) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Brillo especular suave */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(90% 60% at 12% 0%, rgba(255,255,255,.55), transparent 55%);
  opacity: .55;
}
:root[data-theme="dark"] .glass::before { background: linear-gradient(140deg, rgba(255,255,255,.4), rgba(255,255,255,.06) 35%, transparent 60%, rgba(255,255,255,.22)); }
:root[data-theme="dark"] .glass::after { opacity: .18; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: color-mix(in srgb, var(--page) 90%, white); }
}

/* ---------------------------------------------------------------- estructura */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; gap: 18px; padding: 18px; }
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); display: flex; flex-direction: column; padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.brand img { width: 50px; height: auto; filter: drop-shadow(0 6px 10px rgba(255, 71, 1, 0.35)); }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -0.01em; }
.brand-name small { display: block; font-family: var(--text); font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-top: 4px; letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  text-decoration: none; color: var(--ink-2); font-weight: 560; transition: background .2s, color .2s;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, 0.35); color: var(--ink); }
:root[data-theme="dark"] .nav a:hover { background: rgba(255, 255, 255, 0.06); }
.nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(160deg, #ff7a3d, var(--orange) 55%, var(--orange-deep));
  box-shadow: 0 10px 24px -10px rgba(255, 71, 1, .8), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(120, 20, 0, .25);
}
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.28); }
:root[data-theme="dark"] .user-chip { background: rgba(255,255,255,.05); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 600; color: #fff;
  background: linear-gradient(140deg, var(--sun), var(--orange)); flex: none; }
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12.5px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 24px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.1; margin: 0; letter-spacing: -0.015em; }
.topbar .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-content: start; }
.panel { padding: 22px 24px; min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h2 { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.panel .hint { color: var(--ink-3); font-size: 13.5px; margin: 3px 0 0; max-width: 62ch; }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 230px; }

/* ---------------------------------------------------------------- héroe */
.hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 26px; padding: 26px 30px; overflow: hidden; }
.hero-fish { width: 132px; animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 18px 22px rgba(255, 71, 1, .35)); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.hero-number { font-family: var(--display); font-weight: 600; font-size: clamp(64px, 8vw, 104px); line-height: .9; letter-spacing: -0.03em;
  background: linear-gradient(170deg, var(--sun), var(--orange) 60%, var(--orange-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { margin: 8px 0 0; font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.hero-copy .lead { font-family: var(--display); font-size: 20px; font-weight: 500; color: var(--ink); margin: 0 0 6px; }
.hero-side { display: grid; gap: 10px; min-width: 220px; }
.pill-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 10px 16px; border-radius: 18px; background: rgba(255,255,255,.4); }
:root[data-theme="dark"] .pill-stat { background: rgba(255,255,255,.06); }
.pill-stat span { color: var(--ink-3); font-size: 13.5px; }
.pill-stat b { font-family: var(--display); font-size: 20px; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------------------------------------------------------------- indicadores */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; grid-column: span 12; }
.kpi { padding: 18px 20px; }
.kpi .k-label { color: var(--ink-3); font-size: 13.5px; font-weight: 550; }
.kpi .k-value { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.1; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .k-value small { font-size: 16px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.kpi .k-foot { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.kpi.accent { color: #fff; background: linear-gradient(155deg, #ff8a4a, var(--orange) 50%, #e23c00); }
.kpi.accent .k-label, .kpi.accent .k-foot, .kpi.accent .k-value small { color: rgba(255,255,255,.88); }

/* ---------------------------------------------------------------- controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; white-space: nowrap;
  padding: 10px 18px; border-radius: var(--radius-control); font-weight: 650; font-size: 14.5px; text-decoration: none;
  background: rgba(255, 255, 255, .55); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 1px var(--field-border), 0 4px 14px -6px rgba(70, 30, 95, .25);
  transition: transform .15s, box-shadow .2s, background .2s;
}
:root[data-theme="dark"] .btn { background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 0 0 1px var(--field-border); }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.75); }
:root[data-theme="dark"] .btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { color: #fff; background: linear-gradient(165deg, #ff7a3d, var(--orange) 55%, var(--orange-deep));
  box-shadow: 0 10px 24px -10px rgba(255,71,1,.85), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -2px 6px rgba(120,20,0,.25); }
.btn.primary:hover { background: linear-gradient(165deg, #ff8a52, #ff5512 55%, var(--orange)); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 7px 13px; font-size: 13.5px; }
.btn.icon { padding: 9px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.seg { position: relative; isolation: isolate; display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--radius-control); background: rgba(255,255,255,.35); box-shadow: inset 0 0 0 1px var(--field-border); }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; z-index: 0; border-radius: var(--radius-control); pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.78));
  box-shadow: 0 4px 14px -4px rgba(70,30,95,.35), inset 0 1px 0 #fff, inset 0 -1px 2px rgba(70,30,95,.08);
  transition: transform .5s cubic-bezier(.34,1.42,.48,1), width .5s cubic-bezier(.34,1.42,.48,1), opacity .2s; }
.seg-thumb.squish { animation: squish .5s cubic-bezier(.34,1.42,.48,1); }
@keyframes squish { 0% { scale: 1 1; } 35% { scale: 1.1 .84; } 70% { scale: .97 1.04; } 100% { scale: 1 1; } }
:root[data-theme="dark"] .seg-thumb { background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.12)); box-shadow: 0 4px 14px -4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.35); }
:root[data-theme="dark"] .seg { background: rgba(255,255,255,.05); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: var(--radius-control); cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); transition: color .25s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg button:active { transform: scale(.96); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); user-select: none; }
.switch input { appearance: none; width: 42px; height: 25px; border-radius: 99px; background: rgba(34,24,58,.18); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
:root[data-theme="dark"] .switch input { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.switch input:checked, :root[data-theme="dark"] .switch input:checked { background: var(--orange); box-shadow: none; }
.switch input:checked::after { transform: translateX(17px); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--field-border); background: var(--field);
  outline: none; transition: border-color .2s, box-shadow .2s; min-height: 44px;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 18%, transparent); }
.input.num { text-align: center; font-family: var(--display); font-size: 22px; font-weight: 600; padding: 8px; }
textarea.input { min-height: 84px; resize: vertical; }
.input.date-chip { width: auto; min-height: 38px; padding: 7px 12px; border-radius: var(--radius-control); font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.form-grid > .c-12 { grid-column: span 12; } .form-grid > .c-6 { grid-column: span 6; } .form-grid > .c-4 { grid-column: span 4; } .form-grid > .c-3 { grid-column: span 3; } .form-grid > .c-8 { grid-column: span 8; }
.help { font-size: 12.5px; color: var(--ink-3); }
.error-text { color: var(--bad); font-size: 13.5px; font-weight: 600; }

/* ---------------------------------------------------------------- hoja digital */
.sheet { display: grid; grid-template-columns: 1.25fr 1fr 1fr; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--field-border); }
.sheet > div { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.sheet .h { font-weight: 700; font-size: 13.5px; color: var(--ink-2); background: rgba(255,255,255,.35); }
:root[data-theme="dark"] .sheet .h { background: rgba(255,255,255,.05); }
.sheet .g { font-family: var(--display); font-weight: 600; font-size: 17px; gap: 10px; }
.sheet .g i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.sheet .tot { font-family: var(--display); font-weight: 600; font-size: 20px; background: color-mix(in srgb, var(--orange) 9%, transparent); }
.sheet .blank { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(34,24,58,.04) 8px 9px); }

/* ---------------------------------------------------------------- tablas */
.table-wrap { overflow-x: auto; border-radius: 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 700; color: var(--ink-3); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:hover { background: rgba(255,255,255,.32); }
:root[data-theme="dark"] table.data tbody tr:hover { background: rgba(255,255,255,.04); }
table.data tr.est td { color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.real { background: color-mix(in srgb, var(--lagoon) 16%, transparent); color: color-mix(in srgb, var(--lagoon) 80%, var(--ink)); }
.tag.est { background: color-mix(in srgb, var(--estimate) 18%, transparent); color: color-mix(in srgb, var(--estimate) 75%, var(--ink)); }
.tag.warn { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.tag.role { background: color-mix(in srgb, var(--plum) 14%, transparent); color: color-mix(in srgb, var(--plum) 75%, var(--ink)); }
.tag.peak { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange-deep); }
:root[data-theme="dark"] .tag.peak { color: #ff9a6b; }

.list-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-rank li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.3); }
:root[data-theme="dark"] .list-rank li { background: rgba(255,255,255,.04); }
.list-rank .pos { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 600; color: #fff; background: linear-gradient(150deg, var(--sun), var(--orange)); }
.list-rank li:nth-child(n+2) .pos { background: linear-gradient(150deg, #b9a6d1, var(--plum)); }
.list-rank li:nth-child(n+4) .pos { background: rgba(34,24,58,.2); color: var(--ink); }
.list-rank b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.list-rank .when { font-weight: 600; }
.list-rank .meta { font-size: 12.5px; color: var(--ink-3); }

.insights { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.insights li::before { content: ""; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; flex: none; background: radial-gradient(circle at 30% 30%, #fff, var(--orange) 60%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 18%, transparent); }

.group-legend { display: grid; gap: 10px; }
.group-legend .row { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.group-legend i { width: 14px; height: 14px; border-radius: 5px; }
.group-legend b { font-family: var(--display); font-weight: 600; font-size: 17px; }
.group-legend span.p { color: var(--ink-3); font-size: 13px; min-width: 46px; text-align: right; }

.heat td.cell { text-align: center; font-family: var(--display); font-weight: 600; border-radius: 10px; }

.money-box { padding: 26px 28px; color: #fff; background: linear-gradient(150deg, #ff8a4a, var(--orange) 50%, #d93700); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.money-box .big { white-space: nowrap; font-family: var(--display); font-size: clamp(38px, 4.4vw, 62px); font-weight: 600; line-height: 1; letter-spacing: -0.02em; margin: 6px 0; }
.money-box p { margin: 0; color: rgba(255,255,255,.9); }
.money-box .side { display: grid; gap: 10px; padding-left: 24px; border-left: 1px solid rgba(255,255,255,.4); }
.money-box .side span { display: block; font-size: 13px; color: rgba(255,255,255,.85); }
.money-box .side b { font-family: var(--display); font-size: 22px; font-weight: 600; }

.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.download { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; text-decoration: none; background: rgba(255,255,255,.35); box-shadow: inset 0 0 0 1px var(--field-border); transition: transform .15s, background .2s; }
:root[data-theme="dark"] .download { background: rgba(255,255,255,.05); }
.download:hover { transform: translateY(-2px); background: rgba(255,255,255,.6); }
:root[data-theme="dark"] .download:hover { background: rgba(255,255,255,.1); }
.download .ext { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; flex: none; }
.download b { display: block; }
.download span { font-size: 13px; color: var(--ink-3); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty img { width: 90px; margin: 0 auto 12px; opacity: .9; }

/* ---------------------------------------------------------------- diálogos y avisos */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(760px, calc(100vw - 24px)); width: 100%; }
dialog.modal::backdrop { background: rgba(25, 14, 45, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.modal .glass { padding: 24px 26px; max-height: calc(100vh - 40px); overflow: auto; background: linear-gradient(150deg, color-mix(in srgb, var(--page) 70%, white), color-mix(in srgb, var(--page) 88%, white)); }
:root[data-theme="dark"] dialog.modal .glass { background: linear-gradient(150deg, #2a2148, #1b1533); }
dialog.modal h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; }
.toast { padding: 12px 18px; border-radius: 18px; font-weight: 600; max-width: 360px; animation: pop .25s ease-out; }
.toast.error { color: var(--bad); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.temp-pass { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; padding: 12px 16px; border-radius: 14px; background: var(--field); text-align: center; letter-spacing: .04em; user-select: all; }

/* ---------------------------------------------------------------- acceso */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(420px, 100%); padding: 34px 32px 30px; text-align: center; }
.login img { width: 120px; margin: -76px auto 6px; filter: drop-shadow(0 18px 20px rgba(255,71,1,.4)); animation: bob 6s ease-in-out infinite; }
.login h1 { font-family: var(--display); font-weight: 600; font-size: 34px; margin: 0; letter-spacing: -0.02em; }
.login p.sub { color: var(--ink-3); margin: 4px 0 22px; }
.login form { display: grid; gap: 14px; text-align: left; }

.loading { display: grid; place-items: center; min-height: 40vh; grid-column: span 12; }
.loading img { width: 70px; animation: bob 1.4s ease-in-out infinite; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 260px; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-control); }

.mobile-only { display: none; }

/* ---------------------------------------------------------------- adaptable */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 1100px) { .span-6 { grid-column: span 12; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 12px 12px 96px; gap: 12px; }
  .sidebar { position: fixed; z-index: 20; top: auto; bottom: 12px; left: 12px; right: 12px; height: auto; padding: 6px; border-radius: 26px; }
  .brand, .sidebar-foot, .nav-sep, .nav .label, .nav a.secondary { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 11px; border-radius: 18px; flex: 1; }
  .nav a .short { display: block; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-fish { width: 90px; position: absolute; right: 18px; top: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .content { gap: 12px; }
  .panel { padding: 18px; }
  .topbar h1 { font-size: 24px; }
  .money-box { grid-template-columns: 1fr; }
  .money-box .side { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.4); padding-top: 12px; }
  .form-grid > .c-6, .form-grid > .c-4, .form-grid > .c-3, .form-grid > .c-8 { grid-column: span 12; }
  .mobile-only { display: inline-flex; }
  .span-3 { grid-column: span 12; }
}
.nav a .short { display: none; }
@media (max-width: 900px) { .nav a .full { display: none; } }
table.heat th.n { text-align: center; }
@media (max-width: 900px) { .hero-copy .lead { padding-right: 96px; } }

/* Rango de fechas del filtro */
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-label { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.input.date-chip { cursor: pointer; }
.input.date-chip::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; }

/* Entrada suave del contenido al cambiar de sección o de periodo */
.content > * { animation: enter .5s cubic-bezier(.2,.8,.2,1) both; }
.content > *:nth-child(2) { animation-delay: .04s; } .content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; } .content > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.content.refreshing { opacity: .55; transition: opacity .2s; pointer-events: none; }

/* Pausar animaciones cuando la pestaña no se ve */
.paused .blob, .paused .bubble, .paused .hero-fish, .paused .login img { animation-play-state: paused !important; }

/* Modo ligero: sin vidrio difuminado ni animaciones de fondo (para equipos lentos) */
:root[data-lite="1"] .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(150deg, color-mix(in srgb, var(--page) 55%, white), color-mix(in srgb, var(--page) 80%, white)); }
:root[data-lite="1"][data-theme="dark"] .glass { background: linear-gradient(150deg, #2a2148, #1d1736); }
:root[data-lite="1"] .glass.kpi.accent { background: linear-gradient(155deg, #ff8a4a, var(--orange) 50%, #e23c00); }
:root[data-lite="1"] .money-box.glass { background: linear-gradient(150deg, #ff8a4a, var(--orange) 50%, #d93700); }
:root[data-lite="1"] .blob, :root[data-lite="1"] .hero-fish { animation: none; }
:root[data-lite="1"] .bubble { display: none; }
:root[data-lite="1"] .content > * { animation: none; }
@media (prefers-reduced-motion: reduce) { .content > *, .seg-thumb.squish { animation: none; } }
