:root {
  --bg: #000;
  --panel: #0d0d0f;
  --panel2: #141418;
  --line: #222228;
  --text: #f4f4f6;
  --muted: #8a8a96;
  --accent: #a3ff12;
  --accent-ink: #0a1200;
  --danger: #ff4d5e;
  --warn: #ffb020;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: inline-block; }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.nav:hover { background: var(--panel2); color: var(--text); }
.nav.on { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav .badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.side .grow { flex: 1; }

.main { padding: 32px clamp(16px, 4vw, 48px) 80px; max-width: 1200px; width: 100%; }
.head { margin-bottom: 24px; }
.banner { border: 1px solid #3a3000; background: #181300; color: #ffd870; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 22px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner a { color: var(--accent); cursor: pointer; text-decoration: underline; }

.step { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.num { width: 28px; height: 28px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 14px; flex: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.card-style { border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; position: relative; transition: border-color .15s, transform .15s; }
.card-style:hover { border-color: #3a3a44; transform: translateY(-1px); }
.card-style.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-style .sw { height: 74px; }
.card-style .body { padding: 10px 12px 12px; }
.card-style .name { font-weight: 650; }
.card-style .tags { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-style .check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); display: none; place-items: center; font-weight: 800; font-size: 13px; }
.card-style.on .check { display: grid; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 200px; }
.field > label { color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--bg); border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor: pointer; }
.btn:hover { border-color: #3a3a44; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 750; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 13px; }
.sticky-cta { position: sticky; bottom: 0; background: linear-gradient(transparent, #000 40%); padding: 24px 0 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; cursor: pointer; }
.vcard:hover { border-color: #3a3a44; }
.vcard .thumb { aspect-ratio: 16/9; background: var(--panel2); display: grid; place-items: center; position: relative; overflow: hidden; }
.vcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard .meta { padding: 12px; }
.vcard .title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 44px; }
.pill { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--accent); border-color: #34510a; }
.pill.err { color: var(--danger); border-color: #5a1b22; }
.pill.run { color: var(--warn); border-color: #5a4210; }
.bar { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.steps span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.steps span.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.steps span.past { color: var(--accent); border-color: #34510a; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 16px; z-index: 50; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(960px, 100%); padding: 22px; max-height: 94vh; overflow: auto; }
.modal .cols { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 22px; }
.modal video { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }
.pre { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 14px; }
.scene { border-left: 2px solid var(--line); padding: 4px 0 4px 12px; margin: 10px 0; }

.table { width: 100%; border-collapse: collapse; }
.table td, .table th { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .brand { width: 100%; padding-bottom: 6px; }
  .nav { width: auto; padding: 8px 10px; }
  .side .grow { display: none; }
  .modal .cols { grid-template-columns: 1fr; }
}

/* ---- canais (tags), selecao, calendario, massa ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.chip { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 7px 14px; cursor: pointer; --c: var(--accent); }
.chip:hover { color: var(--text); border-color: #3a3a44; }
.chip.on { color: var(--text); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }

.vcard.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tick { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 99px; border: 2px solid #fff; background: rgba(0,0,0,.55); display: grid; place-items: center; font-weight: 800; color: var(--accent-ink); z-index: 2; }
.tick.on { background: var(--accent); border-color: var(--accent); }
.selbar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #0d0d0f; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 20px; box-shadow: 0 -8px 30px rgba(0,0,0,.6); }
.selbar select { width: auto; }

.cal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-top .chips { margin: 0; }
.cal-wrap { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.cal-pool { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.pool-list { display: flex; flex-direction: column; gap: 8px; }
.pool-item { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 6px; cursor: grab; }
.pool-item.sel { border-color: var(--accent); }
.pool-item img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }
.pool-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0; }
.cal-cell { min-height: 112px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.past { opacity: .6; }
.cal-cell.over { background: #17210a; border-color: var(--accent); }
.cal-num { font-size: 12px; color: var(--muted); }
.cal-cell.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-chip { font-size: 12px; line-height: 1.25; background: var(--panel2); border-left: 3px solid var(--c, var(--accent)); border-radius: 6px; padding: 4px 6px; cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { background: #1c1c22; }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-pool { position: static; max-height: 320px; }
  .cal-cell { min-height: 84px; }
}

/* simbolo de destino (YouTube / Reels) */
.plat { position: absolute; top: 8px; right: 8px; z-index: 2; line-height: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.65)); }
.plat.sm { position: static; display: inline-block; vertical-align: middle; filter: none; }
.plat.sm svg { width: 18px; height: 14px; }

/* pesquisa de canal: selecao por linha */
.rows { display: flex; flex-direction: column; gap: 14px; }
.row-grid { display: grid; gap: 14px; align-items: stretch; }
.row-btn { border: 1px dashed var(--line); background: var(--panel); color: var(--muted); border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; }
.row-btn:hover:not([disabled]) { border-color: var(--accent); color: var(--text); }
.row-btn.on { background: var(--accent); color: var(--accent-ink); border-style: solid; border-color: var(--accent); }
.row-btn[disabled] { opacity: .35; cursor: not-allowed; }
.row-btn span { font-size: 22px; line-height: 1; }
.row-btn small { font-size: 11px; }
