@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+Condensed:wght@400;600;700&display=swap');

:root {
  --black:   #000000;
  --s1:      #0a0a0a;
  --s2:      #111111;
  --s3:      #1a1a1a;
  --s4:      #242424;
  --s5:      #2e2e2e;
  --line:    #1f1f1f;
  --line2:   #2a2a2a;
  --fg:      #888;
  --fg2:     #aaa;
  --fg3:     #ccc;
  --white:   #e8e8e8;
  --red:     #ff3040;
  --red-bg:  rgba(255,48,64,.08);
  --green:   #00e676;
  --blue:    #3d8bff;
  --blue-bg: rgba(61,139,255,.08);
  --amber:   #ffb300;
  --cyan:    #00d4f0;
  --purple:  #c04fff;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'IBM Plex Sans Condensed', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--black); color: var(--fg2); font-family: var(--mono); font-size: 12px; overflow-x: hidden; }

/* ── TOPBAR ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 48px;
  background: var(--s1); border-bottom: 1px solid var(--line2);
  position: sticky; top: 0; z-index: 100;
}
.topbar h1 { font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; color: var(--white); }
.topbar-sub { font-size: 9px; letter-spacing: 2px; color: #444; margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.clock { font-size: 20px; color: var(--cyan); letter-spacing: 2px; font-variant-numeric: tabular-nums; }

.live-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; border: 1px solid var(--line2); border-radius: 2px;
  font-size: 10px; letter-spacing: 1.5px; color: #444; background: var(--s2); transition: all .25s;
}
.live-badge.on { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #333; transition: all .25s; flex-shrink: 0; }
.live-badge.on .live-dot { background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 0%,49%{opacity:1}50%,100%{opacity:0} }

/* ── LAYOUT ─────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 320px; min-height: calc(100vh - 48px); }
.grid > div:first-child { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); }

/* ── LABELS ─────────────────────────────────────────── */
.section-label { font-size: 9px; letter-spacing: 3px; color: #3a3a3a; text-transform: uppercase; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ── PREVIEW ────────────────────────────────────────── */
.preview-box { background: var(--s1); border: 1px solid var(--line2); border-radius: 2px; }
.preview-box .section-label { padding: 8px 10px; margin: 0; border-bottom: 1px solid var(--line); border-radius: 2px 2px 0 0; }
.canvas-wrap { position: relative; background: #000; aspect-ratio: 16/9; overflow: hidden; }
.canvas-wrap canvas, .canvas-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.src-badge { position: absolute; bottom: 8px; right: 8px; font-size: 9px; letter-spacing: 1px; background: rgba(0,0,0,.75); color: var(--amber); border: 1px solid #3a2a00; padding: 2px 7px; border-radius: 2px; }
.preview-meta { display: flex; justify-content: space-between; padding: 7px 10px; font-size: 10px; color: #3a3a3a; border-top: 1px solid var(--line); }

/* ── VU ─────────────────────────────────────────────── */
.vu-wrap { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--s1); border: 1px solid var(--line); border-radius: 2px; }
.vu-lbl { font-size: 9px; letter-spacing: 2px; color: #333; min-width: 18px; }
#vuBars { display: flex; gap: 2px; flex: 1; height: 20px; align-items: flex-end; }
.vu-bar { width: 100%; background: var(--green); border-radius: 1px 1px 0 0; min-height: 2px; transition: height .04s; }
.vu-bar.a { background: var(--amber); }
.vu-bar.r { background: var(--red); }
#vuDb { font-size: 10px; color: var(--green); min-width: 32px; text-align: right; }
.ledbar-wrap { background: var(--s1); border: 1px solid var(--line); border-radius: 2px; padding: 5px 10px; }
#ledbar { display: flex; gap: 3px; height: 5px; }
.ls { flex: 1; background: var(--s4); border-radius: 1px; }
.ls.ag { background: var(--green); } .ls.aa { background: var(--amber); } .ls.ar { background: var(--red); }

/* ── GO LIVE ────────────────────────────────────────── */
.go-live-box { background: var(--s1); border: 1px solid var(--line2); border-radius: 2px; padding: 12px; }

/* ── INPUTS ─────────────────────────────────────────── */
label { display: block; font-size: 10px; letter-spacing: 1px; color: #444; margin-bottom: 5px; margin-top: 10px; }
label:first-of-type { margin-top: 0; }
input[type="text"], input[type="number"], select {
  width: 100%; background: var(--s2); border: 1px solid var(--line2); color: var(--white);
  font-family: var(--mono); font-size: 12px; padding: 7px 9px; border-radius: 2px; outline: none; transition: border-color .15s;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: var(--blue); }
select { cursor: pointer; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23444'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 24px; }
input[type="file"] { font-size: 10px; color: #444; background: var(--s2); border: 1px dashed var(--line2); border-radius: 2px; padding: 6px 8px; width: 100%; cursor: pointer; }
input[type="file"]:hover { border-color: var(--blue); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn-row { display: flex; gap: 7px; margin-top: 10px; }
button { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; border: none; border-radius: 2px; cursor: pointer; padding: 8px 14px; transition: all .12s; white-space: nowrap; }
.btn-go   { background: var(--green); color: #000; flex: 1; }
.btn-go:hover { filter: brightness(1.15); }
.btn-stop { background: var(--s3); color: var(--red); border: 1px solid #2a1015; flex: 1; }
.btn-stop:not(:disabled):hover { background: var(--red-bg); border-color: var(--red); }
.btn-stop:disabled { opacity: .3; cursor: not-allowed; }
.btn-blue  { background: var(--s3); color: var(--blue); border: 1px solid #1a2540; padding: 6px 11px; }
.btn-blue:hover { background: var(--blue-bg); }
.btn-ghost { background: transparent; color: #444; border: 1px solid var(--line2); padding: 6px 11px; }
.btn-ghost:hover { color: var(--fg3); border-color: #444; }
.btn-warn  { background: #1a0a0b; color: var(--red); border: 1px solid #3a1015; flex: 1; }
.btn-warn:not(:disabled):hover { background: var(--red-bg); border-color: var(--red); }
.btn-warn:disabled { opacity: .3; cursor: not-allowed; }

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar { background: var(--s1); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar::-webkit-scrollbar { width: 3px; } .sidebar::-webkit-scrollbar-thumb { background: var(--s4); }

/* ── CARDS ──────────────────────────────────────────── */
.card { border-bottom: 1px solid var(--line); padding: 12px 14px; }
.card-title { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--fg3); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.ctdot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.card label { font-size: 10px; letter-spacing: 1px; color: #444; margin-bottom: 5px; margin-top: 10px; }
.card label:first-of-type { margin-top: 0; }

/* ── TABS ───────────────────────────────────────────── */
.src-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.src-tab { flex: 1; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .5px; text-transform: none; padding: 6px 8px; background: var(--s2); border: 1px solid var(--line2); color: #444; border-radius: 2px; cursor: pointer; transition: all .12s; }
.src-tab.active { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }

/* ── PLAYLIST ───────────────────────────────────────── */
.playlist { border: 1px solid var(--line); background: var(--black); border-radius: 2px; max-height: 110px; overflow-y: auto; }
.playlist::-webkit-scrollbar { width: 3px; } .playlist::-webkit-scrollbar-thumb { background: var(--s4); }
.pl-empty { padding: 10px; text-align: center; color: #333; font-size: 10px; }
.pl-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .1s; }
.pl-item:hover { background: var(--s2); } .pl-item.playing { background: var(--blue-bg); }
.pl-ic { color: var(--blue); font-size: 9px; min-width: 10px; } .pl-name { flex: 1; font-size: 10px; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-dur { color: #444; font-size: 9px; } .pl-del { color: #333; cursor: pointer; padding: 0 2px; font-size: 10px; } .pl-del:hover { color: var(--red); }

/* ── SEEK ───────────────────────────────────────────── */
.seek-wrap { margin-top: 8px; }
.seek { -webkit-appearance: none; width: 100%; height: 3px; background: var(--s4); border-radius: 2px; outline: none; border: none; padding: 0; cursor: pointer; }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); cursor: pointer; }
.time-row { display: flex; justify-content: space-between; font-size: 10px; color: #333; margin-top: 4px; }
.pb-row { display: flex; gap: 5px; align-items: center; margin-top: 7px; }
.pb-row .btn-blue { padding: 5px 9px; font-size: 11px; }

/* ── RANGES ─────────────────────────────────────────── */
.rrow { display: flex; gap: 7px; align-items: center; }
.rval { font-size: 10px; color: var(--cyan); min-width: 34px; text-align: right; }
input[type="range"] { -webkit-appearance: none; flex: 1; height: 3px; background: var(--s4); border-radius: 2px; outline: none; cursor: pointer; border: none; padding: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--cyan); cursor: pointer; }

/* ── CHECKBOX ───────────────────────────────────────── */
.chk { display: flex !important; align-items: center; gap: 7px; cursor: pointer; user-select: none; color: var(--fg2) !important; font-size: 11px !important; letter-spacing: 0 !important; margin-top: 7px !important; }
.chk input[type="checkbox"] { width: 13px; height: 13px; accent-color: var(--blue); cursor: pointer; }

/* ── URGENT ─────────────────────────────────────────── */
.urgent-card { border-top: 1px solid #2a1015; }
.hint { font-size: 9px; color: #333; margin-top: 7px; line-height: 1.6; }

/* ── SOUNDBOARD ─────────────────────────────────────── */
.sb-vol-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sb-vol-label { font-size: 9px; letter-spacing: 1px; color: #444; white-space: nowrap; }
.soundboard-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.sb-btn { background: var(--s2); border: 1px solid var(--line2); color: var(--fg2); font-family: var(--mono); font-size: 9px; letter-spacing: 0; text-transform: none; font-weight: 400; padding: 9px 5px; border-radius: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 50px; text-align: center; line-height: 1.3; transition: all .1s; }
.sb-btn:hover { background: var(--s3); border-color: #444; color: var(--white); }
.sb-btn.playing { border-color: var(--green); color: var(--green); background: rgba(0,230,118,.06); }
.sb-btn .sb-icon { font-size: 14px; }
.sb-btn .sb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.sb-add-btn { background: transparent; border: 1px dashed var(--line2); color: #333; font-family: var(--mono); font-size: 20px; font-weight: 400; letter-spacing: 0; text-transform: none; padding: 9px; border-radius: 2px; cursor: pointer; min-height: 50px; display: flex; align-items: center; justify-content: center; transition: all .1s; }
.sb-add-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── SCREEN CAP ─────────────────────────────────────── */
.screencap-preview { aspect-ratio: 16/9; background: #000; border: 1px solid var(--line2); border-radius: 2px; overflow: hidden; position: relative; margin-top: 8px; }
.screencap-preview video { width: 100%; height: 100%; object-fit: contain; }
.screencap-no-signal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; letter-spacing: 3px; color: #2a2a2a; }
.screencap-badge { position: absolute; top: 5px; left: 5px; background: rgba(0,0,0,.8); border: 1px solid var(--green); color: var(--green); font-size: 8px; letter-spacing: 1px; padding: 2px 6px; border-radius: 2px; display: none; }
.screencap-badge.on { display: block; }
