:root {
  --bg: #060708; --surface: #0d0f12; --surface-2: #13161b; --line: #1d2128; --line-2: #2a2f38;
  --text: #f3f5f8; --muted: #8b93a1; --dim: #5d6573;
  --live: #ff3b55; --live-soft: rgba(255, 59, 85, .12);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .12);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12);
  --accent: #e8ecf2; --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.small { font-size: 13px; } .tiny { font-size: 12px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, transform .08s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: #1a1e25; border-color: #363c47; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: #07080a; border-color: var(--accent); }
.btn.primary:hover { background: #fff; }
.btn.danger { background: #3a1016; border-color: #5c1a24; color: #ffb4bd; }
.btn.danger:hover { background: #4a141c; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.block { width: 100%; }

/* Campos */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: #4b5361; box-shadow: 0 0 0 3px rgba(232, 236, 242, .08); }
.pw { position: relative; } .pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.pw button:hover { color: var(--text); }
.pw svg { width: 20px; height: 20px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

/* Etiquetas */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.live { color: var(--live); background: var(--live-soft); border-color: transparent; }
.tag.live .dot { animation: pulse 1.4s ease-in-out infinite; }
.tag.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tag.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

/* Login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 59, 85, .10), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; animation: rise .35s ease-out; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #15181d; border: 1px solid var(--line-2); display: grid; place-items: center; }
.brand-mark span { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 14px var(--live); }
.auth h1 { font-size: 26px; letter-spacing: -.02em; margin: 28px 0 6px; font-weight: 700; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.google:hover { background: #f1f1f1; }
.err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.note { color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Estrutura do app */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; background: #08090b; }
.side .brand { padding: 4px 10px 22px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; border: 0; background: none; text-align: left; font-weight: 500; min-height: 44px; position: relative; }
.nav svg { width: 19px; height: 19px; }
.nav:hover { color: var(--text); background: var(--surface); }
.nav.on { color: var(--text); background: var(--surface-2); }
.nav .badge { margin-left: auto; background: var(--warn); color: #000; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side .foot { margin-top: auto; padding: 10px 12px; font-size: 12px; color: var(--dim); }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(6, 7, 8, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top h2 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.top .sp { flex: 1; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.content { padding: 28px; max-width: 1180px; animation: rise .25s ease-out; }
.mobile-brand { display: none; }
.tabbar { display: none; }

/* Números */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--dim); margin-top: 2px; }
.stat.hl .v { color: var(--live); }

/* Cartões e listas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h .sp { flex: 1; }
.section { margin-bottom: 22px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.click { cursor: pointer; transition: background .12s; }
.row.click:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); flex: none; }
.ic svg { width: 19px; height: 19px; }
.ic.live { color: var(--live); background: var(--live-soft); border-color: transparent; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--dim); margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, .25); margin-bottom: 22px; }
.alert svg { width: 20px; height: 20px; color: var(--warn); flex: none; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filters .field { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* Esqueleto */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, #1b1f26 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Aviso e modal */
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; background: #15181d; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 16px; font-size: 14px; font-weight: 500; display: flex; gap: 9px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: drop .25s ease-out; max-width: calc(100vw - 32px); }
.toast svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.toast.bad svg { color: var(--bad); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; animation: rise .22s ease-out; max-height: calc(100dvh - 32px); overflow: auto; }
.modal.wide { max-width: 760px; }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.modal .actions { justify-content: flex-end; margin-top: 18px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line-2); overflow: auto; animation: slide .25s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { position: sticky; top: 0; background: var(--surface); display: flex; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); z-index: 2; }
.drawer-b { padding: 18px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; margin-bottom: 18px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 6px 6px 12px; font-size: 13px; margin-top: 8px; }
.copybox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
video.player { width: 100%; max-height: 70dvh; background: #000; border-radius: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Interruptor e opção estilizada */
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all .15s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check .box svg { width: 13px; height: 13px; color: #000; opacity: 0; }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(232, 236, 242, .15); }

/* Celular */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 0 16px; height: 56px; }
  .mobile-brand { display: flex; }
  .top h2 { display: none; }
  .content { padding: 18px 16px 110px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .v { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .row { padding: 14px; align-items: flex-start; flex-wrap: wrap; }
  .row .actions { width: 100%; }
  .row .actions .btn { flex: 1; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(8, 9, 11, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; min-height: 50px; border: 0; background: none; color: var(--dim); font-size: 11px; font-weight: 500; cursor: pointer; position: relative; }
  .tab svg { width: 22px; height: 22px; }
  .tab.on { color: var(--text); }
  .tab .badge { position: absolute; top: 2px; left: 55%; background: var(--warn); color: #000; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 0 5px; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; }
  .drawer { width: 100vw; }
  .modal .actions .btn { flex: 1; }
}

/* Tela de assistir */
.viewer { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
.vbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: linear-gradient(#000, rgba(0, 0, 0, 0)); position: absolute; top: 0; left: 0; right: 0; z-index: 5; transition: opacity .3s; }
.vbar.hide { opacity: 0; pointer-events: none; }
.vbar .ttl { min-width: 0; flex: 1; }
.vbar .ttl b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vstage { flex: 1; display: grid; place-items: center; min-height: 0; }
.vstage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vcenter { text-align: center; padding: 24px; max-width: 420px; }
.vcenter h2 { font-size: 20px; margin: 14px 0 6px; }
.vcenter p { color: var(--muted); margin: 0 0 18px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--text); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.vfoot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0, 0, 0, 0), #000); transition: opacity .3s; z-index: 5; }
.vfoot.hide { opacity: 0; pointer-events: none; }
.qbars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.qbars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.qbars i.on { background: var(--ok); }
.qbars.mid i.on { background: var(--warn); } .qbars.low i.on { background: var(--bad); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
