:root {
  --bg: #0A0A0F;
  --bg-soft: #111118;
  --bg-elev: #1A1A24;
  --card: rgba(17, 17, 24, 0.65);
  --card-solid: #111118;
  --card-2: #1A1A24;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.15);
  --text: #EDEDED;
  --muted: #8B949E;
  --muted-2: #484F58;
  --accent: #00D4AA;
  --accent-2: #00B4D8;
  --accent-glow: rgba(0, 212, 170, 0.25);
  --ok: #2dd4a7;
  --warn: #fbbf24;
  --err: #f87171;
  --live: #ff3b6e;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --glass: blur(18px) saturate(140%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.55);
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-hero: linear-gradient(135deg, #fff, #A1A1AA);
  --grad-bg: radial-gradient(ellipse 80% 60% at 0% 0%, rgba(0, 212, 170, 0.05), transparent 60%),
             radial-gradient(ellipse 70% 50% at 100% 0%, rgba(0, 180, 216, 0.05), transparent 60%),
             linear-gradient(180deg, #0A0A0F 0%, #060609 100%);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ====== Light theme overrides ====== */
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-elev: #ffffff;
  --card: rgba(255, 255, 255, 0.78);
  --card-solid: #ffffff;
  --card-2: #eef1f8;
  --border: rgba(20, 30, 70, 0.08);
  --border-2: rgba(20, 30, 70, 0.16);
  --text: #0b1020;
  --muted: #5a6483;
  --muted-2: #8b94b3;
  --accent: #00A685;
  --accent-2: #0088A3;
  --accent-glow: rgba(0, 166, 133, 0.28);
  --ok: #00a48a;
  --warn: #c98700;
  --err: #dc2626;
  --live: #e11d48;
  --glass: blur(16px) saturate(160%);
  --shadow-sm: 0 1px 3px rgba(20, 30, 70, 0.06), 0 1px 2px rgba(20, 30, 70, 0.04);
  --shadow: 0 4px 16px rgba(20, 30, 70, 0.06), 0 2px 6px rgba(20, 30, 70, 0.04);
  --shadow-lg: 0 18px 48px rgba(20, 30, 70, 0.10), 0 6px 16px rgba(20, 30, 70, 0.05);
  --grad-bg: radial-gradient(ellipse 80% 60% at 0% 0%, rgba(0, 166, 133, 0.08), transparent 60%),
             radial-gradient(ellipse 70% 50% at 100% 0%, rgba(0, 136, 163, 0.06), transparent 60%),
             linear-gradient(180deg, #f4f6fb 0%, #eef1f8 100%);
  --grad-hero: linear-gradient(135deg, #111, #00A685);
}
:root[data-theme="light"] body { color-scheme: light; }
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #fff;
  border-color: var(--border-2);
}
:root[data-theme="light"] .iconbtn { background: #fff; }
:root[data-theme="light"] .btn { background: #fff; }
:root[data-theme="light"] .btn.primary { background: var(--grad-accent); color: #fff; }
:root[data-theme="light"] .btn.ghost { background: transparent; }
:root[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.72); }
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.78); }
:root[data-theme="light"] .nav-item:hover { background: rgba(20, 30, 70, 0.04); }
:root[data-theme="light"] .nav-item.active { background: rgba(59, 108, 255, 0.10); color: var(--accent); }
:root[data-theme="light"] .skeleton { background: rgba(20, 30, 70, 0.06); }
:root[data-theme="light"] .skeleton::after { background: linear-gradient(90deg, transparent 0%, rgba(20, 30, 70, 0.10) 50%, transparent 100%); }
:root[data-theme="light"] .live-row:hover { background: rgba(20, 30, 70, 0.04); }
:root[data-theme="light"] .live-row.active { background: rgba(59, 108, 255, 0.10); border-color: rgba(59, 108, 255, 0.25); }
:root[data-theme="light"] .video-box { background: #000; }
:root[data-theme="light"] .auth-hero {
  background: radial-gradient(ellipse 70% 80% at 20% 30%, rgba(59, 108, 255, 0.30), transparent 60%),
              radial-gradient(ellipse 70% 80% at 80% 70%, rgba(107, 78, 255, 0.30), transparent 60%),
              linear-gradient(180deg, #1a2240 0%, #0a0e1c 100%);
  color: #fff;
}
:root[data-theme="light"] .auth-hero h1,
:root[data-theme="light"] .auth-hero p,
:root[data-theme="light"] .auth-hero li { color: rgba(255, 255, 255, 0.92); }
:root[data-theme="light"] .auth-hero p.sub { color: rgba(255, 255, 255, 0.65); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 160, 220, 0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 160, 220, 0.35); }

/* ====== Inputs / botones ====== */
input, select, textarea {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--card-solid);
}
textarea { resize: vertical; min-height: 80px; font-family: ui-monospace, monospace; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }

.btn {
  border: 1px solid var(--border-2);
  background: var(--card-solid);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s, opacity .15s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: inherit;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--grad-accent);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 22px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px var(--accent-glow); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); color: var(--err); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.iconbtn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); width: 40px; height: 40px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px;
  transition: background .15s, border-color .15s;
}
.iconbtn:hover { background: var(--card); border-color: var(--border-2); }

