[hidden] { display: none !important; }
/* =====================================================================
   Отель — дизайн в духе Apple: светлая база, системный шрифт,
   сгруппированные списки, один акцент, полупрозрачные панели.
   ===================================================================== */

/* ---------- токены ---------- */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f5f5f7; --surface-3: #e8e8ed; --fill: rgba(118, 118, 128, .12);
  --line: rgba(60, 60, 67, .14); --line-strong: rgba(60, 60, 67, .26);
  --text: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6;
  --accent: #0071e3; --accent-hover: #0077ed; --on-accent: #ffffff; --accent-soft: rgba(0, 113, 227, .1);
  --ok: #248a3d; --bad: #d70015; --warn: #b25000; --info: #0071e3;
  --dot-ok: #34c759; --dot-bad: #ff3b30; --dot-warn: #ff9f0a; --dot-info: #0a84ff;
  --glass: rgba(251, 251, 253, .72); --glass-strong: rgba(255, 255, 255, .86);
  --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06);
  --radius: 18px; --radius-sm: 12px; --side: 248px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Noto Sans Thai", "Helvetica Neue", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c; --fill: rgba(118, 118, 128, .24);
    --line: rgba(84, 84, 88, .55); --line-strong: rgba(84, 84, 88, .9);
    --text: #f5f5f7; --muted: #98989d; --faint: #636366;
    --accent: #0a84ff; --accent-hover: #409cff; --on-accent: #ffffff; --accent-soft: rgba(10, 132, 255, .18);
    --ok: #30d158; --bad: #ff6961; --warn: #ffb340; --info: #64d2ff;
    --glass: rgba(28, 28, 30, .72); --glass-strong: rgba(44, 44, 46, .92);
    --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --surface-3: #3a3a3c; --fill: rgba(118, 118, 128, .24);
  --line: rgba(84, 84, 88, .55); --line-strong: rgba(84, 84, 88, .9);
  --text: #f5f5f7; --muted: #98989d; --faint: #636366;
  --accent: #0a84ff; --accent-hover: #409cff; --on-accent: #ffffff; --accent-soft: rgba(10, 132, 255, .18);
  --ok: #30d158; --bad: #ff6961; --warn: #ffb340; --info: #64d2ff;
  --glass: rgba(28, 28, 30, .72); --glass-strong: rgba(44, 44, 46, .92);
  --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.47 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
html[lang="th"] body { letter-spacing: 0; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 34px; line-height: 1.12; margin: 0; font-weight: 700; letter-spacing: -.022em; }
h2 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: -.016em; display: flex; align-items: center; gap: 8px; }
.i { flex: none; vertical-align: middle; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--fill); padding: 1px 6px; border-radius: 6px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 12px 14px; background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: .5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; padding: 2px 8px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--text); color: var(--bg); flex: none; }
.side-cta { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font: inherit;
  font-weight: 500; font-size: 14.5px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.nav a .i, .nav button .i { color: var(--accent); }
.nav a:hover, .nav button:hover { background: var(--fill); }
.nav a.on { background: var(--accent); color: #fff; }
.nav a.on .i { color: #fff; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px 0; margin-bottom: -8px; }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav a.on .nav-count { color: rgba(255, 255, 255, .85); }

.occ { display: block; padding: 14px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.occ-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.occ-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 10px; }
.occ-nums b { display: block; font-size: 28px; line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.occ-nums span { font-size: 12px; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--text); border-radius: 99px; }
.bar.thin { height: 4px; }
.occ-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.side-foot { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; border-top: .5px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; flex: 1; min-width: 0; }
.me:hover, .me.on { background: var(--fill); }
.me span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 12px; color: var(--muted); }
.me .avatar { width: 32px; height: 32px; font-size: 12px; }
.content { min-width: 0; }
.main { min-width: 0; padding: 36px 44px 64px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.topbar, .tabbar, .fab { display: none; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; min-height: 36px; border-radius: 980px;
  border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.97); }
.btn.ghost, .btn.soft { background: var(--fill); color: var(--text); }
.btn.ghost:hover, .btn.soft:hover { background: color-mix(in srgb, var(--fill) 100%, var(--text) 6%); }
.btn.soft { color: var(--accent); }
.btn.plain { background: none; color: var(--accent); padding-left: 6px; padding-right: 6px; }
.btn.plain:hover { background: var(--accent-soft); }
.btn.danger { background: var(--dot-bad); color: #fff; }
.btn.danger-ghost { background: none; color: var(--bad); }
.btn.danger-ghost:hover { background: color-mix(in srgb, var(--dot-bad) 10%, transparent); }
.btn.sm { padding: 5px 12px; min-height: 30px; font-size: 13.5px; }
.btn.icon { padding: 0; width: 36px; }
.btn.sm.icon { width: 30px; }
.btn .i { stroke-width: 1.8; }
form.inline { display: inline; margin: 0; }

input, select, textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); padding: 10px 12px;
  border: .5px solid var(--line-strong); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); -webkit-appearance: auto; appearance: auto; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; position: relative; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* сегментированный переключатель (iOS) */
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); position: relative; flex-wrap: nowrap; }
.seg a, .seg label > span, .seg button { display: block; padding: 5px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--text);
  cursor: pointer; white-space: nowrap; border: 0; background: none; font-family: inherit; transition: background .15s; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg a.on, .seg input:checked + span, .seg button.on { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
:root[data-theme="dark"] .seg a.on, :root[data-theme="dark"] .seg input:checked + span, :root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seg a.on, :root:not([data-theme="light"]) .seg input:checked + span, :root:not([data-theme="light"]) .seg button.on { background: #636366; }
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500;
  white-space: nowrap; background: var(--fill); color: var(--muted); border: 0; }
.badge.bad { color: var(--bad); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.badge.ok .dot { color: var(--dot-ok); } .badge.bad .dot { color: var(--dot-bad); }
.badge.warn .dot { color: var(--dot-warn); } .badge.info .dot { color: var(--dot-info); }
.room-pill { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--fill); color: var(--text); line-height: 20px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13.5px;
  color: #fff; background: linear-gradient(180deg, #a5a5aa, #86868b); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- карточки и сгруппированные списки ---------- */
.panel { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; flex-wrap: wrap; }
.panel-head .count { color: var(--muted); font-weight: 500; }
.panel-body { padding: 4px 20px 20px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.panel:not([open]) > summary.panel-head { padding-bottom: 16px; }
.chev { color: var(--faint); transition: transform .2s; }
details[open] > summary .chev { transform: rotate(180deg); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .cols, .cols.three { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: block; transition: transform .15s; }
a.kpi:hover { transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.chip { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--fill); color: var(--muted); flex: none; }
.chip .i { width: 15px; height: 15px; }
.kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; line-height: 1.08; }
.kpi-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; position: relative; min-height: 56px; }
.row::after { content: ""; position: absolute; left: 70px; right: 0; bottom: 0; height: .5px; background: var(--line); }
.row:last-child::after { display: none; }
a.row:hover, .row.link:hover { background: color-mix(in srgb, var(--fill) 50%, transparent); }
a.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row-end { text-align: right; display: flex; align-items: center; gap: 10px; }
a.row .row-end::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-top: 2px solid var(--faint); transform: rotate(45deg); margin-left: 2px; }
.group-label { padding: 14px 20px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); }

