/* Black & White — система за резервации
   Стил по одобрените мокъпи: Onest + Unbounded, неутрален фон, цветове по статус. */

/* 0.37: шрифтовете са на нашия сървър (без Google Fonts) — Onest 400–700, Unbounded 600–700, латиница + кирилица; лиценз OFL (assets/fonts) */
@font-face { font-family: Onest; src: url("fonts/onest.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: Unbounded; src: url("fonts/unbounded.woff") format("woff"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #0d0d0f;
  --ink2: #45454c;
  --muted: #6b6b72;
  --faint: #8a8a92;
  --line: #e3e3e0;
  --line2: #efefec;
  --soft: #fafaf8;

  --held-bg: #efefec;  --held-bd: #8a8a92;  --held-fg: #45454c;
  --book-bg: #fbe5e5;  --book-bd: #f0c4c4;  --book-fg: #b02a2a;
  --dep-bg:  #fdf0d9;  --dep-bd:  #f0d9ae;  --dep-fg:  #8f5600;
  --paid-bg: #e4f4ea;  --paid-bd: #bfe3cc;  --paid-fg: #1b7a43;
  --err: #b02a2a;
  --ok: #1b7a43;
  --viber: #7360f2;

  --r: 12px;
  --font: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Unbounded, Onest, system-ui, sans-serif;
  --top: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font);
}
a { color: var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 21px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 15px; margin: 22px 0 10px; }
.card > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.ok-text { color: var(--ok); font-weight: 600; }
.err-text { color: var(--err); }
.grow { flex: 1; min-width: 0; }
.pre { white-space: pre-line; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upper { text-transform: uppercase; }

/* ---------- Лого ---------- */
.brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--display); text-decoration: none; color: var(--ink); }
.brand.big { font-size: 22px; justify-content: center; }
.logo { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--ink) 50%, #fff 50%); flex: none; }
.brand.big .logo { width: 30px; height: 30px; }
.logo-img { height: 46px; width: auto; display: block; }
.logo-big { width: 150px; height: auto; display: block; margin: 0 auto 4px; }

/* ---------- Горна лента ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 28px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
.topnav a:hover { background: var(--line2); color: var(--ink); }
.topnav a.on { background: var(--ink); color: #fff; font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.who form { margin: 0; }
.linkbtn { border: 0; background: none; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px 0; min-height: 44px; }

.main { padding: 20px 24px 40px; max-width: 1480px; margin: 0 auto; }

/* ---------- Съобщения ---------- */
.flashes { max-width: 1480px; margin: 12px auto 0; padding: 0 24px; display: grid; gap: 8px; }
.flash { padding: 12px 14px; border-radius: var(--r); font-weight: 500; font-size: 14px; }
.flash.ok { background: var(--paid-bg); color: var(--paid-fg); border: 1px solid var(--paid-bd); }
.flash.err { background: var(--book-bg); color: var(--book-fg); border: 1px solid var(--book-bd); }

/* ---------- Бутони и полета ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font: 600 15px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a2f; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--faint); }
.btn.hold { background: var(--held-bg); border: 1.5px dashed var(--held-bd); color: var(--ink); }
.btn.viber { background: var(--viber); color: #fff; }
.btn.viber:hover { background: #5f4be0; }
.btn.danger-ghost { background: #fff; color: var(--err); border-color: var(--book-bd); }
.btn:focus-visible, .iconbtn:focus-visible, .slot:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--viber); outline-offset: 2px;
}
.iconbtn {
  width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r); font-size: 20px; line-height: 1;
  text-decoration: none; color: var(--ink); cursor: pointer;
}
.iconbtn.sm { width: 36px; height: 36px; font-size: 18px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btnrow > form { margin: 0; }
.btnrow.reverse { flex-direction: row-reverse; }
.btnrow .grow2 { flex: 2; }
.btnrow.reverse .btn { flex: 1; }
.btnrow.reverse .btn.grow2 { flex: 2; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field > span em { text-transform: none; letter-spacing: 0; font-style: normal; font-weight: 500; }
input, select, textarea {
  font: 16px var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; min-height: 46px; width: 100%;
}
textarea { min-height: 0; resize: vertical; line-height: 1.45; }
textarea.msg { font-size: 15px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input.num { max-width: 110px; }
.hint { font-size: 12.5px; color: var(--ok); min-height: 1em; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; padding: 10px 0; }
.check input { width: 20px; height: 20px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pad-top { padding-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card.warn { background: var(--dep-bg); border-color: var(--dep-bd); }
fieldset.card { margin: 0; }
fieldset.card legend { font-weight: 700; padding: 0 6px; }
details.card summary { cursor: pointer; font-weight: 600; min-height: 28px; display: flex; align-items: center; }
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }

/* сегментирани избори */
.seg { display: flex; background: #ebebe8; border-radius: var(--r); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg label, .seg a { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span, .seg a {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 10px;
  border-radius: 9px; font-weight: 500; color: var(--muted); text-decoration: none; font-size: 14px; cursor: pointer;
}
.seg input:checked + span, .seg a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg input:focus-visible + span { outline: 2px solid var(--viber); }

/* ---------- Статуси ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.lg { width: 14px; height: 14px; }
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; background: var(--line2); color: var(--ink2); }
.chip.mini { font-size: 11px; padding: 2px 8px; }
.st-held { background: var(--held-bg); color: var(--held-fg); }
.st-booked { background: var(--book-bg); color: var(--book-fg); }
.st-deposit { background: var(--dep-bg); color: var(--dep-fg); }
.st-paid { background: var(--paid-bg); color: var(--paid-fg); }
.st-cancelled { background: var(--line2); color: var(--faint); text-decoration: line-through; }

/* ---------- Календар ---------- */
.cal-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav h1 { min-width: 190px; justify-content: center; font-size: 22px; }
.month-nav .yr { color: var(--muted); font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); margin-left: auto; flex-wrap: wrap; }
.legend span { display: flex; gap: 6px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.st-held { border: 1.5px dashed var(--held-bd); }
.sw.st-booked { border: 1px solid var(--book-fg); }
.sw.st-deposit { border: 1px solid var(--dep-fg); }
.sw.st-paid { border: 1px solid var(--paid-fg); }

.cal-layout { display: flex; gap: 20px; align-items: flex-start; }
.cal-main { flex: 1; min-width: 0; }
.cal-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--top) + 16px); }

