:root {
  --bg: #0a0d14;
  --bg2: #0f131c;
  --card: #131926;
  --card2: #1a2132;
  --line: #253049;
  --text: #eaf1ff;
  --muted: #8d9bb5;
  --dim: #5b6884;
  --accent: #22d3ee;
  --accent2: #a3e635;
  --mint: #a3e635;
  --red: #ff5d7a;
  --yellow: #ffd84d;
  --radius: 14px;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 85% -10%, #0c2a3a 0%, transparent 60%), var(--bg);
  color: var(--text); font: 15px/1.5 var(--body); display: flex; min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Barra lateral ---------- */
.side {
  width: 232px; flex: none; padding: 22px 14px; border-right: 1px solid var(--line);
  background: rgba(10,13,20,.75); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 8px; }
.brand span { font: 700 26px var(--display); letter-spacing: .02em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-weight: 500;
}
.side nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.side nav a:hover { background: var(--card); color: var(--text); }
.side nav a.on { background: linear-gradient(90deg, rgba(34,211,238,.18), rgba(34,211,238,0)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.pill { font-size: 12px; padding: 6px 10px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); }

main { flex: 1; min-width: 0; padding: 34px 42px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card2); padding: 9px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: #36446a; background: #212a40; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #04121a; border: 0; box-shadow: 0 6px 24px -8px rgba(34,211,238,.7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 13px 26px; font-size: 16px; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
textarea.input { resize: vertical; min-height: 80px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); padding: 7px 13px; border-radius: 99px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.on { background: rgba(34,211,238,.14); border-color: var(--accent); color: var(--text); }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: #04121a; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 18px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--mint); border-color: rgba(124,242,196,.35); }
.badge.warn { color: var(--yellow); border-color: rgba(255,216,77,.35); }
.badge.err { color: var(--red); border-color: rgba(255,93,108,.35); }
.badge.ai { color: #04121a; background: var(--mint); border: 0; }

.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; transition: width .4s; }

/* ---------- Criar ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: stretch; margin-bottom: 40px; }
.hero h1 { font-size: 44px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.create { display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.tabs { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; align-self: flex-start; }
.tabs button { background: none; border: 0; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--card2); color: var(--text); }
.drop {
  border: 1.5px dashed #36446a; border-radius: 12px; padding: 26px; text-align: center; cursor: pointer; background: var(--bg2);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(34,211,238,.06); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.how { padding: 24px; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(160deg, #0f2230, var(--card)); }
.how ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.how li { display: flex; gap: 14px; counter-increment: s; }
.how li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font: 700 15px var(--display); background: rgba(34,211,238,.16); color: var(--accent2); }
.how li b { display: block; }
.how li span { color: var(--muted); font-size: 14px; }

/* ---------- Projetos ---------- */
.projects { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.proj { padding: 0; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.proj:hover { border-color: #36446a; transform: translateY(-2px); }
.proj .thumb { aspect-ratio: 16/9; background: #000 center/cover; position: relative; }
.proj .thumb .badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.65); }
.proj .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.proj h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Clips ---------- */
.clips { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.clip { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.clip .media { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.clip .media img, .clip .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip .media .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.7); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.clip .media .rank { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.7); padding: 2px 9px; border-radius: 6px; font: 700 13px var(--display); }
.clip .body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.clip h3 { font-size: 17px; line-height: 1.3; }
.score { display: flex; gap: 14px; align-items: center; }
.ring { --v: 50; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--v) * 1%), var(--line) 0); }
.ring b { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font: 700 19px var(--display); }
.subs { flex: 1; display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.subs .bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.subs .bar div { height: 100%; background: var(--accent2); }
.reason { font-size: 13.5px; color: var(--muted); margin: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags span { font-size: 12px; color: var(--accent2); }
.clip .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(320px, 1fr) 400px; gap: 26px; align-items: start; }
.ed-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.ed-top .title-input { font: 600 22px var(--display); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; min-width: 200px; flex: 1; }
.ed-top .title-input:hover, .ed-top .title-input:focus { border-color: var(--line); outline: none; background: var(--bg2); }
.stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.frame { position: relative; overflow: hidden; background: #000; border-radius: 18px; box-shadow: 0 30px 80px -30px #000, 0 0 0 1px var(--line); max-width: 100%; }
.frame video { position: absolute; top: 0; height: 100%; width: auto; max-width: none; pointer-events: none; }
.frame .cap { position: absolute; left: 6%; right: 6%; text-align: center; pointer-events: none; line-height: 1.15; }
.frame .cap span { display: inline-block; margin: 0 .12em; transition: transform .08s; }
.frame .hook { position: absolute; left: 7%; right: 7%; top: 8%; text-align: center; pointer-events: none; }
.frame .hook span { display: inline-block; padding: .25em .5em; border-radius: .2em; font-family: "Arial Black", sans-serif; color: #fff; line-height: 1.2; }
.frame .pbar { position: absolute; left: 0; bottom: 0; height: .8%; background: var(--accent); }
.frame .wm { position: absolute; width: 16%; opacity: .85; }
.frame .facebox { position: absolute; border: 2px solid var(--mint); border-radius: 6px; pointer-events: none; opacity: .0; transition: opacity .2s; }
.controls { display: flex; gap: 10px; align-items: center; width: 100%; max-width: 520px; }
.controls .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; min-width: 96px; text-align: right; }
.timeline { position: relative; height: 58px; width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; user-select: none; }
.timeline .words { position: absolute; inset: 0; }
.timeline .w { position: absolute; top: 8px; height: 18px; background: #1f2a40; border-radius: 3px; font-size: 10px; color: var(--muted); overflow: hidden; white-space: nowrap; padding: 1px 3px; }
.timeline .sel { position: absolute; top: 0; bottom: 0; background: rgba(34,211,238,.16); border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); }
.timeline .h { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; z-index: 2; }
.timeline .h::after { content: ""; position: absolute; top: 18px; bottom: 18px; left: 5px; width: 4px; border-radius: 4px; background: #fff; }
.timeline .ph { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 3; pointer-events: none; }
.timeline .loud { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: flex-end; gap: 1px; opacity: .55; }
.timeline .loud i { flex: 1; background: var(--accent2); border-radius: 1px 1px 0 0; }
.panel { position: sticky; top: 20px; padding: 0; overflow: hidden; }
.ptabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { flex: 1; background: none; border: 0; padding: 13px 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; border-bottom: 2px solid transparent; }
.ptabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pbody { padding: 18px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 160px); overflow: auto; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { aspect-ratio: 1.3; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(160deg, #1d2a44, #0b0f18); cursor: pointer; display: grid; place-items: center; padding: 6px; overflow: hidden; position: relative; }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(34,211,238,.3); }
.preset em { position: absolute; bottom: 4px; left: 0; right: 0; font-style: normal; font-size: 11px; color: var(--muted); text-align: center; }
.words-edit { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; line-height: 1.4; }
.words-edit span { padding: 2px 5px; border-radius: 5px; cursor: pointer; border: 1px solid transparent; }
.words-edit span:hover { border-color: var(--line); background: var(--bg2); }
.words-edit span.cur { background: rgba(34,211,238,.25); }
.words-edit span.del { text-decoration: line-through; color: var(--dim); }
.words-edit span.mod { color: var(--mint); }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.note { font-size: 13px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note b { color: var(--text); }

/* ---------- Biblioteca / agendador ---------- */
.lib { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.vid { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.vid video { width: 100%; aspect-ratio: 9/16; object-fit: contain; background: #000; display: block; }
.vid video.a11 { aspect-ratio: 1; }
.vid video.a169 { aspect-ratio: 16/9; }
.vid .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.vid h3 { font-size: 14.5px; line-height: 1.3; }
.sched { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.days { display: flex; flex-direction: column; gap: 18px; }
.day h3 { font-size: 14px; color: var(--muted); margin-bottom: 8px; text-transform: capitalize; }
.post { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px; }
.post img { width: 64px; height: 90px; object-fit: cover; border-radius: 8px; background: #000; }
.plats { display: flex; gap: 5px; flex-wrap: wrap; }
.plat { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--card2); border: 1px solid var(--line); }

/* ---------- Estatísticas ---------- */
.kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi b { display: block; font: 700 34px var(--display); }
.kpi span { color: var(--muted); font-size: 13px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px -10px #000; max-width: 380px; animation: in .2s; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--mint); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .hero, .editor, .sched { grid-template-columns: 1fr; }
  .panel { position: static; }
}
@media (max-width: 760px) {
  body { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  main { padding: 20px; }
  .opts { grid-template-columns: 1fr; }
}

/* ---------- NeonReel: extras ---------- */
.brand span b { font-weight: 700; background: linear-gradient(90deg, var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.usercard { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.usercard b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard small { font-size: 12px; }
.usercard .cr { color: var(--accent2); font-weight: 700; }
.auth { min-height: 100vh; width: 100%; display: grid; place-items: center; padding: 30px; }
.auth .card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.auth .brand { justify-content: center; margin-bottom: 4px; }
.auth h1 { font-size: 26px; text-align: center; }
.auth p { text-align: center; margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.table input.input, .table select.input { padding: 6px 8px; font-size: 13px; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.acct img, .acct .av { width: 38px; height: 38px; border-radius: 50%; background: var(--card2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; }
.net { display: flex; flex-direction: column; gap: 12px; }
.net .row b { font-size: 16px; }
.plans { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan .price { font: 700 36px var(--display); }
.plan.cur { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(34,211,238,.25); }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.res { font-size: 12px; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.res .ok { color: var(--mint); } .res .bad { color: var(--red); }
code { background: var(--bg2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }

/* ---------- Formatos, chat ---------- */
.fmt-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.fmt { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; padding: 16px; transition: border-color .15s, transform .15s; }
.fmt:hover { border-color: #36446a; transform: translateY(-2px); }
.fmt-ic { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, rgba(163,230,53,.18), rgba(34,211,238,.18)); }
.fmt b { font-size: 15px; }
.fmt small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.4; }
.chat-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - 190px); min-height: 480px; }
.chat-list { padding: 8px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-list a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list a small { color: var(--dim); font-size: 11.5px; }
.chat-list a:hover, .chat-list a.on { background: var(--card2); }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-msgs { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 12px 15px; border-radius: 14px; line-height: 1.55; font-size: 14.5px; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(163,230,53,.2), rgba(34,211,238,.2)); border: 1px solid rgba(34,211,238,.3); }
.msg.assistant { align-self: flex-start; background: var(--card2); border: 1px solid var(--line); }
.chat-in { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-in textarea { min-height: 48px; resize: none; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 160px; } }
