/* Gerenciador · tudo em px de propósito: o rem do <html> é usado pela prévia do card. */
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fonts/InterVariable.woff2") format("woff2"); }

:root {
  --bg: #f4f3f7; --surface: #fff; --text: #1c1b22; --muted: #6b6878; --line: #e3e1ea;
  --accent: #5b3cf0; --accent-ink: #fff; --live: #12a150; --warn: #b7791f; --danger: #d33a2c;
  --shadow: 0 1px 2px rgba(20, 16, 40, .06), 0 4px 16px rgba(20, 16, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121216; --surface: #1c1b22; --text: #ecebf2; --muted: #a09db0; --line: #2e2c37;
          --accent: #8b74ff; --accent-ink: #0f0d18; --live: #3ccf7c; --warn: #f0b44c; --danger: #ff6b5e;
          --shadow: none; }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0; line-height: 1.25; }
h2 { font-size: 17px; margin: 32px 0 12px; }
h3 { font-size: 15px; margin: 24px 0 10px; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; margin: 6px 0 0; display: block; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 1480px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.card.empty { color: var(--muted); text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
.brand img { width: 30px; height: 30px; }
.brand b { font-weight: 400; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who form { margin: 0; }
.top { flex-wrap: wrap; }
.who { flex-wrap: wrap; justify-content: flex-end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
       padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
       cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; min-height: 30px; }
.danger-text { color: var(--danger) !important; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 15px; font-weight: 400; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
form.inline { display: flex; gap: 8px; margin: 0; }
form.inline input { margin: 0; min-width: 0; }

.flash { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.live { border-left-color: var(--live); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login-logo { width: 56px; height: 56px; display: block; margin-bottom: 12px; }
.login h1 { font-size: 20px; }
.login p { margin: 4px 0 20px; }
.login .btn { width: 100%; margin-top: 4px; }

/* painel */
.onair__head { display: flex; align-items: flex-start; gap: 14px; }
.onair__head > div { flex: 1; }
.onair__head form { margin: 0; }
.onair p { margin: 4px 0 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--muted); flex-shrink: 0; }
.onair.is-live .dot { background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 25%, transparent); }
.onair.is-live .eyebrow { color: var(--live); }
.feeds { margin-top: 16px; display: grid; gap: 8px; }
.feed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.feed .muted { font-size: 13px; min-width: 130px; }
.feed code { flex: 1; min-width: 200px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 32px 0 12px; }
.row-head h2 { margin: 0; }
.eps { display: grid; gap: 10px; }
.ep { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ep.is-live { border-color: var(--live); }
.ep__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 16px; }
.ep__title a { color: var(--text); text-decoration: none; }
.ep__acts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; }
.ep__acts li.off { color: var(--muted); }
.ep__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ep__btns form { margin: 0; }
.tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); }
.tag.live { background: var(--live); color: #fff; }
.tag.warn { background: var(--warn); color: #fff; }
.log { font-size: 13.5px; display: grid; gap: 4px; }

/* editor */
.editbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; position: sticky; top: 58px; z-index: 40; margin-bottom: 16px; }
.editbar label { margin: 0; }
.editbar .grow { flex: 1; min-width: 220px; }
.editbar .back { align-self: center; text-decoration: none; font-weight: 600; font-size: 14px; }
.editbar__btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--live); } .status.warn { color: var(--warn); } .status.err { color: var(--danger); font-weight: 600; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 20px; align-items: start; }
.editor__preview { position: sticky; top: 150px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.tabs button small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tabs button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 16px; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.page { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.page.sel { border-color: var(--accent); }
.page__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.page__tools { display: flex; gap: 4px; }
.page__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.page__img img, .page__img .noimg { width: 100%; aspect-ratio: 752 / 352; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.page__img .noimg { display: grid; place-items: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); }
.page__imgctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.page__imgctl select { margin: 0; padding: 4px 8px; font-size: 13px; width: 100%; }
.page__txt { position: relative; }
.page__txt label:last-of-type { margin-bottom: 4px; }
.count { font-size: 12px; color: var(--muted); float: right; }
.add { width: 100%; border-style: dashed; }

.pv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #000 url("cena.jpg") center / cover; font-family: "Inter", system-ui, sans-serif; }
.stage::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.5) 72%, rgba(0,0,0,.85)); }
.stage.is-empty::after { content: "Ação desativada"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 15px; background: rgba(0,0,0,.45); }
.pv-nav { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pv-nav #pv-page { flex: 1; text-align: center; font-size: 13px; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor__preview { position: static; order: -1; }
  .editbar { position: static; }
}
@media (max-width: 640px) {
  .page__body, .grid2 { grid-template-columns: 1fr; }
  .ep__btns { width: 100%; }
  form.inline { width: 100%; }
}
