:root {
  --fundo: #f4f5f8; --cartao: #fff; --texto: #1b1f2a; --suave: #5d6475; --borda: #dde1ea;
  --primaria: #1f3fbf; --primaria-texto: #fff; --perigo: #b3261e; --ok: #1a7f4b; --aviso: #8a5a00;
  --raio: 14px; --sombra: 0 1px 2px rgba(20,30,60,.06), 0 4px 16px rgba(20,30,60,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --fundo: #11141b; --cartao: #1a1e28; --texto: #e8eaf0; --suave: #9aa1b2; --borda: #2c3240;
    --primaria: #5b7cff; --perigo: #ff6b61; --ok: #4cc38a; --aviso: #f0b847; --sombra: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primaria); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.8rem 0 .7rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.pequeno { font-size: .8rem; }
.mt { margin-top: 1rem; }
.inline { display: inline; }

.topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 16px;
  background: var(--primaria); color: var(--primaria-texto); flex-wrap: wrap; }
.topo a, .topo .link { color: inherit; text-decoration: none; }
.marca { font-weight: 700; letter-spacing: .02em; }
.topo nav { display: flex; gap: 1rem; align-items: center; font-size: .95rem; flex-wrap: wrap; }
.marca-grande { color: var(--primaria); text-align: center; font-size: 1.8rem; }

.conteudo { max-width: 640px; margin: 0 auto; padding: 1.2rem 16px 3rem; }
.conteudo.estreito { max-width: 420px; padding-top: 2.5rem; }
.conteudo.largo { max-width: 1100px; }
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.cartao.centro { text-align: center; }
.cartao.vazio { text-align: center; color: var(--suave); }
.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.cabecalho h1 { margin: 0; }
.voltar { margin: 0 0 .6rem; }
.voltar a { text-decoration: none; }
.dica { color: var(--suave); font-size: .9rem; }
.faixa { padding: .7rem 16px; text-align: center; font-weight: 600; }
.faixa.erro { background: var(--perigo); color: #fff; }
.msg { padding: .75rem .9rem; border-radius: 10px; margin: 0 0 1rem; }
.msg.erro { background: color-mix(in srgb, var(--perigo) 12%, transparent); color: var(--perigo); }
.msg.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.grande-texto { font-size: 1.3rem; letter-spacing: .05em; }

label { display: block; margin: 0 0 .9rem; font-weight: 600; font-size: .92rem; }
label small { display: block; font-weight: 400; color: var(--suave); margin-top: .25rem; }
input, select { display: block; width: 100%; margin-top: .3rem; padding: .7rem .8rem; font: inherit; font-weight: 400;
  color: var(--texto); background: var(--fundo); border: 1px solid var(--borda); border-radius: 10px; min-height: 46px; }
input:focus, select:focus { outline: 2px solid var(--primaria); outline-offset: 1px; }
input.codigo, input.pin { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; padding: .5rem 0; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; }
.grade2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 720px) { .grade2 { grid-template-columns: 1fr 1fr; } .grade2 .span2 { grid-column: span 2; } .grade2 > .botao { justify-self: start; } }

.botao { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.1rem; min-height: 44px;
  font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--borda); background: var(--cartao); color: var(--texto);
  text-decoration: none; cursor: pointer; }