/* список жильцов */
.g-row { display: grid; grid-template-columns: minmax(220px, 2fr) 1.4fr 1.2fr 1fr; gap: 18px; align-items: center; }
.g-row.no-money { grid-template-columns: minmax(220px, 2fr) 1.4fr; }
.g-head { padding: 12px 20px 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; min-height: 0; }
.g-head::after { display: none; }
.g-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.g-who .row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
@media (max-width: 760px) { .g-row, .g-row.no-money { grid-template-columns: 1fr 1fr; } .g-who { grid-column: 1 / -1; } .g-head { display: none; } }

/* ---------- номера ---------- */
.floor { margin-bottom: 26px; }
.floor-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.room { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.room-photo { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.room-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-photo .no-photo { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.room-num { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  background: var(--glass-strong); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.room-status { position: absolute; right: 10px; top: 10px; }
.room-status .badge { background: var(--glass-strong); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.room-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.room-kind { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.room-guest { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; letter-spacing: -.015em; }
.room.s-free .room-guest, .room.s-reserved .room-guest { color: var(--muted); font-weight: 500; }
.room-foot { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; align-items: center; }
.room-clean { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); font-weight: 500; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.swatch.busy { background: var(--text); box-shadow: none; }
.swatch.booking { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text); }
.swatch.past { background: var(--fill); box-shadow: none; }
.swatch.s1 { background: var(--text); box-shadow: none; }
.swatch.s2 { background: var(--faint); opacity: .6; box-shadow: none; }
.swatch.s3 { background: var(--dot-bad); opacity: .7; box-shadow: none; }

.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; padding: 6px 20px 20px; }
.map a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; aspect-ratio: 1.15;
  border-radius: 12px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; transition: transform .12s; }
.map a:active { transform: scale(.96); }
.map small { font-size: 10.5px; font-weight: 500; opacity: .75; letter-spacing: 0; }
.map .s-busy, .map .s-out_today, .map .s-late { background: var(--text); color: var(--bg); }
.map .s-free, .map .s-reserved { background: var(--surface-2); color: var(--text); }
.map a::after { content: ""; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; display: none; }
.map .s-out_today::after, .map .s-late::after { display: block; background: var(--dot-warn); }
.map .s-reserved::after { display: block; background: var(--dot-info); }
.map .dirty::before { content: ""; position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 14px; height: 3px; border-radius: 2px; background: var(--dot-warn); }

/* ---------- карточка жильца ---------- */
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 8px; align-items: center; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-photo { width: 96px; height: 64px; border-radius: 12px; object-fit: cover; display: block; }
.ul { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.sched { width: 100%; border-collapse: collapse; }
.sched td, .sched th { padding: 12px 20px; text-align: left; vertical-align: middle; border-bottom: .5px solid var(--line); }
.sched th { font-size: 12.5px; color: var(--muted); font-weight: 500; padding-top: 4px; }
.sched tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.t-actions { text-align: right; white-space: nowrap; }
.who-link { display: flex; align-items: center; gap: 10px; }
.pay-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-top: .5px solid var(--line); }
.pay-box input { max-width: 180px; }
.deposit-cols { gap: 0; }
.deposit-cols > form + form { border-left: .5px solid var(--line); }
@media (max-width: 1100px) { .deposit-cols > form + form { border-left: 0; border-top: .5px solid var(--line); } }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 4px 20px 20px; }
.doc { margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.doc img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.doc figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; font-weight: 500; }
.foot-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.panel > .foot-note { padding: 0 20px 16px; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.quick button { font: inherit; font-size: 12.5px; font-weight: 500; padding: 3px 9px; border-radius: 99px; border: 0; background: var(--fill); color: var(--text); cursor: pointer; }
.quick button:hover { background: var(--accent-soft); color: var(--accent); }
.hint-box { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.hint-box b { color: var(--text); }
.hint-box:empty { display: none; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30; background: var(--glass-strong); border-radius: 12px;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-pop); overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.suggest button:hover { background: var(--accent); color: #fff; }
.suggest button:hover small { color: rgba(255, 255, 255, .8); }
.suggest small { display: block; color: var(--muted); font-size: 12.5px; }

/* выпадающее меню */
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 170px; padding: 5px; background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-radius: 12px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 1px; animation: pop .14s ease-out; }
.dd-menu.wide { width: min(320px, calc(100vw - 40px)); padding: 14px; gap: 10px; }
.dd-menu.up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.dd-item { font: inherit; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer;
  display: flex; align-items: center; gap: 8px; width: 100%; }
.dd-item:hover { background: var(--accent); color: #fff; }
.dd-item.on::after { content: "✓"; margin-left: auto; }
.pay-split { display: inline-flex; gap: 1px; align-items: stretch; }
.pay-split > .btn { border-radius: 980px 0 0 980px; }
.pay-split .dd > summary { border-radius: 0 980px 980px 0; height: 100%; padding: 0 9px; width: auto; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- модальные окна, шторки, быстрая панель ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-pop); animation: pop .18s ease-out; }
dialog::backdrop { background: rgba(0, 0, 0, .32); }
.modal-body { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

dialog.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(440px, 100vw); background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-pop); animation: slide-in .22s cubic-bezier(.2, .8, .2, 1); }
.drawer-body { height: 100%; overflow-y: auto; padding: 18px 18px 30px; }
.drawer-close { position: sticky; top: 0; display: flex; justify-content: flex-end; margin-bottom: -10px; z-index: 2; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.peek-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 18px; }
.peek-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.peek .panel { margin-bottom: 14px; }
.peek .row { min-height: 46px; padding: 9px 16px; }
.peek .row::after { left: 16px; }
.peek-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.peek-actions .btn, .peek-actions form .btn { width: 100%; }
.peek-actions form { display: block; }
.peek-loading { padding: 60px 0; text-align: center; color: var(--muted); }

dialog.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; background: transparent; }
.sheet-body { background: var(--surface); color: var(--text); border-radius: 14px 14px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1); }
.sheet-grip { width: 36px; height: 5px; border-radius: 5px; background: var(--surface-3); margin: 0 auto 12px; }
.sheet-body .me { margin-bottom: 6px; }
.sheet-body .nav a, .sheet-body .nav button { padding: 13px 12px; font-size: 16px; }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* палитра поиска ⌘K */
dialog.palette { border: 0; padding: 0; margin: 12vh auto auto; width: min(620px, calc(100vw - 24px)); border-radius: 16px; background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); color: var(--text); box-shadow: var(--shadow-pop); animation: pop .16s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: .5px solid var(--line); color: var(--muted); }
.palette-input input { border: 0; padding: 4px 0; font-size: 19px; background: transparent; box-shadow: none !important; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; }
.palette-list a.on { background: var(--accent); color: #fff; }
.palette-list a.on small { color: rgba(255, 255, 255, .8); }
.palette-list a span { display: flex; flex-direction: column; min-width: 0; }
.palette-list small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--fill); flex: none; }
.palette-list a.on .palette-ico { background: rgba(255, 255, 255, .2); }
.palette-foot { padding: 8px 18px; font-size: 12px; color: var(--muted); border-top: .5px solid var(--line); display: flex; gap: 14px; }
kbd { font: 11.5px var(--font); padding: 1px 5px; border-radius: 5px; background: var(--fill); color: var(--muted); }
.search-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 9px; border: 0; background: var(--fill);
  color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.search-btn kbd { margin-left: auto; }

