/* Admin WebUI — simple dark editorial theme, matching the player. */
:root {
  --shell: #0d0b09;
  --surface: #1a1714;
  --surface-2: #231f1a;
  --surface-3: #2c2823;
  --text: #f5f0e5;
  --text-2: #ece4d2;
  --mute: #9a978f;
  --rule: #2f2a25;
  --accent: #ff4a2b;
  --accent-soft: rgba(255, 74, 43, 0.14);
  --ok: #4ade80;
  --warn: #facc15;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--shell);
  color: var(--text);
  font-family: "Manrope", "Inter", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
}
code { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--mute); }

/* top bar */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.top h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.top-fields { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.top-fields label { display: flex; gap: 6px; align-items: center; color: var(--mute); font-size: 12px; }
input[type=text], input:not([type]) {
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--rule); border-radius: 4px; padding: 6px 8px; font: inherit; width: 150px;
}

/* layout */
main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 1px; background: var(--rule);
  min-height: calc(100vh - 53px);
}
.col, .panel { background: var(--shell); padding: 0; display: flex; flex-direction: column; min-width: 0; }
.panel { padding: 0; }
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.col-head h2 { margin: 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.add {
  background: none; border: 1px solid var(--rule); color: var(--text);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
}
.add:hover { border-color: var(--accent); color: var(--accent); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.list li {
  padding: 10px 14px; border-bottom: 1px solid var(--rule); cursor: pointer;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.list li:hover { background: var(--surface); }
.list li.active { background: var(--accent-soft); border-left: 3px solid var(--accent); padding-left: 11px; }
.list .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--mute); font-size: 11px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.list .empty { color: var(--mute); padding: 14px; font-size: 12px; cursor: default; }
.list .empty:hover { background: transparent; }

/* panel */
#versions-wrap { padding: 14px; overflow: auto; }
.hint { color: var(--mute); margin: 6px 2px; }
.muted { color: var(--mute); font-size: 12px; margin-left: 8px; }
.upload { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
input[type=file] { color: var(--text-2); font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); font-size: 13px; }
th { color: var(--mute); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
td .vno { font-family: "JetBrains Mono", monospace; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-family: "JetBrains Mono", monospace; }
.pill.draft { background: rgba(250,204,21,.14); color: var(--warn); }
.pill.published { background: rgba(74,222,128,.14); color: var(--ok); }
.pill.current { background: var(--accent-soft); color: var(--accent); margin-left: 6px; }

/* buttons */
.btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--rule);
  padding: 7px 12px; border-radius: 4px; cursor: pointer; font: inherit;
}
.btn:hover { border-color: var(--mute); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--rule);
  padding: 10px 16px; border-radius: 6px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; font-size: 13px; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--accent); }
.toast.ok { border-color: var(--ok); }

.hidden { display: none !important; }
@media (max-width: 980px) { main { grid-template-columns: 1fr 1fr; } .panel { grid-column: 1 / -1; } }

/* inline create inputs at column bottom */
.col-foot {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--rule); background: var(--surface); align-items: center;
}
.col-foot .new-name { flex: 1; min-width: 0; width: auto; }
.col-note { width: 36%; }
.note-input {
  width: 100%; min-width: 120px; box-sizing: border-box;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--rule); border-radius: 4px; padding: 4px 6px; font: inherit; font-size: 12px;
}
.note-input:focus { outline: none; border-color: var(--accent); }
