/* Tempesta MC — hoja de estilos única del panel.
   Tokens en :root; el tema oscuro redefine los mismos tokens. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --primary: #059669;
  --primary-hover: #047857;
  --primary-soft: #d1fae5;
  --primary-text: #065f46;
  --accent: #10b981;

  --ok: #16a34a;      --ok-soft: #dcfce7;
  --warn: #d97706;    --warn-soft: #fef3c7;
  --danger: #dc2626;  --danger-soft: #fee2e2;
  --info: #2563eb;    --info-soft: #dbeafe;
  --idle: #64748b;    --idle-soft: #eef1f5;

  --c-cpu: #6366f1;
  --c-ram: #0ea5e9;
  --c-players: #10b981;
  --c-disk: #f59e0b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -8px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --sidebar: 248px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0d12;
  --surface: #11151c;
  --surface-2: #151a22;
  --surface-3: #1b212b;
  --border: #222a36;
  --border-strong: #2e3847;
  --text: #e8ecf2;
  --text-2: #c3cad5;
  --muted: #8a94a6;
  --faint: #5f6b7e;

  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-soft: rgba(16, 185, 129, .14);
  --primary-text: #6ee7b7;
  --accent: #34d399;

  --ok: #22c55e;      --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f59e0b;    --warn-soft: rgba(245, 158, 11, .14);
  --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .14);
  --info: #60a5fa;    --info-soft: rgba(96, 165, 250, .14);
  --idle: #8a94a6;    --idle-soft: rgba(138, 148, 166, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14.5px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
::selection { background: var(--primary-soft); }

.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* ── Estructura ─────────────────────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand b span { color: var(--accent); }
.brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 550;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.activo { background: var(--primary-soft); color: var(--primary-text); }
.nav a .contador { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }

.sidebar-pie { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.host-mini { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.host-mini .fila { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.host-mini .fila b { color: var(--text-2); font-weight: 600; }
.host-mini .medidor { margin-bottom: 8px; }
.host-mini .medidor:last-child { margin-bottom: 0; }

.usuario-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  background: none; width: 100%; text-align: left; color: var(--text); font: inherit;
}
.usuario-chip:hover { background: var(--surface-3); }
.usuario-chip .datos { min-width: 0; flex: 1; }
.usuario-chip .datos b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-chip .datos small { display: block; font-size: 12px; color: var(--muted); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #0d9488); color: #fff;
  font-size: 13px; font-weight: 700;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.contenido { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }

.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.encabezado .titulo { min-width: 0; }
.encabezado .titulo p { color: var(--muted); margin-top: 4px; }
.encabezado .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.miga { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.miga:hover { color: var(--text); }

/* ── Botones ────────────────────────────────────────────────────────────── */

