:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #212121;
  --surface-3: #2c2c2c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --muted: #898781;
  --accent: #22c55e;
  --accent-hover: #34d399;
  --accent-ink: #04210f;
  --live: #e5383b;
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --series-1: #3987e5;
  --series-2: #d95926;
  --gridline: #2c2c2a;
  --axis: #383835;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; word-break: break-all; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.ic { width: 20px; height: 20px; flex: none; }
.ball { width: 28px; height: 28px; flex: none; }
.wordmark { font-weight: 800; letter-spacing: -0.02em; font-size: 19px; }
.wordmark b { color: var(--accent); font-weight: 800; margin-left: 1px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; height: 44px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.secondary { background: var(--surface-3); }
.btn.secondary:hover:not(:disabled) { background: #3a3a3a; }
.btn.ghost { background: transparent; border-color: var(--border-strong); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #f05252; }
.btn.danger-outline { background: transparent; border-color: rgba(239, 68, 68, .5); color: #ff8a8a; }
.btn.danger-outline:hover { background: var(--danger-soft); border-color: var(--danger); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: transparent; transition: background .15s;
}
.icon-btn:hover, .icon-btn.active { background: var(--surface-3); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-2); font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { color: var(--text); background: var(--surface-2); }
.link-btn .ic { width: 16px; height: 16px; }
.link { color: #7cc4ff; }
.link:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 96px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--text-2); border-radius: 8px; display: grid; place-items: center; }
.reveal:hover { color: var(--text); }
.form-error { background: var(--danger-soft); color: #ff9b9b; border: 1px solid rgba(239, 68, 68, .3); padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 50% 0%, rgba(34, 197, 94, .16), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 80px, transparent 80px 160px);
}
.login-card {
  position: relative; width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 28px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 18px; }
.login-logo .ball { width: 34px; height: 34px; }
.login-card h1 { margin: 0; }
.login-card h1 .wordmark { font-size: 26px; }
.login-card > p { margin: 4px 0 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

/* ---------- Bloqueado ---------- */
.blocked-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 16px; }
.blocked-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(229, 56, 59, .12); color: #ff6b6e; display: grid; place-items: center; margin-bottom: 20px; }
.blocked-icon .ic { width: 36px; height: 36px; }
.blocked-page h1 { margin: 0 0 8px; font-size: 26px; }
.blocked-page p { margin: 0; color: var(--text-2); max-width: 400px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: rgba(15, 15, 15, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.search {
  flex: 0 1 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-2);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.btn.create { background: var(--surface-3); height: 38px; padding: 0 16px 0 12px; }
.btn.create:hover { background: #3a3a3a; }
.btn.create .ic { width: 22px; height: 22px; }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); margin-left: 6px; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; }
.avatar-sm .ic { width: 18px; height: 18px; }
.user-chip em { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
main { padding: 24px; max-width: 1760px; margin: 0 auto; }

/* ---------- Inicio ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-head h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(229, 56, 59, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 56, 59, .6); } 70% { box-shadow: 0 0 0 10px rgba(229, 56, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 56, 59, 0); } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 16px; }
.card { position: relative; min-width: 0; }

.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 17%, rgba(255, 255, 255, .13) 17% calc(17% + 1.5px), transparent calc(17% + 1.5px)),
    linear-gradient(90deg, transparent calc(50% - .75px), rgba(255, 255, 255, .13) calc(50% - .75px) calc(50% + .75px), transparent calc(50% + .75px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 10%, transparent 10% 20%),
    radial-gradient(120% 120% at 50% 0%, hsl(var(--hue, 140) 55% 26%), hsl(var(--hue, 140) 60% 10%));
}
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .55)); }
.thumb-art { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12% 10%; text-align: center; z-index: 1; }
.thumb-art .team {
  font-weight: 800; font-size: clamp(15px, 1.5vw, 22px); line-height: 1.1; text-transform: uppercase; letter-spacing: .01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.thumb-art .team.solo { -webkit-line-clamp: 3; }
.thumb-art .vs { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: rgba(255, 255, 255, .7); background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 999px; margin: 4px 0; }
.play-btn {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(0, 0, 0, .65); display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s;
}
.play-btn .ic { width: 28px; height: 28px; margin-left: 3px; }
.thumb:hover .play-btn { opacity: 1; transform: scale(1); }
.thumb:hover .thumb-art { opacity: .35; }
.thumb-art { transition: opacity .2s; }
.badge-live {
  position: absolute; z-index: 2; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 4px;
}
.badge-live i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.viewers-chip {
  position: absolute; z-index: 2; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0, 0, 0, .75); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px;
}
.viewers-chip .ic { width: 15px; height: 15px; }
.card-del {
  position: absolute; z-index: 3; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; transition: background .15s;
}
.card-del .ic { width: 17px; height: 17px; }
.card-del:hover { background: var(--danger); }
.card-meta { display: flex; gap: 12px; padding-top: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex: none; }
.avatar .ball { width: 24px; height: 24px; }
.card-text { min-width: 0; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 16px; line-height: 1.35; margin-bottom: 4px; }
.card-sub { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { display: grid; justify-items: center; text-align: center; padding: 80px 16px; color: var(--text-2); }
.empty > .ic { width: 44px; height: 44px; color: var(--muted); margin-bottom: 12px; }
.empty h2 { color: var(--text); font-size: 18px; margin: 0 0 6px; }
.empty p { margin: 0 0 20px; max-width: 420px; }
.empty.small { padding: 40px 16px; }
.empty.small > .ic { width: 32px; height: 32px; }

/* ---------- Ver directo ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1; }
.player-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.player-ended { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 6px; padding: 16px; background: var(--surface); }
.player-ended > .ic { width: 40px; height: 40px; color: var(--muted); }
.player-ended h2 { margin: 6px 0 0; font-size: 20px; }
.player-ended p { margin: 0 0 14px; color: var(--text-2); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; flex: none; margin-top: 1px; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.safe-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid transparent; background: none; font-size: 13px; font-weight: 600; text-align: left;
}
.safe-chip .ic { width: 17px; height: 17px; }
.safe-chip.on { color: #4ade80; background: rgba(34, 197, 94, .1); }
.safe-chip.off { color: #fbbf24; background: rgba(251, 191, 36, .1); }
button.safe-chip:hover { border-color: currentColor; }
.fs-btn { flex: none; }
.fs-exit {
  position: absolute; z-index: 3; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .6); color: #fff; display: none; place-items: center;
}
.fs-exit:hover { background: rgba(0, 0, 0, .85); }
.player:fullscreen { border-radius: 0; }
.player:fullscreen .fs-exit { display: grid; }
.player:-webkit-full-screen .fs-exit { display: grid; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
.player.pseudo-fs .fs-exit { display: grid; }
body.no-scroll { overflow: hidden; }
.watch-title { font-size: 21px; margin: 14px 0 12px; line-height: 1.3; word-wrap: break-word; }
.watch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.channel { display: flex; align-items: center; gap: 12px; }
.channel .avatar { width: 40px; height: 40px; }
.channel b { display: block; font-size: 15px; }
.channel .muted { font-size: 13px; }
.watch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.pill .ic { width: 16px; height: 16px; }
.pill.live { background: var(--live); color: #fff; font-size: 12px; letter-spacing: .04em; }
.pill.live i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.watch-side h3 { margin: 0 0 12px; font-size: 16px; }
.side-item { display: flex; gap: 10px; padding: 6px; margin: 0 -6px 4px; border-radius: 10px; transition: background .15s; }
.side-item:hover { background: var(--surface-2); }
.thumb.mini { width: 168px; flex: none; border-radius: 8px; }
.thumb.mini .thumb-art .team { font-size: 11px; }
.thumb.mini .thumb-art .vs { font-size: 8px; padding: 1px 5px; margin: 1px 0; }
.thumb.mini .badge-live { font-size: 9px; padding: 2px 5px; left: 6px; top: 6px; gap: 4px; }
.thumb.mini .badge-live i { width: 5px; height: 5px; }
.side-text { min-width: 0; display: grid; align-content: start; gap: 4px; }
.side-title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Admin ---------- */
.admin { max-width: 1280px; margin: 0 auto; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 24px; }
.realtime { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(34, 197, 94, .1); padding: 4px 10px; border-radius: 999px; }
.realtime i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.6s infinite; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .ic { width: 18px; height: 18px; }
.count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); font-size: 12px; text-align: center; }
.tabs a.active .count { background: var(--accent); color: var(--accent-ink); }

.stat-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.stat-strip > div { display: flex; align-items: baseline; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; }
.stat-strip b { font-size: 20px; }
.stat-strip span { color: var(--text-2); font-size: 13px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap.flush { border: 0; border-radius: 0; background: transparent; margin: 0 -20px -20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.muted { white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.ip { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.you { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(34, 197, 94, .12); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.role { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.role.admin { background: rgba(34, 197, 94, .14); color: #4ade80; }
.role.guest { background: rgba(57, 135, 229, .16); color: #7cb6f5; }
.role.anon { background: var(--surface-3); color: var(--text-2); }

.inline-form { display: flex; align-items: flex-end; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.inline-form .field { margin: 0; flex: 1; max-width: 360px; }
.inline-form .btn { height: 44px; }

/* ---------- Resumen ---------- */
.summary-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.summary-toolbar .icon-btn { margin-left: auto; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: none; color: var(--text-2); font-weight: 600; padding: 6px 14px; border-radius: 7px; }
.segmented button.active { background: var(--surface-3); color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; transition: opacity .2s; }
.kpis.loading { opacity: .5; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.kpi span { color: var(--text-2); font-size: 13px; }
.kpi b { font-size: 28px; font-weight: 650; letter-spacing: -0.01em; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 20px; margin-bottom: 16px; min-width: 0; }
.charts .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); min-height: 18px; margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { min-height: 230px; }
.chart-wrap { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .gridline { stroke: var(--gridline); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .band { fill: transparent; }
.chart .band.on { fill: rgba(255, 255, 255, .04); }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 160px; background: #262626; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 6px; }
.tip div span { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-table { max-height: 230px; overflow-y: auto; margin: 0 -20px -20px; }
.bars-h { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 60px; align-items: center; gap: 12px; }
.bar-label { color: var(--text-2); font-size: 13px; }
.bar-track { height: 10px; border-radius: 5px; background: rgba(57, 135, 229, .14); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--series-1); border-radius: 5px; }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, .6); animation: pop .18s; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 24px; }
.modal-head h2, .modal-body h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px 24px 4px; }
.modal-body > p { margin: 8px 0 16px; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 24px 20px; }
.modal-foot .spacer { flex: 1; }
.detect { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); margin: -6px 0 16px; }
.detect .ic { width: 17px; height: 17px; margin-top: 1px; }
.detect.ok { color: #4ade80; }
.detect.ok code { color: var(--text-2); }
.detect.bad { color: #ff9b9b; }
.found:empty { display: none; }
.found { display: grid; gap: 6px; margin: -6px 0 16px; }
.found-title { font-size: 12px; font-weight: 600; color: var(--text-2); }
.found-msg { font-size: 13px; color: var(--text-2); }
.found-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; text-align: left;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; transition: border-color .15s;
}
.found-item:hover { border-color: rgba(255, 255, 255, .3); }
.found-item.on { border-color: var(--accent); background: rgba(34, 197, 94, .06); }
.found-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; margin-top: 1px; }
.found-item.on .found-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); background: var(--accent); }
.found-text { min-width: 0; display: grid; gap: 2px; }
.found-text b { font-size: 13px; }
.found-text code { color: var(--text-2); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; margin-bottom: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check b { display: block; font-size: 13px; }
.check small { color: var(--text-2); font-size: 12px; }
.modal-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 16px; font-size: 12px; color: var(--text-2); }
.modal-note .ic { width: 15px; height: 15px; }
.preview { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Avisos ---------- */
#toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: #f1f1f1; color: #0f0f0f; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); animation: pop .2s; transition: opacity .3s, transform .3s; }
.toast .ic { width: 18px; height: 18px; color: #16a34a; }
.toast.error .ic { color: #dc2626; }
.toast.info .ic { color: var(--live); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .search { display: none; }
  .brand { margin-right: auto; }
  .btn.create span, .user-chip .user-name, .user-chip em { display: none; }
  .btn.create { width: 40px; padding: 0; }
  .user-chip { padding: 4px; }
  main { padding: 16px; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 22px; }
  .bar-row { grid-template-columns: 120px minmax(0, 1fr) 44px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form .field { max-width: none; }
  .thumb.mini { width: 140px; }
  .player-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .fs-btn { order: -1; height: 44px; }
  .safe-chip { align-self: flex-start; }
  .watch-actions .btn span { display: none; }
  .watch-actions .btn { width: 38px; padding: 0; }
  .admin-head h1 { font-size: 20px; }
}
@media (max-width: 420px) {
  .wordmark { font-size: 17px; }
  .modal-foot #preview-btn span { display: none; }
}
