:root {
  --bg: #0f172a; --card: #1e293b; --linha: #334155; --txt: #e2e8f0; --sub: #94a3b8;
  --pri: #f97316; --ok: #22c55e; --alerta: #eab308; --erro: #ef4444; --azul: #38bdf8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; }
body { padding-bottom: env(safe-area-inset-bottom); }
/* celular com app instalado: o topo nao fica atras do relogio, wi-fi e bateria */
.topo { padding-top: calc(.7rem + env(safe-area-inset-top)) !important; padding-left: calc(1rem + env(safe-area-inset-left)) !important; padding-right: calc(1rem + env(safe-area-inset-right)) !important; }
body:not(:has(.topo)) { padding-top: env(safe-area-inset-top); }
.oculto { display: none !important; }
a { color: var(--azul); }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p.sub, .sub { color: var(--sub); font-size: .88rem; margin: .2rem 0 .8rem; }

.marca { font-size: 1.1rem; letter-spacing: .02em; }
.marca b { color: var(--pri); }
.tela-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.tela-login .sobre { width: 100%; max-width: 340px; }
.entrada { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: .9rem; text-align: center; }
.entrada .marca { font-size: 2.2rem; }
.entrada .cartao { text-align: center; padding: 1.2rem; }
.entrada .cartao .btn { width: 100%; }
.link-discreto { background: none; border: 0; color: var(--sub); font-size: .9rem; padding: .4rem; cursor: pointer; text-decoration: underline; }
.tela-login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: .8rem; text-align: center; }
.tela-login .marca { font-size: 2rem; }
.erro { color: var(--erro); min-height: 1.2em; }

