/* ═══════════════════════════════════════════════════
   SubTrack — hoja de estilos cyberpunk
   Misma identidad visual que NIGHT CITY OS // App Hub (valiteee.es).
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #07080d; --bg-2: #0c0e16;
  --surface: #11131c; --surface-2: #181b27; --surface-3: #1f2331;
  --text: #e8f3ff; --muted: #8a93a8; --dim: #5a6173;
  --border: #2a3148; --border-strong: #3a4365;

  --neon-cyan: #00f0ff; --neon-magenta: #ff00d6; --neon-yellow: #fffb00;
  --neon-lime: #00ff9d; --neon-pink: #ff2e93; --neon-orange: #ff8a00;

  --primary: var(--neon-cyan);
  --primary-glow: rgba(0, 240, 255, 0.5);
  --on-accent: #06070b;
  --panel-a: rgba(17, 19, 28, 0.94);
  --panel-b: rgba(12, 14, 22, 0.94);
  --field-bg: rgba(7, 8, 13, 0.85);
  --shadow-strong: 0 0 30px rgba(0, 240, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.8);
  --radius: 4px; --radius-lg: 6px;
  --f-title: 'Orbitron', 'Rajdhani', sans-serif;
  --f-mono: 'Share Tech Mono', Consolas, monospace;
  --f-body: 'Rajdhani', system-ui, sans-serif;
  color-scheme: dark;
}

/* Variante clara (opcional, con el botón «Tema»): mismos roles de color. */
:root[data-theme="light"] {
  --bg: #f1f4fa; --bg-2: #e9edf6;
  --surface: #ffffff; --surface-2: #eef1f8; --surface-3: #e2e7f2;
  --text: #161b2e; --muted: #5b6478; --dim: #8a93a8;
  --border: #ccd2e2; --border-strong: #aab3cc;
  --neon-cyan: #0086a8; --neon-magenta: #b0158a; --neon-yellow: #8a6d00;
  --neon-lime: #1f8a3c; --neon-pink: #c1273f; --neon-orange: #b35c00;
  --primary-glow: rgba(0, 134, 168, 0.35);
  --on-accent: #ffffff;
  --panel-a: rgba(255, 255, 255, 0.96);
  --panel-b: rgba(246, 248, 253, 0.96);
  --field-bg: #ffffff;
  --shadow-strong: 0 4px 18px rgba(30, 40, 80, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }

body {
  font-family: var(--f-body);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 240, 255, 0.14) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 0, 214, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 255, 157, 0.05) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
:root[data-theme="light"] body { background: var(--bg); }

/* ─── Efectos de ambiente ─────────────────────── */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 2px, rgba(0, 240, 255, 0.025) 3px, transparent 4px);
  mix-blend-mode: overlay;
}
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
.bg-lines { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.bg-lines span {
  position: absolute; left: 0; width: 100%; height: 1px; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.45), transparent);
  animation: bgline 9s linear infinite;
}
.bg-lines span:nth-child(1) { top: 18%; }
.bg-lines span:nth-child(2) { top: 52%; animation-delay: 3s; background: linear-gradient(90deg, transparent, rgba(255, 0, 214, 0.45), transparent); }
.bg-lines span:nth-child(3) { top: 78%; animation-delay: 6s; background: linear-gradient(90deg, transparent, rgba(0, 255, 157, 0.45), transparent); }
@keyframes bgline {
  0% { transform: translateX(-100%); opacity: 0; }
  10%, 90% { opacity: 0.7; }
  100% { transform: translateX(100%); opacity: 0; }
}
:root[data-theme="light"] .scanlines, :root[data-theme="light"] .grid-bg,
:root[data-theme="light"] .vignette, :root[data-theme="light"] .bg-lines { display: none; }
@media (prefers-reduced-motion: reduce) {
  .bg-lines, .glitch::before, .glitch::after, .brand-name::before, .brand-name::after { display: none; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

h1, h2, h3 {
  font-family: var(--f-title); margin: 0 0 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--text);
}
p { margin: 0; }
.tenue { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }

/* ─── Barra HUD superior ─────────────────────── */
.hud-top {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.9) 0%, rgba(7, 8, 13, 0.7) 100%);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 0 rgba(0, 240, 255, 0.1);
}
:root[data-theme="light"] .hud-top { background: rgba(255, 255, 255, 0.9); box-shadow: none; }
.hud-top__left { display: flex; align-items: center; gap: 14px; }
.hud-top__center { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hud-top__right { display: flex; gap: 14px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-title); font-weight: 700; }
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: var(--on-accent); display: grid; place-items: center;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 0 20px var(--primary-glow), inset 0 0 8px rgba(255, 255, 255, 0.3);
}
.brand-name { font-size: 17px; letter-spacing: 0.12em; color: var(--text); position: relative; display: inline-block; text-transform: uppercase; }
.brand-name span { color: var(--neon-cyan); text-shadow: 0 0 8px var(--primary-glow); }
.brand-name::before, .brand-name::after {
  content: "SubTrack"; position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0;
}
.brand-name::before { color: var(--neon-magenta); text-shadow: 2px 0 var(--neon-magenta); animation: glitch-flash-1 7s steps(1) infinite; }
.brand-name::after { color: var(--neon-cyan); text-shadow: -2px 0 var(--neon-cyan); animation: glitch-flash-2 7s steps(1) infinite; }
.brand-tag {
  font-family: var(--f-mono); font-size: 11px; color: var(--neon-magenta); letter-spacing: 0.15em;
  padding: 2px 6px; border: 1px solid var(--neon-magenta); border-radius: 2px;
  background: rgba(255, 0, 214, 0.08); text-transform: uppercase;
}