/* ====== Tabs / pills ====== */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--border); border-radius: 12px; }
.tab {
  border: none; background: transparent; color: var(--muted);
  padding: 9px 18px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: inherit; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad-accent); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }

.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { width: auto; }

.pill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: rgba(140, 160, 220, 0.12); color: var(--muted); border: 1px solid var(--border);
}
.pill.ok { background: rgba(45, 212, 167, 0.14); color: var(--ok); border-color: rgba(45, 212, 167, 0.3); }
.pill.warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); border-color: rgba(251, 191, 36, 0.3); }
.pill.err { background: rgba(248, 113, 113, 0.14); color: var(--err); border-color: rgba(248, 113, 113, 0.3); }
.pill.live { background: rgba(255, 59, 110, 0.18); color: var(--live); border-color: rgba(255, 59, 110, 0.4); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); margin-right: 6px; animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(0.75); }
}

/* ====== Layout principal ====== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--grad-bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); backdrop-filter: var(--glass);
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  padding: 32px; box-shadow: var(--shadow-lg);
}
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--border); border-radius: 12px; margin-bottom: 20px; }
.auth-tab { flex: 1; border: none; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; cursor: pointer; font-weight: 600; font-family: inherit; }
.auth-tab.active { background: var(--grad-accent); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-hint { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-hint a { font-weight: 600; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-accent); display: grid; place-items: center;
  color: #fff; font-size: 18px; box-shadow: 0 6px 20px var(--accent-glow);
}
.brand h1 { font-size: 17px; margin: 0; letter-spacing: -0.02em; }
.brand p { margin: 0; font-size: 11px; color: var(--muted); }

/* ====== App shell ====== */
#appView { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; height: 100vh; overflow: hidden; }
#appView.collapsed { grid-template-columns: 64px 1fr; }

.topbar {
  grid-column: 1 / 3; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--card);
  backdrop-filter: var(--glass); border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 480px;
}
.search-box input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px 9px 38px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.search-box input:focus {
  border-color: var(--accent);
}
.search-box .ico {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip { font-size: 13px; color: var(--muted); padding: 0 8px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar {
  background: rgba(8, 12, 24, 0.5); backdrop-filter: var(--glass);
  border-right: 1px solid var(--border); padding: 18px 12px;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar .brand { padding: 8px 10px; margin-bottom: 14px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(140, 160, 220, 0.06); color: var(--text); }
.nav-item.active { background: rgba(91, 140, 255, 0.14); color: #fff; }
.nav-item.active .ico { color: var(--accent); }
.nav-item .ico { font-size: 17px; width: 22px; text-align: center; }
.sidebar .nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); padding: 18px 14px 8px; font-weight: 700; }
#appView.collapsed .nav-item .label,
#appView.collapsed .nav-section,
#appView.collapsed .brand h1,
#appView.collapsed .brand p { display: none; }
#appView.collapsed .nav-item { justify-content: center; padding: 11px; }

.main { overflow-y: auto; padding: 24px 28px 60px; }
.view { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* ====== Cards / glassmorphism ====== */
.card {
  background: var(--card); backdrop-filter: var(--glass);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: -0.01em; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 130px; padding: 16px 18px;
  background: rgba(20, 26, 48, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.08), transparent 60%);
  pointer-events: none;
}
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.stat .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.table tr:hover td { background: rgba(140, 160, 220, 0.04); }

.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.status.warn { color: var(--warn); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card-solid); border: 1px solid var(--border-2);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; z-index: 1000; animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ====== Player view ====== */
.player-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas:
    "toolbar toolbar"
    "main side";
  gap: 16px;
  align-items: start;
}
.player-toolbar { grid-area: toolbar; }
.player-main { grid-area: main; min-width: 0; }
.player-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; }

