/* Arena Club — панель администратора. Тёмная тема для работы в зале. */
:root {
  color-scheme: dark;
  --bg: #140c2b;
  --bg-2: #1a1036;
  --panel: #21154a;
  --panel-2: #2c1d5e;
  --line: #3a2c6b;
  --line-2: #4a3a80;
  --text: #f4eeff;
  --text-2: #b4a9d6;
  --text-3: #7c70a6;
  --accent: #e9b949;          /* лайм — фирменный акцент */
  --accent-ink: #2a1600;
  --danger: #ff5d5d;
  --warn: #f5b02e;
  --ok: #3ddc84;
  /* статусы мест */
  --st-free: #3ddc84;
  --st-busy: #4f8cff;
  --st-paused: #f5b02e;
  --st-booked: #a77bff;
  --st-offline: #5b6170;
  --st-maint: #ff7a59;
  /* категориальная палитра графиков (тёмная) */
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 20px 0 10px; }
h4 { font-size: 13px; margin: 8px 0; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
code { font-family: var(--mono); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
code.small { font-size: 11px; color: var(--text-3); background: none; white-space: pre-wrap; word-break: break-all; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 12px; overflow: auto; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.right { margin-left: auto; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #2b303a; border-color: #4a5160; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #c8ff6e; }
.btn.danger { color: var(--danger); border-color: #5a2a2e; background: #2a1719; }
.btn.danger:hover { background: #3a1d20; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 185, 73, .15); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 34px; width: 64px; }
input.search { width: 280px; }
textarea { resize: vertical; }

/* ---------- вход ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 70% -10%, #1f2a12 0%, transparent 60%), var(--bg); padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo b { display: block; font-size: 18px; }
.login-logo small { color: var(--text-2); }
.logo-mark { width: 38px; height: 38px; color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 20px; flex: none; object-fit: contain; filter: drop-shadow(0 0 10px rgba(233, 185, 73, .35)); }

/* ---------- каркас ---------- */
.layout { display: flex; height: 100vh; }
.sidebar { width: 220px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.brand b { display: block; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { color: var(--text-3); font-size: 11px; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-ico { width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--warn); color: #000; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.nav-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me b { display: block; font-size: 13px; }
.me small { color: var(--text-3); font-size: 11px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 16px; background: var(--bg); }
.stats { display: flex; align-items: center; gap: 18px; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--text-3); }
.stat.s-free b { color: var(--st-free); }
.stat.s-booked b { color: var(--st-booked); }
.stat.s-offline b { color: var(--text-3); }
.load { width: 120px; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.load-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.top-right { display: flex; align-items: center; gap: 14px; }
.shift-pill { font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--text-2); }
.shift-pill.on { border-color: #2f5a3d; color: var(--ok); background: #13261b; }
.shift-pill.off { border-color: #5a4a22; color: var(--warn); background: #2a2213; }
.clock { font-family: var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.content { flex: 1; overflow: auto; padding: 20px; }
.loading, .empty { color: var(--text-3); padding: 24px; text-align: center; }
.empty.big { padding: 48px; font-size: 15px; background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.offline-banner { display: none; position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: var(--danger); color: #fff; padding: 6px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
body.offline .offline-banner { display: block; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }
.section-head { display: flex; align-items: center; gap: 8px; }
.section-head h3 { margin-right: auto; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h3 { margin-top: 0; }
.card.info { border-color: #2f4a1b; background: #151c10; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .cols, .cols3 { grid-template-columns: 1fr; } }

/* чипы, вкладки, бейджи */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--text); border-color: #4a5160; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.tabs { display: flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tab { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 500; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: var(--text); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-2); margin-right: 4px; white-space: nowrap; }
.badge.ok { background: #13261b; color: var(--ok); border-color: #24452f; }
.badge.warn { background: #2a2213; color: var(--warn); border-color: #4a3c1d; }
.badge.err { background: #2a1719; color: var(--danger); border-color: #4a2427; }

/* таблицы */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--panel-2); }
.a-r { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* модальные окна и формы */
.modal-back { position: fixed; inset: 0; background: rgba(5, 6, 8, .65); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .14s; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.day { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; font-size: 13px; }
.quick { margin-top: -4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.note { background: #2a2213; border: 1px solid #4a3c1d; color: #f3d48a; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }

/* тосты */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 380px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--st-busy); padding: 10px 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: pop .15s; transition: opacity .3s, transform .3s; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast.hide { opacity: 0; transform: translateX(20px); }

/* ---------- зал ---------- */
.hall-page { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.hall-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hall-toolbar .chip.active { background: color-mix(in srgb, var(--zc, var(--text)) 22%, transparent); color: var(--text); border-color: var(--zc, var(--text)); }
.hall-body { display: flex; gap: 16px; flex: 1; min-height: 0; }
.hall-map { flex: 1; display: grid; gap: 10px; align-content: start; overflow: auto; padding: 2px; }
.hall-map.editing { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; border-radius: var(--radius); }
.cell { border: 1px dashed var(--line); border-radius: 10px; min-height: 108px; }
.cell.over { border-color: var(--accent); background: rgba(233, 185, 73, .06); }
.pc { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 14px; cursor: pointer; min-height: 108px; display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, transform .12s, opacity .15s; overflow: hidden; z-index: 1; }
.pc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--zc); }
.pc:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pc.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pc.dim { opacity: .25; }
.pc-head { display: flex; align-items: center; justify-content: space-between; }
.pc-head b { font-size: 14px; }
.online { width: 8px; height: 8px; border-radius: 50%; background: var(--st-offline); }
.online.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.pc-status { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pc-guest { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-time { font-family: var(--mono); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pc-mode, .pc-tariff, .pc-book, .pc-stats { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-book { color: var(--st-booked); }
.pc-stats { color: var(--text-3); margin-top: auto; font-family: var(--mono); font-size: 11px; }
.pc.s-free .pc-status { color: var(--st-free); }
.pc.s-busy { background: linear-gradient(180deg, #17233a 0%, var(--panel) 100%); border-color: #273a5c; }
.pc.s-busy .pc-status { color: var(--st-busy); }
.pc.s-paused { background: linear-gradient(180deg, #2a2312 0%, var(--panel) 100%); border-color: #4a3c1d; }
.pc.s-paused .pc-status { color: var(--st-paused); }
.pc.s-booked { border-color: #3d2d63; }
.pc.s-booked .pc-status { color: var(--st-booked); }
.pc.s-offline { opacity: .6; }
.pc.s-offline .pc-status { color: var(--text-3); }
.pc.s-maint { background: repeating-linear-gradient(135deg, var(--panel) 0 10px, #241a17 10px 20px); }
.pc.s-maint .pc-status { color: var(--st-maint); }
.pc.low .pc-time { color: var(--warn); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .55; } }

.pc-panel { width: 340px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.panel-empty { text-align: center; color: var(--text-3); margin-top: 30px; }
.panel-empty .big { font-size: 40px; }
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { margin-right: auto; }
.panel-sub { color: var(--text-3); font-size: 12px; margin-top: -8px; }
.status-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); }
.status-pill.s-free { color: var(--st-free); } .status-pill.s-busy { color: var(--st-busy); } .status-pill.s-paused { color: var(--st-paused); }
.status-pill.s-booked { color: var(--st-booked); } .status-pill.s-offline { color: var(--text-3); } .status-pill.s-maint { color: var(--st-maint); }
.session-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.big-clock { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.session-box .kv { margin-top: 12px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .btn { flex: 1 1 auto; justify-content: center; }
.actions.small .btn { height: 30px; font-size: 12px; padding: 0 8px; }
.panel-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border-top: 1px solid var(--line); padding-top: 12px; }
.booking-box { background: #1d1730; border: 1px solid #3d2d63; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.specs { font-size: 12px; color: var(--text-2); display: grid; gap: 2px; }
.specs small { color: var(--text-3); }
.legend { display: grid; gap: 8px; text-align: left; margin: 24px auto 0; width: max-content; font-size: 13px; color: var(--text-2); }
.legend.inline { display: flex; gap: 16px; margin: 0 0 8px; width: auto; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw.s-free { background: var(--st-free); } .sw.s-busy { background: var(--st-busy); } .sw.s-paused { background: var(--st-paused); }
.sw.s-booked { background: var(--st-booked); } .sw.s-offline { background: var(--st-offline); } .sw.s-maint { background: var(--st-maint); }

/* диалог запуска */
.start-dlg { display: flex; flex-direction: column; gap: 12px; }
.guest-results { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.guest-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.guest-row:hover { background: var(--panel-2); }
.guest-row.active { border-color: var(--accent); background: #1a2210; }
/* подсказки гостей при вводе */
.ac-field { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #0008; max-height: 260px; overflow: auto; padding: 4px; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ac-item:hover { background: var(--panel-2); }
.ac-item small { color: var(--text-3); }
.ac-item .right { margin-left: auto; color: var(--text-3); }
.ac-empty { padding: 10px; color: var(--text-3); font-size: 13px; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.opt { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.opt:hover { border-color: #4a5160; }
.opt.active { border-color: var(--accent); background: #1a2210; }
.opt.off { opacity: .55; }
.opt small { color: var(--text-2); }

/* гости */
.guest-card { display: flex; flex-direction: column; gap: 12px; }
.guest-top { display: flex; gap: 14px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #4f8cff, #a77bff); display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; }
.guest-top > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.money-box { display: flex; gap: 18px; }
.money-box div { text-align: right; }
.money-box small { display: block; color: var(--text-3); font-size: 12px; }
.money-box b { font-size: 20px; font-variant-numeric: tabular-nums; }
.level-progress .load { width: 100%; margin-top: 4px; }

/* бар */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.pos-left { display: flex; flex-direction: column; gap: 12px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.product { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text); font: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; transition: border-color .12s, transform .1s; }
.product:hover { border-color: var(--accent); }
.product:active { transform: scale(.98); }
.product.out { opacity: .4; }
.p-ico { font-size: 28px; }
.p-name { font-weight: 600; }
.p-price { color: var(--accent); font-weight: 700; }
.p-stock { font-size: 12px; color: var(--text-3); }
.p-stock.low { color: var(--warn); }
.pos-cart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.pos-cart h3 { margin: 0; }
.cart-lines { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.cart-line { display: flex; align-items: center; gap: 8px; }
.cl-name { flex: 1; }
.cl-sum { width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty b { width: 22px; text-align: center; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-total b { font-size: 24px; }
.pay-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay-buttons .btn { justify-content: center; height: 42px; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.order { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.order.new { border-color: #6b5520; box-shadow: 0 0 0 1px #6b5520; }
.order.done, .order.cancelled { opacity: .6; }
.order-head { display: flex; align-items: center; gap: 8px; }
.order-head b { font-size: 16px; }
.order-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }

/* отчёты */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--text-3); font-size: 12px; }
.kpi b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.report { display: flex; flex-direction: column; gap: 4px; }

/* брони */
.date-label { min-width: 170px; text-align: center; }
.timeline { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; overflow: auto; }
.tl-hours, .tl-row { display: flex; align-items: center; min-width: 900px; }
.tl-name { width: 110px; flex: none; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tl-track { position: relative; flex: 1; height: 26px; border-left: 1px solid var(--line); background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: calc(100% / 24) 100%; cursor: copy; }
.tl-hours .tl-track { height: 18px; background: none; cursor: default; border: 0; }
.tl-hours span { position: absolute; font-size: 11px; color: var(--text-3); transform: translateX(-2px); }
.tl-row { border-top: 1px solid var(--line); }
.tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: #3d2d63; border: 1px solid var(--st-booked); font-size: 11px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 18px; cursor: pointer; }
.tl-bar.arrived { background: #13261b; border-color: var(--ok); }
.tl-bar.done { opacity: .5; }
.tl-bar.noshow { background: #2a1719; border-color: var(--danger); opacity: .7; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; }

/* тарифы, игры, лояльность */
.zone-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.zone-card { min-width: 150px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--zc); border-radius: 10px; padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; }
.zone-card small { color: var(--text-3); }
.zone-block { margin-top: 12px; border-top: 1px solid var(--line); }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; transition: border-color .12s, transform .12s; }
.game-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.game-card.off { opacity: .45; }
.g-cover { aspect-ratio: 2 / 3; background: linear-gradient(160deg, #1d2433, #121419 70%); display: grid; place-items: center; overflow: hidden; }
.g-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-cover.empty span { font-size: 44px; }
.g-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.g-body b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card small { color: var(--text-3); }
.g-meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 12px; }
.cover-row { display: flex; gap: 14px; align-items: flex-start; }
.cover-row > .g-cover { width: 110px; flex: none; border-radius: 8px; border: 1px solid var(--line); }
.cover-actions { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cover-actions small { font-size: 12px; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.level { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.level .big { font-size: 30px; font-weight: 800; color: var(--accent); }
.level small { color: var(--text-3); }

/* графики */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .hit:hover { fill: rgba(255,255,255,.04); }
.chart-tip { display: none; position: absolute; top: 0; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.chart-tip div { display: flex; align-items: center; gap: 6px; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand div, .nav-item span:not(.nav-ico):not(.nav-badge), .me { display: none; }
  .pc-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 30; width: min(360px, 100%); border-radius: 0; }
  .pc-panel:has(.panel-empty) { display: none; }
  .pos-layout { grid-template-columns: 1fr; }
  .stats .stat:not(:first-child), .load { display: none; }
  input.search { width: 100%; }
}

/* ---------- Обращения (чат с гостями) ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 170px); min-height: 420px; }
.chat-threads { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: auto; padding: 6px; }
.thread { position: relative; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.thread:hover { background: var(--panel-2); }
.thread.active { background: var(--panel-2); border-color: var(--line-2); }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-top .right { margin-left: auto; color: var(--text-3); }
.thread-guest { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-last { color: var(--text-2); font-size: 13px; margin-top: 3px; padding-right: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .thread-last { color: var(--text); font-weight: 600; }
.thread-badge { position: absolute; right: 10px; bottom: 10px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.chat-main { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .right { margin-left: auto; }
.chat-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.chat-sep { align-self: center; color: var(--text-3); font-size: 12px; margin: 8px 0 2px; }
.msg { max-width: 70%; padding: 8px 12px; border-radius: 14px; line-height: 1.35; }
.msg.in { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: #2b3a12; border: 1px solid #3f5418; border-bottom-right-radius: 4px; }
.msg.call { border: 1px solid var(--warn); }
.msg-call { color: var(--warn); font-weight: 700; font-size: 13px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; text-align: right; }
.chat-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 16px 0; }
.chat-input { display: flex; gap: 8px; padding: 10px 16px 14px; align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; height: auto; } .chat-threads { max-height: 220px; } .chat-main { height: 70vh; } .msg { max-width: 88%; } }

/* новые устройства (подключились сами) */
.new-pcs:empty { display: none; }
.new-pcs { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.new-pcs-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.new-pcs-list { display: flex; gap: 10px; flex-wrap: wrap; }
.new-pc { display: flex; align-items: center; gap: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 14px; }
.new-pc small { display: block; }
.new-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.setup-hint { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.zone-hint { color: var(--text-2); }
.zone-hint.warn { color: var(--warn); }

/* мастер подключения ЮKassa */
.pay-steps { counter-reset: st; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pay-steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.pay-steps li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.pay-steps small { color: var(--text-2); display: block; }
.pay-check { display: flex; flex-direction: column; gap: 6px; }
.pay-check .res { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.pay-check .res.ok { border-color: var(--ok); }
.pay-check .res.err { border-color: var(--danger); }

/* ---------- Инструкции ---------- */
.help-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.help-top .tabs { margin: 0; }
.help-search { flex: 1; min-width: 240px; }
.help-intro { color: var(--text-2, #b4a9d6); margin: 0 0 14px; max-width: 900px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; align-items: start; }
.help-card { background: var(--panel); border: 1px solid var(--line, #262a33); border-radius: 14px; padding: 0; }
.help-card[open] { border-color: rgba(233, 185, 73, .35); }
.help-card summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 14px 16px; font-weight: 600; font-size: 15px; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card summary::after { content: '▸'; margin-left: auto; color: var(--text-3); transition: transform .15s; }
.help-card[open] summary::after { transform: rotate(90deg); }
.help-ico { font-size: 20px; width: 28px; text-align: center; }
.help-title small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }
.help-steps { margin: 0; padding: 0 18px 16px 52px; display: grid; gap: 8px; line-height: 1.5; }
.help-steps li::marker { color: var(--accent); font-weight: 700; }
.help-steps mark { background: rgba(233, 185, 73, .3); color: inherit; border-radius: 3px; }
@media (max-width: 700px) { .help-grid { grid-template-columns: 1fr; } }

/* ---------- схема зала: плотность карточек (до 15–20 ПК в ряд) ---------- */
.hall-map { min-width: 0; }
.hall-map[data-density="compact"] { gap: 6px; }
.hall-map[data-density="compact"] .pc { padding: 7px 8px 7px 10px; min-height: 84px; }
.hall-map[data-density="compact"] .cell { min-height: 84px; }
.hall-map[data-density="compact"] .pc-head b { font-size: 12px; }
.hall-map[data-density="compact"] .pc-status { font-size: 9.5px; letter-spacing: .03em; }
.hall-map[data-density="compact"] .pc-time { font-size: 14px; }
.hall-map[data-density="compact"] .pc-guest { font-size: 12px; }
.hall-map[data-density="compact"] .pc-mode, .hall-map[data-density="compact"] .pc-tariff, .hall-map[data-density="compact"] .pc-book { font-size: 10.5px; }
.hall-map[data-density="compact"] .pc-stats { display: none; }
.hall-map[data-density="tiny"] { gap: 4px; }
.hall-map[data-density="tiny"] .pc { padding: 5px 4px 5px 7px; min-height: 58px; gap: 1px; border-radius: 7px; }
.hall-map[data-density="tiny"] .cell { min-height: 58px; border-radius: 7px; }
.hall-map[data-density="tiny"] .pc::before { width: 3px; }
.hall-map[data-density="tiny"] .pc-head b { font-size: 10.5px; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.hall-map[data-density="tiny"] .pc-head .ico { display: none; }
.hall-map[data-density="tiny"] .online { width: 6px; height: 6px; position: absolute; top: 4px; right: 4px; }
/* в мини-режиме статус — цветной полоской снизу вместо текста */
.hall-map[data-density="tiny"] .pc-status { display: none; }
.hall-map[data-density="tiny"] .pc::after { content: ""; position: absolute; left: 3px; right: 0; bottom: 0; height: 3px; background: var(--st-offline); }
.hall-map[data-density="tiny"] .pc.s-free::after { background: var(--st-free); }
.hall-map[data-density="tiny"] .pc.s-busy::after { background: var(--st-busy); }
.hall-map[data-density="tiny"] .pc.s-paused::after { background: var(--st-paused); }
.hall-map[data-density="tiny"] .pc.s-booked::after { background: var(--st-booked); }
.hall-map[data-density="tiny"] .pc.s-maint::after { background: var(--st-maint); }
.hall-map[data-density="compact"] .pc-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hall-map[data-density="tiny"] .pc-time { font-size: 12px; letter-spacing: -.04em; }
.hall-map[data-density="tiny"] .pc-guest { font-size: 10px; }
.hall-map[data-density="tiny"] .pc-mode, .hall-map[data-density="tiny"] .pc-tariff, .hall-map[data-density="tiny"] .pc-book, .hall-map[data-density="tiny"] .pc-stats { display: none; }
.hall-map[data-density="tiny"] .new-badge { display: none; }

.pc-time .t-short { display: none; }
.hall-map[data-density="tiny"] .pc-time .t-full { display: none; }
.hall-map[data-density="tiny"] .pc-time .t-short { display: inline; }
/* Сообщения о проблемах */
.report-btn { margin-right: 6px; }
.pre-log { max-height: 320px; overflow: auto; background: rgba(0,0,0,.3); border: 1px solid var(--line, #3a2a6e); border-radius: 8px; padding: 10px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.form textarea { width: 100%; }
