@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0d0b0a;
  --bg-2: #161210;
  --card: #1c1715;
  --card-2: #27201c;
  --line: #3a2e28;
  --text: #f6efe7;
  --muted: #a8968a;
  --accent: #e0222a;
  --accent-dark: #9c1016;
  --accent-2: #f5c451;
  --gold: #f2b632;
  --ok: #22c3a6;
  --warn: #ffa51f;
  --bad: #ff4d5a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --frame: rgba(255, 214, 140, .28);
  --brand-gradient: linear-gradient(180deg, #ffe596 0%, #ffbf3a 38%, #ff7a1a 68%, #e0222a 100%);
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Фирменный знак и иконки */
.wordmark {
  display: inline-flex; align-items: flex-end; line-height: .9; padding-top: .32em;
  font-family: "Montserrat", sans-serif; font-weight: 900; font-size: 24px; letter-spacing: .01em;
  filter: drop-shadow(0 0 14px rgba(255, 90, 30, .35));
}
.wordmark > span {
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wm-i { position: relative; }
.wm-crown {
  position: absolute; left: 50%; bottom: 92%; transform: translateX(-50%);
  width: .66em; height: .43em; fill: #ffc23d; filter: drop-shadow(0 0 4px rgba(255, 170, 40, .6));
}
.wordmark-lg { font-size: 44px; }
.wordmark-xl { font-size: 84px; }
.tagline {
  margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff;
}
.slogan { margin: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-2); }
.brand-divider { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #e0222a, #ff7a1a 55%, rgba(255, 191, 58, 0)); }
.ic {
  width: 44px; height: 44px; fill: none; stroke: url(#ic-grad); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 140, 30, .55));
}
.ic-sm { width: 22px; height: 22px; stroke-width: 2.6; filter: drop-shadow(0 0 3px rgba(255, 140, 30, .5)); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(224, 34, 42, .16), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(242, 182, 50, .09), transparent 60%),
    var(--bg);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 0; }
code { background: var(--card-2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-bad { color: var(--bad); }

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: rgba(13, 11, 10, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(224, 34, 42, .45)); }
.brand-lg { flex-direction: column; font-size: 30px; justify-content: center; margin-bottom: 8px; gap: 4px; }
.brand-lg .brand-logo { width: 120px; height: 120px; filter: drop-shadow(0 0 30px rgba(224, 34, 42, .5)); }
.brand-lg .tagline { font-size: 13px; letter-spacing: .08em; }
.nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 8px 14px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--card-2); }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700;
}
.nav-badge:empty { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-right form { margin: 0; }
.clock { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; }
.shift-pill { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.topbar-right { flex-shrink: 0; }

/* Ноутбуки и планшеты: шапка в одну строку без прокрутки страницы */
@media (max-width: 1360px) {
  .topbar { gap: 14px; padding: 10px 16px; }
  .topbar .brand .wordmark { display: none; }
  .nav a { padding: 8px 10px; font-size: 14px; }
  .topbar-right { gap: 10px; }
  .clock { font-size: 17px; }
}
@media (max-width: 1180px) {
  .shift-name { display: none; }
}
.shift-pill:hover { text-decoration: none; filter: brightness(1.15); }
.shift-open { background: rgba(34, 195, 166, .15); color: var(--ok); }
.shift-closed { background: rgba(255, 176, 32, .15); color: var(--warn); }

.page { padding: 24px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head > .btn:last-child { margin-left: auto; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .08s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: rgba(242, 182, 50, .35); color: #fff;
  box-shadow: 0 6px 18px rgba(224, 34, 42, .25);
}
.btn-danger { background: rgba(255, 92, 108, .15); color: var(--bad); border-color: rgba(255, 92, 108, .3); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.link-danger { color: var(--bad); }

/* Карточки залов */
.panel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.panel-layout .rooms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .panel-layout .rooms-grid { grid-template-columns: 1fr; } }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* Колонка приставок */
.devices-col {
  position: sticky; top: 84px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.devices-col h2 { font-size: 16px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.device { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.device:first-of-type { border-top: 0; }
.device-main { flex: 1; min-width: 0; }
.device-name { font-weight: 700; }
.device-status { font-size: 13px; display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.device-repair { opacity: .5; }
.dot.dot-device-free { background: var(--ok); }
.dot.dot-device-issued { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot.dot-device-home { background: var(--accent-2); }
.dot.dot-device-repair { background: var(--bad); }

/* Кухня */
.menu-section { margin-bottom: 16px; }
.menu-section h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.menu-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .08s;
}
.menu-item:hover { border-color: var(--gold); }
.menu-item:active { transform: scale(.97); }
.menu-item:disabled { opacity: .4; cursor: not-allowed; }
.menu-name { font-weight: 600; font-size: 14px; }
.menu-price { color: var(--gold); font-weight: 700; font-size: 13px; }
.menu-price.free { color: var(--ok); }
.menu-item-qty { cursor: default; grid-column: span 2; }
.menu-qty { display: flex; gap: 6px; width: 100%; margin-top: 4px; }
.menu-qty input {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; color-scheme: dark;
}
.menu-stock { font-size: 11px; color: var(--muted); }
.menu-stock.low { color: var(--warn); }

/* Доставка и выбор зала */
.partners { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.partner { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); }
.partner-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 4px solid var(--room);
  color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.pick:hover { border-color: var(--gold); border-left-color: var(--room); }
.chip-delivery { background: rgba(242, 182, 50, .14); }
.chip-pending { outline: 1px dashed var(--warn); }

@media (max-width: 1100px) {
  .panel-layout { grid-template-columns: 1fr; }
  .devices-col { position: static; }
}
.room-card {
  position: relative; display: flex; flex-direction: column;
  min-height: 420px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.room-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--room); box-shadow: 0 0 24px var(--room);
}
.room-card.state-session, .room-card.state-ending, .room-card.state-overtime {
  background: linear-gradient(180deg, color-mix(in srgb, var(--room) 12%, var(--card)), var(--card) 55%);
}
.room-card.state-overtime { border-color: var(--bad); animation: pulse-bad 1.6s infinite; }
.room-card.state-ending { border-color: var(--warn); }
.room-card.state-late { border-color: var(--warn); }
@keyframes pulse-bad {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(255, 92, 108, .0); }
  50% { box-shadow: var(--shadow), 0 0 0 6px rgba(255, 92, 108, .18); }
}
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.room-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.guest { font-size: 16px; font-weight: 600; color: var(--text); }
.timer {
  font-size: 56px; font-weight: 700; line-height: 1.05; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.timer-sm { font-size: 44px; }
.state-ending .timer { color: var(--warn); }
.state-overtime .timer { color: var(--bad); }
.progress { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin: 6px 0; }
.progress span { display: block; height: 100%; background: var(--room); transition: width .5s; }
.state-ending .progress span { background: var(--warn); }
.state-overtime .progress span { background: var(--bad); }

.chips { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--card-2); display: inline-flex; gap: 6px; align-items: center; }
.chip-device { background: color-mix(in srgb, var(--room) 25%, var(--card-2)); }
.chip-btn { border: 0; background: rgba(255, 255, 255, .12); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.chip-btn:hover { background: var(--ok); }

.sums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 12px; }
.sums div { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; }
.sums small { display: block; color: var(--muted); font-size: 11px; }
.sums b { font-size: 15px; font-variant-numeric: tabular-nums; }
.sums .due { color: var(--warn); }

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-row .btn { flex: 1; white-space: nowrap; padding-left: 8px; padding-right: 8px; }

.empty-state { align-items: center; justify-content: center; text-align: center; }
.empty-title { font-size: 26px; font-weight: 700; }
.state-free .empty-title { color: var(--ok); }
.state-cleaning .empty-title { color: var(--warn); }

.room-later { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.later-item { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; padding: 3px 0; display: flex; align-items: center; gap: 8px; }
.later-item:hover { color: var(--text); }
.later-item b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Бейджи и точки статусов */
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; background: var(--card-2); color: var(--muted); }
.badge-free { background: rgba(34, 195, 166, .15); color: var(--ok); }
.badge-soon, .badge-ending, .badge-cleaning { background: rgba(255, 176, 32, .15); color: var(--warn); }
.badge-late, .badge-overtime { background: rgba(255, 92, 108, .15); color: var(--bad); }
.badge-session { background: rgba(242, 182, 50, .16); color: var(--gold); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-new { background: var(--warn); }
.dot-confirmed { background: var(--ok); }
.dot-in_progress { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-completed { background: var(--muted); }
.dot-cancelled, .dot-no_show { background: var(--bad); }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 176, 32, .15); color: var(--warn); }

/* Общие блоки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.narrow { max-width: 560px; margin: 0 auto 20px; }
.narrow h1 { margin-bottom: 6px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--card-2); }
.flash-success { background: rgba(34, 195, 166, .12); color: var(--ok); }
.flash-warning { background: rgba(255, 176, 32, .12); color: var(--warn); }
.flash-error { background: rgba(255, 92, 108, .12); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--bg-2); border-radius: 12px; padding: 12px; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-accent { background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--card-2); }
.row-muted td { opacity: .5; }

.summary { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-variant-numeric: tabular-nums; }
.summary td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.summary td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.summary-total td { font-weight: 700; }
.summary-due td { font-weight: 700; font-size: 18px; color: var(--warn); border-bottom: 0; }
.summary-ok td:last-child { color: var(--ok); font-weight: 700; }
.summary-warn td:last-child { color: var(--warn); font-weight: 700; }
.summary-bad td:last-child { color: var(--bad); font-weight: 700; }

.details { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 12px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* Заявки */
.request { position: relative; overflow: hidden; padding: 16px 20px; }
.request::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--room); }
.request-main { display: flex; gap: 20px; align-items: flex-start; }
.request-when { display: flex; flex-direction: column; min-width: 110px; }
.request-when b { font-size: 16px; }
.request-when span { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.request-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.request-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.request-notes { background: var(--bg-2); border-radius: 10px; padding: 8px 10px; margin-top: 4px; }
.request-sum { text-align: right; display: flex; flex-direction: column; }
.request-sum b { font-size: 18px; }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.btn-wa { background: rgba(37, 211, 102, .15); color: #25d366; border-color: rgba(37, 211, 102, .35); }

.bonus-box {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 6px 0 4px; border-radius: 12px;
  background: rgba(242, 182, 50, .1); border: 1px solid rgba(242, 182, 50, .3);
}

/* Формы */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid > .btn, .form-grid > .form-error,
.form-grid > .field:has(textarea), .form-grid > .field:has(select[name="room"]) { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea, .day-nav input {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  font: inherit; color-scheme: dark;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 34, 42, .25); }
.has-error input, .has-error select { border-color: var(--bad); }
.field-error { color: var(--bad); }
.req { color: var(--accent); font-weight: 800; }
.required-note { margin: 0; }
.request-film { margin-top: 6px; font-size: 14px; color: var(--accent-2); }
.request-film b { color: var(--text); }
.room-head-right { display: flex; align-items: center; gap: 8px; }
.room-msg-btn { padding: 5px 10px; font-size: 12px; }
.room-on-screen {
  margin: 0 16px 6px; padding: 6px 10px; border-radius: 10px; font-size: 13px;
  background: rgba(242, 182, 50, .12); color: var(--accent-2); border: 1px solid rgba(242, 182, 50, .3);
}
.room-agent-offline {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255, 77, 90, .14); color: var(--bad); border: 1px solid rgba(255, 77, 90, .35);
}
.message-templates { display: flex; flex-wrap: wrap; gap: 6px; }

/* Отчёты */
.report-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.report-filter input[type="date"] {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px;
}
.report-stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.report-grid > .card { margin-bottom: 0; }
.report-grid + .card, .card + .report-grid { margin-top: 20px; }
.report-bar { height: 10px; min-width: 120px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.report-bar span { display: block; height: 100%; border-radius: 999px; background: var(--gold); }
.report-day { white-space: nowrap; width: 90px; color: var(--muted); }
.report-hours { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 8px; }
.report-hour { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.report-hour-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.report-hour-bar span { display: block; width: 100%; background: var(--accent); }
.report-hour small { font-size: 11px; color: var(--muted); }
.report-hour em { font-style: normal; font-size: 10px; color: var(--accent-2); min-height: 13px; white-space: nowrap; }
.message-template { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-2); }
.film-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.film-ok { background: rgba(34, 195, 166, .15); color: var(--ok); }
.film-missing { background: rgba(255, 165, 31, .15); color: var(--warn); }
.form-error { padding: 10px 12px; border-radius: 10px; background: rgba(255, 92, 108, .12); color: var(--bad); }
.field-radio > div { display: flex; flex-wrap: wrap; gap: 8px; }
.field-radio > div > div { flex: 1; display: flex; }
.field-radio label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2);
  cursor: pointer; font-weight: 600;
}
.field-radio label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); }
.field-radio input { display: none; }

/* Вход */
.login { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: 360px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.login-card .form, .login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 20px; }
.login-card input { width: 100%; padding: 11px 12px; border-radius: 10px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); font: inherit; }