.hud-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--border-strong); border-radius: 2px;
  background: rgba(0, 240, 255, 0.05);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }
.dot--lime { background: var(--neon-lime); box-shadow: 0 0 8px var(--neon-lime); }
.dot--magenta { background: var(--neon-magenta); box-shadow: 0 0 8px var(--neon-magenta); }
.dot--dim { background: var(--dim); box-shadow: none; }
.dot.blink { animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.25; } }

.hud-meta { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.hud-meta__label { color: var(--neon-cyan); font-size: 10.5px; opacity: 0.75; }
.hud-meta__value { color: var(--text); font-weight: 700; font-size: 13px; }
.hud-meta--time .hud-meta__value { color: var(--neon-lime); text-shadow: 0 0 8px rgba(0, 255, 157, 0.5); min-width: 76px; display: inline-block; }
:root[data-theme="light"] .hud-meta--time .hud-meta__value { text-shadow: none; }

.admin-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px;
  border: 1px solid rgba(255, 0, 214, 0.55); border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 0, 214, 0.15), rgba(0, 240, 255, 0.1));
  color: var(--neon-magenta); font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 0, 214, 0.25); white-space: nowrap; user-select: none;
}
.admin-chip .dot { width: 8px; height: 8px; animation: admin-pulse 1.6s ease-in-out infinite; }
@keyframes admin-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: 0.55; } }

/* ─── Estructura ─────────────────────── */
#app { position: relative; z-index: 2; }
.hub-shell { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 24px 28px 60px; }

nav.pestanas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
nav.pestanas button {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 8px 16px; color: var(--muted); background: transparent;
  border: 1px solid var(--border-strong); border-radius: 2px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
nav.pestanas button:hover { color: var(--text); border-color: var(--neon-cyan); }
nav.pestanas button[aria-current="page"] {
  color: var(--neon-cyan); border-color: var(--neon-cyan); background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2), inset 0 0 0 1px rgba(0, 240, 255, 0.08);
}

/* Hero */
.hero {
  position: relative; padding: 28px 32px 24px; margin-bottom: 26px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-a) 0%, var(--panel-b) 100%);
  backdrop-filter: blur(10px); box-shadow: var(--shadow-strong), inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 12% 30%, rgba(0, 240, 255, 0.15), transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(255, 0, 214, 0.12), transparent 45%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 4px);
}
:root[data-theme="light"] .hero::after { display: none; }
.corner { position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 2; }
.corner--tl { top: -1px; left: -1px; border-top: 2px solid var(--neon-cyan); border-left: 2px solid var(--neon-cyan); }
.corner--tr { top: -1px; right: -1px; border-top: 2px solid var(--neon-magenta); border-right: 2px solid var(--neon-magenta); }
.corner--bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--neon-magenta); border-left: 2px solid var(--neon-magenta); }
.corner--br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--neon-cyan); border-right: 2px solid var(--neon-cyan); }

