/* Quickly Partner — планшет у кассы: тёмная тема, синий акцент, крупный тап. */
:root {
  --bg: #0b0f17;
  --panel: #131a26;
  --panel-2: #1a2333;
  --line: #243048;
  --text: #e9eef7;
  --muted: #8a97ae;
  --blue: #2f7bff;
  --blue-dim: #1f5bd0;
  --yellow: #ffb020;
  --green: #24c07a;
  --red: #ff4d4f;
  --radius: 16px;
  --tap: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overscroll-behavior-y: none;
}
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--red); font-size: 14px; }

/* --- Вход --- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.logo { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.logo span { color: var(--blue); }
input, select {
  height: var(--tap); padding: 0 16px; font-size: 17px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; width: 100%;
}
input:focus { outline: 2px solid var(--blue); border-color: transparent; }

/* --- Кнопки --- */
.btn {
  min-height: var(--tap); padding: 0 18px; font-size: 16px; font-weight: 600; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.btn.primary:active { background: var(--blue-dim); }
.btn.big { width: 100%; font-size: 18px; min-height: 60px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #4a2230; color: #ff8b8c; }
.btn.pause { border-color: #4a2230; color: #ff8b8c; }
.btn.pause.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip {
  height: 36px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); cursor: pointer;
}
.chip.on { color: var(--text); border-color: var(--blue); }
.chip.conn.live { color: var(--green); border-color: #1d4f3c; }

/* --- Каркас --- */
.app { display: flex; flex-direction: column; min-height: 100%; }
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.cafe-name { font-size: 18px; font-weight: 700; }
.top-right { display: flex; gap: 8px; align-items: center; }
main { flex: 1; padding: 16px 16px 96px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }

/* --- Полосы заказов --- */
[data-screen='orders'] { display: grid; gap: 18px; }
@media (min-width: 900px) {
  [data-screen='orders'] { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .today-fold { grid-column: 1 / -1; }
}
.lane-title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.lane-title.new { color: var(--yellow); }
.lane-title.prep { color: var(--blue); }
.lane-title.ready { color: var(--green); }
.count { background: var(--panel-2); border-radius: 999px; padding: 2px 9px; font-size: 13px; color: var(--text); }
.cards { display: grid; gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.card.new { border-color: #4a3a12; box-shadow: inset 3px 0 0 var(--yellow); }
.card.preparing { box-shadow: inset 3px 0 0 var(--blue); }
.card.ready { box-shadow: inset 3px 0 0 var(--green); }
.card.done { opacity: 0.6; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.short-id { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; }
.who { color: var(--muted); font-size: 14px; }
.lines { margin: 10px 0; display: grid; gap: 4px; }
.line { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.line .qty { color: var(--blue); font-weight: 700; }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.total { font-size: 18px; font-weight: 700; color: var(--text); }
.timer { font-variant-numeric: tabular-nums; color: var(--yellow); font-weight: 600; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions .btn { flex: 1; }
.empty { color: var(--muted); font-size: 14px; padding: 10px 2px; }
.today-fold { border-top: 1px solid var(--line); padding-top: 12px; }
.today-fold summary { cursor: pointer; color: var(--muted); padding: 8px 0; }

/* --- Меню --- */
.cat { margin: 18px 0 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px;
}
.item .name { flex: 1; font-size: 16px; }
.item.off .name { color: var(--muted); text-decoration: line-through; }
.price-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; height: 44px; padding: 0 12px; font-size: 16px; cursor: pointer; }
.toggle { width: 62px; height: 34px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); position: relative; cursor: pointer; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--muted); transition: 0.15s; }
.toggle.on { background: rgba(47, 123, 255, 0.25); border-color: var(--blue); }
.toggle.on::after { left: 31px; background: var(--blue); }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 6px; }

/* --- Сводка --- */
.seg { display: flex; gap: 6px; background: var(--panel); padding: 6px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px; }
.seg-btn { flex: 1; height: 44px; border: none; background: none; color: var(--muted); font-size: 15px; border-radius: 8px; cursor: pointer; }
.seg-btn.active { background: var(--blue); color: #fff; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .v { font-size: 24px; font-weight: 700; }
.tile .k { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 120px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.bar { flex: 1; background: var(--blue-dim); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--muted); }
.hours { padding-bottom: 28px; }

/* --- Настройки --- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
[data-screen='settings'] .btn { margin-bottom: 12px; }

/* --- Табы --- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--panel);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; min-height: 64px; background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer;
}
.tab.active { color: var(--blue); font-weight: 600; }
.badge { background: var(--yellow); color: #17202e; border-radius: 999px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-left: 4px; }

/* --- Лист --- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.sheet-body {
  position: relative; width: 100%; max-height: 86vh; overflow: auto; background: var(--panel);
  border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  display: grid; gap: 12px;
}
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; justify-content: center; }
  .sheet-body { max-width: 520px; border-radius: 20px; border: 1px solid var(--line); }
}
.sheet-title { font-size: 19px; font-weight: 700; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }

/* --- Тост --- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 12px; z-index: 30; max-width: 90vw;
}
