:root {
  --bg: #0a0e13;
  --bg2: #0f141b;
  --panel: #131a23;
  --panel2: #18212c;
  --line: #222d3a;
  --line2: #2c3948;
  --text: #e7edf3;
  --muted: #8a97a6;
  --dim: #5d6b7b;
  --accent: #5b8cff;
  --accent2: #3e6fe6;
  --live: #ff4d4f;
  --ok: #2fbf71;
  --warn: #f5a524;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; }
.brand img { width: 28px; height: 28px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); margin: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: rgba(91, 140, 255, .13); color: #fff; }
.nav a.active svg { color: var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.main { min-width: 0; }
.topbar { height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(10, 14, 19, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 600; font-size: 15px; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 26px 60px; max-width: 1400px; }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; width: 250px; left: -260px; transition: left .2s; }
  .side.open { left: 0; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ---------- building blocks ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { flex: 1; }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.page-h { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h .grow p { margin: 4px 0 0; color: var(--muted); }

/* ---------- forms ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, .18); }
input[type=color] { padding: 2px; width: 42px; height: 34px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--accent); padding: 0; }
textarea { resize: vertical; min-height: 80px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.days { display: flex; gap: 4px; }
.days button { width: 34px; padding: 6px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a4a5c; background: #1c2633; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { color: #ffb3b4; border-color: rgba(255, 77, 79, .4); background: rgba(255, 77, 79, .08); }
.btn.danger:hover { background: rgba(255, 77, 79, .18); }
.btn.live { background: var(--live); border-color: var(--live); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.icon { padding: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn.on { background: rgba(91, 140, 255, .18); border-color: var(--accent); color: #fff; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255, 255, 255, .015); }
.tbl-wrap { overflow-x: auto; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: #7ee2a8; background: rgba(47, 191, 113, .1); border-color: rgba(47, 191, 113, .35); }
.badge.warn { color: #ffd38a; background: rgba(245, 165, 36, .1); border-color: rgba(245, 165, 36, .35); }
.badge.bad { color: #ffaaab; background: rgba(255, 77, 79, .1); border-color: rgba(255, 77, 79, .35); }
.badge.info { color: #a9c2ff; background: rgba(91, 140, 255, .1); border-color: rgba(91, 140, 255, .35); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.live { background: var(--live); box-shadow: 0 0 0 0 rgba(255, 77, 79, .7); animation: pulse 1.6s infinite; }
.dot.ok { background: var(--ok); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 77, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); } }
.onair { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 6px; font-weight: 700; letter-spacing: .08em; font-size: 12px; background: var(--live); color: #fff; }
.offair { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 6px; font-weight: 700; letter-spacing: .08em; font-size: 12px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); }

/* ---------- stats ---------- */
.stat { padding: 16px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.bar.warn > div { background: var(--warn); }
.bar.bad > div { background: var(--live); }

/* ---------- player ---------- */
.player { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); text-align: center; padding: 20px; background: repeating-linear-gradient(45deg, #0b0f14, #0b0f14 10px, #0d1218 10px, #0d1218 20px); }
.timecode { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- media ---------- */
.thumb { width: 96px; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover; background: #000; border: 1px solid var(--line); display: block; }
.thumb.sm { width: 64px; }
.thumb.ph { display: grid; place-items: center; color: var(--dim); font-size: 10px; }
.drop { border: 2px dashed var(--line2); border-radius: 12px; padding: 34px; text-align: center; color: var(--muted); transition: all .15s; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); background: rgba(91, 140, 255, .06); color: var(--text); }
.drop svg { width: 38px; height: 38px; color: var(--accent); }
.upl { display: grid; grid-template-columns: 1fr 160px 90px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }

/* ---------- playlist editor ---------- */
.pl-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
@media (max-width: 1000px) { .pl-editor { grid-template-columns: 1fr; } }
.list { max-height: 62vh; overflow-y: auto; }
.li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.li:hover { background: rgba(255, 255, 255, .02); }
.li .handle { cursor: grab; color: var(--dim); padding: 2px; }
.li .handle svg { width: 16px; height: 16px; }
.li.ghost { opacity: .4; background: rgba(91, 140, 255, .1); }
.li .idx { width: 26px; color: var(--dim); font-family: var(--mono); font-size: 12px; text-align: right; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 10, .65); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal .card-h { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; animation: tin .2s; }
.toast.error { border-left-color: var(--live); }
.toast.ok { border-left-color: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.banner { padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: rgba(245, 165, 36, .1); border: 1px solid rgba(245, 165, 36, .35); color: #ffd38a; }
.banner.bad { background: rgba(255, 77, 79, .1); border: 1px solid rgba(255, 77, 79, .35); color: #ffb3b4; }
.banner.info { background: rgba(91, 140, 255, .1); border: 1px solid rgba(91, 140, 255, .35); color: #c4d4ff; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 10%, rgba(91, 140, 255, .25), transparent 60%), radial-gradient(800px 500px at 90% 90%, rgba(255, 77, 79, .18), transparent 60%), #070a0e; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.auth-art h1 { font-size: 40px; line-height: 1.1; max-width: 520px; }
.auth-art p { color: var(--muted); max-width: 460px; font-size: 15px; }
.auth-art .tc { position: absolute; top: 40px; left: 48px; display: flex; align-items: center; gap: 12px; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form .box { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- graphics designer ---------- */
.designer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .designer { grid-template-columns: 1fr; } }
.stage { position: relative; aspect-ratio: 16/9; background: #222 center/cover no-repeat; border-radius: 8px; overflow: hidden; user-select: none; container-type: inline-size; border: 1px solid var(--line2); }
.stage .el { position: absolute; cursor: move; outline: 1px dashed transparent; }
.stage .el:hover { outline-color: rgba(255, 255, 255, .5); }
.stage .el.sel { outline: 2px solid var(--accent); z-index: 5; }
.stage .el.off { opacity: .25; }
.stage .el .rs { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: var(--accent); border-radius: 3px; cursor: nwse-resize; }
.stage .txt { white-space: nowrap; font-weight: 700; line-height: 1.15; }
.stage .tag { position: absolute; top: -18px; left: 0; font-size: 10px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 4px; display: none; white-space: nowrap; font-family: Inter, sans-serif; font-weight: 600; }
.stage .el.sel .tag { display: block; }
.el-list button { justify-content: flex-start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ---------- schedule timeline ---------- */
.timeline { position: relative; height: 64px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.timeline .blk { position: absolute; top: 18px; height: 36px; border-radius: 5px; background: rgba(91, 140, 255, .35); border: 1px solid var(--accent); font-size: 11px; padding: 2px 6px; overflow: hidden; white-space: nowrap; }
.timeline .blk.break { background: rgba(245, 165, 36, .3); border-color: var(--warn); }
.timeline .hr { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); font-size: 9.5px; color: var(--dim); padding-left: 3px; }
.timeline .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); }

.logs { background: #05080b; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; max-height: 420px; overflow: auto; white-space: pre-wrap; color: #b8c4d0; }
.logs .e { color: #ff9e9f; }
.logs .w { color: #ffd38a; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--dim); margin-bottom: 8px; }
.kbd { font-family: var(--mono); background: var(--bg2); border: 1px solid var(--line2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.price { font-size: 26px; font-weight: 700; }
.plan-card { padding: 18px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; }
.plan-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91, 140, 255, .3); }

.dash { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1050px) { .dash { grid-template-columns: 1fr; } }