/* ---------- уведомления ---------- */
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px;
  max-width: min(460px, calc(100vw - 32px)); padding: 10px 18px; border-radius: 99px; background: rgba(30, 30, 32, .86); color: #fff;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-pop); font-weight: 500; font-size: 14px;
  animation: toast 4.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 6%, 86% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 20px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); font-weight: 500; }
.alert .i { color: var(--dot-bad); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .brand { justify-content: center; flex-direction: column; gap: 14px; font-size: 26px; font-weight: 700; margin-bottom: 26px; }
.login-card .brand-mark { width: 64px; height: 64px; border-radius: 16px; }
.login-card form.creds { display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.login-card input { border: 0; border-radius: 0; padding: 14px 16px; font-size: 16px; }
.login-card input:focus { box-shadow: none; }
.login-card input + input { border-top: .5px solid var(--line); }
.login-card .btn.full { margin-top: 18px; min-height: 44px; font-size: 16px; width: 100%; }
.login-card .alert { text-align: left; }
.lang-pick { margin-top: 26px; display: flex; justify-content: center; }

/* ---------- календарь ---------- */
.cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.cal { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; table-layout: fixed; font-size: 12.5px; }
.cal th, .cal td { border-bottom: .5px solid var(--line); padding: 0; height: 44px; }
.cal thead th { position: sticky; background: var(--surface); z-index: 2; width: 40px; min-width: 40px; text-align: center; font-weight: 500; color: var(--muted); height: auto; }
.cal .cal-months th { top: 0; padding: 10px 0 0; text-align: left; border-bottom: 0; }
.cal .cal-months th span { position: sticky; left: 80px; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--text); text-transform: capitalize; }
.cal .cal-days th { top: 30px; padding: 4px 0 6px; }
.cal thead th b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.cal thead th small { font-size: 10.5px; }
.cal thead th.wk small, .cal thead th.wk b { color: var(--muted); }
.cal thead th.today b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--dot-bad); color: #fff; }
.cal td.wk { background: color-mix(in srgb, var(--fill) 45%, transparent); }
.cal td.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cal .m1 { border-left: .5px solid var(--line-strong); }
.cal .cal-room { position: sticky; left: 0; z-index: 3; background: var(--surface); width: 72px; min-width: 72px; text-align: left; padding: 0 16px;
  font-weight: 600; color: var(--text); font-size: 14px; }
