:root {
  --bg: #0f1115; --panel: #171a21; --panel-2: #1e222b; --border: #2a2f3a;
  --text: #e8eaed; --muted: #8b93a3; --accent: #f5c400; --accent-2: #4f8cff;
  --danger: #e5555a; --ok: #3fbf7f; --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
input, select, textarea, button {
  font-family: inherit; font-size: 14px; background: var(--panel-2);
  color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px;
}
textarea { width: 100%; resize: vertical; }
label { display: block; margin: 14px 0 4px; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
button { cursor: pointer; }
button.primary { background: var(--accent); color: #1a1a1a; border: none; font-weight: 600; }
button.full { width: 100%; }

/* ---- login ---- */
.login-screen { height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--panel); padding: 32px; border-radius: 12px; width: 280px; text-align: center; }
.login-card h1 { margin: 0 0 2px; }
.login-card input { width: 100%; margin: 16px 0 10px; text-align: center; letter-spacing: 8px; font-size: 20px; }
.error { color: var(--danger); min-height: 18px; font-size: 12px; }

/* ---- layout ---- */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 320px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px; gap: 10px; overflow-y: auto;
}
.sidebar-header { display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 700; font-size: 16px; }
.whoami { font-size: 12px; color: var(--muted); }
.filters { display: flex; gap: 8px; }
.filters select { flex: 1; }
.video-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.video-item {
  padding: 10px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
}
.video-item:hover { background: var(--panel-2); }
.video-item.active { background: var(--panel-2); border-color: var(--accent); }
.video-item .vi-title { font-weight: 600; }
.video-item .vi-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; margin-right: 4px; }
.badge.draft { background: #3a3f4b; }
.badge.scripting { background: #3a3160; }
.badge.media { background: #1f3f5c; }
.badge.ready { background: #1c4a33; color: var(--ok); }
.badge.archived { background: #33261c; }

.main { flex: 1; overflow-y: auto; }
.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.video-detail { padding: 24px 32px; max-width: 900px; }
.detail-header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.title-input { flex: 1; font-size: 20px; font-weight: 700; padding: 10px 12px; }
.detail-header-meta { display: flex; gap: 8px; align-items: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn { background: none; border: none; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-panel select, .tab-panel input:not([type=checkbox]) { width: 100%; }

.cost-box { margin-top: 20px; padding: 12px; background: var(--panel-2); border-radius: var(--radius); font-size: 13px; color: var(--muted); }

.media-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.upload-final { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }

.scene-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.scene-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.scene-card-header .scene-title { font-weight: 600; }
.scene-assets { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.scene-assets img, .scene-assets video { max-width: 120px; max-height: 120px; border-radius: 4px; border: 1px solid var(--border); }
.scene-upload-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.scene-upload-row label { display: inline-flex; margin: 0; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: normal; background: var(--panel-2); padding: 6px 10px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); }

.platform-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.platform-card h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.platform-card textarea { margin-top: 4px; }
