:root {
  --bg: #0f0d0b;
  --panel: #1a1714;
  --panel2: #221e1a;
  --line: #342e28;
  --text: #f3ece4;
  --muted: #a3978a;
  --saffron: #f28c28;
  --saffron-d: #c86a12;
  --green: #3fbf6f;
  --red: #e5484d;
  --amber: #e9b949;
  --radius: 12px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans Devanagari", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1.2em; }
a { color: var(--saffron); }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 28px 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
h3 { margin: 0; font-size: 15px; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }

.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--saffron); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, .18); }
.brand.big { font-size: 26px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: rgba(15, 13, 11, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
#tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
#tabs button { background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; white-space: nowrap; }
#tabs button.active { color: var(--text); background: var(--panel2); }
#tabs button:hover { color: var(--text); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; }

main { padding: 22px 20px 60px; max-width: 1500px; margin: 0 auto; }
.section-head { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } .top { flex-wrap: wrap; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.notice { border-color: var(--saffron-d); background: #2a1d10; margin: 12px 0; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--saffron); border-color: var(--saffron); color: #1b0f02; font-weight: 600; }
.btn.primary:hover { background: #ff9b3a; }
.btn.danger { color: #ffb4b6; border-color: #5b2427; }
.btn.ghost { background: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; margin-top: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--saffron-d); border-color: transparent; }
label { display: block; color: var(--muted); font-size: 12.5px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; margin: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.form-row label { flex: 1 1 160px; }
.form-row label.grow { flex: 3 1 320px; }
.form-row .full { flex-basis: 100%; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #2a1a0c 0, var(--bg) 55%); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login-card p { margin: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); text-transform: uppercase; }
.pill.ok { color: #9be7b8; border-color: #1f5133; background: #10261a; }
.pill.bad { color: #ffb4b6; border-color: #5b2427; background: #2a1213; }
.pill.warn { color: #f6dc95; border-color: #5c4a19; background: #2a220c; }
.pill.onair { color: #fff; background: var(--red); border-color: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, .25); } }

.feed { display: flex; flex-direction: column; gap: 10px; }
.feed.online { border-color: #2c4a35; }
.feed.onair { border-color: var(--red); }
.feed-head { display: flex; align-items: center; gap: 8px; }
.feed-head .name { font-weight: 600; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.metric { background: var(--bg); border-radius: 8px; padding: 7px 8px; }
.metric b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 11px; color: var(--muted); }
.metric.bad b { color: var(--red); }
.metric.warn b { color: var(--amber); }
.links { display: grid; gap: 4px; }
.link { display: grid; grid-template-columns: 90px 1fr 70px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--saffron); border-radius: 4px; }
.link.down .bar i { background: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.phone-line { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }
.msg { font-size: 12px; background: #2a1d10; border-left: 3px solid var(--saffron); padding: 6px 8px; border-radius: 4px; }

.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .actions { justify-content: flex-end; }

.kv { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.kv span { color: var(--muted); }
.kv code { background: var(--bg); padding: 5px 7px; border-radius: 6px; overflow-wrap: anywhere; }

.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.settings .full { grid-column: 1 / -1; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-body { display: grid; gap: 12px; padding: 20px; }
.dlg-body .actions { justify-content: flex-end; }
dialog.preview { width: min(960px, 96vw); }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
dialog.preview video { width: 100%; background: #000; aspect-ratio: 16/9; display: block; }
dialog.preview p { padding: 8px 14px; margin: 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
#toast.show { opacity: 1; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