.hero__breadcrumb {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase;
}
.hero__breadcrumb .sep { color: var(--dim); }
.hero__breadcrumb .hl { color: var(--neon-cyan); text-shadow: 0 0 8px var(--primary-glow); }
.hero__title { position: relative; font-size: clamp(28px, 5vw, 52px); letter-spacing: 0.08em; margin: 0 0 10px; }
.hero__sub { position: relative; color: var(--muted); font-family: var(--f-mono); font-size: 14px; margin-bottom: 20px; max-width: 680px; letter-spacing: 0.05em; }
.hero__sub:last-child { margin-bottom: 0; }
.hero__stats { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hero-stat { position: relative; padding: 14px 16px; border: 1px solid var(--border); background: rgba(7, 8, 13, 0.6); border-radius: var(--radius); overflow: hidden; }
:root[data-theme="light"] .hero-stat { background: rgba(255, 255, 255, 0.7); }
.hero-stat::before { content: ""; position: absolute; top: 0; left: 0; width: 18px; height: 1px; background: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan); }
.hero-stat--magenta::before { background: var(--neon-magenta); box-shadow: 0 0 6px var(--neon-magenta); }
.hero-stat--lime::before { background: var(--neon-lime); box-shadow: 0 0 6px var(--neon-lime); }
.hero-stat--pink::before { background: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink); }
.hero-stat__label { font-family: var(--f-mono); font-size: 11px; color: var(--neon-cyan); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 6px; opacity: 0.85; }
.hero-stat__value { font-family: var(--f-title); font-size: 24px; font-weight: 700; text-shadow: 0 0 12px rgba(0, 240, 255, 0.25); overflow-wrap: anywhere; }
.hero-stat__value--sm { font-size: 15px; letter-spacing: 0.04em; line-height: 1.9; }
.hero-stat__note { margin-top: 4px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.hero-stat__note.pasado { color: var(--neon-pink); }
.hero-stat__value.pasado { color: var(--neon-pink); text-shadow: 0 0 12px rgba(255, 46, 147, 0.4); }
:root[data-theme="light"] .hero-stat__value { text-shadow: none; }

/* Títulos con efecto glitch */
.glitch { position: relative; display: inline-block; text-shadow: 0 0 10px rgba(0, 240, 255, 0.35), 1px 0 0 rgba(255, 0, 214, 0.4), -1px 0 0 rgba(0, 255, 157, 0.4); }
:root[data-theme="light"] .glitch { text-shadow: none; }
.glitch[data-text]::before, .glitch[data-text]::after {
  content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0;
}
.glitch[data-text]::before { color: var(--neon-magenta); text-shadow: 2px 0 var(--neon-magenta); animation: glitch-flash-1 5s steps(1) infinite; }
.glitch[data-text]::after { color: var(--neon-cyan); text-shadow: -2px 0 var(--neon-cyan); animation: glitch-flash-2 5s steps(1) infinite; }
@keyframes glitch-flash-1 {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
  93% { opacity: 1; clip-path: inset(15% 0 65% 0); transform: translate(-3px, 0); }
  94% { opacity: 1; clip-path: inset(55% 0 25% 0); transform: translate(3px, 0); }
  95% { opacity: 0; }
  96% { opacity: 1; clip-path: inset(70% 0 10% 0); transform: translate(-2px, 1px); }
  97% { opacity: 1; clip-path: inset(30% 0 50% 0); transform: translate(2px, -1px); }
}
@keyframes glitch-flash-2 {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
  93% { opacity: 1; clip-path: inset(50% 0 30% 0); transform: translate(3px, 0); }
  94% { opacity: 1; clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
  95% { opacity: 0; }
  96% { opacity: 1; clip-path: inset(10% 0 75% 0); transform: translate(2px, -1px); }
  97% { opacity: 1; clip-path: inset(60% 0 20% 0); transform: translate(-2px, 1px); }
}

/* ─── Tarjetas (esquinas cortadas) ─────────────────────── */
.tarjeta {
  position: relative; padding: 22px 22px 18px; margin-bottom: 18px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-a) 0%, var(--panel-b) 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  transition: border-color .18s, box-shadow .18s;
}
.tarjeta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background:
    linear-gradient(135deg, var(--neon-cyan) 0%, transparent 16%) top left / 20px 20px no-repeat,
    linear-gradient(315deg, var(--neon-magenta) 0%, transparent 16%) bottom right / 20px 20px no-repeat;
}
.tarjeta:hover, .tarjeta:focus-within { border-color: var(--neon-cyan); }
.tarjeta:hover::before, .tarjeta:focus-within::before { opacity: 1; }
:root[data-theme="light"] .tarjeta { box-shadow: 0 2px 10px rgba(30, 40, 80, 0.08); }
.rejilla { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.rejilla > .tarjeta { margin-bottom: 0; }
.rejilla > .ancho { grid-column: 1 / -1; }
.barra-acciones label.casilla { margin-bottom: 0; }

h2 { font-size: 16px; letter-spacing: 0.08em; color: var(--text); margin-bottom: 14px; }
h2::before { content: "// "; color: var(--neon-cyan); text-shadow: 0 0 8px var(--primary-glow); }

/* ─── Botones ─────────────────────── */
button, input, select, textarea { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
  padding: 8px 14px; border-radius: 2px; cursor: pointer;
  color: var(--text); background: rgba(0, 240, 255, 0.04); border: 1px solid var(--border-strong);
  transition: background .15s, color .15s, transform .15s, box-shadow .15s, border-color .15s;
}
button:hover { transform: translateY(-1px); border-color: var(--neon-cyan); color: var(--neon-cyan); }
button:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
button.primario {
  color: var(--on-accent); border-color: var(--neon-cyan);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.25);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
  padding-right: 20px;
}
button.primario:hover { color: var(--on-accent); filter: brightness(1.1); transform: translateX(2px); }
button.peligro { color: var(--neon-pink); border-color: var(--neon-pink); background: rgba(255, 46, 147, 0.06); }
button.peligro:hover { background: rgba(255, 46, 147, 0.2); color: var(--neon-pink); border-color: var(--neon-pink); }
button.enlace { background: none; border: none; padding: 4px 6px; color: var(--neon-cyan); letter-spacing: 0.1em; font-size: 11px; }
button.enlace:hover { color: var(--text); text-shadow: 0 0 8px var(--primary-glow); transform: none; }
button.enlace.mal { color: var(--neon-pink); }