/* Modo explorar: ocultar video + info, alinear streams con cats */
.player-shell:not(.playing) .video-box,
.player-shell:not(.playing) .now-playing,
.player-shell:not(.playing) .info-panel { display: none; }
@media (max-width: 1100px) {
  .player-shell { grid-template-columns: 1fr; grid-template-areas: "toolbar" "main" "side"; }
}

.player-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.video-box {
  position: relative; aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-2);
}
.video-box video { width: 100%; height: 100%; display: block; background: #000; }

.video-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.8) 100%);
  opacity: 0; transition: opacity .25s;
}
.video-box:hover .video-overlay,
.video-box.show-controls .video-overlay { opacity: 1; }

.video-badge {
  position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; align-items: center;
  pointer-events: none;
}
.video-badge .channel-logo {
  width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,0.08);
  backdrop-filter: var(--glass); display: grid; place-items: center;
  border: 1px solid var(--border-2); overflow: hidden;
}
.video-badge .channel-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.video-controls {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: auto; opacity: 0; transition: opacity .25s;
}
.video-box:hover .video-controls,
.video-box.show-controls .video-controls { opacity: 1; }
.vc-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(20, 26, 48, 0.7); backdrop-filter: var(--glass);
  border: 1px solid var(--border-2); color: #fff;
  cursor: pointer; font-size: 14px; display: grid; place-items: center;
  transition: background .15s, transform .1s;
}
.vc-btn:hover { background: rgba(91, 140, 255, 0.3); }
.vc-btn:active { transform: scale(0.92); }
.vc-btn.fav.on { color: var(--warn); }
.vc-slider {
  flex: 1; height: 4px; background: rgba(255,255,255,0.18); border-radius: 2px; cursor: pointer;
  position: relative; overflow: hidden;
}
.vc-slider .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--grad-accent); border-radius: 2px; }
.vc-time { font-size: 12px; color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.vc-vol { width: 90px; }

.now-playing {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: var(--glass);
}
.now-playing .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.now-playing .t { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing .s { font-size: 12px; color: var(--muted); }
.fav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-2);
  background: var(--card-solid); color: var(--muted); cursor: pointer; font-size: 18px;
  transition: color .15s, transform .1s;
}
.fav-btn:hover { color: var(--warn); }
.fav-btn.on { color: var(--warn); }
.fav-btn:active { transform: scale(0.92); }

/* Right panel (now-playing info) */
.player-side { display: flex; flex-direction: column; gap: 14px; }
.info-panel {
  background: var(--card); backdrop-filter: var(--glass);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px;
}
.info-panel h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--muted); }
.info-row .v { font-weight: 600; text-align: right; }

.epg-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.epg-item { padding: 10px 12px; background: rgba(20, 26, 48, 0.5); border-radius: 10px; border-left: 3px solid transparent; transition: border-color .15s; }
.epg-item.now { border-left-color: var(--live); background: rgba(255, 59, 110, 0.06); }
.epg-item .time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.epg-item .title { font-size: 13px; font-weight: 600; margin-top: 2px; }

