/* Надзор. Палитра: бутылочное зелёное сукно, бумага, сигнальный красный.
   Главный элемент: сетка мест/столов. Остальное спокойное. */
:root {
  color-scheme: light dark;
  --paper: #EEF2EE; --panel: #FFFFFF; --ink: #17221C; --muted: #5E6B63; --line: #D3DBD4; --line-strong: #A9B6AD;
  --brand: #1D5C45; --brand-hover: #174A37; --header: #1D5C45; --link: #1D5C45;
  --red: #C81D35; --amber: #B8741A; --rust: #9C4A1F; --felt: #2C7A63;
  --ok-text: #1F6B50; --warn-text: #8A5410; --bad-text: #B0182E;
  --t-free: #E3E9E4; --t-occ: #D5EDE4; --t-occ-ink: #1D5C45; --t-away: #F6E7CC; --t-dirty: #F1DDD2; --t-alert: #C81D35;
  --zone: 61,190,139;
  --ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1512; --panel: #151F1A; --ink: #E4ECE6; --muted: #8A9A90; --line: #24332B; --line-strong: #3B4F43;
    --brand: #1F6B50; --brand-hover: #25805F; --header: #12382A; --link: #6CCB9F;
    --red: #D4243D; --amber: #D08F2E; --rust: #C0683A; --felt: #2E8A66;
    --ok-text: #6CCB9F; --warn-text: #E3A94F; --bad-text: #FF7A8A;
    --t-free: #1B2621; --t-occ: #173A2D; --t-occ-ink: #8FDDB8; --t-away: #3A2E17; --t-dirty: #3D2519; --t-alert: #D4243D;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1512; --panel: #151F1A; --ink: #E4ECE6; --muted: #8A9A90; --line: #24332B; --line-strong: #3B4F43;
  --brand: #1F6B50; --brand-hover: #25805F; --header: #12382A; --link: #6CCB9F;
  --red: #D4243D; --amber: #D08F2E; --rust: #C0683A; --felt: #2E8A66;
  --ok-text: #6CCB9F; --warn-text: #E3A94F; --bad-text: #FF7A8A;
  --t-free: #1B2621; --t-occ: #173A2D; --t-occ-ink: #8FDDB8; --t-away: #3A2E17; --t-dirty: #3D2519; --t-alert: #D4243D;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font: 500 24px/1.2 var(--display); letter-spacing: -0.01em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hint.lead { margin: -4px 0 14px; max-width: 70ch; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---------- шапка ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 10px 20px; min-height: 56px;
  background: var(--header); color: #fff; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-name { font: 500 15px/1 var(--display); white-space: nowrap; }
.brand-org { font-weight: 500; color: rgba(255,255,255,.78); padding-left: 12px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.28);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; flex: 0 0 auto; }
.brand-mark i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.9); }
.brand-mark i:nth-child(2) { background: rgba(255,255,255,.45); }
.brand-mark i:nth-child(4) { background: #FF5A6E; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who .muted { color: rgba(255,255,255,.75); font-size: 14px; }
.role { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; }
.top .btn, .top .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); padding: 6px 12px; font-size: 13px; }
.top .btn:hover, .top .btn.ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.top :focus-visible { outline-color: #fff; }
@media (max-width: 600px) {
  .top { padding: 10px 16px; }
  .who .muted { display: none; }
}

.main { max-width: 1200px; margin: 0 auto; padding: 22px 16px 48px; }
.page-head { margin-bottom: 18px; }
.title-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.title-row h1 { margin: 0; }
.summary { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.summary:empty { display: none; }
.crumbs { margin-bottom: 10px; font-size: 14px; }

/* ---------- панели ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > .card { margin-bottom: 16px; min-width: 0; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; gap: 0; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row-between h2 { margin: 0; }

/* ---------- кнопки и поля ---------- */
.btn { font: 500 14px/1.3 var(--ui); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--line-strong); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ok:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--bad-text); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 8%, var(--panel)); border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { border-color: var(--line); color: var(--ink); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; }
input, select { font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 0; }
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus { outline: 2px solid var(--link); outline-offset: -1px; border-color: transparent; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 200px; }
.inline-form.stack { flex-direction: column; margin-top: 12px; }
.org-type { margin-bottom: 4px; }
.org-type label { font-size: 14px; }
.org-type select { flex: 0 0 auto; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand h1 { font-size: 20px; margin: 0; }
.login-brand .brand-mark i { background: var(--brand); }
.login-brand .brand-mark i:nth-child(2) { background: color-mix(in srgb, var(--brand) 40%, var(--panel)); }
.login-brand .brand-mark i:nth-child(4) { background: var(--red); }
.login-sub { margin: 8px 0 22px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.login input { width: 100%; margin-top: 5px; }
.err { color: var(--bad-text); min-height: 1.2em; margin: 12px 0 0; font-size: 14px; }
.lock { max-width: 520px; margin: 40px auto; text-align: center; }

/* ---------- цифры директора: одна полоса ---------- */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.kpi { background: var(--panel); padding: 14px 18px; min-width: 0; }
.kpi-v { font: 500 22px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-t { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) {
  .kpis { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpi-v { font-size: 19px; }
}

/* ---------- значки ---------- */
.badge { font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.b-ok { color: var(--ok-text); background: color-mix(in srgb, var(--felt) 15%, transparent); }
.b-warn { color: var(--warn-text); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.b-bad { color: var(--bad-text); background: color-mix(in srgb, var(--red) 13%, transparent); }
.count { font-size: 12px; font-weight: 600; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.count:empty { display: none; }

/* ---------- таблицы ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.row-alert td { background: color-mix(in srgb, var(--red) 7%, transparent); }
tr.row-alert td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.row-off td { color: var(--muted); }
td.actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.c-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0 0 8px; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.empty { color: var(--muted); padding: 10px 0; font-size: 14px; }

/* ---------- зал: главный элемент ---------- */
.card.floor { padding: 18px 18px 20px; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.seat { border-radius: 10px; padding: 12px 12px 10px; min-height: 112px; border: 1.5px solid transparent; display: flex; flex-direction: column; }
.seat-n { font: 700 30px/1 var(--display); letter-spacing: -0.02em; }
.seat-s { font-size: 14px; font-weight: 500; margin-top: auto; padding-top: 10px; line-height: 1.25; }
.seat-t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.st-free { background: var(--t-free); }
.st-free .seat-n { color: var(--muted); }
.st-occupied { background: var(--t-occ); border-color: var(--felt); }
.st-occupied .seat-n { color: var(--t-occ-ink); }
.st-away { background: var(--t-away); border-color: var(--amber); }
.st-dirty { background: var(--t-dirty); border-color: var(--rust); }
.st-alert { background: var(--t-alert); border-color: var(--t-alert); color: #fff; }
.st-alert .seat-t { color: rgba(255,255,255,.85); }
.st-unknown { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.seat.stale { opacity: .5; }
@media (max-width: 480px) {
  .seats { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .seat { min-height: 96px; padding: 10px; }
  .seat-n { font-size: 24px; }
  .seat-s { font-size: 13px; }
}
.cams { display: flex; gap: 8px 18px; flex-wrap: wrap; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.cam i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--red); vertical-align: 1px; }
.cam.on i { background: var(--felt); }
.cam.off { color: var(--bad-text); }

/* ---------- алерты: талоны с цветной кромкой ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.alert.k-needs_cleaning { border-left-color: var(--rust); }
.alert.k-refill { border-left-color: var(--amber); }
.alert-body { flex: 1; min-width: 0; }
.alert-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.alert-head b { font-size: 16px; font-weight: 600; }
.alert-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.alert-text { margin: 4px 0 10px; }
.alert-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.clarify { display: flex; gap: 8px; margin-top: 8px; }
.clarify input { flex: 1; }
.snap { flex: 0 0 auto; width: 100px; cursor: zoom-in; }
.snap:empty { display: none; }
.snap img { width: 100%; border-radius: 6px; display: block; }
.snap.big { position: fixed; inset: 0; width: auto; background: rgba(0,0,0,.82); display: grid; place-items: center; z-index: 30; cursor: zoom-out; padding: 16px; }
.snap.big img { max-width: min(900px, 100%); max-height: 90vh; width: auto; }
@media (max-width: 480px) { .snap { width: 76px; } }
@media (max-width: 560px) {
  table.events .c-seat, table.events .c-kind { display: none; }
}

/* ---------- конторы владельца: карточки с кадром ---------- */
.new-org { margin-top: 4px; }
.new-org[open] > summary { margin-bottom: 12px; }
.new-org form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-width: 720px; }
.new-org .hint { margin-top: 8px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.org-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.org-photo { display: block; position: relative; aspect-ratio: 16 / 9; background: var(--t-free); color: var(--muted); }
.org-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.org-nophoto { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px 24px; font-size: 13px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px; background-position: -1px -1px; }
.org-alerts { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.org-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.org-name { font: 500 17px/1.25 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.org-kind { color: var(--muted); font-size: 13px; margin: 3px 0 12px; }
.org-facts { margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; }
.org-facts div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.org-facts dt { color: var(--muted); }
.org-facts dd { margin: 0; font-weight: 500; text-align: right; }
.org-trouble { margin: -6px 0 14px; font-size: 13px; color: var(--bad-text); line-height: 1.35; }
.org-actions { margin-top: auto; display: flex; gap: 8px; }
.org-actions .btn { flex: 1; }

/* ---------- люди ---------- */
.person { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-role { color: var(--muted); font-size: 13px; white-space: nowrap; }
.person.off .person-name { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--line-strong); }
.people-new { margin-top: 14px; }
.people-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.people-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
.people-form input, .people-form select { width: 100%; color: var(--ink); }
.people-form [type=submit] { grid-column: 1 / -1; justify-self: start; }
.pw { display: flex; gap: 6px; }
.pw input { flex: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 560px) { .people-form { grid-template-columns: 1fr; } }
.note { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--felt) 45%, var(--line)); background: color-mix(in srgb, var(--felt) 7%, var(--panel));
  border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.warn { color: var(--warn-text); font-size: 13px; margin: 10px 0 0; }

/* ---------- камеры ---------- */
.cam-list { margin-bottom: 14px; }
.cam-row { display: flex; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cam-row > span:first-child { flex: 1 1 200px; }
.cam-row .cam { font-size: 13px; color: var(--muted); }
.cam-row .cam.off { color: var(--bad-text); }
.tokenbox { margin-top: 14px; border: 1px dashed var(--amber); border-radius: 10px; padding: 14px; }
pre { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13px; user-select: all; margin: 8px 0 0; }
code { background: var(--paper); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.toast.bad { background: var(--red); color: #fff; }
body.zone-ed #toasts { top: 16px; bottom: auto; }

/* ---------- редактор зон ---------- */
.ed-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.ed-tools .grow { flex: 1; }
.ed-stage { margin-bottom: 14px; position: relative; width: 100%; max-width: 1100px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; touch-action: none; user-select: none; }
.ed-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.ed-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: default; }
.ed-stage.drawing svg { cursor: crosshair; }
.ed-stage polygon.zone { fill: rgba(var(--zone), .24); stroke: rgb(var(--zone)); stroke-width: 2; cursor: pointer; }
.ed-stage polygon.zone.sel { fill: rgba(240,180,76,.32); stroke: #F0B44C; cursor: move; }
.ed-stage.drawing polygon.zone { cursor: crosshair; }
.ed-stage .draft { fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: 2; stroke-dasharray: 6 4; }
.ed-stage .draft.done { stroke-dasharray: none; fill: rgba(255,255,255,.2); }
#labels { position: absolute; inset: 0; pointer-events: none; }
.zlabel { position: absolute; transform: translate(-50%, -50%); background: rgba(0,0,0,.68); color: #fff; font: 700 14px/1.2 var(--display); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.zlabel.sel { background: #F0B44C; color: #1b1b1b; }
.dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid rgb(var(--zone)); }
.dot.first { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: rgb(var(--zone)); border-color: #fff; }
/* ручки правки: крупнее на пальцах */
.vh, .mh { position: absolute; pointer-events: auto; border-radius: 50%; touch-action: none; }
.vh { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: #F0B44C; border: 2px solid #fff; cursor: grab; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.vh.on { background: #fff; border-color: #F0B44C; width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.mh { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: rgba(255,255,255,.85); border: 1px solid rgba(0,0,0,.5); cursor: copy; }
@media (pointer: coarse) {
  .vh { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
  .vh.on { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
  .mh { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
}
.ed-help { margin: -6px 0 14px; max-width: 72ch; min-height: 2.9em; }
.ed-frame { font-size: 13px; }
.ed-panel { margin-bottom: 16px; position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 6px 24px rgba(20,40,30,.18); }
.ed-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-row + .ed-row { margin-top: 10px; }
.ed-row .grow { flex: 1; }
.ed-row label { color: var(--muted); }
.ed-row input { flex: 0 1 140px; }
.ed-panel .hint:empty { display: none; }
.zchips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- камеры владельца: действия, ссылка, токен ---------- */
.cam-row { align-items: flex-start; }
.cam-main { flex: 1 1 260px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cam-main .cam { font-size: 13px; color: var(--muted); }
.cam-main .cam.off { color: var(--bad-text); }
.cam-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cam-extra { flex-basis: 100%; }
.cam-extra:empty { display: none; }
.src-form input { flex: 1 1 320px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.tokenbox details { margin-top: 10px; }
.tokenbox summary { cursor: pointer; color: var(--link); font-size: 14px; }

/* ---------- часы работы ---------- */
.org-hours { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.sched { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.sched-hours { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.sched-hours label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sched input[type=time] { width: 9em; }
.org-hours .hint { flex-basis: 100%; margin-top: 2px; }

/* ---------- заявки ---------- */
.leads-card { margin-top: 20px; }
.lead { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 3px; font-size: 14px; }
.lead:last-child { border-bottom: 0; }
.lead-main { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: baseline; }
.lead .btn { justify-self: start; margin-top: 4px; }
.lead.done { opacity: .65; }
.leads-done { margin-top: 10px; }
.leads-done summary { cursor: pointer; color: var(--muted); font-size: 14px; }

/* ---------- «Зал вживую» ---------- */
.live-entry { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; margin: 0 0 14px; }
.live-entry .cams, .live-entry .cams-wrap .cams { margin: 0; }
.live-head h1 { margin: 0; }
.cam-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.live-stage { position: relative; width: 100%; max-width: 1100px; max-width: min(1100px, calc((100vh - 230px) * 16 / 9));
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0b0f0d; border: 1px solid var(--line); }
.live-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.live-stage img:not([src]) { display: none; }
.live-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.live-stage.empty::after { content: "Кадра с этой камеры пока нет"; position: absolute; inset: 0; display: grid; place-items: center; color: #9fb3aa; font-size: 15px; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.lz { stroke-width: 2.5; fill-opacity: .18; }
.lz.busy  { stroke: #3DDC97; fill: #3DDC97; }
.lz.free  { stroke: rgba(255,255,255,.55); fill: #fff; fill-opacity: .05; stroke-width: 1.5; }
.lz.away  { stroke: #F5B83D; fill: #F5B83D; }
.lz.dirty { stroke: #FF8A3D; fill: #FF8A3D; }
.lz.alarm { stroke: #FF4D5E; fill: #FF4D5E; fill-opacity: .28; stroke-width: 3; }
.lz.none  { stroke: rgba(255,255,255,.6); fill: none; stroke-dasharray: 5 4; }
.lz-label { position: absolute; transform: translate(-50%, -50%); font: 700 13px/1.15 var(--display); padding: 3px 7px; border-radius: 6px;
  background: rgba(0,0,0,.66); color: #fff; text-align: center; white-space: nowrap; }
.lz-label small { display: block; font: 500 11px/1.2 var(--sans, inherit); opacity: .9; }
.lz-label.busy { background: #1f8a5f; }
.lz-label.away { background: #a66d0c; }
.lz-label.dirty { background: #b4511b; }
.lz-label.alarm { background: #c81d35; }
.live-badge { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 600; padding: 4px 9px 4px 22px; border-radius: 999px;
  background: rgba(0,0,0,.62); color: #fff; }
.live-badge::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #9aa7a1; }
.live-badge.on::before { background: #FF4D5E; box-shadow: 0 0 0 3px rgba(255,77,94,.3); }
.live-legend { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: 14px 0 6px; font-size: 14px; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg b { font-family: var(--display); font-size: 15px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.busy { background: #3DDC97; } .sw.free { background: transparent; border: 1.5px solid var(--line-strong); }
.sw.away { background: #F5B83D; } .sw.dirty { background: #FF8A3D; } .sw.alarm { background: #FF4D5E; }
.sw.none { border: 1.5px dashed var(--line-strong); }
@media (max-width: 600px) {
  .lz-label { font-size: 11px; padding: 2px 5px; }
  .lz-label small { font-size: 10px; }
}
