:root {
  --bg: #08060d; --bg2: #0f0b17; --card: #141019; --card2: #1b1524; --line: #2a2136; --line2: #3a2b4f;
  --text: #f3eefb; --muted: #a49bb3; --dim: #6f6680;
  --p1: #8f2cf5; --p2: #b34cff; --pink: #ff4fd8; --glow: rgba(167, 76, 255, .45);
  --ok: #34d399; --warn: #fbbf24; --err: #ff5c7a; --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  background: radial-gradient(1200px 600px at 75% -10%, #2a0f4a 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #1d0b33 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
}
a { color: inherit; }
svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* ---------- lateral */
.side { padding: 22px 16px; border-right: 1px solid var(--line); background: rgba(10, 7, 16, .7); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 10px 26px; }
.logo .crown { width: 46px; filter: drop-shadow(0 0 8px var(--glow)); }
.logo b { display: block; font-size: 24px; font-weight: 900; letter-spacing: 1px; line-height: 1; font-style: italic; }
.logo span { display: block; font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--pink); font-style: italic; }
nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: #d8d0e6; margin-bottom: 4px; font-weight: 500; }
nav a:hover { background: var(--card2); }
nav a.on { background: linear-gradient(90deg, var(--p1), #6d23c4); color: #fff; box-shadow: 0 6px 24px -6px var(--glow); }
.side-foot { margin-top: auto; font-size: 12px; color: var(--dim); padding: 10px; }
.side-foot b { color: var(--muted); }

/* ---------- topo */
.mainwrap { min-width: 0; }
.top { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 16px 34px; }
.top .bell svg { width: 20px; height: 20px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--pink), var(--p1)); box-shadow: 0 0 0 2px #2a1840, 0 0 18px -2px var(--glow); }
.me b { display: block; font-size: 14px; } .me small { color: var(--muted); font-size: 12px; }
.queue { font-size: 12px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
main { padding: 6px 34px 60px; max-width: 1320px; }

/* ---------- base */
h1 { font-size: 30px; margin: 0; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 19px; margin: 0; font-weight: 700; }
.sub { color: var(--muted); margin: 4px 0 0; }
.panel { background: linear-gradient(180deg, rgba(27, 21, 36, .9), rgba(16, 12, 22, .9)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.panel.glow { border-color: #4a2d70; box-shadow: 0 0 0 1px rgba(167, 76, 255, .15), 0 20px 60px -30px var(--glow); }
.row { display: flex; gap: 14px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.mt { margin-top: 22px; } .mt2 { margin-top: 32px; } .mts { margin-top: 12px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(90deg, var(--p1), var(--p2)); box-shadow: 0 8px 26px -10px var(--glow); text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); } .btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn.ghost { background: var(--card2); border: 1px solid var(--line2); box-shadow: none; font-weight: 600; }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn.icon { padding: 7px; border-radius: 9px; background: transparent; box-shadow: none; color: var(--muted); }
.btn.icon:hover { background: var(--card2); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid #5a2433; color: var(--err); box-shadow: none; }
label.lb { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
input.in, select.in, textarea.in { width: 100%; background: #120d1a; color: var(--text); border: 1px solid var(--line2); border-radius: 11px; padding: 11px 13px; font: inherit; }
textarea.in { resize: vertical; min-height: 140px; line-height: 1.6; }
.in:focus { outline: 2px solid var(--p2); border-color: transparent; }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a49bb3' fill='none' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input[type=range] { width: 100%; accent-color: var(--p2); }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; gap: 12px; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: #2b2238; border-radius: 99px; cursor: pointer; transition: .2s; }
.sw span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.sw input:checked + span { background: linear-gradient(90deg, var(--p1), var(--p2)); box-shadow: 0 0 14px -2px var(--glow); }
.sw input:checked + span::after { transform: translateX(20px); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #241b30; color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(52, 211, 153, .14); color: var(--ok); }
.pill.warn { background: rgba(251, 191, 36, .14); color: var(--warn); }
.pill.err { background: rgba(255, 92, 122, .14); color: var(--err); }
.pill.p { background: rgba(179, 76, 255, .18); color: #d6a8ff; }
.spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .8s linear infinite; display: inline-block; flex: none; }
@keyframes s { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty svg { width: 42px; height: 42px; color: var(--p2); margin-bottom: 10px; }

/* ---------- dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat svg { width: 34px; height: 34px; color: var(--p2); filter: drop-shadow(0 0 8px var(--glow)); }
.stat b { font-size: 26px; display: block; line-height: 1.1; } .stat span { color: var(--muted); font-size: 13px; }
.live-strip { display: flex; align-items: center; gap: 16px; padding: 14px 18px; cursor: pointer; }
.live-strip .bar { flex: 1; }

/* ---------- cards de corte */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.clips.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.clip { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: .15s; }
.clip:hover { border-color: #5b3a86; transform: translateY(-2px); box-shadow: 0 16px 40px -24px var(--glow); }
.thumb { position: relative; aspect-ratio: 9/16; background: #000 center/cover no-repeat; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.clips.wide .thumb { aspect-ratio: 16/10; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .75); padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.thumb .cat { position: absolute; left: 8px; top: 8px; }
.thumb .fav { position: absolute; right: 8px; top: 8px; color: var(--warn); }
.clip .info { padding: 11px 12px 12px; }
.clip .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip .acts { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.clip .acts .pill { margin-right: auto; }

/* ---------- nova análise */
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.source { text-align: center; padding: 34px 28px; cursor: pointer; transition: .15s; }
.source:hover, .source.on { border-color: var(--p2); box-shadow: 0 0 0 1px var(--p2), 0 20px 60px -24px var(--glow); }
.source .big { width: 64px; height: 64px; color: var(--pink); filter: drop-shadow(0 0 12px rgba(255, 79, 216, .6)); }
.source h2 { margin: 14px 0 8px; font-size: 22px; }
.source p { color: var(--muted); margin: 0 auto 22px; max-width: 300px; }
.plats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chip { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 13px; background: #130e1b; border: 1px solid var(--line2); cursor: pointer; font-weight: 600; user-select: none; }
.chip svg { width: 24px; height: 24px; }
.chip small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.chip.on { border-color: var(--p2); background: linear-gradient(180deg, rgba(143, 44, 245, .25), rgba(143, 44, 245, .08)); box-shadow: 0 0 22px -8px var(--glow); }
.chip.on::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 5px; background: var(--p2); font-size: 12px; display: grid; place-items: center; font-weight: 900; }
.chip.off { opacity: .45; }

/* ---------- processamento */
.proc { max-width: 760px; margin: 10px auto; display: grid; grid-template-columns: 200px 1fr; gap: 34px; align-items: center; padding: 38px; }
.proc .art svg { width: 190px; height: 190px; color: var(--p2); filter: drop-shadow(0 0 18px var(--glow)); }
.bar { height: 14px; background: #1d1528; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--p1), var(--pink)); box-shadow: 0 0 16px var(--glow); transition: width .6s; }
.bar.thin { height: 6px; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.steps li .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #241a32; flex: none; }
.steps li.done .dot { background: var(--p1); } .steps li.done .dot svg { width: 13px; height: 13px; stroke-width: 3; }
.steps li .r { margin-left: auto; }
.steps li.done .r { color: var(--ok); } .steps li.cur { font-weight: 700; } .steps li.skip { color: var(--dim); }

/* ---------- projeto */
.proj { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 22px; align-items: start; }
.player { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 14px; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.player video { width: 100%; height: 100%; }
.sugs { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.sug { background: #130e1b; border: 1px solid var(--line); border-radius: 13px; padding: 12px; display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.sug.on { border-color: #6a3fa0; }
.sug input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--p2); margin-top: 2px; }
.sug .tm { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.sug .tm input { width: 86px; padding: 6px 8px; font-size: 13px; }
.sug .msgs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.sug .msgs span { font-size: 11px; background: #211830; color: #cfc3e3; padding: 2px 8px; border-radius: 6px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.filters button { background: #1a1323; border: 1px solid var(--line2); color: var(--muted); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.filters button.on { background: var(--p1); border-color: var(--p1); color: #fff; }
.c-jogadas { color: #7dd3fc; } .c-engracados { color: #fde047; } .c-reacoes { color: #fb923c; }
.c-rp { color: #c4b5fd; } .c-tretas { color: #f87171; } .c-gerais { color: #f0abfc; } .c-manual { color: #a7f3d0; }

/* ---------- biblioteca */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs button { background: transparent; border: 1px solid var(--line2); color: var(--text); border-radius: 99px; padding: 8px 16px; font: inherit; cursor: pointer; }
.tabs button.on { background: linear-gradient(90deg, var(--p1), var(--p2)); border-color: transparent; font-weight: 700; }
.search { margin-left: auto; position: relative; }
.search input { padding-left: 36px; width: 240px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--muted); width: 16px; height: 16px; }

/* ---------- editor */
.editor { display: grid; grid-template-columns: 360px 1fr; gap: 26px; align-items: start; }
.vplayer { aspect-ratio: 9/16; background: #000; border-radius: 16px; overflow: hidden; display: grid; place-items: center; color: var(--muted); text-align: center; border: 1px solid var(--line); }
.vplayer video { width: 100%; height: 100%; }
.etabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #120d1a; border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
.etabs button { background: transparent; border: 0; color: var(--muted); padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.etabs button.on { background: var(--card2); color: #fff; box-shadow: inset 0 0 0 1px var(--line2); }
.range2 { position: relative; height: 34px; }
.range2 input { position: absolute; left: 0; top: 8px; pointer-events: none; appearance: none; background: transparent; }
.range2 input::-webkit-slider-thumb { pointer-events: all; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--p2); cursor: pointer; box-shadow: 0 0 10px var(--glow); }
.range2 input::-moz-range-thumb { pointer-events: all; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--p2); cursor: pointer; }
.range2 .track { position: absolute; left: 0; right: 0; top: 15px; height: 5px; background: #2b2238; border-radius: 9px; }
.range2 .sel { position: absolute; top: 15px; height: 5px; background: linear-gradient(90deg, var(--p1), var(--pink)); border-radius: 9px; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: #fff; box-shadow: 0 0 12px var(--glow); }
.footer-acts { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; }

/* ---------- tabela */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); }
table.t tr:hover td { background: rgba(255, 255, 255, .02); }
table.t td.ttl { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; cursor: pointer; }

/* ---------- toast / modal */
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--card2); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 12px; display: none; max-width: 420px; box-shadow: 0 20px 50px -20px #000; z-index: 50; }
.modal { position: fixed; inset: 0; background: rgba(4, 2, 8, .7); display: none; place-items: center; z-index: 40; backdrop-filter: blur(4px); }
.modal.show { display: grid; }
.modal-card { width: min(640px, 92vw); max-height: 90vh; overflow: auto; }
.err-box { background: rgba(255, 92, 122, .1); border: 1px solid #5a2433; color: #ffb3c1; padding: 12px 14px; border-radius: 12px; margin-top: 14px; word-break: break-word; }
.hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; background: #1d1528; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 1100px) {
  .proj, .editor { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chips { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .sources { grid-template-columns: 1fr; } .proc { grid-template-columns: 1fr; text-align: center; }
  main { padding: 6px 16px 40px; }
}

/* ---------- autenticação */
body.auth-mode .shell { display: none; }
#auth { display: none; }
body.auth-mode #auth { display: grid; min-height: 100vh; place-items: center; padding: 30px 16px; position: relative; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-bg svg { position: absolute; opacity: .55; filter: drop-shadow(0 0 18px rgba(255, 79, 216, .7)); }
.auth-card { position: relative; width: min(470px, 100%); padding: 34px 34px 28px; text-align: center; background: rgba(14, 10, 20, .92); backdrop-filter: blur(6px); }
.auth-card .logo { justify-content: center; padding: 0 0 18px; }
.auth-card .logo .crown { width: 70px; }
.auth-card .logo b { font-size: 36px; } .auth-card .logo span { font-size: 15px; letter-spacing: 3px; }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { margin-bottom: 22px; }
.prov { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 16px; margin-top: 10px; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 15px; color: #fff; cursor: pointer; border: 1px solid var(--line2); background: #17121f; text-decoration: none; }
.prov:hover { border-color: #6a3fa0; background: #1d1728; }
.prov.main { background: linear-gradient(90deg, var(--p1), var(--p2)); border-color: transparent; box-shadow: 0 10px 30px -12px var(--glow); }
.prov .mk { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; flex: none; }
.prov.off { opacity: .4; cursor: not-allowed; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; margin: 20px 0 14px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.auth-card form { text-align: left; }
.auth-card .link { color: #d6a8ff; font-weight: 700; text-decoration: none; cursor: pointer; }
.auth-card .fine { font-size: 12px; color: var(--dim); margin-top: 18px; }
.pw { position: relative; } .pw button { position: absolute; right: 8px; top: 7px; }
.me { cursor: pointer; position: relative; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.menu { position: absolute; right: 0; top: 52px; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; min-width: 200px; z-index: 30; box-shadow: 0 20px 50px -20px #000; }
.menu a, .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 8px; background: none; border: 0; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: #2a2136; }
.conn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.conn:last-child { border: 0; }
.conn .mk { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; }
.section-t { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 6px; }