.cal-grid { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: clip; }
.cal-row { display: grid; grid-template-columns: 92px repeat(var(--halls), minmax(0, 1fr)); border-bottom: 1px solid var(--line2); min-height: 46px; }
.cal-row:last-child { border-bottom: 0; }
.cal-hdr { background: var(--soft); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; position: sticky; top: var(--top); z-index: 5; }
.cal-hdr > div { padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.cal-hdr .c-hall { border-left: 1px solid var(--line); }
.cal-hdr .muted { font-weight: 400; font-size: 12px; }
.cal-row.we { background: #fcfcfa; }
.cal-row.today { box-shadow: inset 3px 0 0 var(--ink); }
.cal-row.past .c-cell, .cal-row.past .c-date { opacity: .5; }

.c-date { padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.c-date b { font: 700 15px var(--display); width: 24px; }
.c-date .wd { font-size: 12px; color: var(--faint); }
.cal-row.we .c-date .wd { color: var(--ink); font-weight: 700; }
.c-date .long, .c-date .freecount { display: none; }
.c-cell { border-left: 1px solid var(--line2); padding: 4px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.slot {
  flex: 1; min-height: 36px; border-radius: 8px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; font: 500 12.5px var(--font); text-decoration: none; color: var(--ink);
  border: 1px solid transparent; background: none; width: 100%; text-align: left; min-width: 0; cursor: pointer;
}
.slot .hn { display: none; }
.slot .dot { display: none; }
.slot .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.slot .meta { color: inherit; opacity: .8; white-space: nowrap; }
.slot .amt { margin-left: auto; font-weight: 700; white-space: nowrap; }
.slot.free { color: #b5b5bb; }
.slot.free:not([disabled]):hover { background: var(--line2); color: var(--ink); }
.slot.free[disabled] { cursor: default; }
.slot.add { flex: 0 0 auto; min-height: 26px; font-size: 12px; }
.seg input:disabled + span { opacity: .35; cursor: default; }
.slot.st-held { border: 1.5px dashed var(--held-bd); background: var(--held-bg); }
.slot.st-booked { border-color: var(--book-bd); background: var(--book-bg); color: var(--book-fg); }
.slot.st-deposit { border-color: var(--dep-bd); background: var(--dep-bg); color: var(--dep-fg); }
.slot.st-paid { border-color: var(--paid-bd); background: var(--paid-bg); color: var(--paid-fg); }
.slot.st-booked .nm, .slot.st-deposit .nm, .slot.st-paid .nm { color: var(--ink); }
.slot.st-held .nm, .slot.st-held .meta { color: var(--ink2); }
a.slot:hover { filter: brightness(.97); }

.occ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.occ:last-child { margin-bottom: 0; }
.occ-top { display: flex; justify-content: space-between; font-size: 13px; }
.occ-sub { font-size: 12px; }
.bar { height: 6px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.bar i { display: block; height: 100%; }

.daystrip { display: none; }

/* ---------- Панел (dialog) ---------- */
dialog.sheet {
  border: 0; padding: 18px; border-radius: 18px; width: min(380px, calc(100vw - 32px));
  background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog.sheet::backdrop { background: rgba(13,13,15,.45); }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.sheet-title { font: 700 17px var(--display); }
.sheet .btnrow .btn { flex: 1; }

/* ---------- Страници ---------- */
.page { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head h1 { font-size: 19px; }

.hallpick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hallopt { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border: 2px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; }
.hallopt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.hallopt .hname { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.hallopt .hname .dot { background: var(--c); }
.hallopt .hstate { font-size: 12.5px; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hallopt.busy { background: var(--held-bg); }
.hallopt.busy .hstate { color: var(--muted); }
.hallopt:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.hallopt:has(input:focus-visible) { outline: 2px solid var(--viber); outline-offset: 2px; }

.summary { display: grid; gap: 8px; padding: 12px 14px; }
.sumrow { display: grid; grid-template-columns: 1fr 150px 70px; gap: 10px; align-items: center; font-size: 14px; }
.sumrow input { min-height: 38px; padding: 6px 8px; font-size: 14px; }
.sumrow b { text-align: right; }

.kv { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.money { display: grid; gap: 6px; }
.mrow { display: flex; justify-content: space-between; gap: 10px; }
.mrow.total { border-top: 1px solid var(--line2); padding-top: 8px; margin-top: 2px; font-size: 17px; }

.card.list { padding: 4px 0; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line2); text-decoration: none; color: var(--ink); }
.lrow:last-child { border-bottom: 0; }
.lrow .grow { display: flex; flex-direction: column; }
.lrow form { margin: 0; }
.danger-zone { margin-top: 10px; }
.inline-form { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; }

.page.wide { max-width: 1180px; }
.badge { background: var(--err); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .seg { flex: none; }
.toolbar input[type="search"] { flex: 1 1 260px; min-width: 0; }
.seg.tabs a { white-space: nowrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.filters select, .toolbar select { width: auto; min-height: 42px; padding: 8px 10px; font-size: 14px; }
.txlist { display: flex; flex-direction: column; gap: 10px; }
.tx { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tx-top { display: flex; gap: 12px; align-items: flex-start; }
.tx-cp { font-weight: 600; overflow-wrap: anywhere; }
.tx-reason { overflow-wrap: anywhere; }
.tx-amt { font: 700 16px var(--font); text-align: right; white-space: nowrap; }
.tx.out .tx-amt { color: var(--ink); }
.tx-actions { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line2); padding-top: 8px; }
.cand { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--soft); margin: 0; }
.cand .dot { margin-right: 4px; }
.confirm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.confirm-row select { width: auto; min-height: 40px; padding: 6px 8px; font-size: 14px; max-width: 100%; }
.confirm-row .check { padding: 0; }
.tx-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
.inline-edit summary { cursor: pointer; color: var(--muted); }
.client-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.lrow .grow b + .muted { display: block; }
.settings-link { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--muted); }
.settings-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.staff-tabs { align-self: flex-start; }
.taskrow { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line2); }
.taskrow:first-of-type { border-top: 0; }
.taskrow .inline-edit { flex-basis: 100%; }
.taskrow .inline-edit[open] { background: var(--soft); border-radius: 10px; padding: 8px; }
.salgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.num-cell { text-align: right; white-space: nowrap; }
.salgrid .tbl td:first-child { white-space: normal; }
.salgrid .tbl { table-layout: auto; }
.salgrid .card { min-width: 0; overflow: hidden; }
.rematch { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: 0; }
.appfoot { text-align: center; color: var(--faint); font-size: 12px; padding: 4px 16px 24px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi > span { font-size: 12px; color: var(--muted); }
.kpi b { font: 700 20px var(--display); }
.kpi small { font-size: 12px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.chartbox { position: relative; overflow-x: auto; }
.cols-charts { align-items: start; }

.tbl.rep td, .tbl.rep th { text-align: right; }
.tbl.rep td:first-child, .tbl.rep th:first-child { text-align: left; }
.morelist { display: flex; flex-direction: column; gap: 10px; }
.morelist .card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 17px; } }
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.statgrid div { background: var(--soft); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.statgrid b { font: 700 22px var(--display); }
.statgrid span { font-size: 12px; color: var(--muted); }
.tbl.small td { font-size: 13px; }
@media (max-width: 640px) { .statgrid { grid-template-columns: 1fr 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.tbl td { padding: 6px 8px; border-top: 1px solid var(--line2); white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.15); }

/* ---------- Вход / инсталация ---------- */
body.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-card.wide { max-width: 640px; }
.auth-card > .muted { text-align: center; margin: -6px 0 4px; }
.auth-card h1 { justify-content: center; }

.bottomnav { display: none; }

/* =========================================================
   ТЕЛЕФОН
   ========================================================= */
@media (max-width: 860px) {
  :root { --top: 54px; }
  html { scroll-padding-top: calc(var(--top) + 84px); }
  body { font-size: 15px; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 16px; gap: 12px; }
  .logo-img { height: 42px; }
  .topnav { display: none; }
  .settings-link { display: inline-flex; }
  .who > span { display: none; }
  .who { margin-left: auto; }
  .main { padding: 12px 16px 24px; }
  .flashes { padding: 0 16px; }

  .appfoot { padding-bottom: 12px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; min-height: 48px; justify-content: center; }
  .bottomnav a.on { color: var(--ink); font-weight: 700; }
  .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  .cal-head { margin-bottom: 8px; }
  .month-nav { width: 100%; }
  .month-nav h1 { flex: 1; min-width: 0; font-size: 18px; }
  .legend { display: none; }

  .daystrip {
    display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; position: sticky; top: var(--top); z-index: 10;
    background: var(--bg); margin: 0 -16px 10px; padding: 6px 16px 8px; scrollbar-width: none;
  }
  .daystrip::-webkit-scrollbar { display: none; }
  .daystrip a {
    flex: none; width: 50px; scroll-snap-align: start; text-align: center; border-radius: 12px; padding: 5px 0;
    text-decoration: none; color: var(--ink); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  }
  .daystrip small { font-size: 11px; color: var(--faint); }
  .daystrip a.we small { color: var(--ink); font-weight: 700; }
  .daystrip b { font-size: 16px; }
  .daystrip em { font-style: normal; font-size: 10px; color: var(--ok); font-weight: 600; }
  .daystrip em.full { color: var(--faint); }
  .daystrip a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
  .daystrip a.on small, .daystrip a.on em { color: #fff; }
  .daystrip a.past { opacity: .5; }

  .cal-layout { flex-direction: column; align-items: stretch; }
  .cal-side { width: 100%; position: static; }
  .cal-grid { background: none; border: 0; border-radius: 0; overflow: visible; }
  .cal-row.cal-hdr { display: none; }
  .cal-row { display: flex; flex-direction: column; gap: 6px; border: 0; margin-bottom: 16px; background: none !important; box-shadow: none !important; }
  .c-date { padding: 0; justify-content: space-between; }
  .c-date b, .c-date .wd { display: none; }
  .c-date .long { display: block; font: 700 14px var(--display); }
  .c-date .freecount { display: block; font-size: 12px; color: var(--ok); font-weight: 600; }
  .c-date .freecount.full { color: var(--faint); }
  .cal-row.today .c-date .long::after { content: " · днес"; color: var(--muted); font-weight: 600; }
  .c-cell { border: 0; padding: 0; gap: 6px; }
  .slot { min-height: 48px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 13.5px; gap: 10px; }
  .slot .dot { display: inline-block; }
  .slot .hn { display: block; width: 92px; flex: none; font-weight: 600; color: var(--ink); }
  .slot.free { color: var(--ok); font-weight: 600; }
  .slot.add { min-height: 44px; border-style: dashed; }
  .slot.st-held { background: var(--held-bg); }
  .slot.st-booked { background: var(--book-bg); }
  .slot.st-deposit { background: var(--dep-bg); }
  .slot.st-paid { background: var(--paid-bg); }

  dialog.sheet {
    margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .sumrow { grid-template-columns: 1fr 132px 56px; font-size: 13px; }
  .kv { grid-template-columns: 84px 1fr; }
  .sticky-save { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid2.keep { grid-template-columns: 1fr 1fr; }
  .slot .hn { width: 84px; }
}

/* SVG графики */
.svgchart { width: 100%; height: auto; display: block; }
.svgchart .grid { stroke: #ececea; stroke-width: 1; }
.svgchart .zero { stroke: #b9b9b4; stroke-width: 1; }
.svgchart .ax { font-size: 11px; fill: #6b6b72; font-family: inherit; }
.svgchart rect:hover, .svgchart circle:hover { opacity: .8; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #55555c; margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-legend .sw.line { height: 0; width: 16px; border-top: 2.5px solid; border-radius: 0; background: none; }
.chart-legend .sw.line.dash { border-top-style: dashed; }
.hbars { display: grid; gap: 7px; }
.hb { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-b { background: #f2f2ef; border-radius: 4px; height: 12px; overflow: hidden; }
.hb-b i { display: block; height: 100%; border-radius: 4px; }
.hb-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .svgchart { min-width: 520px; } }
.cols-charts > *, .grid2 > * { min-width: 0; }

/* Понеделник */
.daygrp { font-size: 15px; margin: 18px 2px 8px; text-transform: capitalize; }
.mcard { display: grid; gap: 10px; margin-bottom: 10px; }
.mcard.done { opacity: .62; }
.mhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mhead .grow { flex: 1; }
.mbody { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mmoney { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; font-size: 14px; }
.mact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mcheckin { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.mcheckin .field { margin: 0; min-width: 120px; }
.duerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--dep-bd); }
.duerow:first-of-type { border-top: 0; }
.duerow .grow { flex: 1; min-width: 200px; }
@media (max-width: 600px) { .mmoney { align-items: flex-start; text-align: left; } }
.page-head .seg a { white-space: nowrap; }
@media (max-width: 600px) { .monday-head { flex-wrap: wrap; } .monday-head .seg { width: 100%; } .monday-head .seg a { flex: 1; text-align: center; } }
.tbl td.wrap { white-space: normal; min-width: 130px; }
.cashtbl td:nth-child(3), .cashtbl td:nth-child(4), .cashtbl th:nth-child(3), .cashtbl th:nth-child(4) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cashtbl td:first-child { white-space: nowrap; }
@media (max-width: 600px) { .cashtbl { font-size: 13px; } .cashtbl td, .cashtbl th { padding-left: 4px; padding-right: 4px; } }
/* Календар: уикенди, месеци, час за настаняване */
:root { --we-bg: #f3ede1; --we-ink: #7a4b00; --we-strong: #f2b53a; --we-strong-ink: #2a1800; --we-line: #e3c27a; }
.cal-row.we { background: none; }
.cal-row.we .c-date { background: var(--we-strong); }
.cal-row.we .c-date b, .cal-row.we .c-date .wd { color: var(--we-strong-ink); }
.cal-row.we .c-date .wd { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.cal-row.we5 { border-top: 2px solid var(--we-line); }
.cal-row.we0 { border-bottom: 2px solid var(--we-line); }
/* кой настанява и кой чисти — втори ред в резервацията */
.slot.has-ppl { flex-wrap: wrap; align-content: center; row-gap: 1px; padding-top: 5px; padding-bottom: 5px; }
.slot .ppl { flex-basis: 100%; font-size: 11px; font-weight: 500; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .ppl .miss { color: var(--err); opacity: .8; }
.cal-month { padding: 14px 12px 8px; font: 700 15px var(--display); background: var(--soft); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.slot .ci { display: inline-block; font-weight: 800; font-size: 11px; padding: 1px 5px; border-radius: 5px; background: var(--ink); color: #fff; margin-right: 2px; font-variant-numeric: tabular-nums; }
.nodep li { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.nodep li a { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; text-decoration: none; color: var(--ink); }
.nodep .nd-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nodep .nd-d { flex: none; font-size: 12px; }
.daystrip .ds-month { flex: none; align-self: center; font: 700 11px var(--display); color: var(--muted); text-transform: uppercase; padding: 0 4px; }
@media (max-width: 860px) {
  .cal-row.we .c-date { background: var(--we-strong); border-radius: 10px; padding: 6px 10px; }
  .cal-row.we .c-date .long, .cal-row.we .c-date .freecount { color: var(--we-strong-ink); }
  .slot.has-ppl .ppl { padding-left: 102px; }
  .cal-row.we5, .cal-row.we0 { border: 0; }
  .cal-month { background: none; border: 0; padding: 18px 0 8px; font-size: 18px; }
}
/* Седмичен график — календар със задачи */
.wk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.wk-day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wk-day.we { background: var(--we-bg); border-color: #e2d3b4; }
.wk-day.today { box-shadow: inset 0 3px 0 var(--ink); }
.wk-h { font-size: 13px; }
.wk-day.we .wk-h b { color: var(--we-ink); }
.wk-ev { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line2); padding-top: 6px; }
.wk-t { font-size: 12.5px; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.todos .td a, .todos .td > span { text-decoration: none; color: inherit; }
.todos .td { font-size: 12px; line-height: 1.3; }
.todos .td a, .todos .td { display: flex; gap: 5px; align-items: flex-start; }
.todos .ck { flex: none; width: 14px; height: 14px; border: 1.5px solid var(--faint); border-radius: 4px; font-size: 10px; line-height: 12px; text-align: center; margin-top: 1px; }
.todos .done { color: var(--muted); }
.todos .done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.todos .done span:last-child { text-decoration: line-through; }
.todos .open.warn .ck, .todos .open.late .ck { border-color: var(--err); }
.todos .open.late, .todos .open.warn { color: var(--err); font-weight: 600; }
.todos.staff .ck { border-style: dashed; }
@media (max-width: 1100px) { .wk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .wk-grid { grid-template-columns: 1fr; } .wk-day { min-height: 0; } }
.exportform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.exportform select { width: auto; min-height: 36px; padding: 4px 10px; font-size: 14px; }
.monthsw { display: flex; flex-wrap: wrap; margin: 4px 0 14px; width: fit-content; max-width: 100%; }
.monthsw a { white-space: nowrap; }
.kpi .delta { display: block; }
.fin-tabs { width: fit-content; max-width: 100%; margin-bottom: 12px; }
/* резервацията заема цялата клетка; „+ дневно“ — малко, в ъгъла, при посочване */
@media (min-width: 861px) {
  .c-cell.busy { position: relative; }
  .slot.add.corner { position: absolute; right: 6px; bottom: 6px; width: auto; min-height: 22px; padding: 0 8px; font-size: 11px; border-radius: 6px;
    background: #fff; border: 1px dashed var(--faint); color: var(--muted); opacity: 0; z-index: 2; flex: none; }
  .c-cell.busy:hover .slot.add.corner, .slot.add.corner:focus-visible { opacity: 1; }
}
.wk-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-top: 1px solid var(--line2); padding-top: 6px; }
/* календар: филтри, свободни зали като бутони (телефон), „+“ до резервацията */
.calfilters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.chipbtn { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 6px 12px; font: 600 13px var(--font); color: var(--ink2); cursor: pointer; }
.chipbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-grid.f-free .cal-row.full, .cal-grid.f-free .cal-row.past { display: none; }
.cal-grid.f-we .cal-row:not(.we):not(.cal-hdr) { display: none; }
.freechips { display: none; }
.fl-short { display: none; }
.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only { display: inline-block; }
  .cal-grid.hide-past .cal-row.past, .daystrip.hide-past a.past { display: none; }
  .c-cell.empty { display: none; }
  .freechips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .freechips .fc-l { font-size: 12px; font-weight: 600; color: var(--ok); }
  .slot.free.chip { flex: none; width: auto; min-height: 38px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--c); background: #fff;
    color: var(--ink); font-weight: 700; gap: 6px; }
  .slot.free.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
  .c-cell.has-corner { flex-direction: row; align-items: stretch; }
  .c-cell.has-corner > a.slot { flex: 1; min-width: 0; }
  .c-cell.has-corner .slot.add.corner { flex: 0 0 46px; min-height: 0; padding: 0; justify-content: center; border-style: dashed; }
  .slot.add.corner .hn, .slot.add.corner .dot, .slot.add.corner .fl-long { display: none; }
  .slot.add.corner .fl-short { display: inline; font-size: 20px; line-height: 1; }
}
@media (max-width: 860px) { .topbar .who form, .topbar .who > span { display: none; } }
/* Бърза резервация */
.qk-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.qk-chips .chipbtn { text-decoration: none; }
.qk-title { font-size: 16px; margin: 16px 2px 8px; }
.qk-list { display: grid; gap: 8px; }
.qk-hall { display: grid; gap: 8px; border-left: 4px solid var(--c); }
.qk-hall.taken { opacity: .6; }
.qk-h { display: flex; align-items: center; gap: 8px; }
.qk-st { font-size: 12px; font-weight: 700; color: var(--ok); }
.qk-hall.taken .qk-st { color: var(--muted); }
.qk-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qk-btns .btn { flex: 1; min-height: 46px; }
.qk-next { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); text-decoration: none; color: var(--ink); font-size: 14px; }
.qk-next:first-of-type { border-top: 0; }
.qk-next b { width: 70px; flex: none; }
.qk-next span { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; }
.hallcards { display: grid; gap: 10px; }
.hallcard { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.hc-h { display: flex; align-items: center; gap: 8px; }
.hc-h .check { padding: 0; }
.hc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 12px; }
.hc-grid .field { margin: 0; }
.h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink2); }
/* ===== 0.11: телефон — 2 седмици отгоре, дните като решетка 2×2 ===== */
.twoweeks, .c-hl { display: none; }
.bn-ic { position: relative; display: inline-flex; }
.bn-badge { position: absolute; top: -5px; left: 14px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--err); color: #fff; font: 800 10px/16px var(--font); text-align: center; }
@media (max-width: 860px) {
  .settings-link { display: none !important; }
  html { scroll-padding-top: calc(var(--top) + var(--tw-h, 0px) + 6px); }
  .daystrip { display: none !important; }
  .twoweeks { display: block; position: sticky; top: var(--top); z-index: 12; background: #fff; margin: 0 -16px 8px; padding: 6px 0 6px;
    border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px rgba(13,13,15,.06); }
  .tw-pages { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tw-pages::-webkit-scrollbar { display: none; }
  .tw-page { flex: 0 0 100%; scroll-snap-align: start; box-sizing: border-box; padding: 0 12px; display: flex; flex-direction: column; gap: 5px; }
  .tw-label { text-align: center; font: 700 14px var(--display); }
  .tw-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .tw-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); border-radius: 6px; padding: 1px 0; }
  .tw-wd.we { background: var(--we-strong); color: var(--we-strong-ink); }
  .tw-d { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 5px; border-radius: 9px; background: var(--bg); color: var(--ink); text-decoration: none; min-width: 0; }
  .tw-d.we { background: #fbe7bd; }
  .tw-d b { font-size: 15px; line-height: 1; }
  .tw-d em { font-style: normal; font-size: 10px; font-weight: 700; line-height: 1; color: var(--faint); white-space: nowrap; }
  .tw-d em.many { color: var(--ok); }
  .tw-d em.few { color: var(--dep-fg); }
  .tw-d em.full { color: var(--err); }
  .tw-d.today { box-shadow: inset 0 0 0 2px var(--ink); }
  .tw-d.cur:not(.today) { box-shadow: inset 0 0 0 2px #8a8a92; }
  .tw-d.past, .tw-d.out { opacity: .4; }
  .tw-hint { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding-top: 4px; }

  /* ден = заглавие + 4 плочки (2×2), залите винаги на едно място */
  .cal-grid .cal-row:not(.cal-hdr) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 12px; }
  .cal-grid .cal-row .c-date { grid-column: 1 / -1; display: flex; align-items: center; padding: 4px 10px; min-height: 28px; border-radius: 9px; background: #fff; border: 1px solid var(--line2); }
  .cal-grid .cal-row.we .c-date { background: var(--we-strong); border-color: var(--we-strong); padding: 4px 10px; }
  .cal-grid .c-date .long { font-size: 13.5px; }
  .cal-grid .freechips { display: none; }
  .cal-grid .c-cell, .cal-grid .c-cell.empty, .cal-grid .c-cell.has-corner { display: flex; flex-direction: column; position: relative; height: 76px; padding: 0; gap: 0;
    border: 0; border-left: 4px solid var(--c); border-radius: 10px; overflow: hidden; background: #fff; min-width: 0; }
  .cal-grid .c-cell.empty { box-shadow: inset 0 0 0 1px #c6e3d0; }
  .cal-grid .c-hl { display: block; position: absolute; top: 6px; left: 9px; right: 60px; z-index: 1; pointer-events: none; font: 800 9.5px var(--font); letter-spacing: .06em;
    text-transform: uppercase; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-grid .c-cell .slot .hn, .cal-grid .c-cell .slot .dot { display: none; }
  .cal-grid .c-cell > .slot { flex: 1 1 auto; min-height: 0; width: auto; margin: 0; border: 0; border-radius: 0; font-size: 13px; }
  /* свободна */
  .cal-grid .c-cell.empty > .slot.free { justify-content: center; padding: 14px 6px 0; font-weight: 700; font-size: 13.5px; background: #fff; }
  .cal-grid .c-cell.empty > .slot.free[disabled] { color: var(--faint); }
  /* една резервация — 4 реда */
  .cal-grid .c-cell:not(.multi) > a.slot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 6px; row-gap: 0; padding: 21px 9px 4px; }
  .cal-grid .c-cell:not(.multi) > a.slot .nm { grid-column: 1 / -1; font-size: 13.5px; font-weight: 700; }
  .cal-grid .c-cell:not(.multi) > a.slot .meta { font-size: 12px; font-weight: 600; opacity: 1; overflow: hidden; text-overflow: ellipsis; }
  .cal-grid .c-cell:not(.multi) > a.slot .amt { font-size: 12px; margin: 0; }
  .cal-grid .c-cell > a.slot .ppl { grid-column: 1 / -1; padding: 0 !important; font-size: 10.5px; }
  /* две резервации в една зала — по един ред */
  .cal-grid .c-cell.multi { padding-top: 20px; gap: 3px; }
  .cal-grid .c-cell.multi > a.slot { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; min-height: 0; padding: 3px 6px; margin: 0 5px; border-radius: 6px; font-size: 11.5px; }
  .cal-grid .c-cell.multi > a.slot .meta { order: 1; flex: none; font-weight: 600; opacity: 1; }
  .cal-grid .c-cell.multi > a.slot .nm { order: 2; flex: 1; min-width: 0; font-weight: 700; }
  .cal-grid .c-cell.multi > a.slot .amt { order: 3; margin: 0; }
  .cal-grid .c-cell.multi > a.slot .ppl, .cal-grid .c-cell.multi > a.slot .ci { display: none; }
  /* „+ дневно / + вечерно“ — малко копче горе вдясно */
  .cal-grid .c-cell .slot.add, .cal-grid .c-cell.has-corner .slot.add.corner { position: absolute; top: 3px; right: 3px; z-index: 2; flex: none; width: auto; height: 22px; min-height: 22px;
    padding: 0 6px; margin: 0; border: 1px dashed var(--faint); border-radius: 6px; background: rgba(255,255,255,.9); color: var(--ink2); font-size: 10.5px; font-weight: 700; justify-content: center; }
  .cal-grid .c-cell .slot.add { top: 2px; right: 2px; height: 18px; min-height: 18px; }
  .cal-grid .c-cell .slot.add .fl-long { display: inline; }
  .cal-grid .c-cell .slot.add .fl-short { display: none; }
  /* Банка */
  .bank-head { flex-wrap: nowrap; }
  .periodform select { max-width: 52vw; }
}
/* Банка: метрика в брой, ред „като в графиката“ */
.flowline { margin: 10px 0 0; }
.cashline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.cashline .grow { flex: 1; min-width: 180px; }
.bank-range { margin: -6px 0 10px; }
.cashmtbl td, .cashmtbl th { text-align: right; font-variant-numeric: tabular-nums; }
.cashmtbl td:first-child, .cashmtbl th:first-child { text-align: left; }
.cashmtbl tr.sel td { background: #fff7e6; }
.realform { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.realform input.num { width: 92px; min-height: 32px; padding: 2px 8px; text-align: right; }
.realform .btn { min-height: 32px; padding: 0 8px; }
@media (max-width: 600px) {
  .cashmtbl, .cashmtbl tbody { display: block; }
  .cashmtbl thead { display: none; }
  .cashmtbl tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--line2); align-items: center; }
  .cashmtbl td { border: 0; padding: 0; text-align: left !important; font-size: 13.5px; background: none !important; order: 2; white-space: nowrap; }
  .cashmtbl td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .cashmtbl td.c-m { grid-column: span 2; order: 0; font-weight: 700; }
  .cashmtbl td.c-real { grid-column: span 2; order: 1; text-align: right !important; }
  .cashmtbl td.c-real::before { display: none !important; }
  .cashmtbl tr.sel { background: #fff7e6; border-radius: 8px; padding: 8px; }
  .cashmtbl .realform { justify-content: flex-end; }
  .cashmtbl .realform input.num { width: 100px; }
}
@media (max-width: 860px) {
  .month-nav { flex-wrap: wrap; row-gap: 8px; }
  .month-nav > .btn { order: 9; }
  .month-nav > .grow { display: none; }
  .month-nav:has(> .btn)::before { content: ""; order: 8; flex-basis: 100%; height: 0; }
}
@media (max-width: 600px) {
  .monthsw { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .monthsw a { text-align: center; padding-left: 0; padding-right: 0; }
}
/* Съобщение: заглавие на един ред, бутоните винаги видими над долното меню */
.msg-actions { display: flex; flex-direction: column; gap: 8px; }
.btn[disabled] { opacity: .45; cursor: default; }
@media (max-width: 860px) {
  .msg-head { flex-wrap: nowrap; gap: 10px; }
  .msg-head .grow { min-width: 0; }
  .msg-head h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
  .msg-head .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .msg-head .chip { flex: none; font-size: 11px; padding: 3px 8px; }
  #msgBox textarea.msg { height: 38vh; min-height: 180px; }
  .msg-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 6; background: var(--bg);
    margin: 0 -16px; padding: 8px 16px 10px; border-top: 1px solid var(--line); box-shadow: 0 -6px 14px rgba(13,13,15,.06); }
  .msg-actions .btnrow { flex-wrap: nowrap; }
  .msg-actions .btnrow .btn { min-width: 0; padding-left: 6px; padding-right: 6px; }
}
/* Час за настаняване */
.ci-btn { position: absolute; right: 4px; bottom: 4px; z-index: 2; width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 1px solid var(--line);
  background: rgba(255,255,255,.9); color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ci-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ci-btn:hover { background: #fff; color: var(--ink); border-color: var(--faint); }
.ci-btn.set { background: var(--ink); border-color: var(--ink); color: #fff; }
.c-cell .slot .ppl { padding-right: 28px; }
.cibox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cibox .grow { flex: 1; min-width: 180px; }
@media (min-width: 861px) {
  .slot.add.corner { right: 36px; }
}
@media (min-width: 861px) {
  .cal-row[id] { scroll-margin-top: 46px; }
  .c-cell:has(> .ci-btn) > a.slot { padding-right: 34px; }
  .ci-btn { width: 24px; height: 24px; right: 9px; bottom: 50%; transform: translateY(50%); }
}
@media (max-width: 860px) {
  .cal-grid .c-cell:has(> .ci-btn):not(.multi) > a.slot { padding-right: 34px; }
  .cal-grid .ci-btn { width: 28px; height: 28px; right: 4px; bottom: 4px; }
}
.mcheckin { align-items: center; }
.mcheckin .grow { flex: 1; min-width: 160px; }
.unass-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--err); padding: 10px 14px; }
.unass-link span { font-size: 13px; font-weight: 600; }
.unassigned > summary { cursor: pointer; }
.qk-next .qk-free { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; flex: 1; }
.qk-next .qk-free > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (min-width: 861px) { .qk-next .qk-free { grid-template-columns: repeat(4, max-content); } }
.client-row .grow { min-width: 0; }
.client-row .grow > .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh { min-width: 0; }
.vh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vh-top h1 { margin: 0; }
@media (max-width: 600px) {
  .view-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .view-actions > :first-child { grid-column: 1 / -1; }
  .view-actions .btn { width: 100%; }
}
.hint:empty { display: none; }
.grid2.keep > .field > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaverow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line2); }
.leaverow:first-child { border-top: 0; }
.leaverow .grow { flex: 1; min-width: 180px; }
.leaverow form { margin: 0; }
.leavetbl td:nth-child(n+2), .leavetbl th:nth-child(n+2) { text-align: right; }
/* таблици с полета → на телефон на редове */
.btn.wrap { white-space: normal; height: auto; min-height: 36px; text-align: center; line-height: 1.3; padding-top: 6px; padding-bottom: 6px; }
.leaveadd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.leaveadd .field { margin: 0; }
@media (max-width: 700px) {
  .leaveadd { grid-template-columns: 1fr 1fr; }
  .leaveadd .btn { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .tbl.stk, .tbl.stk tbody { display: block; }
  .tbl.stk thead { display: none; }
  .tbl.stk tr { display: grid; grid-template-columns: repeat(var(--stk, 2), minmax(0, 1fr)); gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--line2); }
  .tbl.stk tr:first-child { border-top: 0; }
  .tbl.stk td { display: block; border: 0; padding: 0; white-space: normal; }
  .tbl.stk td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .tbl.stk td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
  .tbl.stk select, .tbl.stk input { width: 100%; max-width: none !important; }
  .table-scroll:has(> .tbl.stk) { overflow: visible; }
}
.kpis.kpi3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .leaverow .grow { flex-basis: 100%; }
}
.hc-grid { align-items: end; }
#templates .field { margin-top: 14px; }
.tplreset { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tplreset form { margin: 0; }
details.charts > summary { cursor: pointer; margin-top: 12px; color: var(--ink2); font-weight: 600; }
@media (max-width: 600px) {
  .toolbar .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
  .toolbar .filters select { width: 100%; min-width: 0; }
  .confirm-row { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
  .confirm-row select { width: 100%; min-width: 0; }
  .confirm-row .check { grid-column: 1 / 2; }
  .confirm-row > .tiny { grid-column: 1 / -1; }
  .cand { flex-wrap: wrap; }
}
.svg-m { display: none; }
@media (max-width: 600px) {
  .svg-d { display: none; }
  .svg-m { display: block; }
  .svgchart.narrow { min-width: 0 !important; }
  .svgchart.narrow .ax { font-size: 10px; }
}
/* таблици с превъртане: сянка отстрани, когато има още колони */
.table-scroll {
  background:
    linear-gradient(90deg, var(--card, #fff) 30%, rgba(255,255,255,0)) left / 28px 100% no-repeat local,
    linear-gradient(270deg, var(--card, #fff) 30%, rgba(255,255,255,0)) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(13,13,15,.16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(13,13,15,.16), transparent) right / 12px 100% no-repeat scroll;
}
@media (max-width: 600px) {
  .tbl.stk td.stk-act { grid-column: 1 / -1; text-align: right; }
  .tbl.rep.stk td { text-align: left !important; }
}
.seg2 { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.seg2 small { font-size: 11.5px; font-weight: 500; opacity: .75; }
.msg-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.msg-tabs a { text-align: center; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
@media (max-width: 400px) { .msg-tabs a { font-size: 13px; } }
.staff-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 520px; }
.staff-tabs a { text-align: center; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
@media (max-width: 400px) { .staff-tabs a, .fin-tabs a { font-size: 13.5px; } }
@media (max-width: 600px) {
  .tbl.stk td:empty { display: none; }
  /* каса: дата | движение | сума; наличност под сумата */
  .cashtbl.ledger, .cashtbl.ledger tbody { display: block; }
  .cashtbl.ledger thead { display: none; }
  .cashtbl.ledger tr { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 8px; padding: 8px 0; border-top: 1px solid var(--line2); }
  .cashtbl.ledger td { border: 0; padding: 0 !important; }
  .cashtbl.ledger td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .cashtbl.ledger td:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; white-space: normal; }
  .cashtbl.ledger td:nth-child(3) { grid-column: 3; grid-row: 1; }
  .cashtbl.ledger td:nth-child(4) { grid-column: 3; grid-row: 2; font-size: 12px; color: var(--muted); }
  .cashtbl.ledger td:nth-child(4)::before { content: "остава "; }
  .cashtbl.ledger td:nth-child(5) { grid-column: 3; grid-row: 3; text-align: right; }
  .cashtbl.ledger td:nth-child(5):empty { display: none; }
  .table-scroll:has(> .cashtbl.ledger) { overflow: visible; background: none; }
}
@media (max-width: 400px) { .seg.tabs.staff-tabs a, .seg.tabs.fin-tabs a { font-size: 13px; padding-left: 2px; padding-right: 2px; } }
/* 0.12: преглед на телефона */
.due-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.todos .done span:last-child { text-decoration: none; }
@media (max-width: 600px) {
  .duerow .grow { flex-basis: 100%; min-width: 0; }
  .due-btns { width: 100%; }
  .due-btns .btn { flex: 1; }
}
@media (max-width: 600px) {
  .mcheckin .grow { flex-basis: 100%; }
  .mcheckin > .btn { flex: 1; }
}
@media (max-width: 440px) { .seg.tabs.staff-tabs a, .seg.tabs.fin-tabs a { font-size: 13.5px; padding-left: 2px; padding-right: 2px; } }
.unassigned > summary { display: block; line-height: 1.4; }
.unassigned > summary .muted { display: block; font-weight: 500; }
details.card.unassigned > summary { display: block; line-height: 1.4; }
form .grid3, form .grid2 { align-items: end; }
.grid3 > .field, .grid2 > .field { min-width: 0; }
.card > input[type=hidden] + h2, .card > input[type=hidden] ~ h2:first-of-type { margin-top: 0; }
.cr-main { min-width: 0; }
.cr-l1, .cr-l2 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-l2 .chip { vertical-align: 1px; margin-right: 4px; }
.cr-amt { flex: none; white-space: nowrap; }
@media (max-width: 600px) {
  .tbl.stk:has(td.stk-act) td:first-child { grid-column: 1 / -2; }
  .tbl.stk td.stk-act { grid-column: -2 / -1 !important; grid-row: 1; text-align: right; }
}
.fin-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 420px; }
.fin-tabs a { text-align: center; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
@media (max-width: 860px) {
  .month-nav h2 { flex: 1; min-width: 0; text-align: center; margin: 0; }
}
@media (max-width: 600px) {
  .cashtbl.ledger td:nth-child(4)::before { content: "налично "; }
}
.chartbox .chart-legend { display: flex; flex-wrap: wrap; max-width: 100%; }
@media (max-width: 600px) {
  .hb { grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px; }
  .hb-l { grid-column: 1 / -1; white-space: normal; font-size: 12.5px; }
  .hbars { gap: 9px; }
}
@media (max-width: 600px) { .cashtbl.ledger.divs td:nth-child(4)::before { content: "остава "; } }
.slot .hold-until { font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 861px) { .slot.st-held { flex-wrap: wrap; row-gap: 1px; } .slot .hold-until { flex-basis: 100%; } }
@media (max-width: 860px) {
  .cal-grid .c-cell:not(.multi) > a.slot .hold-until { grid-column: 1 / -1; }
  .cal-grid .c-cell.multi > a.slot .hold-until { display: none; }
}
@media (max-width: 380px) {
  .cal-grid .c-hl { font-size: 9px; letter-spacing: .03em; left: 8px; right: 64px; }
  .cal-grid .c-cell .slot.add { padding: 0 4px; font-size: 10px; }
}
@media (max-width: 600px) {
  .cashtbl.ledger.divs tr { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .toolbar .seg.tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .toolbar .seg.tabs a { text-align: center; white-space: nowrap; }
}
@media (max-width: 600px) {
  .client-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .client-btns > .btn.primary { grid-column: 1 / -1; }
  .client-btns .btn { width: 100%; }
}
.userlist { display: grid; }
.userrow { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line2); }
.userrow:first-child { border-top: 0; }
.userrow .grow { flex: 1; min-width: 180px; }
.userrow.off { opacity: .6; }
.userrow .inline-edit { flex-basis: 100%; }
/* Google таблица */
.sheet-head { align-items: center; flex-wrap: wrap; }
.sheet-head h1 { margin: 0; }
.sheet-btns { display: flex; gap: 8px; }
.sheet-btns .btn { display: inline-flex; align-items: center; gap: 8px; }
.sheet-btns svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sheetframe { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: calc(100vh - var(--top) - 170px); min-height: 420px; }
.sheetframe iframe { display: block; width: 100%; height: 100%; border: 0; }
.sheet-note { margin-top: 8px; }
.sheetpage.wide { max-width: none; }
@media (max-width: 860px) {
  .sheet-head .grow { min-width: 0; flex: 1; }
  .sheet-btns { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .sheet-btns .btn { justify-content: center; min-height: 44px; }
  .sheetframe { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; height: calc(100vh - var(--top) - 250px - env(safe-area-inset-bottom)); height: calc(100dvh - var(--top) - 250px - env(safe-area-inset-bottom)); min-height: 360px; }
}
@media (max-width: 860px) { .iconbtn.mobile-only { display: inline-flex; } }
/* 0.14: изпратени графици, собственик / Todoist */
.sendsum { display: flex; align-items: center; gap: 12px; }
.sendsum .grow { flex: 1; min-width: 0; }
.ss-ring { --p: 0; flex: none; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line2) 0); display: flex; align-items: center; justify-content: center; }
.ss-ring span { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; }
.empcard .emp-head { align-items: flex-start; }
.emp-st > span { display: none; }
.emp-st > .muted { display: inline; }
.empcard.sent .st-sent { display: inline; color: var(--ok); font-weight: 600; }
.empcard.changed .st-changed { display: inline; color: var(--dep-fg); font-weight: 600; }
.empcard.pending .st-pending { display: inline; color: var(--err); font-weight: 600; }
.empcard.pending { border-color: var(--book-bd); }
.empcard.changed { border-color: var(--dep-bd); background: #fffaf0; }
.emp-toggle { display: none; }
.empcard.sent .emp-toggle { display: inline; }
.empcard.sent:not(.open) .emp-body { display: none; }
.empcard.sent:not(.open) { gap: 0; }
.unsent { margin: 0; }
.owner-check { align-items: flex-start; gap: 10px; padding-top: 6px; }
.owner-check input { margin-top: 3px; }
.ownercard { border-left: 4px solid #e44332; }
.td-brand { color: #e44332; font-size: 13px; }
.tdlist { display: grid; }
.tdrow { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line2); font-size: 13.5px; }
.tdrow:first-child { border-top: 0; }
.tdrow .grow { flex: 1; min-width: 0; }
.td-st { flex: none; font-size: 11.5px; font-weight: 700; }
.td-ok { color: var(--ok); } .td-changed { color: var(--dep-fg); } .td-new { color: var(--err); } .td-gone, .td-past { color: var(--faint); }
.btn.todoist { background: #e44332; border-color: #e44332; color: #fff; }
.btn.todoist:hover { filter: brightness(.95); }
.td-resend { margin: 0; flex: none; }
/* 0.15: ръчни задачи в календара, попъп „+ Задача“, известяване */
.c-tasks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 6px 6px 98px; border-top: 1px dashed var(--line2); }
.tchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; border-radius: 8px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c); font-size: 12px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tchip b { font-weight: 700; }
.tchip-st { font-size: 11px; font-weight: 700; }
.tchip.ok .tchip-st { color: var(--ok); }
.tchip.later .tchip-st { color: var(--muted); }
.tchip.todo { background: #fff5f5; border-color: var(--book-bd); }
.tchip.todo .tchip-st { color: var(--err); }
.tchip.noemp { background: #fff5f5; border-color: var(--book-bd); }
.hl { animation: hlpulse 2.4s ease-out 1; }
@keyframes hlpulse { 0%, 40% { box-shadow: 0 0 0 3px #f2b53a; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 860px) {
  .c-tasks { padding: 0; border: 0; }
  .tchip { font-size: 12.5px; padding: 6px 10px; flex: 1 1 100%; }
}
#taskSheet .seg label span { padding-left: 4px; padding-right: 4px; }
.task-state { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.task-state.todo, .task-state.noemp { color: var(--err); background: #fbe5e5; }
.task-state.ok { color: var(--ok); }
.task-state.later { color: var(--muted); }
.cal-row .c-tasks { grid-row: 2; }
.cal-row .c-date { grid-row: 1; }
@media (min-width: 861px) { .cal-row:has(.c-tasks) .c-date { grid-row: 1 / span 2; } .c-tasks { grid-column: 2 / -1; padding-left: 6px; } }
/* 0.16: неизпратени данни за плащане */
.unsent-box { background: #fff5f5; border: 1.5px solid var(--book-bd); border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; display: grid; gap: 8px; }
.ub-head { display: flex; align-items: center; gap: 8px; }
.ub-head b { flex: 1; color: var(--err); font-size: 14px; }
.ub-n { width: 26px; height: 26px; border-radius: 50%; background: var(--err); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.ub-list { display: flex; flex-wrap: wrap; gap: 6px; }
.unsent-box.closed .ub-list { display: none; }
.ub-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--book-bd); border-left: 4px solid var(--c); border-radius: 10px; padding: 6px 8px 6px 10px; font-size: 13px; }
.ub-row a.grow { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.ub-row .btn { flex: none; }
.unsent-badge { flex: none; font-size: 10px; font-weight: 800; color: #fff; background: var(--err); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.slot.unsent { outline: 2px solid var(--err); outline-offset: -1px; }
@media (max-width: 860px) {
  .ub-row { flex: 1 1 100%; }
  .cal-grid .c-cell:not(.multi) > a.slot.unsent .amt { display: none; }
  .cal-grid .c-cell:not(.multi) > a.slot.unsent .unsent-badge { justify-self: end; align-self: center; }
  .cal-grid .c-cell.multi > a.slot .unsent-badge { order: 4; }
  .cal-grid .c-cell:has(> a.slot.unsent) { box-shadow: inset 0 0 0 2px var(--err); }
  .cal-grid .c-cell > a.slot.unsent { outline: 0; }
}
/* 0.16: Задачи — таск мениджър */
.tasks-head { align-items: center; flex-wrap: wrap; gap: 10px; }
.tasks-head h1 { margin: 0; }
.tasks-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.tasks-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--top) + 16px); }
.task-filters { margin-bottom: 10px; }
.task-filters a { text-decoration: none; }
.chipbtn .cnt { font-weight: 700; opacity: .7; margin-left: 2px; }
.tgroup { padding: 4px 14px 2px; margin-bottom: 10px; }
.tg-h { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 8px 0 6px; }
.tgroup.overdue { border-color: var(--book-bd); }
.tgroup.overdue .tg-h { color: var(--err); }
.trow { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line2); }
.tg-h + .trow { border-top: 0; }
.tcheck { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px; border: 2px solid #c8c8ce; background: #fff; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tcheck:hover { border-color: var(--ok); }
.tcheck[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.tgroup.overdue .tcheck[aria-pressed="false"] { border-color: var(--err); }
.tmain { flex: 1; min-width: 0; }
.t1 { font-size: 14px; }
.t1, .t2 { overflow: hidden; text-overflow: ellipsis; }
.t3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.t3 a { color: var(--muted); }
.trow.done .tmain { opacity: .55; }
.trow.done .t1 { text-decoration: line-through; }
.tk { font-weight: 700; }
.tk-viewing { color: #7360f2; } .tk-clean { color: #13a3a3; } .tk-other { color: #8f5600; } .tk-checkin { color: var(--ink); }
.tstate { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; }
.tstate.ok { color: var(--ok); background: var(--paid-bg); }
.tstate.td { color: #e44332; background: #fdecea; }
.tstate.todo, .tstate.noemp { color: var(--err); background: var(--book-bg); }
.tstate.warn { color: var(--dep-fg); background: var(--dep-bg); }
.tstate.later { color: var(--muted); background: var(--line2); }
.tact { flex: none; align-self: center; }
.sched-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.warn-text { color: var(--dep-fg); }
.td-side { border-left: 4px solid #e44332; }
.howto { line-height: 1.5; }
.howto .ink { color: var(--ink); }
.sched-mini { display: none; align-items: center; gap: 10px; margin-bottom: 10px; }
.sched-mini .grow { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .tasks-layout { grid-template-columns: 1fr; }
  .tasks-side { position: static; }
  .sched-mini.mobile-flex { display: flex; }
  .task-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; }
  .task-filters::-webkit-scrollbar { display: none; }
  .task-filters a { flex: none; }
  .tasks-head .seg { order: 3; width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tasks-head .seg a { text-align: center; }
  .tgroup { padding: 2px 12px 0; }
}
.topnav a { white-space: nowrap; }
@media (max-width: 1440px) and (min-width: 861px) { .topnav { gap: 0; } .topnav a { padding-left: 9px; padding-right: 9px; font-size: 14px; } }
@media (max-width: 1200px) and (min-width: 861px) { .topnav a { padding-left: 6px; padding-right: 6px; font-size: 13px; } .brand span { display: none; } }
.wk-tasks { display: flex; flex-direction: column; gap: 4px; }
.wk-tasks .tchip { white-space: normal; display: block; }
.emprow { flex-wrap: wrap; }
.emprow .grow { min-width: 160px; }
.emprow .right { display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: flex-end; }
@media (max-width: 600px) { .emprow .right { flex-basis: 100%; justify-content: flex-start; text-align: left; } }
/* 0.17: Задачи — статуси (час за настаняване, доплащане, графици), 7/14 дни */
.show-m { display: none; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; }
.st-card { gap: 7px; }
.st-ci { border-top: 3px solid var(--ink); }
.st-rem { border-top: 3px solid #d9922b; }
.st-h { display: flex; align-items: baseline; gap: 8px; }
.st-h > b:first-child { flex: 1; }
.st-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; min-height: 30px; }
.st-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }
.st-name:hover { text-decoration: underline; }
.st-name .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.st-val { font-weight: 700; color: var(--muted); white-space: nowrap; }
.st-btn { flex: none; min-width: 30px; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.st-btn:hover { border-color: var(--ink); }
.st-btn.ok { color: var(--ok); border-color: transparent; background: var(--paid-bg); }
.st-btn.off { opacity: .35; }
.st-line.done .st-name { color: var(--muted); }
.st-more summary { font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 4px 0; list-style: none; }
.st-more summary::-webkit-details-marker { display: none; }
.st-more[open] summary { display: none; }
.st-tiles { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.st-tile { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.st-tile > span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile > b { font: 700 17px var(--display); }
.st-tile > small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-dlg { width: min(440px, calc(100vw - 32px)); }
.st-dlg[open] { display: flex; flex-direction: column; gap: 8px; }
.st-dlg .st-line { border-top: 1px solid var(--line2); padding: 6px 0; font-size: 14px; }
.st-dlg p { margin: 0; }
@media (max-width: 860px) {
  .show-m { display: inline; } .hide-m { display: none; }
  .st-tiles { display: grid; }
  .tasks-side > .st-ci, .tasks-side > .st-rem, .tasks-side > .st-sched { display: none; }
  .tasks-head h1 { flex: 1 1 calc(100% - 60px); order: 0; }
  .tasks-head .btn.primary { order: 1; width: 40px; height: 40px; padding: 0; font-size: 20px; }
  .tasks-head .seg.view-seg, .tasks-head .seg.days-seg { order: 2; width: auto; flex: 1 1 0; display: grid; grid-template-columns: 1fr 1fr; }
  .tasks-head .seg.days-seg { flex: 0.8 1 0; }
  .tasks-head .period-txt { display: none; }
  .st-dlg { width: 100%; max-height: 85vh; overflow: auto; }
}
/* 0.17: Клиенти — таблица с филтри */
.page.xwide { max-width: 1320px; }
.cl-head { flex-wrap: wrap; gap: 10px; align-items: center; }
.cl-head h1 { margin: 0; }
.cl-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cl-filters input, .cl-filters select { width: auto; }
.cl-filters .cl-q { width: 260px; }
.cl-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cl-chips a { text-decoration: none; }
.cl-table { padding: 0; overflow: clip; }
.cl-row { display: grid; grid-template-columns: minmax(170px, 1.6fr) 130px 70px 170px minmax(120px, 1fr) 100px 90px 72px 96px; gap: 10px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line2); font-size: 13px; color: var(--ink); text-decoration: none; }
a.cl-row:hover { background: #fafaf8; }
.cl-th { border-top: 0; background: #fafaf8; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8a8a92; position: sticky; top: var(--top); z-index: 1; }
.cl-th a { color: inherit; text-decoration: none; white-space: nowrap; }
.cl-th a.on { color: var(--ink); }
.cl-row .c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-row .c-phone, .cl-row .c-hall, .cl-row .c-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-row .c-n, .cl-row .c-paid, .cl-row .c-left { text-align: right; white-space: nowrap; }
.cl-row .c-left.err-text { font-weight: 700; }
.cl-row .c-last.ok-text { font-weight: 700; }
.cl-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.cl-row .c-meta { display: none; }
.cl-sum { border-top: 2px solid var(--line); background: #fafaf8; font-weight: 700; }
.cltag { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; }
.cltag.t-repeat { color: var(--ok); background: var(--paid-bg); }
.cltag.t-new { color: #2f6fd0; background: #e6effc; }
.cltag.t-once { color: var(--muted); background: var(--line2); }
.cltag.t-inactive { color: #8a8a92; background: #efefec; }
@media (max-width: 1100px) and (min-width: 861px) {
  .cl-row { grid-template-columns: minmax(150px, 1.6fr) 60px 120px minmax(110px, 1fr) 90px 80px 90px; }
  .cl-row .c-phone, .cl-row .c-since { display: none; }
}
@media (max-width: 860px) {
  .cl-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .cl-filters .cl-q { width: 100%; grid-column: 1 / -1; }
  .cl-filters select { width: 100%; min-width: 0; }
  .cl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cl-kpis .kpi { padding: 9px 10px; }
  .cl-kpis .kpi b { font-size: 15px; }
  .cl-kpis .kpi small { display: none; }
  .cl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .cl-chips::-webkit-scrollbar { display: none; }
  .cl-chips a { flex: none; }
  .cl-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name paid" "meta left"; gap: 2px 10px; padding: 10px 14px; }
  .cl-row > * { display: none; }
  .cl-row .c-name { display: block; grid-area: name; font-size: 14px; }
  .cl-row .c-paid { display: block; grid-area: paid; font-weight: 700; font-size: 14px; }
  .cl-row .c-meta { display: block; grid-area: meta; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cl-row .c-left { display: block; grid-area: left; font-size: 11.5px; }
  .cl-row .c-left.muted { visibility: hidden; }
  .cl-th { display: flex; gap: 14px; overflow-x: auto; padding: 8px 14px; position: static; }
  .cl-th > * { display: inline; flex: none; }
  .cl-th .c-phone, .cl-th .c-tag, .cl-th .c-since { display: none; }
  .cl-sum .c-name, .cl-sum .c-paid { display: block; }
}
/* 0.17: Google таблица — скрол с пръст и влачене с мишката */
.sheet-scroll { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; position: relative; }
.sheet-canvas { position: relative; }
.sheet-canvas iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.sheet-drag { position: absolute; inset: 0; display: none; cursor: grab; touch-action: pan-x pan-y; }
.sheet-scroll.drag-on .sheet-drag { display: block; }
.sheet-scroll.dragging .sheet-drag { cursor: grabbing; }
.sheet-tools { margin-top: 6px; }
.sheet-tools .linkbtn { padding: 0; min-height: 0; color: var(--ink); font-weight: 700; }
/* 0.18: табове Задачи · Графици за Viber; променен график */
.tasks-tabs { align-self: flex-start; }
.tasks-tabs .badge { margin-left: 4px; }
.st-btn.warn { background: var(--dep-bg); border-color: #e9b765; color: var(--dep-fg); }
.st-changed-line .st-name { font-weight: 700; }
@media (max-width: 860px) { .tasks-tabs { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; } .tasks-tabs a { text-align: center; } }
/* 0.18: Последни резервации */
.rr-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rr-row { display: grid; grid-template-columns: 150px minmax(180px, 1.4fr) minmax(120px, 1fr) 190px 90px 90px 130px; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line2); font-size: 13px; color: var(--ink); text-decoration: none; }
a.rr-row:hover { background: #fafaf8; }
.rr-row .r { text-align: right; white-space: nowrap; }
.rr-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.rr-row.cancelled { opacity: .55; }
.rr-row.cancelled .rr-client b { text-decoration: line-through; }
@media (max-width: 860px) {
  .rr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rr-row.cl-th { display: none; }
  .rr-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client rent" "ev st" "when hall"; gap: 3px 10px; padding: 10px 14px; }
  .rr-client { grid-area: client; } .rr-rent { grid-area: rent; font-weight: 700; } .rr-ev { grid-area: ev; font-size: 12px; }
  .rr-st { grid-area: st; justify-self: end; } .rr-when { grid-area: when; font-size: 11.5px; } .rr-when b { font-weight: 600; }
  .rr-hall { grid-area: hall; justify-self: end; font-size: 12px; } .rr-paid { display: none; }
  .cl-head .seg { order: 3; }
}
/* 0.18.1: една лява линия за всички страници (като календара) и еднакви табове */
.page { margin: 0; }
.page.wide, .page.xwide { max-width: none; }
.seg.tabs.staff-tabs, .seg.tabs.fin-tabs, .seg.tabs.tasks-tabs {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); grid-template-columns: none;
  width: fit-content; max-width: 100%; align-self: flex-start; margin: 0;
}
.seg.tabs.staff-tabs a, .seg.tabs.fin-tabs a, .seg.tabs.tasks-tabs a { text-align: center; white-space: nowrap; padding-left: 14px; padding-right: 14px; font-size: 14px; }
@media (max-width: 860px) {
  .seg.tabs.staff-tabs, .seg.tabs.fin-tabs, .seg.tabs.tasks-tabs { width: 100%; grid-auto-columns: minmax(0, 1fr); align-self: stretch; }
  .seg.tabs.staff-tabs a, .seg.tabs.fin-tabs a, .seg.tabs.tasks-tabs a { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 400px) { .seg.tabs.staff-tabs a, .seg.tabs.fin-tabs a, .seg.tabs.tasks-tabs a { font-size: 13px; } }
/* 0.19: календар — от текущата седмица; празна клетка без „свободно“ */
.past-more { display: none; }
@media (min-width: 861px) {
  .cal-grid.hide-past .cal-row.pastwk { display: none; }
  .past-more { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fafaf8; padding: 9px 16px; text-align: left; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
  .past-more:hover { color: var(--ink); background: var(--line2); }
  .cal-grid.hide-past .past-more .pm-hide, .cal-grid:not(.hide-past) .past-more .pm-show { display: none; }
  .c-cell.empty .slot.free .fl-new { display: none; }
  .c-cell.empty .slot.free .fl { opacity: 0; transition: opacity .12s; font-weight: 700; color: var(--ink); }
  .c-cell.empty .slot.free:not([disabled]):hover .fl { opacity: 1; }
  .c-cell.empty .slot.free:not([disabled]):hover .fl-new { display: inline; }
}
@media (max-width: 860px) { .slot.free .fl-new { display: none; } }
.seg a .badge, .seg span.badge { display: inline-block; flex: none; min-height: 0; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 800; text-align: center; box-shadow: none; vertical-align: 1px; box-sizing: border-box; }
/* 0.19: Седмичен график — статуси като кръгчета (не приличат на отметки) */
.todos .ck { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #b9b9c0; background: transparent; font-size: 0; line-height: 0; margin-top: 3.5px; box-sizing: border-box; }
.todos .done .ck { background: var(--ok); border-color: var(--ok); }
.todos .open.warn .ck, .todos .open.late .ck { background: var(--err); border-color: var(--err); }
.todos.staff .ck { border-style: dashed; background: transparent; }
.todos .done span:last-child { text-decoration: none; }
.flash.warn { background: var(--dep-bg); color: var(--dep-fg); border: 1px solid #ecc98a; }
.sched-notice { display: grid; gap: 6px; }
.sn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink); }
.sn-row span { flex: 1; min-width: 200px; }
/* сравнение: изпратено преди → сега */
.sched-diff { border: 1px solid #ecc98a; background: #fffaf0; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.sched-diff summary { font-weight: 700; cursor: pointer; color: var(--dep-fg); }
.sd-lines { margin-top: 8px; display: grid; gap: 1px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; }
.sd-add { color: var(--ok); background: var(--paid-bg); padding: 1px 6px; border-radius: 4px; }
.sd-del { color: var(--err); text-decoration: line-through; background: var(--book-bg); padding: 1px 6px; border-radius: 4px; }
.sd-same { color: var(--muted); padding: 1px 6px; }
.sd-legend { margin-top: 6px; }
.nodep li a.nd-btn { flex: none; height: 24px; min-width: 0; padding: 0 7px; font-size: 11px; justify-content: center; }
.st-dep { border-top: 3px solid var(--err); }
@media (max-width: 860px) { .st-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tasks-side > .st-dep { display: none; } }
/* 0.19: Банка → Извлечение */
.stmt-card { padding: 0; overflow: clip; }
.stmt-card .table-scroll { overflow-x: auto; }
.tbl.stmt th, .tbl.stmt td { vertical-align: top; }
.tbl.stmt th.r, .tbl.stmt td.r { text-align: right; }
.tbl.stmt td.reason { min-width: 260px; max-width: 420px; }
.tbl.stmt td.wrap { min-width: 110px; max-width: 220px; }
.tbl.stmt .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.tbl.stmt tfoot td { border-top: 2px solid var(--line); background: #fafaf8; }
.bank-q { min-width: 220px; }
@media (max-width: 860px) { .bank-q { min-width: 0; width: 100%; } }
.tdrow { flex-wrap: wrap; } .tdrow .inline-edit[open] { flex-basis: 100%; }
/* 0.20: Седмичен график — залите винаги в един ред (като в календара), без точки; легенда */
.wk-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: start; margin: 14px 0; }
.wk-wrap .wk-grid { margin: 0; }
.wk-slot { border-left: 3px solid var(--c); padding-left: 7px; min-width: 0; }
.wk-slot.empty { border-left-color: color-mix(in srgb, var(--c) 30%, transparent); font-size: 11.5px; color: var(--faint, #b5b5bb); padding-top: 2px; padding-bottom: 2px; }
.wk-slot.empty .wk-hn { color: color-mix(in srgb, var(--c) 55%, #b5b5bb); font-weight: 600; }
.wk-slot .wk-ev { border-top: 0; padding-top: 0; }
.wk-slot .wk-ev + .wk-ev { border-top: 1px dashed var(--line2); padding-top: 6px; margin-top: 6px; }
.wk-slot .wk-t .wk-hn { color: var(--c); }
.wk-extra { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-legend { position: sticky; top: calc(var(--top) + 12px); font-size: 12.5px; padding: 12px 14px; }
.wk-legend summary { cursor: pointer; list-style: none; }
.wk-legend summary::-webkit-details-marker { display: none; }
.wl-h { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.wl-i { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
.wk-legend .ck { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #b9b9c0; box-sizing: border-box; flex: none; }
.wk-legend .ck.c-done { background: var(--ok); border-color: var(--ok); }
.wk-legend .ck.c-late { background: var(--err); border-color: var(--err); }
.wk-legend .ck.c-staff { border-style: dashed; }
.wl-bar { display: inline-block; width: 3px; height: 14px; border-radius: 2px; flex: none; }
@media (min-width: 1101px) {
  .wk-grid { grid-auto-rows: auto; row-gap: 8px; }
  .wk-day { display: grid; grid-row: span var(--wkrows); grid-template-rows: subgrid; row-gap: 8px; }
}
@media (max-width: 1100px) {
  .wk-wrap { grid-template-columns: 1fr; }
  .wk-legend { position: static; order: -1; }
  .wk-legend details:not([open]) { }
}
/* 0.20: Банка — извлечение + панел „как е свързано“ */
.bank-sum { padding: 12px 16px; }
.bank-sum > summary { cursor: pointer; list-style: none; font-size: 14px; }
.bank-sum > summary::-webkit-details-marker { display: none; }
.bank-sum > summary::before { content: "▸ "; color: var(--muted); }
.bank-sum[open] > summary::before { content: "▾ "; }
.bank-sum[open] > summary { margin-bottom: 10px; }
.bank-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.tbl.stmt tbody tr { cursor: pointer; }
.tbl.stmt tbody tr:hover td { background: #fafaf8; }
.tbl.stmt tbody tr.sel td { background: #f3f1ff; }
.tbl.stmt tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 #7360f2; }
.tbl.stmt td.how { min-width: 150px; max-width: 220px; }
.how-link { color: var(--ok); font-weight: 700; text-decoration: none; }
.how-link:hover { text-decoration: underline; }
.how-review { color: var(--err); font-weight: 700; background: var(--book-bg); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.tx-side { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 24px); overflow: auto; padding: 14px 16px; }
.tx-side .tx { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; }
.txp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.txp-head .iconbtn.sm { width: 30px; height: 30px; min-height: 0; }
.txp-kv { display: grid; grid-template-columns: 86px 1fr; gap: 4px 8px; font-size: 12.5px; margin: 8px 0; }
.txp-kv > span:nth-child(odd) { color: var(--muted); }
.txp-kv .mono, .tbl.stmt .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.txp-sub { font-weight: 700; border-top: 1px solid var(--line2); padding-top: 10px; margin: 10px 0 6px; }
.txp-link { display: flex; flex-direction: column; gap: 2px; border: 1px solid #cfe9d9; background: #eef8f2; border-radius: 10px; padding: 10px 12px; color: var(--ink); text-decoration: none; margin-bottom: 8px; }
.txp-link:hover { border-color: var(--ok); }
.bank-toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1100px) {
  .bank-split { grid-template-columns: 1fr; }
  .tx-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; z-index: 60; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); display: none; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .tx-side.open { display: block; }
  .tx-side .txs-empty { display: none; }
  .tbl.stmt th:nth-child(3), .tbl.stmt td:nth-child(3), .tbl.stmt th:nth-child(4), .tbl.stmt td:nth-child(4) { display: none; }
}
.wk-slot.empty { align-self: start; } .bank-sum > summary b:first-child { margin-right: 4px; }
@media (max-width: 700px) {
  .bank-sum > summary { display: flex; flex-direction: column; gap: 2px; }
  .bank-sum > summary::before { display: none; }
  .tbl.stmt thead { display: none; }
  .tbl.stmt tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cp amt" "how date"; gap: 2px 10px; padding: 9px 12px; border-top: 1px solid var(--line2); }
  .tbl.stmt tbody td { border: 0; padding: 0; display: none; }
  .tbl.stmt tbody td:nth-child(2) { display: block; grid-area: cp; min-width: 0; max-width: none; }
  .tbl.stmt tbody td:nth-child(5), .tbl.stmt tbody td:nth-child(6) { grid-area: amt; display: block; }
  .tbl.stmt tbody td:nth-child(5):empty, .tbl.stmt tbody td:nth-child(6):empty { display: none; }
  .tbl.stmt tbody td:nth-child(5):not(:empty)::before { content: "−"; }
  .tbl.stmt tbody td:nth-child(6):not(:empty)::before { content: "+"; color: var(--ok); font-weight: 700; }
  .tbl.stmt tbody td.how { display: block; grid-area: how; min-width: 0; max-width: none; font-size: 11.5px; }
  .tbl.stmt tbody td:first-child { display: block; grid-area: date; font-size: 11.5px; color: var(--muted); text-align: right; }
  .tbl.stmt tbody td:first-child .tiny { display: none; }
  .tbl.stmt tbody tr.sel td:first-child { box-shadow: none; }
  .tbl.stmt tfoot tr { display: flex; justify-content: space-between; padding: 8px 12px; }
  .tbl.stmt tfoot td { border: 0; padding: 0; }
  .tbl.stmt tfoot td:empty { display: none; }
}
@media (max-width: 700px) { .bank-sum > summary { align-items: flex-start; text-align: left; } }
/* 0.21: Седмичен график — празна зала без текст, почистванията в залата, легенда като ⓘ */
.wk-wrap { grid-template-columns: minmax(0, 1fr); }
.wk-slot.empty { border-left-color: transparent; padding: 0; min-height: 0; }
.wk-slot.only-tasks .wk-hn-only { display: block; font-size: 12px; color: var(--c); margin-bottom: 2px; }
.wk-slot .wk-clean { margin-top: 4px; }
.wk-slot .wk-tasks { margin-top: 4px; }
.wk-info { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; }
.wk-info-btn { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); background: #fff; color: var(--muted); font: 700 11px/1 Georgia, serif; font-style: italic; cursor: pointer; padding: 0; }
.wk-info-btn:hover, .wk-info:focus-within .wk-info-btn { border-color: var(--ink); color: var(--ink); }
.wk-info-pop { display: none; position: absolute; left: 0; top: 28px; z-index: 30; width: 250px; padding: 10px 14px; font: 400 12.5px var(--font); letter-spacing: 0; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.wk-info:hover .wk-info-pop, .wk-info:focus-within .wk-info-pop { display: block; }
.wk-info-pop .wl-h:first-child { margin-top: 0; }
@media (max-width: 1100px) { .wk-slot.empty { display: none; } }
.wk-info-pop .ck { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #b9b9c0; box-sizing: border-box; flex: none; }
.wk-info-pop .ck.c-done { background: var(--ok); border-color: var(--ok); }
.wk-info-pop .ck.c-late { background: var(--err); border-color: var(--err); }
.wk-info-pop .ck.c-staff { border-style: dashed; }
.wk-info.open .wk-info-pop { display: block; }
@media (max-width: 700px) { .wk-info { position: static; } .wk-info-pop { position: fixed; left: 16px; right: 16px; top: 120px; width: auto; } }
/* 0.22: календар — месецът в средата */
.cal-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.cal-head .ch-left { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cal-head .month-nav { justify-self: center; }
.cal-head .legend { justify-self: end; margin-left: 0; justify-content: flex-end; }
.cal-month { text-align: center; }
@media (max-width: 860px) {
  .cal-head { grid-template-columns: 1fr; }
  .cal-head .month-nav { order: -1; width: 100%; }
  .cal-head .month-nav h1 { text-align: center; }
  .cal-head .ch-left { justify-content: center; }
}
/* 0.22: Задачи — десният стълб се скролва със страницата (беше залепен и долните карти не се виждаха) */
.tasks-side { position: static; }
/* 0.22: махане на отказани от „Последни резервации“ */
.rr-row { grid-template-columns: 150px minmax(180px, 1.4fr) minmax(120px, 1fr) 190px 90px 90px 130px 30px; }
.rr-hide { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.rr-hide:hover { border-color: var(--err); color: var(--err); }
.rr-row.gone { opacity: 0; transition: opacity .25s; }
@media (max-width: 860px) { .rr-row { grid-template-areas: "client rent x" "ev st x" "when hall x"; grid-template-columns: minmax(0, 1fr) auto 28px; } .rr-x { grid-area: x; align-self: center; } }
@media (max-width: 860px) { .tasks-layout { grid-template-columns: minmax(0, 1fr); } .tasks-main, .tasks-side { min-width: 0; } }
/* 0.23: версията под името; „Без капаро“ най-горе в календара */
.brand-t { display: flex; flex-direction: column; line-height: 1.05; }
.brand-v { font: 500 10.5px var(--font); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.nodep-card { border-top: 3px solid var(--err); }
/* 0.23.1: Банка — бутони горе, прозорци, търсене на резервация */
.bank-head { flex-wrap: wrap; align-items: center; }
.bank-head h1 { margin: 0; }
.bank-dlg { width: min(520px, calc(100vw - 32px)); }
.bank-dlg .stack { gap: 10px; }
.res-search { margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.res-search input { width: 100%; }
.rs-results { display: flex; flex-direction: column; gap: 6px; }
.rs-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.rs-item .grow { flex: 1; min-width: 0; }
.rs-item .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 4px 0 2px; vertical-align: 1px; }
#cashm > summary b:first-child { margin-right: 4px; }
@media (max-width: 860px) {
  .bank-head .grow { flex-basis: 100%; }
  .bank-head .periodform { flex: 1; }
  .bank-head .btn { flex: 1; }
}
.bank-sum > summary { text-align: left; } @media (max-width: 700px) { .bank-sum > summary { align-items: stretch; } }
/* 0.24: настаняване в друг ден */
.slot .ci.other { background: #fff; color: #8f5600; box-shadow: inset 0 0 0 1.5px #d9922b; }
.ci-day { color: #8f5600; font-weight: 700; }
/* 0.25: Заплати — на ходене, списък по дати, проверка на тарифата */
.sal-warn { border: 1px solid var(--book-bd); background: var(--book-bg); color: var(--err); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.sal-lines { display: flex; flex-direction: column; }
.sal-line { border-top: 1px solid var(--line2); padding: 8px 0; }
.sal-line > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; cursor: pointer; font-size: 14px; }
.sal-line > summary::-webkit-details-marker { display: none; }
.sal-line > summary .sl-name::before { content: "▸ "; color: var(--muted); }
.sal-line[open] > summary .sl-name::before { content: "▾ "; }
.sl-name small { display: block; margin-left: 14px; font-size: 11.5px; }
.sl-rate { font-size: 13px; white-space: nowrap; }
.sl-sum { white-space: nowrap; }
.sl-items { margin: 6px 0 0 14px; }
.sl-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line2); font-size: 12.5px; }
.sl-item.merged { color: var(--muted); }
.sl-item.warn { background: var(--book-bg); color: var(--err); border-radius: 6px; padding: 4px 6px; margin: 0 -6px; }
.sl-item .sl-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-item a { color: inherit; }
@media (max-width: 600px) { .sl-item { grid-template-columns: 78px minmax(0, 1fr); } .sl-item .sl-x { grid-column: 2; } .sal-line > summary { grid-template-columns: minmax(0, 1fr) auto; } .sl-rate { grid-column: 1; grid-row: 2; } }
.sal-line > summary { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.sal-line > summary .sl-rate { grid-column: 1 / -1; margin-left: 14px; font-size: 12px; white-space: normal; }
.sl-item { grid-template-columns: 92px minmax(0, 1fr); }
.sl-item .sl-x { grid-column: 2; font-size: 12px; }
@media (max-width: 600px) { .sal-line > summary .sl-rate { grid-row: auto; } }
/* 0.26: Време — личен анализ */
.time-h { margin: 18px 0 8px; font-size: 17px; }
.time-card .rate-form { display: flex; align-items: center; gap: 4px; }
.time-card .rate-form input { width: 64px; padding: 4px 6px; min-height: 30px; }
.time-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.time-add input { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }
.time-add input[type=date] { width: 140px; }
.time-add input.num { width: 56px; }
.time-add input.grow { flex: 1; min-width: 120px; }
a.sl-who { color: inherit; text-decoration: none; }
a.sl-who:hover { text-decoration: underline; }

/* 0.26 — сбит изглед на резервация */
.rc-info { padding: 12px 14px; display: grid; gap: 6px; }
.rc-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 14px; }
.rc-k { color: var(--muted); font-size: 12.5px; }
.rc-v { min-width: 0; overflow-wrap: anywhere; }
.rc-note summary { list-style: none; cursor: pointer; }
.rc-note summary::-webkit-details-marker { display: none; }
.rc-note[open] summary { display: none; }
.linkish { color: var(--accent, #2563eb); font-size: 12.5px; }
.rc-money { padding: 12px 14px; display: grid; gap: 8px; }
.rc-mline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.rc-mline b { color: var(--text, inherit); margin-left: 3px; }
.rc-left { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line, #eee); padding-top: 8px; font-size: 15px; }
.rc-left b { font-size: 17px; margin-left: 4px; }
.rc-cash { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; border-radius: 8px; padding: 2px 4px; transition: background .3s; }
.rc-actions { align-items: center; }
.rc-sent { margin-left: auto; }
.rc-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.rc-hrow { display: flex; align-items: center; justify-content: space-between; }
.rc-hrow h2 { font-size: inherit; margin: 0; letter-spacing: inherit; color: inherit; }
.rc-hrow .linkbtn { text-transform: none; letter-spacing: 0; font-size: 13px; }
.rc-tasks { padding: 4px 14px; }
.rc-task { padding: 8px 0; border-bottom: 1px solid var(--line, #eee); }
.rc-task:last-child { border-bottom: 0; }
.rc-trow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.rc-kind { min-width: 92px; }
.rc-when { flex: 1 1 140px; text-align: left; font-size: 14px; }
button.rc-when { text-decoration: underline dotted; text-underline-offset: 3px; }
.rc-emp { width: auto; min-width: 110px; padding: 5px 8px; font-size: 13.5px; border-radius: 8px; transition: box-shadow .3s; }
.rc-edit { flex-basis: auto; }
.rc-edit[open] { flex-basis: 100%; }
.rc-tsub { margin-top: 2px; padding-left: 102px; }
.saving { opacity: .6; }
.saved { box-shadow: 0 0 0 2px rgba(22, 163, 74, .45); background: rgba(22, 163, 74, .08); }
.save-err { box-shadow: 0 0 0 2px rgba(220, 38, 38, .5); }
.rc-pays .lrow { padding: 8px 14px; gap: 10px; }
.rc-payadd { margin-top: 8px; }
.rc-payadd:not([open]) { display: none; }
.rc-foot { display: flex; justify-content: flex-end; margin: 16px 0 4px; }
.rc-cancel summary { color: var(--err, #b91c1c); cursor: pointer; list-style: none; }
.rc-cancel summary::-webkit-details-marker { display: none; }
@media (max-width: 520px) {
  .rc-kind { min-width: 0; }
  .rc-tsub { padding-left: 0; }
  .rc-sent { margin-left: 0; flex-basis: 100%; }
}
.rc-emp { height: 34px; min-height: 0; padding: 4px 26px 4px 10px; }
.rc-nopay { margin: 0; }
.rc-hrow + .rc-nopay, .rc-hrow + .rc-pays { margin-top: 0; }
@media (max-width: 520px) { .rc-trow .rc-when { flex: 1 1 60%; } .rc-emp { min-width: 0; flex: 1 1 auto; max-width: 60%; } }

/* ---------- Празни уикенди и промо (v0.27) ---------- */
.fw-card { margin-top: 16px; }
.fw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fw-head h2 { margin: 0; }
.fw-tot { margin: 10px 0 8px; }
.fw-byhall { display: flex; margin-top: 4px; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink2); }
.fw-byhall b { color: var(--c); }
.fw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 18px; }
.fw-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); min-width: 0; }
.fw-d { width: 64px; flex: none; white-space: nowrap; }
.fw-halls { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.fw-h { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; color: var(--c); border: 1px solid var(--c); background: transparent; text-decoration: none; white-space: nowrap; }
.fw-h:hover { background: var(--c); color: #fff; }
.fw-p { flex: none; white-space: nowrap; }
.promo-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.promo-filters .seg { flex: 0 1 auto; }
.promo-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.promo-grid h2 { margin: 0; }
.gdpr-note { font-size: 13px; line-height: 1.45; background: var(--dep-bg); border: 1px solid var(--dep-bd); border-radius: 10px; padding: 10px 12px; }
.seg.sm a { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.promo-rows { display: flex; flex-direction: column; }
.promo-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.promo-row .grow { flex: 1; min-width: 0; }
.promo-row.sent { opacity: .6; }
.promo-st { color: var(--ok, #2e7d32); margin-left: 6px; }
.promo-btns { display: flex; gap: 6px; flex: none; }
.promo-btns form { margin: 0; }
@media (max-width: 900px) {
  .promo-grid { grid-template-columns: minmax(0, 1fr); }
  .fw-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .promo-row { flex-wrap: wrap; }
  .promo-btns { width: 100%; }
  .promo-btns .btn { flex: 1; }
  .promo-btns form { flex: 1; display: flex; }
}
.promo-filters .seg a, .promo-list .seg a { white-space: nowrap; flex: 0 1 auto; padding-left: 12px; padding-right: 12px; }
.promo-list .fw-head .seg { flex: none; }
@media (max-width: 420px) { .promo-hint { display: none; } }

/* ---------- Известия (v0.28) ---------- */
.push-dev { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.push-dev .grow { flex: 1; min-width: 180px; }
.push-help { font-size: 13px; line-height: 1.5; background: var(--dep-bg); border: 1px solid var(--dep-bd); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.push-help.err-text { background: transparent; border: 0; padding: 0; }
.push-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.push-row .grow { flex: 1; min-width: 0; }
.push-row form { margin: 0; }
#push h3 { margin: 14px 0 4px; }
#push [hidden] { display: none !important; }

/* ---------- Обаждания — запитвания от сайта (v0.29.1) ---------- */
.inq-card { margin-bottom: 12px; border-color: var(--err); padding-top: 12px; padding-bottom: 4px; }
.inq-h { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); padding-bottom: 8px; }
.inq-hi-n { color: var(--err); margin-left: 6px; }
.inq { border-top: 1px solid var(--line); border-left: 4px solid var(--c); margin: 0 -16px; padding: 10px 16px 10px 12px; }
.inq-high { background: linear-gradient(90deg, rgba(176,42,42,.06), transparent 55%); }
.inq-past { opacity: .6; }
.inq-row { display: flex; gap: 12px; align-items: center; }
.inq-main { flex: 1; min-width: 0; }
.inq-t1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.inq-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inq-prio { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 10px; background: var(--line2); color: var(--ink2); }
.inq-high .inq-prio { background: var(--err); color: #fff; }
.inq-t2 { font-size: 14px; margin-top: 2px; }
.inq-alt { font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.inq-t3 { margin-top: 3px; }
.inq-rep { color: var(--ok); }
.inq-msg { margin-top: 4px; color: var(--ink2); font-style: italic; }
.inq-act { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.inq-act form, .inq-inline form, .inq-panel form { margin: 0; }
.inq-inline { display: inline-flex; gap: 6px; }
.inq-more-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.inq-panel { margin-top: 10px; padding: 10px; background: var(--line2); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.inq-panel[hidden] { display: none; }
.inq-panel-main { gap: 6px; }
.inq-panel-main form { display: inline-block; }
.inq-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inq-menu input { flex: 1 1 200px; min-width: 0; }
.inq-menu-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.inq-raw pre { max-height: 220px; overflow: auto; font-size: 11px; white-space: pre-wrap; word-break: break-all; background: var(--card); padding: 8px; border-radius: 8px; }
.inq-past-wrap > summary { cursor: pointer; padding: 8px 0; border-top: 1px solid var(--line); }
.pay-reason { display: block; color: var(--ink2); margin-top: 2px; word-break: break-word; }
.new-banner { position: sticky; top: 8px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.new-banner[hidden] { display: none; }
.new-banner .btn { background: #fff; color: var(--ink); }
@media (max-width: 860px) {
  .inq-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .inq-act { width: 100%; }
  .inq-act .inq-call { flex: 1; text-align: center; justify-content: center; }
  .inq-panel-main.show-m { display: flex; flex-wrap: wrap; }
  .inq-act .inq-inline.hide-m { display: none; }
  .inq-menu-btns .btn { flex: 1 1 auto; }
}
.hook-url { display: flex; gap: 6px; }
.hook-url input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; }
.hook-help ol { padding-left: 20px; line-height: 1.6; }
}

/* ---------- Настройки — свити групи (v0.30) ---------- */
.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-sec { padding: 0; }
.set-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.set-sec > summary::-webkit-details-marker { display: none; }
.set-sec > summary::before { content: '▸'; font-size: 13px; color: var(--ink2); transition: transform .15s; flex: none; }
.set-sec[open] > summary::before { transform: rotate(90deg); }
.set-t { font-weight: 700; font-size: 16px; flex: none; }
.set-sum { margin-left: auto; color: var(--ink2); font-size: 13px; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-sec[open] > summary { border-bottom: 1px solid var(--line); }
.set-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.set-sub { border: 1px solid var(--line); border-radius: 12px; }
.set-sub > summary { cursor: pointer; padding: 10px 12px; font-weight: 600; }
.set-sub[open] > summary { border-bottom: 1px solid var(--line); }
.set-sub > form { padding: 10px 12px 12px; }
.brand-logo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand-logo img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 6px; }
.brand-logo .stack { flex: 1; min-width: 220px; }
.brand-logo input[type=file] { font-size: 13px; }
input[type=color] { width: 64px; height: 38px; padding: 2px; }
@media (max-width: 600px) {
  .set-sec > summary { flex-wrap: wrap; row-gap: 2px; }
  .set-sum { margin-left: 25px; flex-basis: 100%; text-align: left; white-space: normal; }
}

/* ---------- Задачи: Списък / По дни (v0.31) ---------- */
.mode-seg { background: var(--ink); }
.mode-seg a { color: #d8d8d4; }
.mode-seg a.on { background: #fff; color: var(--ink); }
.days-mode { display: flex; flex-direction: column; gap: 12px; }
.days-mode .st-tiles.days-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.inq-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-color: var(--err); text-decoration: none; color: var(--ink); }
.inq-line .inq-line-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inq-line > span:last-child { margin-left: auto; white-space: nowrap; }
.days-legend { display: flex; align-items: center; gap: 6px; }
.fw-side { display: flex; flex-direction: column; gap: 4px; }
.fw-side-h { display: flex; align-items: center; gap: 8px; }
.fw-side-t { margin: 0 0 4px; }
.fw-side .fw-row { padding: 5px 0; }
.fw-side .fw-d { width: 58px; font-size: 12px; }
.fw-more > summary { cursor: pointer; padding: 4px 0; }
@media (max-width: 860px) {
  .days-mode .st-tiles.days-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tasks-head .seg.mode-seg { order: 2; }
  .mode-seg a { flex: 1; text-align: center; }
}

/* 0.32: известие отдолу (Viber — „постави“) */
.bw-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: min(92vw, 480px); background: #0d0d0f; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; z-index: 1000; }
.bw-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .bw-toast { bottom: 90px; } }
.rc-manual { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; }
/* 0.32: доплащане в брой — получено ли е? */
.cc-card { border-color: #1b7a43; padding: 12px 14px 6px; margin-bottom: 12px; }
.cc-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding-bottom: 6px; }
.cc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 10px 10px 10px; border-top: 1px solid var(--line, #efefec); border-left: 4px solid var(--c); margin: 0 -14px; }
.cc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-btns form { margin: 0; }
.rc-ccq { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #1b7a43; border-radius: 12px; background: #eef7f1; margin-top: 10px; }
.rc-ccq form { margin: 0; }

/* 0.32: Отчети — режим, кликаеми полета, постъпления по зали, сверка, разбивки */
.rep-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rep-mode .seg { flex: none; }
.rep-kpis .kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.rep-kpis .kpi:hover { border-color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.rep-kpis .kpi > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl.rep tfoot td { border-top: 2px solid var(--line); font-weight: 600; }
.sbars { display: flex; flex-direction: column; gap: 10px; }
.sb { display: grid; grid-template-columns: 110px 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
.sb-l { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-b { display: flex; height: 18px; background: #f0f0ec; border-radius: 6px; overflow: hidden; }
.sb-b i, .sb-b button { display: block; height: 100%; border: 0; padding: 0; margin: 0; }
i.sb-bank, .sb-legend i.sb-bank { background: #1b7a43; }
.sb-cash, .sb-legend i.sb-cash { background: #d9922b; cursor: pointer; }
.sb-v { text-align: right; font-weight: 700; }
.sb-v small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.sb-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.sb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.rlines { display: flex; flex-direction: column; font-size: 13px; margin-bottom: 12px; }
.rlines > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #f0f0ec; }
.rlines > div b { white-space: nowrap; }
.rlines .rl-tot { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; }
.rlines.big { font-size: 15px; }
dialog.rep-dlg { width: min(680px, calc(100vw - 32px)); max-height: 86vh; }
.rep-dlg-b { overflow: auto; max-height: calc(86vh - 70px); padding-top: 8px; }
.rep-dlg .h3 { margin: 14px 0 6px; }
.tbl.mini { width: 100%; font-size: 13px; }
.tbl.mini td.num { text-align: right; }
.rep-det { border-top: 1px solid var(--line); padding: 8px 0; }
.rep-det summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.ilist { display: flex; flex-direction: column; margin-top: 6px; }
.irow { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f2f2ef; font-size: 13px; color: inherit; text-decoration: none; }
a.irow[href]:hover { background: #fafaf8; }
.irow > .muted { width: 40px; flex: none; }
.irow small { display: block; color: var(--muted); font-size: 11px; }
.irow b { white-space: nowrap; }
.irow .tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; flex: none; }
.irow .tag.bank { background: #e8f4ec; color: #1b7a43; }
.irow .tag.cash { background: #fff1dc; color: #8a5a12; }
.rep-ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) {
  .sb { grid-template-columns: 84px 1fr 92px; }
  dialog.rep-dlg { width: 100%; max-height: 90vh; }
  .rep-dlg-b { max-height: calc(90vh - 70px); }
}
/* 0.32: Банка — табове, търсене и филтри на един ред (компютър) */
@media (min-width: 861px) {
  .bank-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; }
  .bank-toolbar .seg.tabs { flex: none; }
  .bank-toolbar .filters { flex: 1 1 auto; flex-wrap: nowrap; margin-left: 0; justify-content: flex-end; min-width: 0; }
  .bank-toolbar .filters .bank-q { flex: 1 1 200px; min-width: 140px; max-width: 420px; }
  .bank-toolbar .filters select { flex: 0 1 auto; min-width: 0; max-width: 220px; }
}
.rep-mode .seg a { white-space: nowrap; }

/* 0.33: Сравнение по години */
.cmp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cmp-head h2 { margin: 0; }
.cmp-tot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.cmp-tot > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.cmp-tot span { font-size: 12px; color: var(--muted); }
.cmp-tot b { font: 700 18px var(--display); }
.cmp-tot small { color: var(--muted); font-size: 11px; }
.cmp-tot .sw, .cmp-head .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cmp-tbl td small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.cmp-tbl td .delta { display: block; font-size: 11px; }
.cmp-tbl td { vertical-align: top; }
.cmp-tbl tr.cmp-total td { border-top: 2px solid var(--line); }
.cmp-halls { margin-top: 4px; }
.apt-sec > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.apt-sec > summary::-webkit-details-marker { display: none; }
.apt-sec > summary::before { content: '▸'; font-size: 14px; transition: transform .15s; }
.apt-sec[open] > summary::before { transform: rotate(90deg); }
.apt-sec > summary h2 { margin: 0; }
.apt-sec .apt-body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
@media (max-width: 860px) { .cmp-tot { grid-template-columns: 1fr; } }
.cmp-head .seg a { white-space: nowrap; }
@media (max-width: 860px) {
  .cmp-tot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cmp-tot > div { padding: 8px; }
  .cmp-tot b { font-size: 14px; }
  .cmp-tot small { display: none; }
}

/* 0.34: архиви — съдържание и „Възстанови“ */
.bk-list { display: flex; flex-direction: column; }
.bk-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--line2); }
.bk-restore { flex: none; }
.bk-restore[open] { flex: 1 1 100%; background: #fff5f5; border: 1px solid #f0c9c9; border-radius: 12px; padding: 8px 12px; }
.bk-restore summary { cursor: pointer; color: var(--muted); text-decoration: underline; }
.bk-more > summary { cursor: pointer; padding: 8px 0; color: var(--muted); }
.btn.danger { background: var(--err); color: #fff; border-color: var(--err); }
/* 0.35.1: „Без капаро“ — залата под името */
.nodep li b { white-space: nowrap; }
.nodep .nd-n { display: flex; flex-direction: column; line-height: 1.2; }
.nodep .nd-h { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 0.36: Клиенти → Запитвания */
.iq-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.iq-filters .cl-chips { margin: 0; }
.iq-search { display: flex; gap: 8px; flex-wrap: wrap; }
.iq-search input[type=search] { min-width: 240px; }
.iq-row { display: grid; grid-template-columns: 110px minmax(200px, 1.4fr) minmax(110px, .8fr) 190px 100px minmax(130px, 1fr) 150px; gap: 10px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line2); font-size: 13px; }
.iq-row > span { min-width: 0; }
.iq-row.cl-th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-top: 0; }
.iq-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.iq-client small { display: block; }
.iq-client .cltag { text-decoration: none; margin-left: 4px; }
.iq-st small { display: block; }
.iq-row.iq-closed { opacity: .6; }
.iq-act { display: flex; gap: 6px; justify-content: flex-end; align-items: center; position: relative; }
.iq-more > summary { list-style: none; cursor: pointer; }
.iq-more > summary::-webkit-details-marker { display: none; }
.iq-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 10px; width: 280px; display: flex; flex-direction: column; gap: 6px; }
.iq-pop form { margin: 0; }
.iq-pop .btn { width: 100%; }
.iq-pop pre { white-space: pre-wrap; font-size: 11px; max-height: 200px; overflow: auto; }
dialog.iq-dlg { width: min(520px, calc(100vw - 32px)); }
.iq-seg { flex-wrap: wrap; }
.inq-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.inq-h-links { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.inq-empty { padding: 4px 2px 10px; }
.inq-src { font-weight: 600; color: var(--ink2); }
@media (max-width: 860px) {
  .iq-row.cl-th { display: none; }
  .iq-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client act" "date st" "when hall" "src src"; gap: 4px 10px; padding: 10px 14px; }
  .iq-client { grid-area: client; } .iq-act { grid-area: act; } .iq-date { grid-area: date; font-size: 12px; }
  .iq-st { grid-area: st; justify-self: end; text-align: right; } .iq-when { grid-area: when; font-size: 11.5px; color: var(--muted); }
  .iq-hall { grid-area: hall; justify-self: end; font-size: 12px; } .iq-src { grid-area: src; display: none; }
  .iq-search, .iq-search input[type=search] { width: 100%; min-width: 0; }
  .iq-pop { width: min(280px, 80vw); }
}
a.kpi { text-decoration: none; color: inherit; }
.cl-table.iq-table { overflow: visible; }
.iq-table .iq-row:last-child { border-radius: 0 0 14px 14px; }

/* 0.38: Копие в Google */
.gb-steps { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.gb-code { width: 100%; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #fafaf8; }
.gb-howto > summary { cursor: pointer; }

/* 0.39: по-лек Календар — браузърът не рисува дните извън екрана; „Не са пратени…“ — първите 8 */
.cal-grid .cal-row:not(.cal-hdr) { content-visibility: auto; contain-intrinsic-size: auto 58px; }
.unsent-box .ub-extra { display: none; }
.unsent-box.ub-show-all .ub-extra { display: flex; }
.ub-all { padding: 4px 0 0; min-height: 0; }
/* 0.45.2: на телефона без content-visibility — иначе при скок до далечен ден редовете се дорисуват (мигане, неточен скрол) */
@media (max-width: 860px) { .cal-grid .cal-row:not(.cal-hdr) { content-visibility: visible; contain-intrinsic-size: none; } }

/* 0.39.2: „Още“ — като менюто на компютъра */
.more-new { margin-bottom: 12px; }
.tabs .lbl-m { display: none !important; }
@media (max-width: 860px) { .tabs .lbl-d { display: none !important; } .tabs .lbl-m { display: inline !important; } }
@media (max-width: 860px) { .tasks-tabs.cl-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cl-tabs a { display: flex; align-items: center; justify-content: center; gap: 4px; } }
.tabs .lbl-d, .tabs .lbl-m { padding: 0 !important; margin: 0 !important; background: none !important; box-shadow: none !important; height: auto !important; min-height: 0 !important; line-height: 1.2; }

/* 0.40: Обаждания — „✓ Обадих се“ и „Отказа“ на втори ред на телефона */
@media (max-width: 860px) {
  .inq-act { flex-wrap: wrap; }
  .inq-act .inq-called, .inq-act .inq-decl { flex: 1 1 40%; order: 5; }
  .inq-act .inq-called .btn, .inq-act .inq-decl .btn { width: 100%; }
}
.inq-called .btn { color: var(--paid-fg); border-color: var(--paid-bd); }

/* 0.40: изключение за капарото */
.rc-depmode { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.rc-depmode > summary { cursor: pointer; }
.dm-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.dm-form select { width: auto; min-width: 240px; }
.dm-when { display: flex; flex-direction: column; gap: 2px; }
.dm-when[hidden] { display: none; }
.dep-tag { display: block; font-size: 10.5px; font-weight: 700; color: var(--dep-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-dm { font-size: 11px; color: var(--muted); text-decoration: none; padding: 0 4px; }

/* 0.41: 24-часово време и дата ДД.ММ.ГГГГ (текстово поле + скрито истинско) */
.bw-dtw { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; }
.bw-dtw .bw-dt { flex: 1 1 auto; min-width: 0; }
.bw-dtw-time .bw-dt { max-width: 110px; }
.bw-dtw-date .bw-dt { max-width: 150px; }
.bw-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.bw-cal { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; min-height: 40px; width: 40px; cursor: pointer; font-size: 16px; padding: 0; }
.bw-dt.bad { border-color: var(--err) !important; background: var(--book-bg); }
.field .bw-dtw { width: 100%; }

/* 0.42: Зали — редактор */
.sr-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hc-h .iconbtn.sm { width: 30px; height: 30px; font-size: 15px; }
.hc-h .iconbtn.sm:disabled { opacity: .3; cursor: default; }
.hc-grid input[type=color] { height: 38px; padding: 2px 4px; width: 100%; }
.hc-del { display: flex; justify-content: flex-end; }
.hall-new { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.hallcard { min-width: 0; }
.hc-h { flex-wrap: wrap; row-gap: 4px; }
.hc-grid > * { min-width: 0; }
.hc-grid input, .hc-grid .bw-dtw { min-width: 0; max-width: 100%; }
.hc-grid .bw-dtw { width: 100%; }
@media (max-width: 600px) { .hc-grid { grid-template-columns: 1fr 1fr; } }

/* ===== 0.44/0.45: телефон — страници по 4 седмици (плъзгане настрани), закачен горе; дните се скролват отдолу ===== */
@media (max-width: 860px) {
  .cal-head .month-nav { display: none; }
  .twoweeks.mm { padding: 6px 0 8px; }
  .mm-pages { display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .mm-pages::-webkit-scrollbar { display: none; }
  .mm-page { flex: 0 0 100%; scroll-snap-align: start; box-sizing: border-box; padding: 0 12px; border-right: 2px dashed #c9c9c4; }
  .mm-page:last-child { border-right: 0; }
  .mm-h { display: flex; align-items: center; gap: 8px; margin: 0 0 5px; min-height: 22px; }
  .mm-h b { font: 700 16px var(--display); flex: 1; }
  .mm-nav { font: 700 12.5px var(--font); color: #2f7de1; text-decoration: none; white-space: nowrap; background: none; border: 0; padding: 4px 2px; min-height: 0; cursor: pointer; min-width: 24px; }
  .mm-h b { text-align: center; }
  .mm-hint { font-size: 11.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
  .mm-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .mm .tw-d { height: 46px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0; padding: 4px 2px 3px; border-radius: 9px; border: 1px solid var(--line2); background: #fff; color: var(--ink); text-decoration: none; min-width: 0; }
  .mm .tw-d.we { background: #fbe8c2; border-color: #f5d896; }
  .mm .tw-d b { font-size: 14.5px; line-height: 1; }
  .mm .tw-d em { font-style: normal; font-size: 9px; font-weight: 700; line-height: 1; color: var(--faint); white-space: nowrap; }
  .mm .tw-d em.many { color: var(--ok); } .mm .tw-d em.few { color: var(--dep-fg); } .mm .tw-d em.full { color: var(--err); }
  .mg-dots { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; width: 84%; height: 5px; }
  .mg-dots span { border-radius: 3px; box-shadow: inset 0 0 0 1px var(--c); opacity: .55; }
  .mg-dots span.on { background: var(--c); opacity: 1; }
  .mm .tw-d.today { box-shadow: none; border: 2px solid var(--ink); }
  .mm .tw-d.cur, .mm .tw-d.cur.today { background: #2f7de1; border-color: #2f7de1; color: #fff; box-shadow: none; opacity: 1; }
  .mm .tw-d.cur em { color: #fff; }
  .mm .tw-d.cur .mg-dots span { box-shadow: inset 0 0 0 1px #fff; opacity: .9; }
  .mm .tw-d.cur .mg-dots span.on { background: #fff; }
  .mm .tw-d.past { opacity: .45; }
  .mm .tw-d.cur.past { opacity: 1; }
  .mm .tw-d, .mm .mm-nav { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  /* 0.48.5: body:has(...) махнато — в Safari на iPhone :has() на body прави разчитането на голямата страница много бавно (замръзване); overflow-anchor се слага от app.js */
  .mm .tw-d b small { font-size: 8px; font-weight: 600; color: var(--muted); margin-left: 1px; }
  .mm .tw-d.cur b small { color: #fff; }
  /* списъкът: от първия ден с резервация; по-сбити свободни зали */
  .cal-grid.hide-pre .cal-row.pre { display: none; }
  .cal-grid .cal-row:not(.cal-hdr) { gap: 4px; margin-bottom: 8px; }
  .cal-grid .cal-row .c-date { min-height: 24px; padding: 2px 9px; }
  .cal-grid .c-cell.empty { height: auto; min-height: 44px; }
  .cal-grid .c-cell.empty > .slot.free { padding: 12px 6px 0; }
  /* махнато на телефона: филтрите и „Без капаро“ */
  .calfilters, .nodep-card { display: none !important; }
}

/* ===== 0.46: телефон — по-сбити Клиенти, Запитвания, Банка, Задачи ===== */
.tnew, .cashmtbl2 { display: none; }
.bank-chart > summary { cursor: pointer; list-style: none; }
.bank-chart > summary::-webkit-details-marker { display: none; }
@media (min-width: 861px) { .bank-chart > summary h2 { display: inline; } }
@media (max-width: 860px) {
  /* Клиенти → Последни: зала и период на един ред */
  .rr-head { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .rr-head h1 { grid-column: 1 / -1; margin: 0; }
  .rr-head .cl-filters { grid-column: 1; grid-row: 2; min-width: 0; margin: 0; width: 100% !important; display: block !important; max-width: none !important; }
  .rr-head .cl-filters select { width: 100% !important; min-width: 0 !important; min-height: 40px; font-size: 14px; padding-left: 10px; }
  .rr-head .seg { grid-column: 2; grid-row: 2; margin: 0; width: auto !important; }
  .rr-head .seg a { padding: 7px 9px !important; font-size: 13px !important; min-width: 0 !important; }
  /* Запитвания */
  .iq-head { display: grid !important; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
  .iq-head h1 { margin: 0; }
  .iq-head .btn.primary { grid-column: 2; grid-row: 1; min-height: 38px; padding: 0 12px; font-size: 13.5px; }
  .iq-head .seg { grid-column: 1 / -1; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .iq-head .seg a { text-align: center; padding: 7px 4px; font-size: 13.5px; }
  .iq-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .iq-kpis .kpi { padding: 7px 8px !important; min-height: 0; }
  .iq-kpis .kpi > span { font-size: 10.5px; line-height: 1.15; display: block; min-height: 24px; }
  .iq-kpis .kpi b { font-size: 20px; }
  .iq-kpis .kpi small { display: none; }
  .iq-search { display: grid !important; grid-template-columns: minmax(0, 1fr) 120px; gap: 6px; }
  .iq-search input, .iq-search select { min-height: 40px; font-size: 14px; margin: 0; min-width: 0; width: 100%; }
  /* Банка */
  .bank-head { display: grid !important; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
  .bank-head > .grow { grid-column: 1 / -1; }
  .bank-head [data-open-dlg="dlgUpload"], form.rematch, #reset { display: none !important; }
  .bank-head .periodform select { min-height: 40px; font-size: 14px; }
  .bank-head [data-open-dlg="dlgCash"] { min-height: 40px; padding: 0 14px; }
  .bmenu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin: 0 0 12px; overflow: hidden; }
  .bmenu > details { border: 0 !important; border-radius: 0 !important; margin: 0 !important; box-shadow: none !important; border-top: 1px solid var(--line2) !important; padding: 0 !important; background: none !important; }
  .bmenu > details:first-child { border-top: 0 !important; }
  .bmenu > details > summary { padding: 12px 14px !important; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: flex-start !important; gap: 8px; font-size: 14px; text-align: left !important; list-style: none; min-height: 0 !important; cursor: pointer; }
  .bmenu > details > summary::before { content: none !important; }
  .bmenu > details > summary::-webkit-details-marker { display: none; }
  .bmenu > details > summary::after { content: '▸'; margin-left: auto; color: var(--faint); }
  .bmenu > details[open] > summary::after { content: '▾'; }
  .bmenu > details > summary b { white-space: nowrap; }
  .bmenu > details > *:not(summary) { margin-left: 14px; margin-right: 14px; }
  .bmenu > details > *:last-child { margin-bottom: 12px; }
  p.show-m { display: block; }
  .bm-line { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  #cashm .table-scroll { display: none; }
  .cashmtbl2 { display: table; width: calc(100% - 28px) !important; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .cashmtbl2 th { font-size: 10.5px; color: var(--muted); font-weight: 700; text-align: right; padding: 4px 3px; border-bottom: 1px solid var(--line); }
  .cashmtbl2 th:first-child, .cashmtbl2 td:first-child { text-align: left; }
  .cashmtbl2 th:nth-child(1) { width: 26%; } .cashmtbl2 th:nth-child(5) { width: 20%; }
  .cashmtbl2 td { padding: 6px 3px; border-bottom: 1px solid var(--line2); text-align: right; white-space: nowrap; }
  .cashmtbl2 td a { color: inherit; text-decoration: none; }
  .cashmtbl2 td small { display: block; font-size: 10px; color: var(--muted); }
  .cashmtbl2 tr.sel td { background: #fff7e6; }
  .cashmtbl2 form { margin: 0; }
  .cashmtbl2 input.num { width: 100%; box-sizing: border-box; min-height: 0 !important; height: 28px; padding: 3px 5px; border-radius: 7px; font-size: 12.5px; text-align: right; }
  /* Задачи: „+“ до табовете, без заглавието */
  .tasks-tabs:has(.tnew) { grid-template-columns: 1fr 1fr auto !important; align-items: center; }
  .tnew { display: grid; place-items: center; width: 44px; height: 38px; margin-left: 6px; border: 0; border-radius: 11px; background: var(--ink); color: #fff; font: 700 22px/1 var(--font); cursor: pointer; }
  .tasks-head h1, .tasks-head > .btn.primary[data-task-new] { display: none !important; }
  .tasks-head .seg.mode-seg { order: 0; }
}
/* 0.46.2: Последни резервации — 3 числа; „Чакат капаро“ филтрира */
.rr-kpis.rr-kpis3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
a.kpi { color: inherit; text-decoration: none; cursor: pointer; }
.rr-kpis3 a.kpi.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (max-width: 860px) { .rr-kpis.rr-kpis3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
/* 0.47: Върни капаро */
.rf-card { border-top: 3px solid var(--dep-fg, #8f5600); }
@media (max-width: 860px) {
  .rf-card .cc-row { flex-wrap: wrap; }
  .rf-card .cc-row > .grow { flex: 1 1 100%; }
  .rf-card .cc-btns { width: 100%; }
  .rf-card .cc-btns form { display: flex; gap: 6px; width: 100%; }
  .rf-card .cc-btns .btn { flex: 1; }
}
/* 0.48: чака потвърждение */
.pc-box { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 6px; }
.pc-box .pc-note { margin: 0; }
.pc-box.on { border-color: #c98a12; background: #fff7e6; }
.pc-tag { background: #fff3d6 !important; color: #8f5600 !important; }
.pc-card { border-top-color: #c98a12; }
.pc-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #fff7e6; border: 1px solid #f5d896; }
.pc-banner > .grow { flex: 1 1 100%; min-width: 0; }
.pc-banner .btn { flex: 1; }
.pc-card { border-top: 3px solid #c98a12 !important; }
@media (min-width: 861px) { .pc-banner > .grow { flex: 1 1 auto; } .pc-banner .btn { flex: none; } }
/* 0.48.2: прозорецът при свободна зала — 3 бутона на един ред */
.slot-btns { display: grid !important; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.slot-btns .btn { width: 100%; padding-left: 6px; padding-right: 6px; }
#slotSheet .seg2 small { display: none; } /* 0.48.3: само „Вечерно“ / „Дневно“, без часовете */
/* 0.49: неработен ден — сива клетка (0.49.1) */
.c-cell.c-blocked { background: #8a8a92 !important; box-shadow: none !important; }
.c-blocked .blk-form { display: contents; }
.c-blocked .slot.blk { width: 100%; height: 100%; min-height: 44px; border: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, #8a8a92 0 10px, #95959c 10px 20px); color: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: left; }
.c-blocked .slot.blk .nm { font-size: 13.5px; }
.c-blocked .slot.blk .meta { font-size: 12px; opacity: .8; }
.c-blocked .blk-un { font-size: 11px; opacity: .6; text-decoration: underline; }
.c-blocked .c-hl { color: #fff !important; opacity: .85; }
.mg-dots span.blk, .mm .tw-d .mg-dots span.blk { background: #8a8a92 !important; box-shadow: none !important; }
.blk-link { color: var(--muted); font-size: 13px; padding: 4px 0; min-height: 0; align-self: center; }
@media (max-width: 860px) { .cal-grid .c-cell.c-blocked { height: auto; min-height: 58px; } .c-blocked .slot.blk { padding: 20px 9px 6px; } }
/* 0.50: съобщение при запитване */
#inqMsgDlg .im-vars { gap: 6px; }
#inqMsgDlg textarea { width: 100%; box-sizing: border-box; font-size: 15px; }
#inqMsgDlg .im-vars { display: flex; flex-wrap: wrap; gap: 6px; }
#inqMsgDlg .sheet-head { display: flex; align-items: flex-start; gap: 10px; }
#inqMsgDlg .sheet-head > div { flex: 1; min-width: 0; }
#inqMsgDlg .sheet-title { font-size: 18px; }
/* 0.51: оглед към задържане · депозит по банка */
.hv-banner { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; background: #eef4fd; border: 1px solid #c9dcf6; }
.hv-banner.due { background: #fff7e6; border-color: #f5d896; }
.hv-form > summary { list-style: none; display: inline-flex; cursor: pointer; }
.hv-form > summary::-webkit-details-marker { display: none; }
.rc-guar { margin-top: 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.rc-guar.due { border-style: solid; border-color: #c98a12; background: #fff7e6; }
.rc-guar > details > summary { cursor: pointer; }
.guar-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* ===== 0.53: Помощ ===== */
.help-link { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; border: 1.5px solid var(--line); color: var(--muted); font-weight: 800; font-size: 15px; text-decoration: none; flex: none; }
.help-link:hover, .help-link.on { color: var(--ink); border-color: var(--ink); }
.help-q { width: 100%; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 4px 0 12px; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.help-toc a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; }
.help-sec { margin: 18px 0 6px; scroll-margin-top: 110px; }
.help-sec h2 { font-size: 17px; margin: 0 0 8px; }
.help-item { padding: 0; margin-bottom: 6px; scroll-margin-top: 110px; }
.help-item > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary::after { content: '›'; color: var(--muted); font-size: 20px; line-height: 1; flex: none; transition: transform .15s; }
.help-item[open] > summary::after { transform: rotate(90deg); }
.help-body { padding: 0 14px 12px; font-size: 14px; line-height: 1.5; }
.help-body ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.help-body p { margin: 0; }
.help-contact { margin-top: 18px; border-left: 4px solid var(--ink); }
.help-contact p { margin: 4px 0 0; }
.help-page [hidden] { display: none !important; }

/* ===== 0.54: Банка за партньорите ===== */
.bf-tabs { margin-bottom: 12px; }
.bf-h { font-size: 15px; margin: 16px 0 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bf-row { display: flex; align-items: center; gap: 8px; }
.bf-li { padding: 8px 0; border-bottom: 1px solid var(--line2, #eee); }
.bf-li:last-child { border-bottom: 0; }
.bf-list { padding-top: 4px; padding-bottom: 4px; }
.bf-tx { display: grid; gap: 6px; margin-bottom: 8px; }
.bf-cands { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-cands .btn { text-align: left; }
.bf-more summary { cursor: pointer; color: var(--muted); }
.bf-inline { display: flex; gap: 6px; margin: 6px 0 2px; }
.bf-inline input { flex: 1; min-width: 0; }
.bf-month { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; }
.bf-kpis { grid-template-columns: repeat(3, 1fr); }
.bf-add > summary { list-style: none; }
.bf-add > summary::-webkit-details-marker { display: none; }
.bf-add[open] > summary { margin-bottom: 4px; }
.bf-prev td, .bf-prev th { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.bf-prev tr.bf-hdr td { font-weight: 700; background: var(--line2, #f2f1ec); }
#map form .bf-two { display: none; }
#map form.two .bf-two { display: grid; }
#map form.two .bf-one { display: none; }
.rf-tbl td, .rf-tbl th { text-align: right; white-space: nowrap; }
.rf-tbl td:first-child, .rf-tbl th:first-child { text-align: left; }
.rf-tbl tr.tot td { font-weight: 800; border-top: 2px solid var(--ink); }
.rf-tbl tr.on td { background: #fff7e6; }
