/* Painel CINE+ — tema escuro com vermelho (paleta do CineMais original). Sem fontes externas. */
:root {
  --bg: #0a0b0e; --bg2: #101218; --surface: #171a21; --surface2: #1d212a;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --text: #f3f4f6; --muted: #9aa1ac; --red: #ff2b30; --red-dim: rgba(255,43,48,.14);
  --ok: #2fd47f; --warn: #ffb020; --radius: .9rem;
  --font: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.noscript { padding: 2rem; }

/* Logo */
.logo { font-weight: 900; letter-spacing: .12em; font-size: 1.5rem; color: #fff; }
.logo b { color: var(--red); font-weight: 900; margin-left: .05em; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(60rem 30rem at 50% -10%, rgba(255,43,48,.10), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 26rem; }
.login-card .logo { text-align: center; font-size: 2.2rem; }
.login-card .tagline { text-align: center; color: var(--muted); font-size: .9rem; margin: .3rem 0 1.8rem; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }

label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
input.input { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: .65rem; padding: .8rem .9rem; outline: none; }
input.input:focus { border-color: var(--red); box-shadow: 0 0 0 .16rem var(--red), 0 0 0 .5rem rgba(255,43,48,.22); }
.hint { color: var(--muted); font-size: .8rem; margin-top: .35rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--line2); background: var(--surface2);
  border-radius: .65rem; padding: .7rem 1.1rem; font-weight: 700; cursor: pointer; transition: transform .12s, background .12s; }
.btn:hover { background: #262b36; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 .16rem var(--red); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.btn.primary:hover { background: #ff4448; }
.btn.block { width: 100%; padding: .95rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.small { padding: .4rem .75rem; font-size: .85rem; }

.alert { border-radius: .65rem; padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; border: 1px solid; }
.alert.err { background: var(--red-dim); border-color: rgba(255,43,48,.4); color: #ffd7d8; }
.alert.ok { background: rgba(47,212,127,.12); border-color: rgba(47,212,127,.4); color: #c9f7de; }
.alert.info { background: rgba(255,255,255,.05); border-color: var(--line2); color: var(--muted); }

/* Estrutura principal */
.app { display: grid; grid-template-columns: 16rem 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 1.2rem .9rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: .2rem .6rem 1.2rem; }
.side .group { margin-top: 1.1rem; }
.side .group-title { font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #6b7280; padding: 0 .6rem .4rem; }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; text-align: left; background: none; border: 0;
  padding: .6rem .7rem; border-radius: .6rem; color: var(--muted); font-weight: 600; cursor: pointer; border-left: 3px solid transparent; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-item:focus-visible { outline: none; box-shadow: 0 0 0 .14rem var(--red); }
.nav-item.on { color: #fff; background: var(--red-dim); border-left-color: var(--red); }
.badge { font-size: .62rem; font-weight: 800; letter-spacing: .06em; padding: .12rem .4rem; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 2rem; border-bottom: 1px solid var(--line); background: rgba(10,11,14,.85); position: sticky; top: 0; z-index: 2; backdrop-filter: blur(6px); }
.top h1 { font-size: 1.25rem; font-weight: 900; }
.user { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .9rem; }
.user strong { color: var(--text); }
.pill { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .55rem; border-radius: 999px; background: var(--red-dim); color: #ff8f92; }
.view { padding: 2rem; max-width: 74rem; width: 100%; }

/* Cartoes e tabelas */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.kpi .k { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 2rem; font-weight: 900; margin: .2rem 0; }
.kpi .v.na { color: #4b5160; }
.kpi .s { font-size: .78rem; color: #6b7280; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
.card-title { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.rows { display: grid; gap: .1rem; }
.row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.row:last-child { border-bottom: 0; }
.row .l { color: var(--muted); }
.row .r { font-weight: 600; text-align: right; word-break: break-word; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); margin-right: .4rem; }
.dot.warn { background: var(--warn); }
.dot.off { background: var(--red); }

table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .6rem .7rem; border-bottom: 1px solid var(--line2); }
.tbl td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: rgba(255,255,255,.025); }
.tbl .mono { font-family: Consolas, "Courier New", monospace; font-size: .82rem; color: #c7cbd3; word-break: break-all; }
.tag { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: rgba(255,255,255,.07); }
.tag.bad { background: var(--red-dim); color: #ff9a9c; }
.tag.good { background: rgba(47,212,127,.14); color: #8ff0bb; }
.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: 1rem; }
.toolbar select { background: var(--bg2); border: 1px solid var(--line2); border-radius: .6rem; padding: .55rem .7rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.2rem; color: var(--red); font-weight: 900; margin-bottom: .5rem; }
.form-narrow { max-width: 26rem; }

@media (max-width: 52rem) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .view { padding: 1rem; }
  .top { padding: .8rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.sp { height: 1.1rem; }
.mt { margin-top: 1rem; }
[hidden] { display: none !important; }

/* ---- Fase 1: dashboard, configuracoes, administracao ---- */
.side-foot { margin-top: 1.5rem; padding: 0 .7rem; font-size: .72rem; color: #5b6270; }
.sec-title { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 1.6rem 0 .7rem; }
.sec-title:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head .card-title { margin-bottom: 0; }
.card-head select { background: var(--bg2); border: 1px solid var(--line2); border-radius: .6rem; padding: .4rem .6rem; }

.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .8rem; }
.notice { border: 1px solid var(--line2); border-left-width: 4px; border-radius: .7rem; padding: .75rem .9rem; background: var(--surface); }
.notice .n-t { font-weight: 800; font-size: .9rem; }
.notice .n-x { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.notice .n-l { display: inline-block; margin-top: .4rem; font-size: .8rem; color: #ff8f92; }
.notice.critical { border-left-color: var(--red); background: var(--red-dim); }
.notice.warning { border-left-color: var(--warn); }
.notice.info { border-left-color: #4b5160; }

.kpi.off { background: transparent; border-style: dashed; }
.kpi .v.bad { color: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .6rem; font-size: .82rem; color: var(--muted); }
.legend .sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .4rem; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: #6b7280; font-size: 11px; }
.c-ok { fill: var(--ok); background: var(--ok); }
.c-bad { fill: var(--red); background: var(--red); }
.c-mid { fill: #7c8497; background: #7c8497; }

.empty-sm { display: grid; justify-items: center; gap: .35rem; text-align: center; padding: 1.6rem 1rem; color: var(--muted); font-size: .88rem; }
.empty-sm strong { color: var(--text); }
.empty-sm .ring { width: 3.2rem; height: 3.2rem; border-radius: 50%; border: .5rem solid rgba(255,255,255,.06); border-top-color: var(--red-dim); margin-bottom: .4rem; }

.panel-card.dim { opacity: .75; border-style: dashed; }
.muted { color: var(--muted); }
.field-err { color: #ff9a9c; font-size: .8rem; min-height: 0; }
.tbl-wrap { overflow-x: auto; }
.acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.tbl select { background: var(--bg2); border: 1px solid var(--line2); border-radius: .5rem; padding: .3rem .5rem; }
.tbl .tag + .tag, .tbl strong + .tag { margin-left: .4rem; }
.matrix td.yes { color: var(--ok); font-weight: 800; text-align: center; }
.matrix td.no { color: #4b5160; text-align: center; }
.matrix th { text-align: center; }
.matrix th:first-child { text-align: left; }
.card-head + .rows .row .l .hint { margin-top: .1rem; }
@media (max-width: 52rem) { .grid2 { grid-template-columns: 1fr; } }

/* Fase 2: parcerias */
.ferr { display: block; color: #ff9a9c; font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 600; margin-top: .25rem; }
.ferr:empty { display: none; }
textarea.input { resize: vertical; font: inherit; }
.tbl .mono.small { font-size: .72rem; }
.acts { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.acts select { max-width: 9rem; }

/* Fase 3: barra de filtros */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.filters .input { min-width: 16rem; }

/* Fase 4: abas, filtros de data e ações em tabela */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input[type="date"] { background: var(--surface2); color: var(--text); border: 1px solid var(--line2); border-radius: .5rem; padding: .4rem .6rem; font: inherit; color-scheme: dark; }
.tbl td .btn.small { margin: 0 .3rem .3rem 0; }
.kpis.mt { margin-top: 1rem; }
a.btn { text-decoration: none; }
.thumb { width: 3rem; height: 3rem; object-fit: contain; background: repeating-conic-gradient(#2a2a30 0 25%, #202026 0 50%) 0 0 / 12px 12px; border-radius: .4rem; border: 1px solid var(--line2); vertical-align: middle; }
.thumb.big { width: 6rem; height: 6rem; }
.thumb.none { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.imgs { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.steps { margin: .5rem 0 .5rem 1.2rem; padding: 0; line-height: 1.7; }
.acts { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
label.check { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
/* grupo de caixas de marcar (mesmo visual do rotulo de label.field) */
.field-group { margin-bottom: 1rem; }
.field-group > .lbl { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
label.field.inline { display: inline-block; margin: 0 .4rem .3rem 0; }
progress { width: 100%; height: .8rem; accent-color: var(--red); }
input[type="file"] { max-width: 100%; color: var(--muted); }
.mono { word-break: break-all; }

.tbl td.nowrap { white-space: nowrap; }
