:root {
  --green: #22C55E; --green-dark: #16A34A;
  --bg: #0B0F0D; --surface: #121A16; --surface-hi: #1A241F;
  --text: #E7F5EC; --muted: #A8BDB0; --danger: #F87171; --amber: #FBBF24; --blue: #60A5FA;
  --line: #22302a; --line-hi: #2c3c34;
  --pad-x: clamp(18px, 4vw, 48px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-card: 0 4px 14px rgba(0,0,0,.4);
  --shadow-pop: 0 16px 48px rgba(0,0,0,.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; overflow-x: hidden; }
img { display: block; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; }
a { color: inherit; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 5px; }
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 18%, #14251c 0%, var(--bg) 62%); padding: 20px; }
.auth-card { width: 400px; max-width: 94vw; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { width: 116px; margin: 0 auto 8px; }
.auth-brand h1 { font-size: 20px; font-weight: 800; }
.auth-brand h1 b { color: var(--green); }
.auth-brand .tag { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-hi); padding: 4px; border-radius: 12px; }
.auth-tab { flex: 1; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px; border-radius: 9px; }
.auth-tab.active { background: var(--green); color: #04170B; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; background: var(--surface-hi); color: var(--text); border: 1px solid var(--line-hi);
  border-radius: 11px; padding: 13px 15px; font-size: 15px; }
.field input:focus { outline: 2px solid var(--green-dark); }
.btn-primary { width: 100%; background: var(--green); color: #04170B; font-weight: 800; font-size: 15px;
  padding: 14px; border-radius: 12px; letter-spacing: .03em; transition: background .15s; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.auth-status { margin-top: 12px; font-size: 13px; text-align: center; min-height: 18px; color: var(--danger); }
.auth-status.ok { color: var(--green); }
.auth-alt { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.auth-alt a { color: var(--green); font-weight: 600; text-decoration: none; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 12px var(--pad-x); background: rgba(11,15,13,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 9px; cursor: pointer; text-decoration: none; color: var(--text); }
.topbar .brand img { width: 34px; height: 34px; }
.topbar .brand span { font-weight: 800; font-size: 16px; }
.topbar .brand b { color: var(--green); }
.topbar .spacer { flex: 1; }
.tb-link { background: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 9px; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.tb-link:hover { color: var(--text); background: var(--surface-hi); }
.tb-link.active { color: var(--green); }
.tb-user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tb-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #04170B; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

.page { padding: 22px var(--pad-x) 70px; max-width: 1400px; margin: 0 auto; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ---------- abas de tipo ---------- */
.type-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.type-tab { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-hi); color: var(--muted);
  font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 11px; transition: all .15s; }
.type-tab:hover { color: var(--text); }
.type-tab.active { background: var(--green); color: #04170B; }

/* busca */
.search-row { display: flex; gap: 10px; margin-bottom: 22px; max-width: 620px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--surface-hi);
  border: 1px solid var(--line-hi); border-radius: 13px; padding: 0 16px; color: var(--muted); }
.search-box:focus-within { border-color: var(--green-dark); color: var(--text); }
.search-box input { flex: 1; background: none; border: none; color: var(--text); font-size: 15px; padding: 13px 0; outline: none; }

/* ---------- grade de pôsteres ---------- */
.section-title { font-size: 18px; font-weight: 800; margin: 8px 0 14px; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.pcard { position: relative; cursor: pointer; transition: transform .18s var(--ease-out); }
.pcard:hover, .pcard:focus-visible { transform: translateY(-4px); }
.pcard .poster { width: 100%; aspect-ratio: 2/3; border-radius: 12px; object-fit: cover; background: var(--surface-hi); box-shadow: var(--shadow-card); }
.pcard .poster.ph { object-fit: contain; padding: 26px; opacity: .5; }
.pcard .pc-name { margin-top: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pc-year { color: var(--muted); font-size: 12px; }
.pc-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px); }
.pc-badge.have { background: rgba(34,197,94,.92); color: #04170B; }
.pc-badge.req { background: rgba(251,191,36,.92); color: #3a2c00; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; font-size: 14px; }
.skel { background: linear-gradient(100deg, var(--surface-hi) 40%, #243029 50%, var(--surface-hi) 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- modal detalhe ---------- */
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.75); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.modal { width: 760px; max-width: 96vw; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-pop); animation: rise .3s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.modal .backdrop { position: relative; height: 300px; background-size: cover; background-position: center; }
.modal .backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--surface) 2%, transparent 60%); }
.modal .close { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(0,0,0,.6); color: #fff; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.modal .close:hover { background: rgba(0,0,0,.85); }
.modal .body { padding: 0 26px 26px; margin-top: -60px; position: relative; z-index: 2; }
.modal h2 { font-size: 26px; text-shadow: 0 2px 12px rgba(0,0,0,.7); margin-bottom: 8px; }
.modal .meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal .meta .star { color: var(--green); font-weight: 800; }
.modal .desc { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 18px; max-width: 640px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; }
.status-pill.have { background: rgba(34,197,94,.16); color: var(--green); }
.status-pill.pedido { background: rgba(251,191,36,.16); color: var(--amber); }
.status-pill.fila { background: rgba(96,165,250,.16); color: var(--blue); }
.status-pill.add { background: rgba(34,197,94,.16); color: var(--green); }
.status-pill.rec { background: rgba(248,113,113,.16); color: var(--danger); }
.modal-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { background: var(--green); color: #04170B; font-weight: 800; padding: 12px 22px; border-radius: 11px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: background .15s; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface-hi); color: var(--text); }
.btn.ghost:hover { background: #24322b; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.modal .note-in { width: 100%; background: var(--surface-hi); color: var(--text); border: 1px solid var(--line-hi); border-radius: 11px; padding: 11px 13px; font-size: 14px; margin-bottom: 12px; }

/* status de temporadas (série já no catálogo) */
.season-box { width: 100%; }
.season-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.season-row b { font-size: 14px; }
.season-total { color: var(--muted); font-size: 12.5px; }
.season-hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.season-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.season-req[disabled] { opacity: .55; cursor: default; background: var(--surface-hi); color: var(--muted); }
.season-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 13.5px; font-weight: 600; }
.season-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(96,165,250,.16); color: var(--blue); vertical-align: middle; }

/* ---------- TV ao vivo ---------- */
.live-form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: 620px; margin-bottom: 26px; }
.live-form h3 { font-size: 16px; margin-bottom: 6px; }
.live-form p { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.live-form .row { display: flex; gap: 10px; }
.live-form input { flex: 1; background: var(--surface-hi); color: var(--text); border: 1px solid var(--line-hi); border-radius: 11px; padding: 12px 14px; font-size: 14px; }
.chan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.chan-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.chan-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ---------- meus pedidos / admin lista ---------- */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.req-card img { width: 46px; height: 68px; border-radius: 7px; object-fit: cover; background: var(--surface-hi); flex-shrink: 0; }
.req-card img.ph { object-fit: contain; padding: 8px; }
.req-main { flex: 1; min-width: 0; }
.req-main .rt { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-main .rs { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.type-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-hi); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.req-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.req-actions select { background: var(--surface-hi); color: var(--text); border: 1px solid var(--line-hi); border-radius: 9px; padding: 8px 10px; font-size: 13px; }

/* stats admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chip { background: var(--surface-hi); color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.filter-chip.active { background: var(--green); color: #04170B; font-weight: 800; }

/* toolbar admin: copiar lista + selecionar todos */
.ad-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ad-selall { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ad-selall input, .req-sel { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.req-card .req-sel { margin-right: 2px; }
.pop { display: inline-flex; align-items: center; background: rgba(34,197,94,.16); color: var(--green); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }

/* barra flutuante de ações em massa */
#ad-bulkbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(24px); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: min(760px, 94vw); }
#ad-bulkbar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.bulk-inner { display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line-hi); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-pop); flex-wrap: wrap; }
.bulk-inner > span { font-size: 13.5px; font-weight: 700; color: var(--text); }
.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-hi);
  color: var(--text); border: 1px solid var(--line-hi); padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow-pop); max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .modal .backdrop { height: 210px; }
  .modal h2 { font-size: 21px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
  .topbar { gap: 8px; padding: 10px 16px; }
  .tb-link span.lbl { display: none; }
  .req-card { flex-wrap: wrap; }
  .req-actions { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