/* ─── Formularios ─────────────────────── */
input, select, textarea {
  width: 100%; min-width: 0; padding: 9px 11px;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--text); background: var(--field-bg);
  border: 1px solid var(--border-strong); border-radius: 2px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--neon-cyan); background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 0 1px var(--neon-cyan), 0 0 12px rgba(0, 240, 255, 0.25);
}
:root[data-theme="light"] input:focus, :root[data-theme="light"] select:focus, :root[data-theme="light"] textarea:focus { background: #fff; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--neon-cyan); }
input[type="search"] { padding-left: 11px; }
textarea { resize: vertical; min-height: 76px; font-family: var(--f-body); font-size: 15px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--neon-cyan) 50%), linear-gradient(135deg, var(--neon-cyan) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
label.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label.campo > span { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--neon-cyan); }
label.casilla { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.dos-col { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.barra-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.barra-acciones .buscador { flex: 1 1 220px; max-width: 340px; }
.barra-acciones .separador { flex: 1; }
.barra-acciones h2 { margin: 0; }

/* ─── Tabla ─────────────────────── */
.tabla-scroll { overflow-x: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--neon-cyan); user-select: none; background: rgba(0, 240, 255, 0.04); }
th.ordenable { cursor: pointer; }
th.ordenable:hover { color: var(--text); text-shadow: 0 0 8px var(--primary-glow); }
td.num, th.num { text-align: right; }
td.nombre { font-family: var(--f-title); font-size: 13px; letter-spacing: 0.04em; }
td.nombre .dot { width: 7px; height: 7px; margin-right: 10px; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(0, 240, 255, 0.05); }
tbody tr:last-child td { border-bottom: none; }
tr.proximo td { background: rgba(255, 251, 0, 0.07); }
:root[data-theme="light"] tr.proximo td { background: rgba(138, 109, 0, 0.1); }
tr.proximo .dias { color: var(--neon-yellow); font-weight: 700; text-shadow: 0 0 8px rgba(255, 251, 0, 0.35); }
:root[data-theme="light"] tr.proximo .dias { text-shadow: none; }
tr.inactiva td { color: var(--dim); }
tr.inactiva td.nombre { text-decoration: line-through; text-decoration-color: rgba(138, 147, 168, 0.5); }
tr.ajena td { color: var(--muted); }
td.acciones { text-align: right; }
.vacio { padding: 34px; text-align: center; color: var(--muted); font-family: var(--f-mono); letter-spacing: 0.1em; }
.tarjeta.vacio { border-style: dashed; }

/* ─── Gráficas ─────────────────────── */
.fila-barra { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.06em; }
.fila-barra .pista { background: rgba(0, 240, 255, 0.08); border: 1px solid var(--border); height: 14px; overflow: hidden; }
.fila-barra .relleno { height: 100%; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta)); box-shadow: 0 0 10px var(--primary-glow); }
.historial { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 8px; }
.historial .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.historial .col .barra { width: 100%; max-width: 46px; min-height: 2px; background: linear-gradient(180deg, var(--neon-magenta), var(--neon-cyan)); box-shadow: 0 0 10px rgba(255, 0, 214, 0.35); }
.historial .col small { color: var(--muted); font-family: var(--f-mono); font-size: 11px; }

