:root {
  --a1: #ff9a1f; --a2: #ff4d12;
  --grad: linear-gradient(135deg, var(--a1), var(--a2));
  --bg: #120905; --bg2: #1b0f08; --panel: rgba(255, 255, 255, .045); --panel2: rgba(255, 255, 255, .08);
  --line: rgba(255, 190, 140, .12); --line2: rgba(255, 190, 140, .24);
  --text: #fff4ea; --muted: #c9ab95; --dim: #8d725f;
  --ok: #2fd27a; --danger: #ff4d5e; --warn: #ffb020;
  --r: 16px; --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
input, select, button { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .3; cursor: default; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 160, 90, .22); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.ar { direction: rtl; unicode-bidi: plaintext; }
.grow { flex: 1; min-width: 0; }
.small { font-size: 12px; } .muted { color: var(--muted); } .dim { color: var(--dim); } .ok { color: var(--ok); }
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 520px at 85% -10%, rgba(255, 77, 18, .28), transparent 70%),
    radial-gradient(700px 500px at -5% 105%, rgba(255, 154, 31, .18), transparent 70%), linear-gradient(180deg, var(--bg2), var(--bg)); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: rgba(18, 9, 5, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 4px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.tab { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 10px; color: var(--muted); font-weight: 650; transition: .2s var(--ease); }
.tab:hover { color: var(--text); }
.tab.on { color: #fff; background: var(--grad); box-shadow: 0 8px 24px -10px var(--a2); }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.live:hover { color: var(--text); border-color: var(--line2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); flex: none; }
.dot.off { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.dot.busy { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- layout ---------- */
.view { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 22px 22px 60px; animation: in .3s var(--ease); }
.view.calm { animation: none; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.head p { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row.tight { gap: 4px; } .row.wrap { flex-wrap: wrap; } .row.gap { gap: 16px; } .row.sub { margin-top: 10px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid .wide { grid-column: 1 / -1; }
.grid.chs { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); margin-bottom: 16px; }
.grid.eds { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.card h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 750; margin-bottom: 14px; }
.card h3 .sp { flex: 1; }
.foot { margin-top: 12px; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; line-height: 2; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); font-weight: 650; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--line2); background: rgba(255, 255, 255, .11); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.danger { background: rgba(255, 77, 94, .15); border-color: rgba(255, 77, 94, .35); color: #ffb3bb; }
.ibtn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.ibtn:hover:not(:disabled) { background: var(--panel2); color: var(--text); }
.link { color: var(--a1); font-size: 11.5px; font-weight: 700; margin-left: 6px; text-decoration: underline; }
.input { height: 38px; padding: 0 12px; border-radius: 11px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); outline: none; min-width: 0; }
.input:focus { border-color: var(--a1); }
.input.full { width: 100%; margin-top: 12px; }
select.input { padding-right: 8px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--panel2); font-size: 12px; font-weight: 700; }
.chip.ok { background: rgba(47, 210, 122, .16); color: var(--ok); }
.chip.accent { background: var(--grad); color: #fff; height: 19px; font-size: 10.5px; }
.stepper { display: inline-flex; align-items: center; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 11px; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.stepper button:hover { color: #fff; background: var(--panel2); }
.stepper b { min-width: 30px; text-align: center; }
.stepper.sm button { width: 28px; height: 28px; }
.stepper.sm svg { width: 15px; height: 15px; }
.stepper.sm b { min-width: 24px; font-size: 13px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 650; font-size: 13px; }
.seg button.on { background: var(--grad); color: #fff; }
.seg.mini button { padding: 4px 12px; }
.daychips { display: flex; flex-wrap: wrap; gap: 5px; }
.daychips button { min-width: 46px; height: 32px; border-radius: 9px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 12.5px; }
.daychips button.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px var(--a2); }
.toggle { width: 42px; height: 24px; border-radius: 99px; background: rgba(255, 255, 255, .14); position: relative; flex: none; transition: .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s var(--ease); }
.toggle.on { background: var(--grad); } .toggle.on::after { left: 21px; }
.field { margin-top: 14px; }
.field > label, .ecard > label { display: block; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .4px; color: var(--dim); margin-bottom: 6px; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.setrow:first-of-type { border-top: 0; }
.setrow b { display: block; } .setrow .small { display: block; }
.warn { margin: 10px 0; padding: 10px 12px; border-radius: 11px; background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .3); color: #ffd58a; font-size: 13px; }

/* ---------- avatars ---------- */
.av { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #2a1810; flex: none; }
.av.sm { width: 32px; height: 32px; } .av.xs { width: 22px; height: 22px; } .av.lg { width: 54px; height: 54px; }
.eav { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff; flex: none; }
.eav.lg { width: 50px; height: 50px; font-size: 20px; }

/* ---------- today ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: 20px; margin-bottom: 16px; background: var(--grad); box-shadow: 0 20px 50px -24px var(--a2); }
.hero h1 { font-size: 26px; font-weight: 800; }
.hero p { opacity: .9; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: rgba(0, 0, 0, .18); border-radius: 14px; padding: 10px 16px; min-width: 112px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 11.5px; font-weight: 650; opacity: .85; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 8px; border-radius: 14px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); text-align: center; transition: .2s; }
a.tile:hover { border-color: var(--line2); transform: translateY(-2px); }
.tile.done { border-color: rgba(47, 210, 122, .35); }
.tile-av { position: relative; width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 4px; }
.tile-av .av { width: 50px; height: 50px; }
.ring { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(255, 255, 255, .08); }
.ring-fg { stroke: var(--a1); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring-fg.full { stroke: var(--ok); }
.tile .name { font-weight: 700; font-size: 13px; }
.tile .cnt { font-size: 18px; font-weight: 800; } .tile .cnt small { font-size: 12px; color: var(--muted); }
.offrow { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.rrow:first-of-type { border-top: 0; }
.rrow.done { opacity: .55; }
.rrow.later { opacity: .4; }
.pill { min-width: 46px; text-align: center; font-weight: 800; font-size: 16px; }
.pill small { color: var(--muted); font-size: 12px; }
.rrow.done .pill { color: var(--ok); }
.erow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.erow:first-of-type { border-top: 0; }
.echips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.echip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 2px; border-radius: 99px; background: rgba(0, 0, 0, .25); font-size: 12px; border: 1px solid var(--line); }
.echip.ok { border-color: rgba(47, 210, 122, .45); color: var(--ok); }
.chk { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line2); color: transparent; }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- week ---------- */
.scroll-x { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 4px; width: 100%; }
th, td { text-align: center; font-weight: 600; }
thead th { font-size: 12px; color: var(--muted); padding: 4px 2px; }
thead th span, thead th small { display: block; }
thead th.today { color: var(--a1); }
.rowh { text-align: left; white-space: nowrap; padding-right: 8px; }
.rowh .av { vertical-align: middle; margin-right: 7px; }
.cell { position: relative; width: 100%; min-width: 44px; height: 38px; border-radius: 10px; font-weight: 800; font-size: 13px; transition: .15s; display: grid; place-items: center; }
.cell.off { background: rgba(255, 255, 255, .03); border: 1px dashed var(--line); }
.cell.on { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -10px var(--a2); }
.cell.ok { background: rgba(47, 210, 122, .2); color: var(--ok); border: 1px solid rgba(47, 210, 122, .45); }
.cell.miss { background: rgba(255, 77, 94, .16); color: var(--danger); border: 1px solid rgba(255, 77, 94, .4); }
.cell.extra { background: rgba(47, 210, 122, .08); color: var(--ok); border: 1px dashed rgba(47, 210, 122, .45); }
.cell.today { outline: 2px solid rgba(255, 154, 31, .55); outline-offset: 1px; }
button.cell:hover { filter: brightness(1.15); }
.ov, .ovk { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); }
.tot { color: var(--muted); font-weight: 800; white-space: nowrap; } .tot small { font-size: 11px; color: var(--dim); }
tfoot td, tfoot th { padding-top: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 18px; min-width: 18px; height: 14px; border-radius: 4px; display: inline-block; box-shadow: none; }
.legend .ovk { position: static; display: inline-block; background: var(--muted); }
table.rec td, table.rec th { padding: 4px 6px; }
table.rec thead th { text-align: center; }
table.rec tr.low td:first-of-type { color: var(--warn); }

/* ---------- channels & editors ---------- */
.chcard.inactive { opacity: .55; }
.chtop { display: flex; align-items: center; gap: 12px; }
.name-in { width: 100%; background: transparent; border: 0; border-bottom: 1px solid transparent; font-weight: 800; font-size: 17px; outline: none; padding: 2px 0; }
.name-in:focus { border-bottom-color: var(--a1); }
.chcard > .row:last-child { margin-top: 16px; }
.estats { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.estats > div { flex: 1; background: rgba(0, 0, 0, .2); border-radius: 12px; padding: 8px 10px; text-align: center; }
.estats b { display: block; font-size: 18px; } .estats span { font-size: 11px; color: var(--muted); }
.fin { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); color: var(--muted); font-weight: 700; font-size: 12.5px; }
.fin.on { background: rgba(47, 210, 122, .16); border-color: rgba(47, 210, 122, .5); color: var(--ok); }
.chpick { display: flex; flex-wrap: wrap; gap: 6px; }
.chpick button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.chpick button.on { border-color: var(--a1); color: #fff; background: rgba(255, 120, 30, .18); }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(460px, 100%); background: #1f120b; border: 1px solid var(--line2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal h2 { font-size: 19px; margin-bottom: 6px; }
.modal .foot { margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #2a1810; border: 1px solid var(--line2); padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: fade .2s; max-width: 340px; }
.toast.out { opacity: 0; transition: opacity .3s; }

/* ---------- phones & small screens ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .grid.chs, .grid.eds { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab { flex: 1; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; }
  .live { margin-left: auto; }
  .view { padding: 14px 12px 40px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 21px; }
  .stat { flex: 1 1 40%; min-width: 0; padding: 8px 12px; }
  .stat b { font-size: 18px; }
  .card { padding: 14px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .cell { min-width: 36px; height: 34px; }
  .rowh span { display: inline-block; max-width: 86px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  #toasts { left: 12px; right: 12px; align-items: stretch; }
}