/* Модалка */
#modal:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 5, 4, .75); backdrop-filter: blur(4px); z-index: 50; animation: fade .15s; }
.modal {
  position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-head h2 { margin: 0; }
.modal-x { background: none; border: 0; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 14px 20px 20px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }

/* Уведомления */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); max-width: 380px; animation: slide .2s ease-out;
  border-left: 4px solid var(--ok);
}
.toast-error { border-left-color: var(--bad); }
.tag-package { display: inline-block; align-self: flex-start; justify-self: start; width: fit-content; margin: 4px 0 2px; background: rgba(242, 182, 50, .16); color: var(--gold); font-weight: 700; }
.guest-history { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.guest-history-compact { margin: 6px 0 0; }
.gh-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.gh-new { color: var(--ok); border-color: rgba(34, 195, 166, .4); background: rgba(34, 195, 166, .1); }
.gh-loyal { color: var(--gold); border-color: rgba(242, 182, 50, .4); background: rgba(242, 182, 50, .1); font-weight: 700; }
.gh-warn { color: var(--bad); border-color: rgba(255, 77, 90, .4); background: rgba(255, 77, 90, .1); }
.toast-warning { border-left-color: var(--gold); font-weight: 600; }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* Таймлайн */
.day-nav { display: flex; align-items: center; gap: 6px; }
.day-nav form { margin: 0; }
.day-nav input { width: auto; padding: 7px 10px; }
.timeline { padding: 16px 20px 20px; overflow-x: auto; }
.tl-row { display: flex; align-items: stretch; min-width: 900px; }
.tl-row + .tl-row { border-top: 1px solid var(--line); }
.tl-label { width: 130px; flex: none; display: flex; align-items: center; gap: 8px; font-weight: 600; padding-right: 10px; }
.tl-add { margin-left: auto; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.tl-add:hover { color: var(--text); text-decoration: none; background: var(--accent); }
.tl-track { position: relative; flex: 1; height: 64px; }
.tl-hours .tl-track { height: 22px; }
.tl-hour { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255, 255, 255, .04); }
.tl-now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--bad); z-index: 2; }
.tl-now::before { content: ""; position: absolute; top: -3px; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.tl-block {
  position: absolute; top: 8px; bottom: 8px; min-width: 6px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--room) 60%, transparent);
  background: color-mix(in srgb, var(--room) 28%, var(--card));
  color: var(--text); font: inherit; font-size: 12px; text-align: left; padding: 4px 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
.tl-block:hover { filter: brightness(1.25); z-index: 3; }
.tl-new { border-style: dashed; background: color-mix(in srgb, var(--room) 14%, var(--card)); }
.tl-in_progress { background: color-mix(in srgb, var(--room) 55%, var(--card)); box-shadow: 0 0 16px color-mix(in srgb, var(--room) 50%, transparent); }
.tl-completed { opacity: .45; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .page { padding: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