/* ─── Panel lateral (drawer) y diálogos ─────────────────────── */
dialog {
  padding: 0; color: var(--text); border: none;
  background: linear-gradient(180deg, rgba(17, 19, 28, 0.98) 0%, rgba(7, 8, 13, 0.98) 100%);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.7), inset 1px 0 0 0 rgba(0, 240, 255, 0.15);
  border-left: 1px solid var(--border-strong);
  margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(560px, 100vw);
}
:root[data-theme="light"] dialog { background: #fff; box-shadow: -8px 0 30px rgba(30, 40, 80, 0.25); }
dialog[open] { animation: cajon-entra .25s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes cajon-entra { from { transform: translateX(100%); } to { transform: translateX(0); } }
dialog::backdrop { background: rgba(3, 4, 8, 0.7); backdrop-filter: blur(4px); }
dialog.centrado {
  margin: auto; height: fit-content; max-height: calc(100dvh - 32px); width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--neon-cyan); border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.2), 0 8px 30px rgba(0, 0, 0, 0.7);
}
dialog.centrado[open] { animation: aparece .18s ease-out; }
@keyframes aparece { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
dialog form { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
dialog.centrado form { height: auto; }
dialog.centrado .dlg-cuerpo { flex: none; }
dialog .dlg-titulo {
  padding: 20px 26px 16px; border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.05) 0%, transparent 100%);
  font-family: var(--f-title); font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}
:root[data-theme="light"] dialog .dlg-titulo { text-shadow: none; }
dialog .dlg-cuerpo { padding: 20px 26px; overflow-y: auto; flex: 1; }
dialog .dlg-pie { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 16px 26px; border-top: 1px dashed var(--border); }
dialog textarea[readonly] { min-height: 260px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 400;
  max-width: calc(100vw - 32px); padding: 10px 18px;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.06em;
  background: var(--surface-2); border: 1px solid var(--neon-cyan); border-radius: 2px;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}
#toast.error { border-color: var(--neon-pink); color: var(--neon-pink); box-shadow: 0 0 18px rgba(255, 46, 147, 0.3); }
.resultado-envio { white-space: pre-wrap; margin-top: 10px; font-family: var(--f-mono); font-size: 13px; }
.ok { color: var(--neon-lime); }
.mal { color: var(--neon-pink); }

/* ─── Acceso ─────────────────────── */
.acceso-pagina { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px 16px; }
.acceso { position: relative; width: min(420px, 100%); padding: 30px 30px 26px; clip-path: none; margin: 0; }
.acceso::before { display: none; }
.acceso .brand { justify-content: center; margin-bottom: 18px; }
.acceso h1 { display: block; text-align: center; font-size: clamp(26px, 8vw, 36px); margin-bottom: 8px; }
.acceso .sub { text-align: center; color: var(--muted); font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.05em; margin-bottom: 22px; }
.acceso .pestanas-acceso { display: flex; gap: 8px; margin-bottom: 18px; }
.acceso .pestanas-acceso button { flex: 1; }
.acceso .pestanas-acceso button[aria-pressed="true"] { color: var(--neon-cyan); border-color: var(--neon-cyan); background: rgba(0, 240, 255, 0.08); }
.acceso form button.primario { width: 100%; padding: 11px 20px; }
.error-form { color: var(--neon-pink); min-height: 1.4em; margin-bottom: 8px; font-family: var(--f-mono); font-size: 13px; }

/* ─── Pie ─────────────────────── */
.hub-footer {
  margin-top: 40px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px 4px 0; border-top: 1px solid var(--border-strong);
  font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase;
}
.footer-label { color: var(--neon-cyan); }
.footer-sep { color: var(--dim); margin: 0 8px; }

/* ─── Responsive ─────────────────────── */
@media (max-width: 1024px) {
  .hud-top { grid-template-columns: 1fr 1fr; }
  .hud-top__center { display: none; }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hud-top { grid-template-columns: 1fr; padding: 12px 16px; }
  .hud-top__right { justify-content: flex-start; gap: 10px; }
  .hub-shell { padding: 20px 16px 40px; }
  .hero { padding: 22px 20px 20px; }
  .hero__stats { gap: 10px; }
  .hero-stat { padding: 12px 12px; }
  .hero-stat__value { font-size: 17px; }
  .hero-stat__value--sm { font-size: 13px; }
  .tarjeta { padding: 20px 18px 16px; }
  .fila-barra { grid-template-columns: 1fr auto; }
  .fila-barra .pista { grid-column: 1 / -1; grid-row: 2; }
  .hub-footer { flex-direction: column; align-items: flex-start; }
  dialog .dlg-titulo, dialog .dlg-cuerpo, dialog .dlg-pie { padding-inline: 18px; }
}