/* Channel list (left rail of player) */
.list-panel {
  background: var(--card); backdrop-filter: var(--glass);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; max-height: 75vh; overflow: hidden;
}
.list-panel h3 { padding: 16px 18px 10px; margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.list-panel .scroll { overflow-y: auto; flex: 1; padding: 0 8px 12px; }

.cat-item {
  padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13px;
  color: var(--muted); transition: background .15s, color .15s; display: flex; align-items: center; justify-content: space-between;
}
.cat-item:hover { background: rgba(140, 160, 220, 0.06); color: var(--text); }
.cat-item.active { background: rgba(91, 140, 255, 0.14); color: #fff; }
.cat-item .count { font-size: 10px; opacity: 0.7; }

/* Media grid (VOD / Series) */
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.media-card {
  background: var(--card-solid); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--border);
}
.media-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }
.media-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.media-thumb {
  aspect-ratio: 2/3; background: var(--bg-soft) center/cover no-repeat;
  display: grid; place-items: center; font-size: 32px; color: var(--muted-2);
  position: relative;
}
.media-thumb.landscape { aspect-ratio: 16/9; }
.media-card .media-body { padding: 10px 12px; }
.media-card .n { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.media-card[data-id] .media-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
.media-card:hover .media-thumb::after { opacity: 1; }

/* Continue watching rail */
.rail { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rail-item { flex: 0 0 240px; scroll-snap-align: start; }
.rail-item .thumb { aspect-ratio: 16/9; border-radius: var(--radius); background: var(--bg-soft) center/cover; position: relative; overflow: hidden; border: 1px solid var(--border); }
.rail-item .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.85) 100%); }
.rail-item .info { position: absolute; bottom: 10px; left: 12px; right: 12px; z-index: 2; color: #fff; }
.rail-item .info .t { font-size: 13px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.rail-item .progress { height: 3px; background: rgba(255,255,255,0.18); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.rail-item .progress .fill { height: 100%; background: var(--accent); }
.bar-mini { height: 4px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.bar-mini .fill { height: 100%; background: linear-gradient(90deg, var(--accent), #7c5cff); border-radius: 3px; transition: width .3s ease; }

/* Empty state */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--radius); font-size: 14px; }

/* Section header */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.section-head .more { font-size: 13px; color: var(--accent); cursor: pointer; }

@media (max-width: 720px) {
  #appView { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: 280px; z-index: 50; }
  .search-box { display: none; }
  .main { padding: 16px; }
}

/* ====== Iconos SVG ====== */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 14px; height: 14px; }
.brand-logo { display: block; box-shadow: 0 6px 20px var(--accent-glow); }

/* ====== Sidebar active indicator ====== */
.nav-item { position: relative; }
.nav-item::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: transparent;
  transition: background .15s var(--ease-out);
}
.nav-item.active::before { background: var(--grad-accent); }
.nav-item .ico { display: inline-flex; align-items: center; justify-content: center; }

/* ====== Focus accesible ====== */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus { outline: none; }

/* ====== Skeleton loaders ====== */
.skeleton {
  position: relative; overflow: hidden;
  background: rgba(140, 160, 220, 0.08);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(140, 160, 220, 0.14) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton.text { height: 14px; }
.skeleton.title { height: 22px; width: 60%; }
.skeleton.line { height: 10px; }
.skeleton.card { aspect-ratio: 2/3; border-radius: var(--radius); }
.skeleton.landscape { aspect-ratio: 16/9; border-radius: var(--radius); }
.skeleton.row { height: 56px; border-radius: var(--radius); }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.sk-rows { display: flex; flex-direction: column; gap: 8px; }
.sk-rail { display: flex; gap: 12px; overflow: hidden; }
.sk-rail > * { flex: 0 0 240px; }
.sk-stats { display: flex; gap: 14px; }
.sk-stats > * { flex: 1; height: 86px; border-radius: var(--radius); }

/* ====== Spinner ====== */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
.spinner.wrap { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Custom video controls ====== */
.video-box { user-select: none; }
.video-box video { pointer-events: none; }

.video-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 60%, rgba(0, 0, 0, 0.85) 100%);
  opacity: 0; transition: opacity .25s var(--ease-out);
  pointer-events: none;
}
.video-box:hover .video-controls,
.video-box.controls-visible .video-controls,
.video-box.paused .video-controls { opacity: 1; pointer-events: auto; }

.vc-progress {
  position: relative; height: 16px; cursor: pointer; display: flex; align-items: center; margin-bottom: 8px;
}
.vc-progress-track {
  position: relative; width: 100%; height: 4px;
  background: rgba(255, 255, 255, 0.22); border-radius: 2px; overflow: hidden;
  transition: height .15s var(--ease-out);
}
.vc-progress:hover .vc-progress-track { height: 6px; }
.vc-progress-buffer {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.35); border-radius: 2px;
}
.vc-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--grad-accent); border-radius: 2px;
}
.vc-progress-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0; transition: opacity .15s;
}
.vc-progress:hover .vc-progress-thumb { opacity: 1; }

.vc-bar { display: flex; align-items: center; gap: 6px; color: #fff; }
.vc-left, .vc-right { display: flex; align-items: center; gap: 4px; }
.vc-spacer { flex: 1; }

.vc-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: none; color: #fff;
  cursor: pointer; display: grid; place-items: center;
  transition: background .15s, transform .1s;
}
.vc-btn:hover { background: rgba(255, 255, 255, 0.15); }
.vc-btn:active { transform: scale(0.9); }
.vc-btn.primary {
  background: rgba(255, 255, 255, 0.18);
  width: 42px; height: 42px; border-radius: 50%;
}
.vc-btn.primary:hover { background: rgba(255, 255, 255, 0.28); }