.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: rgba(15,23,42,.95); border-bottom: 1px solid var(--linha); backdrop-filter: blur(6px); }
.topo .loja { flex: 1; color: var(--sub); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abas { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 1rem; position: sticky; top: 52px; z-index: 4; background: var(--bg); scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.abas button { flex: 0 0 auto; background: var(--card); color: var(--txt); border: 1px solid var(--linha); border-radius: 999px; padding: .5rem .9rem; font-size: .9rem; }
.abas button.ativa { background: var(--pri); border-color: var(--pri); color: #111; font-weight: 700; }
main { padding: 0 1rem 5rem; max-width: 760px; margin: 0 auto; }

.btn { border: 1px solid var(--linha); background: var(--card); color: var(--txt); border-radius: 10px; padding: .7rem 1rem; font-size: .95rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #111; font-weight: 700; }
.btn.perigo { color: var(--erro); }
.btn.fant { background: transparent; }
.btn.peq { padding: .4rem .7rem; font-size: .85rem; }
.btn.grande { padding: 1rem; font-size: 1.05rem; }
.btn:disabled { opacity: .5; }

.atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.atalho { background: var(--card); border: 1px solid var(--linha); border-radius: 14px; padding: 1rem; text-align: left; color: var(--txt); font-size: 1rem; cursor: pointer; }
.atalho .ic { font-size: 1.6rem; display: block; margin-bottom: .3rem; }
.atalho small { display: block; color: var(--sub); font-size: .8rem; margin-top: .2rem; }

.cartao { background: var(--card); border: 1px solid var(--linha); border-radius: 14px; padding: 1rem; margin: .7rem 0; }
.status-linha { display: flex; flex-wrap: wrap; gap: .5rem; }
.pilula { display: inline-block; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: var(--linha); color: var(--txt); white-space: nowrap; }
.pilula.ok { background: rgba(34,197,94,.18); color: var(--ok); }
.pilula.alerta { background: rgba(234,179,8,.18); color: var(--alerta); }
.pilula.erro { background: rgba(239,68,68,.18); color: var(--erro); }
.pilula.azul { background: rgba(56,189,248,.18); color: var(--azul); }

.lista { display: flex; flex-direction: column; gap: .6rem; }
.item { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--linha); border-radius: 12px; padding: .7rem; }
.item .mini { width: 64px; height: 48px; flex: 0 0 64px; border-radius: 8px; background: #0b1220 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; overflow: hidden; }
.item .mini video { width: 100%; height: 100%; object-fit: cover; }
.item .info { flex: 1; min-width: 0; }
.item .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .info small { color: var(--sub); }
.item .acoes { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .item .acoes { flex-basis: 100%; } .item .acoes .btn { flex: 1; } .item .acoes .btn.fant { flex: 0 0 auto; } }
.vazio { color: var(--sub); text-align: center; padding: 1.5rem; border: 1px dashed var(--linha); border-radius: 12px; }

.folha { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.folha-caixa { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; border: 1px solid var(--linha); padding: 0 1rem 1.5rem; }
.folha-topo { position: sticky; top: 0; background: var(--bg); display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; z-index: 2; }
@media (min-width: 700px) { .folha { align-items: center; } .folha-caixa { border-radius: 18px; } }

form.campos { display: flex; flex-direction: column; gap: .85rem; }
.campo label { display: block; font-size: .85rem; color: var(--sub); margin-bottom: .3rem; }
.campo input[type=text], .campo input[type=number], .campo input[type=date], .campo input[type=time], .campo input[type=month], .campo input[type=password], .campo input[type=tel], .campo select, .campo textarea, .tela-login input, #f-hor input:not([type=checkbox]), #f-hor select {
  width: 100%; background: #0b1220; border: 1px solid var(--linha); color: var(--txt); border-radius: 10px; padding: .75rem; font-size: 1rem; font-family: inherit;
}
.campo input[type=color] { width: 64px; height: 44px; border: 1px solid var(--linha); border-radius: 10px; background: #0b1220; padding: 2px; }
.campo textarea { min-height: 80px; resize: vertical; }
.campo .ajuda { font-size: .78rem; color: var(--sub); margin-top: .25rem; }
.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.check { display: flex; align-items: center; gap: .6rem; font-size: .95rem; padding: .2rem 0; }
.check input { width: 22px; height: 22px; accent-color: var(--pri); }
.dias { display: flex; gap: .3rem; flex-wrap: wrap; }
.dias label { flex: 1; min-width: 40px; text-align: center; border: 1px solid var(--linha); border-radius: 8px; padding: .45rem 0; font-size: .85rem; color: var(--txt); margin: 0; }
.dias input { display: none; }
.dias input:checked + span { color: #111; }
.dias label:has(input:checked) { background: var(--pri); border-color: var(--pri); color: #111; font-weight: 700; }
details.mais { border: 1px solid var(--linha); border-radius: 12px; padding: .6rem .8rem; }
details.mais summary { cursor: pointer; color: var(--sub); font-size: .9rem; }
details.mais[open] summary { margin-bottom: .8rem; }
.envio { border: 1px dashed var(--linha); border-radius: 12px; padding: .8rem; display: flex; gap: .8rem; align-items: center; }
.envio .prev { width: 90px; height: 68px; flex: 0 0 90px; border-radius: 8px; background: #0b1220 center/contain no-repeat; display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: .75rem; overflow: hidden; }
.envio .prev video { width: 100%; height: 100%; object-fit: contain; }
.barra { height: 6px; background: var(--linha); border-radius: 3px; overflow: hidden; margin-top: .4rem; }
.barra i { display: block; height: 100%; width: 0; background: var(--pri); transition: width .2s; }
.botoes { display: flex; gap: .6rem; margin-top: .4rem; }
.botoes .btn { flex: 1; }

table.rel { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.rel th, table.rel td { padding: .5rem .4rem; border-bottom: 1px solid var(--linha); text-align: left; }
table.rel td.num, table.rel th.num { text-align: right; font-variant-numeric: tabular-nums; }
.corte { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; background: var(--card); border: 1px solid var(--linha); border-radius: 12px; padding: .6rem; }
.corte input[data-k=nome], .corte input[name=nome] { grid-column: 1 / -1; font-weight: 600; }
.corte input { width: 100%; background: #0b1220; border: 1px solid var(--linha); color: var(--txt); border-radius: 8px; padding: .55rem; font-size: 1rem; }
.corte .tgl { display: flex; gap: .3rem; }
.corte .tgl button { padding: .45rem .55rem; font-size: .8rem; }
.corte .tgl button.on-dest { background: var(--alerta); color: #111; border-color: var(--alerta); }
.corte .tgl button.on-esg { background: var(--erro); color: #fff; border-color: var(--erro); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #f8fafc; color: #111; padding: .7rem 1.1rem; border-radius: 10px; z-index: 99; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: 90vw; }
.toast.ruim { background: var(--erro); color: #fff; }
.enderecos code { display: block; background: #0b1220; padding: .5rem .7rem; border-radius: 8px; margin: .3rem 0; font-size: .95rem; word-break: break-all; }

.faixa-licenca { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.faixa-licenca.erro { border-color: var(--erro); background: rgba(239,68,68,.12); }
.faixa-licenca.alerta { border-color: var(--alerta); background: rgba(234,179,8,.12); }
.faixa-licenca.azul { border-color: var(--azul); background: rgba(56,189,248,.10); }

#f-hor input[type=time] { width: auto; min-width: 7.5rem; padding: .45rem .6rem; }
#f-hor select { width: auto; padding: .45rem .6rem; }
.pilula.aviso { background: rgba(245,158,11,.2); color: #f59e0b; }
.corte .corte-foto { grid-row: 1 / span 3; grid-column: 1; align-self: start; width: 3.2rem; height: 3.2rem; border-radius: 10px; border: 1px dashed var(--linha); background: #fff center/contain no-repeat; color: var(--sub); font-size: 1.2rem; cursor: pointer; }
.corte .corte-foto:empty { background-color: #fff; }
.corte[data-id] { grid-template-columns: 3.2rem minmax(0, 1fr); }
.corte[data-id] > input[data-k=nome], .corte[data-id] > .corte-preco, .corte[data-id] > .tgl { grid-column: 2; }
.corte .corte-preco { display: flex; gap: .3rem; }
.corte .corte-preco input { flex: 1; min-width: 0; }
.corte select { flex: 0 0 auto; background: #0b1220; border: 1px solid var(--linha); color: var(--txt); border-radius: 8px; padding: .5rem .3rem; font-size: .9rem; width: 6.8rem; }
.corte .tgl { flex-wrap: wrap; }
.corte .tgl button.on-tv { background: var(--ok); color: #062; border-color: var(--ok); }
#novo-corte { grid-template-columns: minmax(0, 1fr) auto; }
#novo-corte input[name=nome] { grid-column: 1 / -1; }

.sobre { margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--linha); text-align: center; font-size: .8rem; line-height: 1.6; color: var(--sub); }
.sobre b { color: var(--txt); }
.sobre a { color: var(--sub); }

/* ---- menu de baixo no celular (estilo app) ---- */
.barra-app { display: none; }
@media (max-width: 760px) {
  .abas { display: none; }
  .barra-app { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(15, 23, 42, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--linha); padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); }
  .barra-app button { background: none; border: 0; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .72rem; padding: .35rem 0; min-height: 52px; justify-content: center; cursor: pointer; }
  .barra-app button.ativa { color: var(--pri); font-weight: 700; }
  .barra-app .barra-mais { align-self: center; justify-self: center; width: 56px; height: 56px; min-height: 56px; border-radius: 50%; background: var(--pri); color: #111; margin-top: -26px; box-shadow: 0 6px 18px rgba(249, 115, 22, .45); }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}
.grade-acoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.grade-acoes .acao { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 92px; padding: .6rem .3rem; background: var(--card); border: 1px solid var(--linha); border-radius: 16px; color: var(--txt); font-size: .85rem; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.grade-acoes .acao span { font-size: 1.6rem; }
.grade-acoes .acao:active { transform: scale(.97); }
.instalar-app { display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-color: var(--pri); }
.pulsar { animation: pulsar 1.4s infinite; }
@keyframes pulsar { 0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .55); } 50% { box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); } }
.passos { padding-left: 1.2rem; line-height: 1.7; }
.lista-temas { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0 .2rem; }