.cal thead .cal-room { z-index: 4; vertical-align: middle; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.cal-cell { position: relative; }
.cal-free a { display: grid; place-items: center; height: 100%; color: transparent; font-size: 18px; font-weight: 300; }
.cal-free a:hover { color: var(--accent); background: var(--accent-soft); }
.cal-stay { position: absolute; inset: 7px 2px; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 12px 0 10px;
  border-radius: 8px; background: var(--text); color: var(--bg); overflow: hidden; white-space: nowrap; font-weight: 500; user-select: none; -webkit-user-select: none; }
.cal-stay span { overflow: hidden; text-overflow: ellipsis; }
.cal-stay small { opacity: .7; font-size: 11px; flex: none; }
.cal-stay.k-booking { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.cal-stay.k-past { background: var(--fill); color: var(--muted); }
.cal-stay.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; left: 0; }
.cal-stay.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; right: 0; }
.cal-stay[data-drag] { cursor: grab; touch-action: none; }
.cal-stay .grip { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; cursor: ew-resize; }
.cal-stay .grip::after { content: ""; position: absolute; right: 4px; top: 30%; bottom: 30%; width: 2px; border-radius: 2px; background: currentColor; opacity: .45; }
.cal-stay.dragging { opacity: .9; box-shadow: var(--shadow-pop); z-index: 10; cursor: grabbing; }
.cal tr.drop-target td, .cal tr.drop-target th { background: var(--accent-soft); }
.cal-hint { font-size: 12.5px; color: var(--muted); }

/* ---------- статистика ---------- */
.stat-section { scroll-margin-top: 16px; margin-bottom: 36px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 14px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head .section-title { margin: 0; }
.anchors { flex-wrap: wrap; }
.vchart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 22px 20px 12px; }
.vchart.single { height: 200px; }
.vchart.days { gap: 3px; height: 140px; }
.vcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.vbars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: .5px solid var(--line-strong); }
.vbars i { display: block; width: 100%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--text); transition: opacity .15s; }
.vbars i.b2 { background: var(--faint); opacity: .6; }
.vbars i.b3 { background: var(--dot-bad); opacity: .7; }
.vbars i:hover { opacity: .7; }
.vchart.days .vbars i { max-width: none; border-radius: 2px 2px 0 0; }
.vcol.fut .vbars i { background: var(--faint); opacity: .5; }
.vcol.we .vlabel { color: var(--text); font-weight: 600; }
.vcol.cur .vlabel { color: var(--text); font-weight: 700; }
.vlabel { font-size: 11.5px; color: var(--muted); height: 14px; white-space: nowrap; }
.vval { font-size: 11.5px; color: var(--muted); }
.table-toggle { padding: 0 20px 14px; }
.table-toggle summary { color: var(--accent); font-size: 13.5px; padding: 6px 0; }
.rank td { vertical-align: middle; }

/* ---------- журнал ---------- */
.log-row { align-items: flex-start; }
.log-row::after { left: 20px; }
.log-time { color: var(--muted); font-size: 13px; min-width: 80px; padding-top: 1px; }
.log-text { font-size: 14px; }
.log-text a:hover { color: var(--accent); }