.vc-volume { display: flex; align-items: center; gap: 2px; }
.vc-vol-slider {
  width: 0; height: 4px; opacity: 0; overflow: hidden;
  background: rgba(255, 255, 255, 0.22); border-radius: 2px;
  appearance: none; cursor: pointer;
  transition: width .2s var(--ease-out), opacity .2s;
}
.vc-volume:hover .vc-vol-slider { width: 80px; opacity: 1; }
.vc-vol-slider::-webkit-slider-thumb {
  appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; cursor: pointer; border: none;
}
.vc-vol-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; cursor: pointer;
}

.vc-time {
  font-size: 12px; color: rgba(255, 255, 255, 0.92); font-variant-numeric: tabular-nums;
  padding: 0 8px; min-width: 90px;
}
.vc-time .dur { color: rgba(255, 255, 255, 0.55); }

.vc-badge { display: inline-flex; align-items: center; gap: 4px; }

/* Big play button overlay (when paused) */
.video-bigplay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid; place-items: center; color: #fff; cursor: pointer;
  opacity: 0; transition: opacity .25s var(--ease-out), transform .15s;
}
.video-bigplay:hover { transform: translate(-50%, -50%) scale(1.05); }
.video-box.paused .video-bigplay { opacity: 1; }

.video-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: #fff;
  animation: spin 0.9s linear infinite;
  opacity: 0; transition: opacity .2s;
}
.video-box.loading .video-loading { opacity: 1; }

/* Live channel list (rows like TiviMate/Plex) */
.live-list { display: flex; flex-direction: column; gap: 6px; }
.live-row {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; transition: background .15s var(--ease-out), border-color .15s, transform .1s;
}
.live-row:hover { background: rgba(140, 160, 220, 0.06); border-color: var(--border); }
.live-row.active { background: rgba(91, 140, 255, 0.16); border-color: rgba(91, 140, 255, 0.35); }
.live-row:active { transform: scale(0.997); }
.live-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-soft); display: grid; place-items: center;
  border: 1px solid var(--border);
}
.live-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.live-info { flex: 1; min-width: 0; }
.live-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-meta { display: flex; align-items: center; gap: 6px; }

/* ====== Imagen lazy fade-in ====== */
.media-thumb img, .rail-item .thumb {
  background-size: cover;
}
.fade-in { animation: fadeIn .35s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ====== Empty states con personalidad ====== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 56px 24px; gap: 14px;
}
.empty-state .icon-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.18), rgba(124, 92, 255, 0.18));
  border: 1px solid var(--border-2);
  display: grid; place-items: center; color: var(--accent);
}
.empty-state h3 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.empty-state p { margin: 0 0 6px; color: var(--muted); max-width: 360px; font-size: 13px; }

/* ====== Auth split layout ====== */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; min-height: 100vh; }
.auth-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse 70% 80% at 20% 30%, rgba(91, 140, 255, 0.35), transparent 60%),
              radial-gradient(ellipse 70% 80% at 80% 70%, rgba(124, 92, 255, 0.35), transparent 60%),
              linear-gradient(180deg, #0a0e1c 0%, #060912 100%);
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='1' cy='1' r='1' fill='%23ffffff' opacity='0.04'/></svg>");
  pointer-events: none;
}
.auth-hero-content { position: relative; z-index: 1; max-width: 460px; }
.auth-hero .hero-logo { width: 56px; height: 56px; margin-bottom: 32px; }
.auth-hero h1 { font-size: 38px; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 16px; font-weight: 800; }
.auth-hero h1 .grad { background: linear-gradient(135deg, #5b8cff, #b599ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p.sub { font-size: 16px; color: var(--muted); margin: 0 0 32px; line-height: 1.5; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-hero li { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text); }
.auth-hero li .ico-circle {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(91, 140, 255, 0.16); border: 1px solid rgba(91, 140, 255, 0.3);
  display: grid; place-items: center; color: var(--accent); flex-shrink: 0;
}
.auth-hero .badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-side { display: grid; place-items: center; padding: 32px; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero ul { display: none; }
}

/* ====== Theme toggle button ====== */
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; display: grid; place-items: center; color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-2); background: var(--card); }