.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  position: relative; user-select: none;
}
.btn:hover { background: var(--surface-3); color: var(--b-fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.btn[disabled], .btn.deshabilitado { opacity: .5; pointer-events: none; }
.btn-primario { --b-bg: var(--primary); --b-fg: #fff; --b-bd: var(--primary); box-shadow: var(--shadow-sm); }
.btn-primario:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
:root[data-theme="dark"] .btn-primario { --b-fg: #04130d; }
:root[data-theme="dark"] .btn-primario:hover { color: #04130d; }
.btn-peligro { --b-bg: var(--danger); --b-fg: #fff; --b-bd: var(--danger); }
.btn-peligro:hover { filter: brightness(.95); background: var(--danger); color: #fff; }
.btn-suave-peligro { --b-fg: var(--danger); }
.btn-suave-peligro:hover { background: var(--danger-soft); color: var(--danger); }
.btn-fantasma { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn-fantasma:hover { background: var(--surface-3); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-icono { width: 38px; padding: 0; }
.btn-sm.btn-icono { width: 32px; }
.btn-bloque { width: 100%; }

/* Spinner en los botones mientras trabaja el backend */
.btn.cargando { color: transparent !important; pointer-events: none; }
.btn.cargando > * { visibility: hidden; }
.btn.cargando::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--b-fg); border-right-color: transparent;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: girar .7s linear infinite; display: inline-block; }

/* ── Tarjetas ───────────────────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-cuerpo { padding: 20px; }
.card-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-cabecera p { color: var(--muted); font-size: 13px; margin-top: 2px; }

.grilla { display: grid; gap: 16px; }
.grilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grilla-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pila { display: flex; flex-direction: column; gap: 16px; }
.fila-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.espaciar { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }
.apagado-texto, .muted { color: var(--muted); }
.chico { font-size: 12.5px; }
.derecha { text-align: right; }
.oculto { display: none !important; }

/* Tarjetas de estadística */
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .icono { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat .valor { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .etiqueta { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tono-cpu { background: rgba(99, 102, 241, .12); color: var(--c-cpu); }
.tono-ram { background: rgba(14, 165, 233, .12); color: var(--c-ram); }
.tono-jug { background: rgba(16, 185, 129, .12); color: var(--c-players); }
.tono-disco { background: rgba(245, 158, 11, .14); color: var(--c-disk); }

/* ── Estado (pill) ──────────────────────────────────────────────────────── */

.estado {
  --e: var(--idle); --e-bg: var(--idle-soft);
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 9px;
  border-radius: 999px; background: var(--e-bg); color: var(--e);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado.encendido { --e: var(--ok); --e-bg: var(--ok-soft); }
.estado.encendido::before { box-shadow: 0 0 0 0 currentColor; animation: latido 2s infinite; }
.estado.iniciando, .estado.deteniendo, .estado.preparando { --e: var(--warn); --e-bg: var(--warn-soft); }
.estado.iniciando::before, .estado.deteniendo::before, .estado.preparando::before { animation: parpadeo 1s infinite; }
.estado.error { --e: var(--danger); --e-bg: var(--danger-soft); }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@keyframes parpadeo { 50% { opacity: .3; } }

.etiqueta-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600;
}
.etiqueta-chip.verde { background: var(--primary-soft); color: var(--primary-text); }
.etiqueta-chip.azul { background: var(--info-soft); color: var(--info); }
.etiqueta-chip.ambar { background: var(--warn-soft); color: var(--warn); }
.etiqueta-chip.rojo { background: var(--danger-soft); color: var(--danger); }

/* ── Medidores ──────────────────────────────────────────────────────────── */

.medidor .cab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; gap: 8px; }
.medidor .cab b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.barra { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.barra > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c, var(--primary)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.barra.alta > i { background: var(--warn); }
.barra.critica > i { background: var(--danger); }

/* ── Tarjetas de servidor (dashboard) ──────────────────────────────────── */

.servidores { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.srv { display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s, transform .15s; }
.srv:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.srv-cab { display: flex; gap: 12px; align-items: flex-start; padding: 18px 18px 14px; }
.srv-icono { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.srv-icono img { width: 30px; height: 30px; }
.srv-icono.apagado img { filter: grayscale(1); opacity: .55; }
.srv-nombre { min-width: 0; flex: 1; }
.srv-nombre a { color: var(--text); font-weight: 650; font-size: 15.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-nombre a:hover { color: var(--primary); }
.srv-nombre small { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.srv-metricas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 0 18px 16px; }
.srv-jugadores { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); min-height: 52px; }
.srv-jugadores .caras { display: flex; }
.srv-jugadores .caras img { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--surface); margin-left: -6px; background: var(--surface-3); image-rendering: pixelated; }
.srv-jugadores .caras img:first-child { margin-left: 0; }
.srv-pie { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); align-items: center; }
.srv-pie .direccion { margin-right: auto; font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: 0; padding: 0; }
.srv-pie .direccion:hover { color: var(--text); }

.error-linea { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); margin: 0 18px 14px; padding: 8px 10px; border-radius: 8px; }

/* ── Pestañas ───────────────────────────────────────────────────────────── */

.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted);
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
}
.pestanas button:hover { color: var(--text); }
.pestanas button.activa { color: var(--text); border-bottom-color: var(--primary); }
.panel-pestana { display: none; }
.panel-pestana.activa { display: block; animation: aparecer .2s ease; }
@keyframes aparecer { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Formularios ────────────────────────────────────────────────────────── */

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo .rotulo { font-size: 13px; font-weight: 600; color: var(--text-2); }
.campo .ayuda { font-size: 12.5px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--faint); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input.invalido { border-color: var(--danger); }
.form-grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grilla .completo { grid-column: 1 / -1; }

/* Switch (en vez de checkbox) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--border); }
.switch .texto b { display: block; font-weight: 600; font-size: 14px; }
.switch .texto small { color: var(--muted); font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .pista {
  width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong); flex: none;
  position: relative; transition: background .2s;
}
.switch .pista::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.switch input:checked + .pista { background: var(--primary); }
.switch input:checked + .pista::after { transform: translateX(17px); }
.switch input:focus-visible + .pista { box-shadow: 0 0 0 3px var(--primary-soft); }
.switch input:disabled + .pista { opacity: .5; }
.switch.mini { padding: 0; gap: 8px; justify-content: flex-start; font-size: 12.5px; }
.switch.mini .pista { width: 32px; height: 18px; }
.switch.mini .pista::after { width: 12px; height: 12px; }
.switch.mini input:checked + .pista::after { transform: translateX(14px); }
.consola-barra .switch.mini .pista { background: #2a3140; }
.consola-barra .switch.mini input:checked + .pista { background: #10b981; }

/* Deslizador de rango (RAM) */
.rango { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); outline: none; }
.rango::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); box-shadow: var(--shadow-sm); cursor: pointer; }
.rango::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); cursor: pointer; }

/* Selector segmentado */
.segmentos { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); flex-wrap: wrap; }
.segmentos label { position: relative; }
.segmentos input { position: absolute; opacity: 0; }
.segmentos span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.segmentos input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmentos input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }

/* Tarjetas seleccionables (tipo de servidor) */
.opciones-tarjeta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opcion-tarjeta { position: relative; cursor: pointer; }
.opcion-tarjeta input { position: absolute; opacity: 0; }
.opcion-tarjeta .caja { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .15s, background .15s; height: 100%; }
.opcion-tarjeta .caja b { display: block; font-weight: 650; }
.opcion-tarjeta .caja small { color: var(--muted); font-size: 12.5px; }
.opcion-tarjeta input:checked + .caja { border-color: var(--primary); background: var(--primary-soft); }
.opcion-tarjeta input:focus-visible + .caja { box-shadow: 0 0 0 3px var(--primary-soft); }

/* ── Tablas ─────────────────────────────────────────────────────────────── */

.tabla-envoltura { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: var(--surface-2); }
.tabla .acciones-celda { text-align: right; white-space: nowrap; }
.tabla .acciones-celda .btn + .btn { margin-left: 4px; }
.persona { display: flex; align-items: center; gap: 10px; min-width: 0; }
.persona b { display: block; font-weight: 600; }
.persona small { display: block; color: var(--muted); font-size: 12.5px; }

/* ── Consola ────────────────────────────────────────────────────────────── */

.consola {
  background: #0b0e13; color: #d1d5db; border-radius: var(--radius); border: 1px solid #1c2230;
  font: 12.5px/1.6 var(--mono); overflow: hidden; display: flex; flex-direction: column; height: 560px;
}
.consola-barra { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #1c2230; background: #0f131a; color: #8b95a5; font-family: var(--font); font-size: 12.5px; }
.consola-barra .puntos { display: flex; gap: 6px; }
.consola-barra .puntos i { width: 10px; height: 10px; border-radius: 50%; background: #2a3140; }
.consola-salida { flex: 1; overflow-y: auto; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.consola-salida .l { display: block; }
.consola-salida .l .t { color: #4b5563; margin-right: 8px; user-select: none; }
.consola-salida .l.err { color: #fca5a5; }
.consola-salida .l.cmd { color: #6ee7b7; }
.consola-salida .l.sis { color: #93c5fd; }
.consola-salida .l.warn { color: #fcd34d; }
.consola-salida .l.ok { color: #86efac; }
.consola-entrada { display: flex; align-items: center; gap: 8px; border-top: 1px solid #1c2230; padding: 8px 10px 8px 14px; background: #0f131a; }
.consola-entrada span { color: #10b981; font-weight: 700; }
.consola-entrada input { flex: 1; background: transparent; border: 0; color: #e5e7eb; font: 13px var(--mono); outline: none; height: 32px; }
.consola-entrada input::placeholder { color: #4b5563; }
.consola-entrada input:disabled { opacity: .5; }

/* ── Gráficos ───────────────────────────────────────────────────────────── */

.grafico { position: relative; height: 150px; }
.grafico svg { width: 100%; height: 100%; display: block; overflow: visible; }
.grafico .rejilla { stroke: var(--border); stroke-width: 1; }
.grafico .eje { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.grafico .vacio { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.grafico .punto-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -130%); opacity: 0; transition: opacity .1s; }
.grafico:hover .punto-tip { opacity: 1; }

/* ── Listas ─────────────────────────────────────────────────────────────── */

.lista { display: flex; flex-direction: column; }
.lista-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.lista-item:last-child { border-bottom: 0; }
.lista-item .cuerpo { flex: 1; min-width: 0; }
.lista-item .cuerpo b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-item .cuerpo small { display: block; color: var(--muted); font-size: 12.5px; }
.cabeza-jugador { width: 32px; height: 32px; border-radius: 8px; image-rendering: pixelated; background: var(--surface-3); flex: none; }

.vacio-bloque { text-align: center; padding: 40px 20px; color: var(--muted); }
.vacio-bloque .icono-grande { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.vacio-bloque b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.info-grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-grilla > div { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.info-grilla > div:nth-child(odd) { border-right: 1px solid var(--border); }
.info-grilla dt { font-size: 12px; color: var(--muted); font-weight: 550; }
.info-grilla dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }

.aviso { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; align-items: flex-start; }
.aviso .i { margin-top: 1px; }
.aviso.info { background: var(--info-soft); color: var(--info); }
.aviso.ambar { background: var(--warn-soft); color: var(--warn); }
.aviso.rojo { background: var(--danger-soft); color: var(--danger); }
.aviso.verde { background: var(--primary-soft); color: var(--primary-text); }
.aviso b { font-weight: 650; }
.aviso p { color: inherit; opacity: .9; }

/* ── Modales ────────────────────────────────────────────────────────────── */

.modal-fondo { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fundido .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: subir .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal.ancho { max-width: 640px; }
.modal-cab { padding: 20px 22px 0; display: flex; gap: 14px; align-items: flex-start; }
.modal-cab .icono-modal { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.modal-cab .icono-modal.peligro { background: var(--danger-soft); color: var(--danger); }
.modal-cab p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.modal-cuerpo { padding: 18px 22px; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }
@keyframes fundido { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ── Avisos deslizantes ─────────────────────────────────────────────────── */

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(400px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px;
  animation: entrar .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.saliendo { animation: salir .2s ease forwards; }
.toast .i { margin-top: 1px; }
.toast.ok .i { color: var(--ok); }
.toast.error .i { color: var(--danger); }
.toast.info .i { color: var(--info); }
@keyframes entrar { from { opacity: 0; transform: translateX(24px); } }
@keyframes salir { to { opacity: 0; transform: translateX(24px); } }

/* Menú desplegable */
.menu { position: fixed; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 150; animation: fundido .1s; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text-2); background: none; border: 0; font: 550 13.5px var(--font); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--text); }
.menu .peligro { color: var(--danger); }
.menu .peligro:hover { background: var(--danger-soft); color: var(--danger); }
.menu hr { margin: 6px 0; }

.esqueleto { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: brillo 1.4s infinite; border-radius: 8px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ── Login / Setup ──────────────────────────────────────────────────────── */

.acceso { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.acceso-arte {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(16, 185, 129, .35), transparent 60%),
              radial-gradient(900px 500px at 90% 90%, rgba(250, 204, 21, .16), transparent 60%),
              linear-gradient(160deg, #06120d 0%, #0a1a14 55%, #0b0f14 100%);
  color: #e8ecf2;
}
.acceso-arte::before {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.acceso-arte > * { position: relative; }
.acceso-arte .marca { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 750; }
.acceso-arte .marca img { width: 42px; }
.acceso-arte .marca span { color: #34d399; }
.acceso-arte .lema h2 { font-size: 38px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; max-width: 460px; }
.acceso-arte .lema p { color: #9fb3aa; margin-top: 14px; font-size: 15.5px; max-width: 420px; }
.acceso-arte .cubo-grande { position: absolute; right: -60px; top: 50%; width: 420px; transform: translateY(-50%) rotate(-8deg); opacity: .16; filter: blur(.3px); }
.acceso-arte .pie { color: #6b8077; font-size: 12.5px; }
.acceso-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.acceso-caja { width: 100%; max-width: 380px; }
.acceso-caja h1 { font-size: 26px; }
.acceso-caja > p { color: var(--muted); margin: 6px 0 26px; }
.acceso-caja .campo { margin-bottom: 14px; }
.acceso-caja .btn { height: 44px; margin-top: 6px; }
.acceso-caja .marca-movil { display: none; }
.codigo-totp { letter-spacing: .5em; text-align: center; font: 700 22px var(--mono) !important; height: 52px !important; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .grilla-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grilla-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.abierta { transform: none; }
  .velo { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 25; display: none; }
  .velo.visible { display: block; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 28px; height: 28px; }
  .contenido { padding: 20px 16px 48px; }
  .grilla-2, .grilla-3 { grid-template-columns: 1fr; }
  .form-grilla { grid-template-columns: 1fr; }
  .servidores { grid-template-columns: 1fr; }
  .acceso { grid-template-columns: 1fr; }
  .acceso-arte { display: none; }
  .acceso-caja .marca-movil { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 750; font-size: 18px; }
  .acceso-caja .marca-movil img { width: 34px; }
  .acceso-caja .marca-movil span { color: var(--accent); }
  .info-grilla { grid-template-columns: 1fr; }
  .info-grilla > div:nth-child(odd) { border-right: 0; }
  .consola { height: 460px; }
  .opciones-tarjeta { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
}

@media (max-width: 520px) {
  .grilla-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .icono { width: 34px; height: 34px; }
  .stat .valor { font-size: 18px; }
  .encabezado .acciones { width: 100%; }
  .encabezado .acciones .btn { flex: 1; }
  .tabla th, .tabla td { padding: 10px 12px; }
  .ocultar-movil { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
