:root {
  --bg: #0a0a0d; --surface: #16161a; --surface-2: #202026; --line: #2a2a31;
  --text: #f4f4f5; --muted: #9a9aa3; --accent: #c6ff3d; --danger: #ff6161; --warn: #ffd23f;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 700; font-size: 20px; }
.logo { width: 26px; height: 26px; border-radius: 50%; border: 5px solid var(--accent); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); top: -6px; right: -6px; }
.qr { margin: 28px auto 18px; width: 260px; height: 260px; border-radius: 22px; background: #fff; padding: 14px; position: relative; }
.qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr.expired img { filter: blur(6px); opacity: .4; }
.qr .refresh { position: absolute; inset: 0; margin: auto; width: 140px; height: 44px; border: 0; border-radius: 22px;
  background: var(--accent); color: #000; font-weight: 700; }
.steps { color: var(--muted); text-align: left; margin: 0 auto; max-width: 320px; padding-left: 20px; }
.steps b { color: var(--text); }
.note { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.side .brand { justify-content: flex-start; padding: 0 8px; }
.side h3 { margin: 0 0 6px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent); color: #000; font-weight: 600; }
.me { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: grid; gap: 4px; }
.me .handle { font-weight: 700; }
.me .email { color: var(--muted); font-size: 13px; word-break: break-all; }
.me .idle { color: var(--muted); font-size: 12px; }
.me button { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
main { padding: 32px clamp(16px, 4vw, 48px); max-width: 1100px; }
main h1 { margin: 0 0 6px; font-size: 26px; }
.sub { color: var(--muted); margin: 0 0 24px; }

/* ---------- forms ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.drop { display: block; cursor: pointer; border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); transition: .15s; }
.drop.over, .drop:hover { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.drop small { display: block; }
.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; background: var(--accent); color: #000; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
label.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.field input[type=text], .field textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-weight: 400; }
.field textarea { min-height: 140px; resize: vertical; }
.field small { color: var(--muted); font-weight: 400; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .grid2 { grid-template-columns: 1fr; } }

/* waveform trimmer */
.wave { position: relative; height: 140px; background: var(--surface-2); border-radius: 12px; overflow: hidden; user-select: none; touch-action: none; }
.wave canvas { width: 100%; height: 100%; display: block; }
.sel { position: absolute; top: 0; bottom: 0; background: rgba(198, 255, 61, .14); border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); cursor: grab; }
.sel .h { position: absolute; top: 0; bottom: 0; width: 18px; cursor: ew-resize; }
.sel .h.l { left: -11px; } .sel .h.r { right: -11px; }
.sel .h::after { content: ""; position: absolute; top: 50%; left: 6px; width: 6px; height: 28px; margin-top: -14px; border-radius: 3px; background: var(--accent); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.times b { color: var(--text); }

.cover { width: 220px; aspect-ratio: 1; border-radius: var(--radius); border: 2px dashed var(--line); display: grid; place-items: center;
  color: var(--muted); text-align: center; overflow: hidden; position: relative; background: var(--surface-2) center/cover; }
.cover.over, .cover:hover { border-color: var(--accent); }
.cover.filled { border-style: solid; color: transparent; }
.cover input { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }

/* lists */
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-2) center/cover; display: grid; place-items: center; color: var(--muted); }
.item .meta { min-width: 0; }
.item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .info { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.pending { background: rgba(255, 210, 63, .15); color: var(--warn); }
.badge.approved { background: rgba(198, 255, 61, .15); color: var(--accent); }
.badge.rejected { background: rgba(255, 97, 97, .15); color: var(--danger); }
.play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #000; display: grid; place-items: center; padding: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card .art { aspect-ratio: 1; background: var(--surface-2) center/cover; position: relative; display: grid; place-items: center; font-size: 42px; color: var(--line); }
.card .art .play { position: absolute; right: 12px; bottom: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.card .body { padding: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
progress { width: 100%; accent-color: var(--accent); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 10; }
#toast.error { border-color: var(--danger); color: var(--danger); }