/* ====== Section heads with accent line ====== */
.section-head { align-items: center; gap: 12px; }
.section-head h2 { position: relative; padding-left: 14px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  background: var(--grad-accent); border-radius: 4px;
}

/* ====== EPG Timeline (Guía) ====== */
.guide-shell {
  display: grid; grid-template-columns: 200px 1fr;
  background: var(--card); backdrop-filter: var(--glass);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; height: calc(100vh - var(--topbar-h) - 100px); min-height: 480px;
}
@media (max-width: 720px) { .guide-shell { grid-template-columns: 140px 1fr; height: calc(100vh - var(--topbar-h) - 60px); } }

.guide-channels {
  border-right: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column;
}
.guide-channels-head {
  padding: 12px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.guide-channels-scroll { flex: 1; overflow: hidden; position: relative; }
.guide-channel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; height: 64px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.guide-channel-row:hover { background: rgba(140, 160, 220, 0.06); }
.guide-channel-row.active { background: rgba(91, 140, 255, 0.14); }
.guide-channel-row .ch-logo {
  width: 40px; height: 40px; border-radius: 8px; background: var(--bg-soft);
  overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--border);
}
.guide-channel-row .ch-logo img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 3px; }
.guide-channel-row .ch-name { font-size: 12px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.guide-timeline { display: flex; flex-direction: column; overflow: hidden; }
.guide-hours-head {
  display: flex; border-bottom: 1px solid var(--border); height: 40px;
  background: var(--bg-soft);
}
.guide-hour-cell {
  flex-shrink: 0; padding: 8px 12px; font-size: 11px; color: var(--muted);
  font-weight: 600; border-right: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.guide-programs-scroll { flex: 1; overflow: auto; position: relative; }
.guide-programs { position: relative; }
.guide-program-row {
  position: relative; height: 64px; border-bottom: 1px solid var(--border);
}
.guide-program-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border); }
.guide-program {
  position: absolute; top: 6px; bottom: 6px;
  background: var(--card-solid); border: 1px solid var(--border-2);
  border-radius: 7px; padding: 6px 10px; font-size: 11px;
  cursor: pointer; overflow: hidden; transition: transform .12s var(--ease-out), box-shadow .15s;
  display: flex; flex-direction: column; justify-content: center;
}
.guide-program:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
  z-index: 2;
}
.guide-program.now { background: linear-gradient(135deg, rgba(91, 140, 255, 0.18), rgba(124, 92, 255, 0.18)); border-color: rgba(91, 140, 255, 0.5); }
.guide-program .pg-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.guide-program .pg-time { font-size: 10px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.guide-now-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--live); z-index: 3; pointer-events: none;
  box-shadow: 0 0 12px var(--live);
}
.guide-now-line::before {
  content: ""; position: absolute; top: -5px; left: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--live);
}