.botao.primario { background: var(--primaria); color: var(--primaria-texto); border-color: var(--primaria); }
.botao.perigo { color: var(--perigo); border-color: color-mix(in srgb, var(--perigo) 40%, transparent); background: transparent; }
.botao.largo { width: 100%; }
.botao.grande { min-height: 56px; font-size: 1.05rem; }
.botao.pequeno { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.botao:disabled { opacity: .6; cursor: wait; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

.etiqueta { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600;
  background: color-mix(in srgb, var(--suave) 14%, transparent); color: var(--suave); }
.etiqueta.no-ar { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.etiqueta.agendada { background: color-mix(in srgb, var(--aviso) 16%, transparent); color: var(--aviso); }
.etiqueta.erro { background: color-mix(in srgb, var(--perigo) 14%, transparent); color: var(--perigo); }
.status { font-size: .85rem; font-weight: 600; }
.status::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05rem; }
.status.on { color: var(--ok); } .status.on::before { background: var(--ok); }
.status.off { color: var(--suave); } .status.off::before { background: var(--suave); }

/* Lista de TVs */
.lista-tvs { display: grid; gap: .8rem; }
.tv-item { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: inherit; margin: 0; }
.miniatura { width: 112px; aspect-ratio: 16/9; flex: none; border-radius: 8px; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.miniatura img, .miniatura video { width: 100%; height: 100%; object-fit: cover; }
.icone-tv { color: #fff; opacity: .5; font-weight: 700; }
.tv-info { display: flex; flex-direction: column; min-width: 0; }

/* Divulgação */
.campanha .tira { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 .5rem; }
.tira figure { margin: 0; flex: none; width: 120px; }
.tira img, .tira video { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.tira figcaption { font-size: .75rem; color: var(--suave); text-align: center; }
details { margin: .4rem 0 .8rem; }
summary { cursor: pointer; color: var(--primaria); font-weight: 600; padding: .3rem 0; }
.tecnico { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; font-size: .9rem; }
.tecnico dt { color: var(--suave); } .tecnico dd { margin: 0; word-break: break-all; }

/* Nova divulgação */
.passo { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.passo span { display: inline-flex; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primaria); color: var(--primaria-texto); align-items: center; justify-content: center; font-size: .9rem; }
.seletor { position: relative; overflow: hidden; }
.seletor input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; min-height: 0; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.chips button { font: inherit; font-size: .9rem; padding: .45rem .9rem; border-radius: 99px; border: 1px solid var(--borda); background: var(--fundo); color: var(--texto); cursor: pointer; min-height: 40px; }
.chips button.sel { background: var(--primaria); color: var(--primaria-texto); border-color: var(--primaria); }
.tempo-todos { margin-top: 1rem; font-size: .9rem; color: var(--suave); }
.itens { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.item { display: grid; grid-template-columns: 96px 1fr auto; gap: .7rem; align-items: center; padding: .5rem; border: 1px solid var(--borda); border-radius: 10px; }
.previa { width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #000; }
.previa img, .previa video { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-controles { min-width: 0; }
.item-nome { display: block; font-size: .8rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-controles select { margin-top: .2rem; min-height: 38px; padding: .3rem .5rem; }
.video-nota { font-size: .85rem; }
.item-acoes { display: flex; flex-direction: column; gap: .25rem; }
.item-acoes button { width: 36px; height: 30px; border: 1px solid var(--borda); background: var(--fundo); color: var(--texto); border-radius: 6px; cursor: pointer; font-size: .75rem; }
.progresso { position: relative; height: 34px; border-radius: 10px; background: var(--borda); overflow: hidden; margin-bottom: 1rem; }
.progresso div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primaria); transition: width .2s; }
.progresso span { position: relative; display: block; text-align: center; line-height: 34px; font-weight: 600; font-size: .9rem; color: #fff; mix-blend-mode: difference; }

/* Tabelas do admin */
.tabela-rolagem { overflow-x: auto; margin-bottom: 1rem; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--cartao); }
.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th, .tabela td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .acoes { white-space: nowrap; text-align: right; }

/* Entrega de código e PIN no admin */
.centro-texto { text-align: center; }
.cartao.destaque { border: 2px solid var(--primaria); }
.entrega { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.entrega > div { display: flex; flex-direction: column; gap: .2rem; }
.entrega small { color: var(--suave); max-width: 22rem; }
.rotulo { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 600; }
.numero-grande { font-size: 2.2rem; letter-spacing: .12em; color: var(--primaria); }
