/* =====================================================================
   Skin "Claro": dashboard SaaS claro con tarjetas y colores semánticos.
   Se activa con <html data-skin="light">. No cambia la estructura: solo
   redefine variables y ajusta los pocos colores fijos del tema oscuro.
   ===================================================================== */
html[data-skin="light"] {
  color-scheme: light;
  --bg: #f1f4fb;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --card-2: #f1f5f9;
  --line: #e5e9f0;
  --line-2: #d6dce6;
  --text: #0f172a;
  --muted: #64748b;
  --dim: #94a3b8;
  --accent: #2563eb;
  --accent-2: #2563eb;
  --live: #ef4444;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --info: #2563eb;
  --purple: #9333ea;
  --spark: #2563eb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root { --spark: #ff6a55; }

html[data-skin="light"] body {
  background:
    radial-gradient(900px 500px at 0% 0%, #e0e7ff 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #ede9fe 0%, transparent 55%),
    linear-gradient(180deg, #eef2fb 0%, #f8fafc 70%);
  background-attachment: fixed;
}

/* ------------------------------------------------ superficies con sombra */
html[data-skin="light"] .card,
html[data-skin="light"] .panel,
html[data-skin="light"] .stat,
html[data-skin="light"] .rs-card,
html[data-skin="light"] .svc,
html[data-skin="light"] .login-card {
  border-color: transparent;
  box-shadow: var(--shadow);
}
html[data-skin="light"] .card { border-radius: 16px; }
html[data-skin="light"] .card:hover { border-color: transparent; box-shadow: 0 2px 4px rgba(15,23,42,.05), 0 10px 28px rgba(15,23,42,.08); }
html[data-skin="light"] .login-card { box-shadow: 0 20px 60px rgba(37, 99, 235, .12); }

/* ------------------------------------------------ barra lateral */
html[data-skin="light"] .sidebar { background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html[data-skin="light"] .nav-btn:hover { background: #f1f5f9; }
html[data-skin="light"] .nav-btn.active {
  background: #eff6ff; color: #1d4ed8; box-shadow: none; font-weight: 600;
}
html[data-skin="light"] .nav-btn.active svg { color: #2563eb; }
html[data-skin="light"] .brand-dot { box-shadow: 0 0 0 4px rgba(239,68,68,.15); }

/* ------------------------------------------------ botones y formularios */
html[data-skin="light"] .btn { background: #fff; border-color: var(--line-2); color: #1e293b; box-shadow: 0 1px 1px rgba(15,23,42,.03); }
html[data-skin="light"] .btn:hover { background: #f8fafc; border-color: #c4ccd8; }
html[data-skin="light"] .btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-skin="light"] .btn.primary:hover { background: #1d4ed8; }
html[data-skin="light"] .btn.danger { color: #dc2626; }
html[data-skin="light"] .btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
html[data-skin="light"] .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
html[data-skin="light"] .btn.ghost:hover { background: #f1f5f9; color: var(--text); }
html[data-skin="light"] input[type=text],
html[data-skin="light"] input[type=password],
html[data-skin="light"] input[type=number],
html[data-skin="light"] select,
html[data-skin="light"] textarea { background: #fff; }
html[data-skin="light"] input:focus,
html[data-skin="light"] select:focus,
html[data-skin="light"] textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
html[data-skin="light"] .switch .track { background: #cbd5e1; }
html[data-skin="light"] .switch input:checked + .track { background: #2563eb; }
html[data-skin="light"] .switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }

/* ------------------------------------------------ chips y avisos (pastel) */
html[data-skin="light"] .chip { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
html[data-skin="light"] .chip.ok { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }
html[data-skin="light"] .chip.err { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
html[data-skin="light"] .chip.warn { color: #b45309; background: #fef3c7; border-color: #fde68a; }
html[data-skin="light"] .chip.info { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
html[data-skin="light"] .alert.info { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; }
html[data-skin="light"] .alert.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
html[data-skin="light"] .alert.err { color: #991b1b; background: #fef2f2; border-color: #fecaca; }

html[data-skin="light"] .chip.live-chip { color: #fff; background: #ef4444; border-color: #ef4444; }
html[data-skin="light"] .ch-table tbody tr:hover { background: #f8fafc; }

/* ------------------------------------------------ indicadores con color por tipo */
html[data-skin="light"] .stat { position: relative; overflow: hidden; padding-top: 14px; }
html[data-skin="light"] .stat::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone, #2563eb);
}
html[data-skin="light"] .stat .value { color: var(--tone-text, #1d4ed8); }
html[data-skin="light"] .stat .label { color: #64748b; font-weight: 600; }
html[data-skin="light"] .stat.tone-blue   { --tone: #3b82f6; --tone-text: #1d4ed8; background: linear-gradient(180deg, #eff6ff 0%, #fff 70%); }
html[data-skin="light"] .stat.tone-green  { --tone: #22c55e; --tone-text: #15803d; background: linear-gradient(180deg, #f0fdf4 0%, #fff 70%); }
html[data-skin="light"] .stat.tone-purple { --tone: #a855f7; --tone-text: #7e22ce; background: linear-gradient(180deg, #faf5ff 0%, #fff 70%); }
html[data-skin="light"] .stat.tone-amber  { --tone: #f59e0b; --tone-text: #b45309; background: linear-gradient(180deg, #fffbeb 0%, #fff 70%); }
html[data-skin="light"] .stat.tone-slate  { --tone: #94a3b8; --tone-text: #334155; background: linear-gradient(180deg, #f8fafc 0%, #fff 70%); }
html[data-skin="light"] .stat.tone-red    { --tone: #ef4444; --tone-text: #b91c1c; background: linear-gradient(180deg, #fef2f2 0%, #fff 70%); }
html[data-skin="light"] .bar { background: #e2e8f0; }
html[data-skin="light"] .bar > i { background: #22c55e; }

/* ------------------------------------------------ tarjetas de canal */
html[data-skin="light"] .thumb {
  background: repeating-linear-gradient(135deg, #1e293b 0 12px, #223047 12px 24px);
}
html[data-skin="light"] .thumb .play { background: rgba(255,255,255,.18); color: #fff; }
html[data-skin="light"] .thumb .play:hover { background: #2563eb; }
html[data-skin="light"] .thumb .res, html[data-skin="light"] .thumb .close-video { color: #fff; }
html[data-skin="light"] .badge-off { background: #64748b; }
html[data-skin="light"] .meta div { background: #f8fafc; border-color: #eef1f5; }
html[data-skin="light"] .meta b { color: #0f172a; }
html[data-skin="light"] .card-title .app { color: #94a3b8; }
html[data-skin="light"] .spark .kbps { color: #1d4ed8; }
html[data-skin="light"] .card-actions { background: #fbfcfe; }

/* ------------------------------------------------ tablas, pestañas, restreams */
html[data-skin="light"] th { color: #64748b; background: #f8fafc; }
html[data-skin="light"] tbody tr:hover { background: #f8fafc; }
html[data-skin="light"] .secret { background: #f1f5f9; }
html[data-skin="light"] .tabs { background: #f1f5f9; }
html[data-skin="light"] .tabs button.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
html[data-skin="light"] .rs-route .arrow { color: #2563eb; }
html[data-skin="light"] .rs-head { background: #fff; border-radius: 10px 10px 0 0; }

/* Los logs se quedan oscuros (se leen mejor como terminal) */
html[data-skin="light"] pre.log { background: #0f172a; border-color: #1e293b; color: #cbd5e1; }

/* ------------------------------------------------ modales y avisos flotantes */
html[data-skin="light"] .modal-back { background: rgba(15,23,42,.35); }
html[data-skin="light"] .modal { border-color: transparent; box-shadow: 0 30px 80px rgba(15,23,42,.25); }
html[data-skin="light"] .toast { background: #fff; border-color: #e2e8f0; box-shadow: 0 10px 30px rgba(15,23,42,.12); }

@media (max-width: 1099px) {
  html[data-skin="light"] .sidebar { background: #fff; }
  html[data-skin="light"] .sidebar-backdrop { background: rgba(15,23,42,.35); }
  html[data-skin="light"] .sidebar.open { box-shadow: 20px 0 60px rgba(15,23,42,.18); }
}

/* ------------------------------------------------ botón de cambio de tema */
.skin-toggle { gap: 6px; }
.skin-toggle .ico-sun { display: none; }
html[data-skin="light"] .skin-toggle .ico-sun { display: block; }
html[data-skin="light"] .skin-toggle .ico-moon { display: none; }
.login-skin { position: fixed; top: 16px; right: 16px; }

@media (max-width: 639px) {
  html[data-skin="light"] .table-wrap tbody tr { background: #fff; }
}
html[data-skin="light"] .nav-btn.active:hover { background: #eff6ff; color: #1d4ed8; }

html[data-skin="light"] .ch-table tr.is-sel { background: #eff6ff; }
html[data-skin="light"] .card.is-sel { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb, var(--shadow); }
html[data-skin="light"] .selbar { background: #fff; border-color: #dbe2ec; box-shadow: 0 16px 40px rgba(15,23,42,.18); }
html[data-skin="light"] .seg { background: #f1f5f9; border-color: #e2e8f0; }
html[data-skin="light"] .seg button.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
html[data-skin="light"] .player-bar { background: #f8fafc; }
html[data-skin="light"] .badge-live { background: rgba(15,23,42,.55) !important; }
html[data-skin="light"] .live-dot { background: #cbd5e1; }
html[data-skin="light"] .live-dot.on { background: #22c55e; }
html[data-skin="light"] .fwd-sec { color: #2563eb; }
html[data-skin="light"] .fwd-preview { background: #f8fafc; }
html[data-skin="light"] .link-btn { color: #2563eb; }
html[data-skin="light"] .srv-card { border-color: transparent; box-shadow: var(--shadow); border-radius: 12px; }
html[data-skin="light"] .srv-card .card-actions { background: #fbfcfe; border-radius: 0 0 16px 16px; }
html[data-skin="light"] .srv-ico { background: #eff6ff; border-color: #dbeafe; color: #2563eb; }
html[data-skin="light"] .srv-nums div { background: #f8fafc; border-color: #eef1f5; }
html[data-skin="light"] .srv-offline { background: #f8fafc; }
html[data-skin="light"] .chip.srv-chip { color: #7e22ce; background: #faf5ff; border-color: #e9d5ff; }
html[data-skin="light"] .chip.srv-chip.err { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
html[data-skin="light"] .lang-switch, html[data-skin="light"] .user-btn { background: #fff; border-color: #dbe2ec; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
html[data-skin="light"] .lang-switch button.active { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }
html[data-skin="light"] .user-dd { background: #fff; border-color: #e2e8f0; box-shadow: 0 20px 50px rgba(15,23,42,.18); }
html[data-skin="light"] .dd-item:hover { background: #f1f5f9; }
html[data-skin="light"] .dd-item .dd-val { background: #f8fafc; }
html[data-skin="light"] .avatar { background: linear-gradient(135deg, #2563eb, #9333ea); }
html[data-skin="light"] .mos-card { border-color: transparent; box-shadow: var(--shadow); border-radius: 12px; }
html[data-skin="light"] .mos-card .card-actions { background: #fbfcfe; }
html[data-skin="light"] .lay-pick button { background: #fff; }

/* densidad compacta */
html[data-skin="light"] .card { border-radius: 12px; }
html[data-skin="light"] .stat { padding-top: 12px !important; }