.guide-empty { padding: 60px 24px; text-align: center; }
.guide-controls {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.guide-controls .zoom-group { display: inline-flex; gap: 2px; padding: 3px; background: var(--border); border-radius: 10px; }
.guide-controls .zoom-group button {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  padding: 7px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: inherit;
}
.guide-controls .zoom-group button.active { background: var(--grad-accent); color: #fff; }

/* ====== Modal ====== */
.modal-overlay {
  position: fixed; inset: 0; background: var(--bg-soft);
  backdrop-filter: blur(6px); z-index: 1000;
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .2s var(--ease-out);
}
.modal {
  background: var(--card-solid); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); padding: 24px;
  width: 100%; max-width: 540px; max-height: 86vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn .25s var(--ease-spring);
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-head h3 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.modal-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.modal-foot #cmStatus { flex: 1; }

.cat-manager-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; padding: 4px; background: var(--bg-soft); border-radius: var(--radius); border: 1px solid var(--border); }
.cm-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--card-solid); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.cm-item.dragging { opacity: 0.5; border-color: var(--accent); }
.cm-handle { color: var(--muted); cursor: grab; display: grid; place-items: center; padding: 2px; }
.cm-handle:active { cursor: grabbing; }
.cm-name { flex: 1; font-size: 14px; font-weight: 500; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-2); border-radius: 22px;
  transition: background .2s var(--ease-out);
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s var(--ease-spring);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* ====== URL M3U card (Ajustes) ====== */
.m3u-url-card { padding: 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px; }
.m3u-url-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.m3u-url-row input {
  flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  background: var(--card-solid);
}
.m3u-token-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.m3u-token-item {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.m3u-token-item .body { flex: 1; min-width: 0; }
.m3u-token-item .body .t { font-size: 13px; font-weight: 600; }
.m3u-token-item .body .s { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ====== Stats / Dashboard ====== */
.stats-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 820px) { .stats-grid { grid-template-columns: 1fr; } }

.bar-chart {
  display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 10px 0;
}
.bar-col {
  flex: 1; min-width: 28px; display: flex; flex-direction: column; align-items: center;
  height: 100%; cursor: default;
}
.bar-value {
  font-size: 11px; color: var(--muted); margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.bar-fill {
  flex: 1; width: 70%; max-width: 36px;
  background: var(--grad-accent); border-radius: 6px 6px 2px 2px;
  transition: height .3s var(--ease-out), filter .15s;
  min-height: 2px;
}
.bar-col:hover .bar-fill { filter: brightness(1.15); }
.bar-label { font-size: 10px; color: var(--muted-2); margin-top: 6px; font-variant-numeric: tabular-nums; }

.dist-row { display: grid; grid-template-columns: 90px 1fr 90px; gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; }
.dist-label { color: var(--text); font-weight: 500; }
.dist-bar { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; }
.dist-fill { height: 100%; background: var(--grad-accent); border-radius: 4px; transition: width .4s var(--ease-out); }
.dist-val { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ====== Ajustes (Settings) ====== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .settings-grid { grid-template-columns: 1fr; } }
.theme-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-card {
  cursor: pointer; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); transition: border-color .15s, transform .1s; position: relative;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); }
.theme-card.active::after {
  content: ""; position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad-accent);
  display: grid; place-items: center;
}
.theme-preview {
  height: 60px; border-radius: 8px; margin-bottom: 10px; padding: 8px;
  display: flex; gap: 6px; align-items: flex-end;
}
.theme-preview.dark { background: linear-gradient(135deg, #060912, #1a2040); }
.theme-preview.light { background: linear-gradient(135deg, #f4f6fb, #eef1f8); border: 1px solid var(--border); }
.theme-preview .dot { width: 8px; height: 8px; border-radius: 50%; }
.theme-card .name { font-weight: 700; font-size: 14px; }
.theme-card .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.info-list { display: flex; flex-direction: column; gap: 0; }
.info-list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.info-list-item:last-child { border-bottom: none; }
.info-list-item .ico-box {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(91, 140, 255, 0.10); color: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.info-list-item .body { flex: 1; min-width: 0; }
.info-list-item .body .t { font-weight: 600; font-size: 14px; }
.info-list-item .body .s { font-size: 12px; color: var(--muted); }

/* ============ PROBE DE COMPATIBILIDAD ============ */
.probe-verdict { font-size: 14px; line-height: 1.5; }
.probe-verdict.ok { background: rgba(45, 212, 167, 0.12); color: #2dd4a7; border: 1px solid rgba(45, 212, 167, 0.3); }
.probe-verdict.warn { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.probe-verdict.err { background: rgba(248, 113, 113, 0.12); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.dist-list { display: flex; flex-direction: column; gap: 6px; }
.dist-list .dist-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--bg-soft); border-radius: 8px; font-size: 13px; }
.dist-list .dist-label { font-family: monospace; font-size: 12px; }
.dist-list .dist-val { font-weight: 700; }
.spinner.wrap { display: flex; align-items: center; gap: 10px; padding: 20px 0; color: var(--muted); font-size: 13px; }

/* Explicit override to guarantee auth submit button text and background visibility in all states and themes */
#authSubmit {
  background: var(--grad-accent) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
#authSubmit:hover {
  filter: brightness(1.08) !important;
  box-shadow: 0 10px 30px var(--accent-glow) !important;
}
#authSubmit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* ====== Brand Logo Fix ====== */
.brand-logo-wrap { display: flex; align-items: center; }
.brand-logo-wrap svg { display: block; }
.brand-logo-wrap svg text { fill: var(--text) !important; }
.brand-logo-wrap svg [fill="#fff"], .brand-logo-wrap svg [fill="white"] { fill: var(--text); }

/* ====== Google Sign-In ====== */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); font-size: 14px; cursor: pointer; transition: all .2s; }
.google-btn:hover { border-color: var(--accent); background: var(--card); }




