:root {
  --bg: #090b0f;
  --panel: #11151b;
  --panel-soft: #151a22;
  --line: #252c37;
  --text: #f4f6f8;
  --muted: #929baa;
  --red: #ff4d5e;
  --red-soft: rgba(255, 77, 94, .13);
  --green: #48d597;
  --amber: #f5b944;
  --blue: #72a5ff;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 80% 0%, #17131b 0, var(--bg) 30%); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: rgba(9,11,15,.9); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; padding: 0 8px 34px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--red); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(255,77,94,.22); }
.brand strong, .brand small { display: block; }
.brand strong { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
nav { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: var(--muted); text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
.nav-item:hover, .nav-item.active { background: var(--panel-soft); color: var(--text); }
.nav-item.active { box-shadow: inset 2px 0 var(--red); }
.badge { margin-left: auto; border-radius: 999px; background: var(--red); color: white; font-size: 11px; padding: 2px 7px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.system-pill { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 0 8px; }
.system-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px currentColor; }
.system-pill i.online { background: var(--green); }
main { padding: 0 4vw 70px; min-width: 0; }
.topbar { min-height: 132px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(27px, 3vw, 42px); letter-spacing: -.04em; margin-bottom: 0; }
h2 { letter-spacing: -.025em; margin-bottom: 0; }
.eyebrow { color: var(--red); letter-spacing: .14em; font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.top-actions, .form-actions { display: flex; gap: 10px; align-items: center; }
.button, .icon-button, .text-button, .close-button { border: 0; cursor: pointer; }
.button { border-radius: 10px; padding: 11px 16px; font-weight: 700; }
.button.primary { background: var(--red); color: white; box-shadow: 0 8px 24px rgba(255,77,94,.17); }
.button.primary:hover { background: #ff6271; }
.button.secondary { background: var(--panel-soft); border: 1px solid var(--line); }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger { background: var(--red-soft); color: #ff8994; }
.button.full { width: 100%; }
.button.small { font-size: 12px; padding: 8px 10px; }
.icon-button, .close-button { width: 42px; height: 42px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--line); font-size: 22px; }
.text-button { color: var(--muted); background: none; font-size: 13px; }
.text-button:hover { color: var(--text); }
.view { display: none; animation: enter .22s ease-out; }
.view.active { display: block; }
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid rgba(245,185,68,.35); background: rgba(245,185,68,.08); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.setup-banner strong { color: #ffd67d; }
.setup-banner p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.setup-banner code { background: #0b0e12; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; white-space: nowrap; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat, .panel { border: 1px solid var(--line); background: linear-gradient(150deg, rgba(21,26,34,.96), rgba(13,16,21,.96)); border-radius: var(--radius); }
.stat { padding: 20px; min-height: 128px; display: flex; flex-direction: column; }
.stat span, .stat small { color: var(--muted); }
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { font-size: 36px; letter-spacing: -.04em; margin: auto 0 1px; }
.stat small { font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 18px; }
.overview-grid.lower { grid-template-columns: 1fr 1fr; }
.panel { padding: 22px; }
.panel-heading, .split-heading, .section-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { font-size: 19px; }
.card-list, .activity-list, .timeline, .idea-list, .calendar-list { display: grid; gap: 10px; }
.empty { color: var(--muted); border: 1px dashed var(--line); padding: 24px; border-radius: 12px; text-align: center; }
.review-card, .job-card, .activity, .timeline-item, .idea-card, .performer-card { border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 12px; padding: 14px; }
.review-card, .job-card, .timeline-item, .idea-card { display: flex; align-items: center; gap: 14px; }
.review-thumb { width: 86px; aspect-ratio: 16/9; background: #222833; border-radius: 8px; object-fit: cover; }
.review-meta, .job-meta, .timeline-meta, .idea-meta { min-width: 0; flex: 1; }
.review-meta strong, .job-meta strong, .timeline-meta strong, .idea-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-line { color: var(--muted); font-size: 12px; margin-top: 5px; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: rgba(114,165,255,.12); color: var(--blue); }
.status.needs_review, .status.queued { color: var(--amber); background: rgba(245,185,68,.12); }
.status.needs_attention, .status.failed, .status.rejected { color: #ff8994; background: var(--red-soft); }
.status.approved, .status.scheduled, .status.published, .status.completed { color: var(--green); background: rgba(72,213,151,.12); }
.progress { height: 5px; border-radius: 99px; background: #262c35; margin-top: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--red); border-radius: inherit; }
.activity { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: start; }
.activity i { width: 7px; height: 7px; background: var(--blue); border-radius: 50%; margin-top: 5px; }
.activity.error i { background: var(--red); }
.activity.warning i { background: var(--amber); }
.activity.success i { background: var(--green); }
.activity p { margin: 0; font-size: 13px; }
.activity small { color: var(--muted); font-size: 10px; }
.section-intro, .split-heading { margin-bottom: 24px; }
.section-intro p, .split-heading p { color: var(--muted); margin: 7px 0 0; }
select, input, textarea { width: 100%; border: 1px solid var(--line); background: #0d1015; color: var(--text); border-radius: 9px; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #636d7c; box-shadow: 0 0 0 3px rgba(114,165,255,.08); }
.section-intro select { width: auto; min-width: 170px; }
.pipeline-list { display: grid; gap: 10px; }
.pipeline-item { display: grid; grid-template-columns: minmax(260px, 2fr) 1fr 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 17px; border-radius: 13px; cursor: pointer; }
.pipeline-item:hover { border-color: #3a4452; transform: translateY(-1px); }
.pipeline-title strong { display: block; margin-bottom: 5px; }
.pipeline-title span, .pipeline-col span { color: var(--muted); font-size: 11px; }
.pipeline-col strong { display: block; font-size: 13px; margin-top: 4px; }
.calendar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.date-chip { min-width: 52px; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 7px; }
.date-chip strong, .date-chip small { display: block; }
.date-chip strong { font-size: 19px; }
.date-chip small { color: var(--red); font-size: 9px; text-transform: uppercase; }
.analytics-stats { grid-template-columns: 1fr 1fr 2fr; }
.stat.wide strong.recommendation { font-size: 19px; line-height: 1.35; letter-spacing: -.02em; }
.settings-form { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
label > span { color: var(--text); font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
.full-row { grid-column: 1 / -1; }
.settings-row { display: flex; flex-wrap: wrap; gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 24px 0; padding: 18px 0; }
.toggle { display: flex; align-items: center; gap: 9px; color: var(--text); cursor: pointer; }
.toggle input { width: auto; }
.dialog { width: min(560px, calc(100vw - 30px)); border: 1px solid var(--line); background: #11151b; color: var(--text); border-radius: 18px; padding: 24px; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.dialog::backdrop { background: rgba(1,3,6,.76); backdrop-filter: blur(7px); }
.dialog form { display: grid; gap: 18px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; }
.dialog-heading h2 { font-size: 27px; }
.content-dialog { width: min(980px, calc(100vw - 30px)); }
.callout { background: rgba(114,165,255,.08); border: 1px solid rgba(114,165,255,.18); padding: 12px; border-radius: 10px; color: #b9d0fb; font-size: 12px; margin: 0; }
.activation-panel { margin-top: 18px; }
.activation-panel .callout { margin-bottom: 14px; }
.timeline-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; border: 2px solid var(--muted); }
.timeline-dot.done { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 4px rgba(72, 213, 151, .1); }
.activation-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; padding-top: 4px; }
.content-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; }
.preview { background: #080a0d; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; display: grid; place-items: center; }
.preview video, .preview img { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { color: var(--muted); text-align: center; padding: 20px; }
.editor { display: grid; gap: 14px; }
.quality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 18px 0; }
.quality-check { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.quality-check.pass { color: var(--green); }
.quality-check.fail { color: #ff8994; }
.loading-bar { height: 2px; position: fixed; top: 0; left: 248px; right: 0; z-index: 10; overflow: hidden; }
.loading-bar.active::after { content: ""; display: block; height: 100%; width: 35%; background: var(--red); animation: load 1s infinite ease-in-out; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
.toast { position: fixed; right: 28px; bottom: 28px; max-width: 380px; background: #202630; border: 1px solid #3b4554; border-radius: 11px; padding: 13px 16px; z-index: 30; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.toast.error { border-color: var(--red); }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .brand { padding-bottom: 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-footer { display: none; }
  main { padding: 0 18px 60px; }
  .loading-bar { left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .overview-grid, .overview-grid.lower, .calendar-grid, .content-layout { grid-template-columns: 1fr; }
  .pipeline-item { grid-template-columns: 1fr auto; }
  .pipeline-col { display: none; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; padding: 25px 0; }
  .top-actions .icon-button { display: none; }
  .stats-grid, .form-grid, .form-grid.two, .quality-grid { grid-template-columns: 1fr; }
  .full-row { grid-column: auto; }
  .stat { min-height: 110px; }
}