/* ---------- настройки ---------- */
.season-row { display: grid; grid-template-columns: 1.5fr .9fr .9fr .7fr .6fr auto auto; gap: 10px; align-items: center; padding: 8px 20px; border-bottom: .5px solid var(--line); }
.season-row:last-child { border-bottom: 0; }
.season-row input, .season-row select { padding: 7px 10px; font-size: 14px; }
.season-head { font-size: 12.5px; color: var(--muted); font-weight: 500; padding-top: 0; padding-bottom: 6px; }
@media (max-width: 900px) { .season-row { grid-template-columns: 1fr 1fr; } .season-head { display: none; } }
.year-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; padding: 4px 20px 20px; }
.year-strip div { text-align: center; padding: 10px 2px; border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.year-strip b { display: block; font-size: 13px; color: var(--text); margin-top: 2px; }
@media (max-width: 760px) { .year-strip { grid-template-columns: repeat(6, 1fr); } }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 4px 20px 16px; }
.rates-grid label { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 4px 4px 4px 12px; font-weight: 600; }
.rates-grid input { border: 0; background: var(--surface); padding: 8px 10px; }

/* ---------- квитанция ---------- */
.receipt-page { background: var(--bg); min-height: 100vh; padding: 30px 16px; }
.receipt { max-width: 560px; margin: 0 auto; background: #fff; color: #1d1d1f; border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); }
.receipt h1 { font-size: 28px; }
.receipt .r-muted { color: #6e6e73; font-size: 14px; }
.receipt table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.receipt td { padding: 9px 0; border-bottom: .5px solid #d2d2d7; vertical-align: top; }
.receipt td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.receipt .r-total td { font-weight: 700; font-size: 17px; border-bottom: 0; padding-top: 14px; }
.receipt-actions { max-width: 560px; margin: 0 auto 18px; display: flex; gap: 8px; flex-wrap: wrap; }
@media print { .receipt-actions { display: none; } .receipt-page { padding: 0; background: #fff; } .receipt { box-shadow: none; } }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20;
    padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--glass); backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--line); }
  .topbar .brand { font-size: 16px; padding: 0; }
  .topbar-actions { display: flex; align-items: center; gap: 6px; }
  .occ-chip { display: flex; align-items: center; gap: 4px; font-size: 13px; padding: 5px 10px; border-radius: 99px; background: var(--fill); color: var(--muted); }
  .occ-chip b { color: var(--text); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: 10.5px; font-weight: 500;
    color: var(--faint); padding: 2px; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar .i { stroke-width: 1.7; }
  .tabbar a.on, .tabbar button.on { color: var(--accent); }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 21;
    width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
  .fab:active { transform: scale(.95); }
  .main { padding: 18px 16px 104px; }
  h1 { font-size: 30px; }
  .page-head { margin-bottom: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; } .kpi-val { font-size: 23px; }
  .kpi-top { font-size: 12px; } .chip { display: none; }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .map { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); padding: 4px 14px 16px; }
  .hide-m { display: none !important; }
  .page-head .actions { width: 100%; }
  .page-head .actions .seg { overflow-x: auto; max-width: 100%; }
  .toast { top: auto; bottom: calc(140px + env(safe-area-inset-bottom)); }
  .panel { border-radius: 14px; }
  .row::after { left: 66px; }
  dialog.drawer { width: 100vw; max-width: 100vw; margin: auto 0 0; height: 92vh; border-radius: 14px 14px 0 0; animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1); }
  dialog.modal { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 14px 14px 0 0; animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1); }
  .modal-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .pay-box input { max-width: none; flex: 1 1 100%; }
  .search-m { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--fill); color: var(--text); border: 0; }
}
@media (min-width: 901px) { .search-m { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =====================================================================
   Стекло и фон: мягкие пятна на фоне, карточки — матовое стекло
   ===================================================================== */
:root {
  --surface-solid: #ffffff;
  --glass-card: rgba(255, 255, 255, .58);
  --glass-border: rgba(255, 255, 255, .7);
  --glass-blur: saturate(180%) blur(24px);
  --blob-1: rgba(0, 113, 227, .16); --blob-2: rgba(175, 82, 222, .12); --blob-3: rgba(52, 199, 89, .10); --blob-4: rgba(255, 159, 10, .10);
  --free: #1f9d4c; --free-soft: rgba(52, 199, 89, .14); --busy-bg: #1d1d1f; --busy-text: #ffffff;
}
:root[data-theme="dark"] {
  --surface-solid: #1c1c1e;
  --glass-card: rgba(44, 44, 46, .55);
  --glass-border: rgba(255, 255, 255, .08);
  --blob-1: rgba(10, 132, 255, .22); --blob-2: rgba(191, 90, 242, .16); --blob-3: rgba(48, 209, 88, .10); --blob-4: rgba(255, 159, 10, .08);
  --free: #30d158; --free-soft: rgba(48, 209, 88, .16); --busy-bg: #f5f5f7; --busy-text: #1d1d1f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-solid: #1c1c1e;
    --glass-card: rgba(44, 44, 46, .55);
    --glass-border: rgba(255, 255, 255, .08);
    --blob-1: rgba(10, 132, 255, .22); --blob-2: rgba(191, 90, 242, .16); --blob-3: rgba(48, 209, 88, .10); --blob-4: rgba(255, 159, 10, .08);
    --free: #30d158; --free-soft: rgba(48, 209, 88, .16); --busy-bg: #f5f5f7; --busy-text: #1d1d1f;
  }
}

/* фон: несколько размытых пятен, неподвижно за контентом */
body::before { content: ""; position: fixed; inset: -10vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 34vmax at 12% 8%, var(--blob-1), transparent 70%),
    radial-gradient(36vmax 30vmax at 92% 12%, var(--blob-2), transparent 70%),
    radial-gradient(38vmax 32vmax at 78% 92%, var(--blob-3), transparent 70%),
    radial-gradient(30vmax 26vmax at 8% 86%, var(--blob-4), transparent 70%);
  filter: blur(10px); }
