:root {
  --bg: #0E1012;
  --panel: #181B1F;
  --panel-2: #22262B;
  --panel-3: #2C3137;
  --line: #2A2E33;
  --text: #F2F4F0;
  --muted: #8D949C;
  --lime: #C6F432;
  --on-lime: #141A00;
  --coral: #FF7A66;
  --amber: #F5C451;
  --cyan: #7FD7FF;
  --violet: #C59BFF;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 600 14px/1.4 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; user-select: none; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { background: var(--panel-2); border: 1px solid transparent; border-radius: 16px; height: 50px; padding: 0 16px; outline: none; width: 100%; color-scheme: dark; }
textarea { height: 80px; padding: 12px 16px; resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); }
h1, h2, h3 { margin: 0; font-family: Unbounded, Manrope, sans-serif; font-weight: 600; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.lime { color: var(--lime); }
.coral { color: var(--coral); }
.amber { color: var(--amber); }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.display { font-family: Unbounded, Manrope, sans-serif; font-weight: 600; letter-spacing: -0.02em; }

/* ── Кнопки ── */
.btn { height: 52px; padding: 0 20px; border-radius: 26px; background: var(--panel-2); font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--panel-3); }
.btn.primary { background: var(--lime); color: var(--on-lime); }
.btn.primary:hover:not(:disabled) { background: #d4fb57; }
.btn.danger { background: #2c1a17; color: var(--coral); }
.btn.light { background: var(--text); color: var(--bg); }
.btn.big { height: 62px; border-radius: 31px; font-size: 17px; }
.btn.sm { height: 40px; padding: 0 14px; border-radius: 20px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--panel); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--panel-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 16px; background: var(--panel); font-size: 12px; font-weight: 700; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; }
.badge { background: var(--amber); color: #1E1700; border-radius: 10px; padding: 1px 7px; font-size: 12px; font-weight: 800; }
.seg { display: flex; background: var(--panel-2); border-radius: 18px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 38px; border-radius: 15px; font-size: 13px; font-weight: 600; color: #C9CED3; }
.seg button.on { background: var(--lime); color: var(--on-lime); font-weight: 800; }

/* ── Экраны входа ── */
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; padding: 4px; flex: none; }
.brand-mark.sm { width: 40px; height: 40px; border-radius: 12px; padding: 3px; }
.brand b { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 22px; display: block; }
.brand small { color: var(--muted); font-size: 13px; }
.cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.card { width: 440px; max-width: 100%; background: var(--panel); border-radius: 30px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.card h2 { font-family: Manrope, sans-serif; font-weight: 800; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { color: var(--text); font-weight: 700; font-size: 15px; }
.err { color: var(--coral); font-size: 13px; min-height: 18px; font-weight: 700; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.person { height: 96px; border-radius: 20px; background: var(--panel-2); border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.person.on { border-color: var(--lime); }
.person .av { width: 42px; height: 42px; border-radius: 21px; background: var(--panel-3); display: grid; place-items: center; font-weight: 800; }
.person.on .av { background: var(--lime); color: var(--on-lime); }
.person span:last-child { font-size: 13px; font-weight: 700; max-width: 100%; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 8px; background: #3A4048; }
.pin-dots i.on { background: var(--lime); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.keypad button { height: 58px; border-radius: 18px; background: var(--panel-2); font-weight: 800; font-size: 22px; }
.keypad button:hover { background: var(--panel-3); }
.money-input { height: 74px; border-radius: 22px; background: var(--panel-2); display: flex; align-items: center; padding: 0 22px; gap: 10px; }
.money-input input { background: transparent; border: 0; padding: 0; height: 100%; font: 600 30px Unbounded, sans-serif; }
.money-input span { font: 600 22px Unbounded, sans-serif; color: var(--muted); }
.note { border-radius: 20px; padding: 14px 16px; font-size: 13px; line-height: 19px; }
.note.ok { background: #1B2410; color: #DDE6C8; }
.note.warn { background: #2A2310; color: #EDE2C2; }
.note.bad { background: #2A1614; color: #F2C5BE; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span:first-child { color: var(--muted); }

/* ── Основной экран ── */
.pos { height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 68px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid #1E2226; }
.topbar .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar .who b { font-weight: 800; font-size: 15px; }
.topbar .who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .grow { flex: 1; }
.topbar .btn { height: 44px; border-radius: 22px; background: var(--panel); font-weight: 700; font-size: 14px; padding: 0 16px; }
.topbar .btn:hover { background: var(--panel-2); }
.status { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 16px; background: var(--panel); font-size: 12px; font-weight: 700; }
.body { flex: 1; display: flex; min-height: 0; }
.groups { width: 190px; flex: none; padding: 14px 8px 14px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.groups button { min-height: 52px; border-radius: 16px; text-align: left; padding: 0 14px; display: flex; align-items: center; gap: 10px; font-size: 15px; color: #C9CED3; }
.groups button:hover { background: var(--panel); }
.groups button.on { background: var(--text); color: var(--bg); font-weight: 800; }
.groups button i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.menu { flex: 1; min-width: 0; padding: 14px 8px; display: flex; flex-direction: column; gap: 12px; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; border-radius: 25px; background: var(--panel); padding: 0 18px; color: var(--muted); flex: none; }
.search input { background: transparent; border: 0; height: 100%; padding: 0; }
.search .btn { height: 36px; padding: 0 12px; font-size: 12px; background: var(--panel-2); }
.search .btn.on { background: var(--coral); color: #2A0E08; }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 118px; gap: 10px; align-content: start; padding-bottom: 14px; }
.tile { position: relative; overflow: hidden; border-radius: 20px; background: var(--panel); padding: 14px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.tile:hover { background: #1E2226; }
.tile:active { transform: scale(.98); }
.tile .bar { position: absolute; left: 0; top: 0; right: 0; height: 4px; }
.tile .name { font-weight: 700; font-size: 15px; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.tile .price { font-weight: 800; font-size: 17px; }
.tile .tag { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.tile.stopped { opacity: .5; }
.tile.stopped .tag { color: var(--coral); }
.tile .qty { position: absolute; right: 10px; top: 12px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--lime); color: var(--on-lime); font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 6px; }

.order { width: 400px; flex: none; margin: 14px 14px 14px 6px; background: var(--panel); border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; }
.order-head { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--panel-2); }
.order-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-title h2 { font-size: 20px; }
.order-title button { color: var(--text); }
.order-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-meta .btn { height: 36px; font-size: 13px; padding: 0 12px; border-radius: 18px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--panel-2); border-radius: 16px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 13px; background: var(--panel-3); font-weight: 800; font-size: 16px; }
.stepper span { min-width: 24px; text-align: center; font-weight: 800; }
.lines { flex: 1; overflow-y: auto; padding: 4px 18px; }
.line { display: flex; align-items: center; gap: 10px; min-height: 60px; border-bottom: 1px solid var(--panel-2); }
.line .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.line .info b { font-weight: 700; font-size: 14px; }
.line .info small { font-size: 12px; color: var(--muted); font-weight: 600; }
.line .info small.c { color: var(--amber); }
.line .info small.k { color: var(--lime); }
.line .sum { width: 70px; text-align: right; font-weight: 800; }
.order-empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.order-foot { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--panel-2); }
.order-foot .kv { font-size: 13px; }
.order-foot .total { display: flex; justify-content: space-between; align-items: baseline; }
.order-foot .total b { font: 600 26px Unbounded, sans-serif; letter-spacing: -0.02em; }
.order-foot .row { display: flex; gap: 8px; }
.order-foot .row .btn { flex: 1; padding: 0 10px; font-size: 14px; min-width: 0; }
.order-foot .row .btn.pay { flex: 1.5; }

/* ── Зал ── */
.hall { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 140px; gap: 14px; }
.table { border-radius: 24px; border: 2px solid #2C3137; background: #14171A; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.table.busy { border-color: var(--lime); background: var(--panel); }
.table.bill { border-color: var(--amber); background: var(--panel); }
.table .n { display: flex; justify-content: space-between; align-items: center; }
.table .n b { font: 600 22px Unbounded, sans-serif; }
.table .n small { font-size: 12px; font-weight: 700; }
.side-list { width: 380px; flex: none; margin: 18px 18px 18px 0; background: var(--panel); border-radius: 26px; padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.oitem { border-radius: 20px; background: var(--panel-2); padding: 14px 16px; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.oitem .tag { width: 44px; height: 44px; border-radius: 14px; color: var(--on-lime); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.oitem .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oitem small { color: var(--muted); font-size: 12px; }

/* ── Окна ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--panel); border-radius: 30px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { font-size: 20px; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.methods button { height: 58px; border-radius: 18px; background: var(--panel-2); font-weight: 800; }
.methods button.on { background: var(--text); color: var(--bg); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick button { height: 48px; border-radius: 16px; background: var(--panel-2); font-weight: 800; }
.change { background: var(--lime); color: var(--on-lime); border-radius: 22px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.change b { font: 600 30px Unbounded, sans-serif; }
.change.bad { background: #2A1614; color: #F2C5BE; }
.receipt-list { display: flex; flex-direction: column; gap: 8px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.report-grid div { background: var(--panel-2); border-radius: 18px; padding: 12px 14px; }
.report-grid small { color: var(--muted); font-size: 12px; display: block; }
.report-grid b { font-size: 18px; font-weight: 800; }
.close-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; padding: 24px; height: calc(100vh - 68px); overflow-y: auto; }
.hero { background: var(--lime); color: var(--on-lime); border-radius: 28px; padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.hero b { font: 600 40px Unbounded, sans-serif; letter-spacing: -0.02em; }
.hero small { font-weight: 700; color: #3A4500; }
.panel { background: var(--panel); border-radius: 26px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.bar-row .name { width: 170px; font-weight: 700; }
.bar-row .track { flex: 1; height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.bar-row .track i { display: block; height: 8px; background: var(--coral); border-radius: 4px; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-weight: 800; padding: 14px 20px; border-radius: 18px; z-index: 200; display: none; max-width: 90vw; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
#toast.err { background: var(--coral); color: #2A0E08; }

/* ── Печать: чек 80 мм ── */
#print { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  html, body { background: #fff !important; overflow: visible; height: auto; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; width: 72mm; margin: 0 auto; padding: 4mm 0; font: 500 11.5px/1.35 'JetBrains Mono', ui-monospace, monospace; }
  #print .c { text-align: center; }
  #print .b { font-weight: 700; }
  #print .big { font-size: 15px; font-weight: 700; }
  #print .huge { font-size: 18px; font-weight: 700; }
  #print .r { display: flex; justify-content: space-between; gap: 8px; }
  #print .r span:first-child { flex: 1; }
  #print hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #print .page { page-break-after: always; }
  #print .page:last-child { page-break-after: auto; }
}

@media (max-width: 1100px) {
  .groups { width: 150px; }
  .order { width: 340px; }
  .pay-grid, .close-grid { grid-template-columns: minmax(0, 1fr); }
  .close-grid { height: auto; }
}
@media (max-width: 820px) {
  html, body { overflow: auto; }
  .pos { height: auto; min-height: 100vh; }
  .body { flex-direction: column; }
  .groups { width: auto; flex-direction: row; overflow-x: auto; padding: 10px 14px 0; }
  .groups button { white-space: nowrap; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .order { width: auto; margin: 0 14px 14px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; }
  .side-list { width: auto; margin: 0 18px 18px; }
  .people, .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