body { background: var(--bg); isolation: isolate; }

/* стеклянные поверхности */
.panel, .kpi, .room, .occ, .login-card form.creds {
  background: var(--glass-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: .5px solid var(--glass-border); box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 8px 24px rgba(0, 0, 0, .04); }
:root[data-theme="dark"] .panel, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .room, :root[data-theme="dark"] .occ { box-shadow: none; }
.side { background: var(--glass); }
dialog.modal, dialog.drawer { background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
dialog.drawer .panel { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
.sheet-body { background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
input, select, textarea { background: color-mix(in srgb, var(--surface-solid) 80%, transparent); }
.cal thead th, .cal .cal-room { background: var(--surface-solid); }
.room-photo { background: color-mix(in srgb, var(--fill) 60%, transparent); }
.receipt { border: 0; }

/* =====================================================================
   Карта номеров: занят / свободен видно сразу
   ===================================================================== */
.map-summary { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 20px 6px; }
.map-summary span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; }
.map-summary .ms-free { background: var(--free-soft); color: var(--free); }
.map-summary .ms-busy { background: var(--fill); color: var(--text); }
.map-summary .ms-busy i { width: 10px; height: 10px; border-radius: 3px; background: var(--busy-bg); display: inline-block; }
.map-summary .ms-free i { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--free); display: inline-block; }
.map { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.map a { aspect-ratio: auto; min-height: 86px; align-items: flex-start; justify-content: space-between; padding: 10px 12px; text-align: left; gap: 4px; }
.map .m-num { font-size: 19px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.map .m-state { font-size: 11.5px; font-weight: 600; letter-spacing: 0; display: inline-flex; align-items: center; gap: 4px; }
.map .m-who { font-size: 12px; font-weight: 500; letter-spacing: 0; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.map .s-busy, .map .s-out_today, .map .s-late { background: var(--busy-bg); color: var(--busy-text); }
.map .s-free, .map .s-reserved { background: var(--free-soft); color: var(--text); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--free) 55%, transparent); }
.map .s-free .m-state, .map .s-reserved .m-state { color: var(--free); }
.map a::after { top: 10px; right: 10px; width: 8px; height: 8px; }
.map .dirty::before { bottom: auto; top: 10px; left: auto; right: 24px; transform: none; width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 900px) { .map { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); padding: 4px 14px 16px; } .map a { min-height: 78px; } }

/* =====================================================================
   Панель инструментов: все элементы одной высоты (38px)
   ===================================================================== */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar > *, .toolbar .btn { height: 38px; min-height: 38px; }
.toolbar .seg { align-items: stretch; padding: 2px; }
.toolbar .seg a, .toolbar .seg button, .toolbar .seg label > span { display: flex; align-items: center; height: 100%; padding: 0 14px; }
.search { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 10px; background: var(--fill); color: var(--muted); }
.search input { border: 0; background: transparent; padding: 0; height: 100%; width: 210px; box-shadow: none !important; font-size: 14.5px; }
.toolbar select { height: 38px; padding-top: 0; padding-bottom: 0; width: auto; }
.filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 0 5px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 4px 20px 18px; align-items: end; }
.filters .field select, .filters .field input { height: 38px; padding-top: 0; padding-bottom: 0; }
.filters-foot { display: flex; gap: 8px; align-items: center; padding: 0 20px 18px; flex-wrap: wrap; }
@media (max-width: 900px) { .search { flex: 1 1 100%; } .search input { width: 100%; } }

/* =====================================================================
   Календарь: исправления и протягивание
   ===================================================================== */
.cal thead .cal-room { padding: 0 16px; text-align: left; }
.cal .cal-days th b { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto; border-radius: 50%; font-size: 14px; }
.cal .cal-days th small { display: block; margin-top: 1px; }
.cal thead th.today b { background: var(--dot-bad); color: #fff; }
.cal td.cal-free { cursor: cell; }
.cal td.cal-free.sel { background: var(--accent-soft) !important; box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.cal td.cal-free.sel a { color: var(--accent); }
.cal-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.quick-title { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* продление на N ночей */
.extend { display: flex; flex-direction: column; gap: 10px; }
.extend-row { display: flex; align-items: center; gap: 10px; }
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 10px; padding: 2px; }
.stepper .step { width: 36px; height: 34px; border: 0; background: none; font: inherit; font-size: 20px; color: var(--accent); cursor: pointer; border-radius: 8px; }
.stepper .step:hover { background: var(--surface-solid); }
.stepper input { width: 58px; height: 34px; border: 0; background: transparent; text-align: center; font-size: 17px; font-weight: 600; padding: 0; box-shadow: none !important; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.extend-label { color: var(--muted); font-size: 14px; }
.extend-out { font-size: 14px; color: var(--muted); }
.extend-out b { color: var(--text); }
.quick button.on { background: var(--accent); color: #fff; }
.cal { -webkit-user-select: none; user-select: none; }

/* метки номеров и ремонт */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 2px; }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 500;
  background: var(--fill); color: var(--muted); white-space: nowrap; }
.tag.tag-type { background: var(--accent-soft); color: var(--accent); }
.badge.repair .dot { color: var(--faint); }
.room.s-repair .room-photo img { filter: grayscale(1) opacity(.6); }
.room.s-repair .room-guest { color: var(--muted); }
.map .s-repair { background: repeating-linear-gradient(135deg, var(--fill) 0 8px, transparent 8px 16px); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-strong); }
.repair-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--fill) 50%, transparent); }
.rate-room { display: flex; flex-direction: column; line-height: 1.15; min-width: 64px; }
.rate-room small { font-size: 10.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

/* протягивание в календаре: одна голубая полоса вместо ряда «+» */
.cal td.cal-free.sel { background: transparent !important; box-shadow: none !important; }
.cal td.cal-free.sel a { color: transparent !important; background: none !important; }
.cal td.cal-free.sel::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; right: 0; background: var(--accent); z-index: 1; }
.cal td.cal-free.sel-start::before { left: 3px; border-radius: 8px 0 0 8px; }
.cal td.cal-free.sel-end::before { right: 3px; border-radius: 0 8px 8px 0; }
.cal td.cal-free.sel-start.sel-end::before { border-radius: 8px; }
.cal td.cal-free.sel-start::after { content: attr(data-label); position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  z-index: 2; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.cal-free a:focus, .cal-free a:focus-visible { outline: none; }

/* окно подтверждения */
dialog.confirm-dlg { width: min(400px, calc(100vw - 32px)); text-align: center; }
dialog.confirm-dlg h2 { justify-content: center; font-size: 19px; }
dialog.confirm-dlg p { margin: 10px 0 0; font-size: 15px; }
dialog.confirm-dlg .modal-foot { justify-content: center; }
dialog.confirm-dlg .modal-foot span { display: none; }
dialog.confirm-dlg .modal-foot .btn { flex: 1; }
@media (max-width: 900px) { dialog.confirm-dlg { margin: auto; border-radius: 16px; width: calc(100vw - 32px); animation: pop .18s ease-out; } }

/* =====================================================================
   Цветовые темы: тёмно-синяя и фиолетовая (обе тёмные, свой акцент)
   ===================================================================== */
:root[data-theme="navy"] {
  --bg: #070d1a; --surface: #0f1829; --surface-2: #16223a; --surface-3: #1f2e4b; --surface-solid: #0f1829;
  --fill: rgba(120, 150, 210, .16); --line: rgba(110, 140, 200, .22); --line-strong: rgba(110, 140, 200, .4);
  --text: #eef3ff; --muted: #94a3c4; --faint: #5b6b8c;
  --accent: #4d8dff; --accent-hover: #6aa0ff; --on-accent: #ffffff; --accent-soft: rgba(77, 141, 255, .2);
  --ok: #3ddc84; --bad: #ff7a85; --warn: #ffbd5c; --info: #6fb8ff;
  --glass: rgba(10, 18, 34, .72); --glass-strong: rgba(18, 28, 48, .92); --glass-card: rgba(20, 32, 56, .55);
  --glass-border: rgba(140, 170, 230, .12);
  --blob-1: rgba(40, 110, 255, .28); --blob-2: rgba(0, 180, 255, .14); --blob-3: rgba(80, 60, 220, .16); --blob-4: rgba(0, 200, 170, .08);
  --free: #3ddc84; --free-soft: rgba(61, 220, 132, .14); --busy-bg: #dfe8ff; --busy-text: #0b1530;
  --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="navy"] .seg a.on, :root[data-theme="navy"] .seg input:checked + span, :root[data-theme="navy"] .seg button.on { background: #2a3b5e; }
:root[data-theme="navy"] .panel, :root[data-theme="navy"] .kpi, :root[data-theme="navy"] .room, :root[data-theme="navy"] .occ { box-shadow: none; }
:root[data-theme="navy"] .brand-mark { background: var(--accent); color: #fff; }

/* образцы тем в настройках */
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.theme-pick button { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: var(--text); text-align: center; }
.theme-pick .sw { display: block; height: 64px; border-radius: 12px; margin-bottom: 6px; box-shadow: inset 0 0 0 1px var(--line-strong); position: relative; overflow: hidden; }
.theme-pick .sw::after { content: ""; position: absolute; left: 10px; bottom: 10px; width: 34px; height: 8px; border-radius: 4px; background: var(--sw-accent); }
.theme-pick button.on .sw { box-shadow: 0 0 0 3px var(--accent); }
.theme-pick span.name { font-size: 13px; font-weight: 500; }

/* кнопка «Оплачено ▾»: обе половины на одном уровне и одной высоты */
.dd { vertical-align: middle; }
form.pay-split { display: inline-flex; flex-wrap: nowrap; align-items: stretch; vertical-align: middle; flex: none; }
.pay-split > .dd { display: flex; }
.pay-split > .btn, .pay-split > .dd > summary { height: 30px; min-height: 30px; margin: 0; }
.pay-split > .dd > summary { display: inline-flex; align-items: center; justify-content: center; width: 30px; padding: 0; line-height: 1; }
.row-end { align-items: center; }

/* тарифы × теги, теги номеров */
.price-matrix th { vertical-align: bottom; }
.price-matrix td input { min-width: 90px; padding: 7px 10px; }
.price-matrix tr.muted td { opacity: .6; }
.tag-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; padding: 0 20px 14px; }
.tag-edit { display: flex; gap: 6px; align-items: center; }
.tag-edit input { padding: 7px 10px; }
.rates-grid select { border: 0; background-color: var(--surface-solid); padding: 7px 30px 7px 10px; font-size: 14px; }
.bf { display: flex; align-items: center; gap: 10px; }

/* сезоны: ровные колонки, подписи, подсказки «?» при наведении */
.season-row { grid-template-columns: minmax(140px, 1.5fr) minmax(96px, .8fr) minmax(96px, .8fr) minmax(110px, .8fr) minmax(80px, .6fr) 56px 150px; }
.season-head span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.season-on { display: flex; justify-content: center; }
.season-actions { display: flex; gap: 4px; justify-content: flex-end; }
.season-new { background: color-mix(in srgb, var(--fill) 40%, transparent); }
.season-new .season-actions .btn { width: 100%; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 26px; }
.input-suffix em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; pointer-events: none; }
.year-strip small { display: block; font-size: 10px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--fill); color: var(--muted);
  font: 600 11px/1 var(--font); font-style: normal; cursor: help; text-transform: none; letter-spacing: 0; flex: none; }
.tip:hover, .tip:focus { background: var(--accent); color: #fff; outline: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); width: max-content; max-width: 260px;
  padding: 9px 12px; border-radius: 10px; background: rgba(30, 30, 32, .94); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.4; white-space: normal;
  text-align: left; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 50; }
.tip:hover::after, .tip:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) {
  .season-row { grid-template-columns: 1fr 1fr; }
  .season-actions { grid-column: 1 / -1; }
  .tip::after { left: auto; right: -10px; transform: none; }
  .tip:hover::after, .tip:focus::after { transform: none; }
}

/* теги: список строками + матрица «номер → тег» */
.tag-list { grid-template-columns: 1fr; max-width: 640px; }
.tag-edit input { flex: 1; min-width: 0; }
.tag-edit .tag-count { min-width: 92px; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tag-matrix th, .tag-matrix td { text-align: center; }
.tag-matrix th:first-child, .tag-matrix td:first-child { text-align: left; white-space: nowrap; }
.tag-matrix td input[type=radio] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: transparent; cursor: pointer; transition: border .12s; }
.tag-matrix td input[type=radio]:checked { border: 5.5px solid var(--accent); background: var(--on-accent, #fff); }
.tag-matrix td label { display: grid; place-items: center; padding: 6px 0; cursor: pointer; }
.tag-matrix tr:hover td { background: color-mix(in srgb, var(--fill) 50%, transparent); }
.tag.tag-none { opacity: .6; }

/* Telegram-бот в настройках */
.bot-link { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bot-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.bot-form .field { flex: 1; min-width: 260px; }
.foot-note.bad { color: var(--bad); }
.field-label { display: inline-flex; align-items: center; gap: 5px; }

/* продажи: текст письма */
.sale-raw { margin-top: 6px; }
.sale-raw summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.sale-raw pre { white-space: pre-wrap; font: 12px/1.45 var(--mono, ui-monospace, monospace); background: var(--fill); padding: 10px 12px; border-radius: 10px; max-height: 260px; overflow: auto; margin: 6px 0 0; }
.staff-table td:last-child { width: 30%; min-width: 120px; }
.staff-table .num { text-align: right; }
/* продажи: номер + «В счёт» в одной строке */
form.sale-charge { display: inline-flex; gap: 4px; align-items: center; flex: none; }
form.sale-charge select { height: 30px; min-height: 30px; padding: 0 26px 0 10px; font-size: 13px; width: auto; }

/* вход: капча и выбор языка во всю ширину кнопки «Войти» */
.login-card .captcha-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: .5px solid var(--line); }
.login-card .captcha-row img { border-radius: 8px; display: block; flex: 1; min-width: 0; height: 56px; object-fit: cover; }
.login-card .cap-refresh { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--fill); color: var(--text); font-size: 20px; cursor: pointer; flex: none; }
.login-card .cap-refresh:hover { background: var(--accent-soft); color: var(--accent); }
.login-card #cap-in { border-top: .5px solid var(--line); text-transform: uppercase; letter-spacing: .2em; }
.login-card .lang-pick { margin-top: 14px; width: 100%; }
.login-card .lang-pick .seg { display: flex; width: 100%; box-sizing: border-box; }
.login-card .lang-pick .seg button { flex: 1 1 0; min-height: 36px; justify-content: center; }

/* внутри Telegram: без лишних отступов сверху, нижняя навигация учитывает безопасную зону */
.in-tg body { overscroll-behavior: none; }
.login-card #cap-in::placeholder { text-transform: none; letter-spacing: normal; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 4px; }
