/* CENTRAL COFFEE — минимализм: белое/чёрное, капс, разрядка, тонкие линии */

@font-face { font-family: 'Roboto Condensed'; font-weight: 400; font-display: swap; src: url(/fonts/roboto-condensed-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-weight: 400; font-display: swap; src: url(/fonts/roboto-condensed-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto Condensed'; font-weight: 500; font-display: swap; src: url(/fonts/roboto-condensed-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-weight: 500; font-display: swap; src: url(/fonts/roboto-condensed-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Roboto Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/roboto-condensed-cyrillic-600.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Roboto Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/roboto-condensed-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #fff;
  --fg: #000;
  --muted: rgba(26, 26, 46, .5);
  --faint: rgba(26, 26, 46, .35);
  --hair: rgba(0, 0, 0, .1);
  --hover: rgba(0, 0, 0, .035);
  --overlay: rgba(255, 255, 255, .82);
  --neg: #c40000;
  --sans: 'Roboto Condensed', 'DIN', 'Bahnschrift', -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --top: 52px;
}
:root[data-theme="night"] {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .5);
  --faint: rgba(255, 255, 255, .32);
  --hair: rgba(255, 255, 255, .14);
  --hover: rgba(255, 255, 255, .06);
  --overlay: rgba(0, 0, 0, .82);
  --neg: #ff5a5a;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 400 13px/1.45 var(--sans);
  text-transform: uppercase; letter-spacing: 1px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--fg); color: var(--bg); }

.num, .mono { font-family: var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.xs { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.neg { color: var(--neg); }
.right { text-align: right; }
.nocase { text-transform: none; letter-spacing: .2px; }
.hidden { display: none !important; }
.grow { flex: 1; }
.gap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--top); display: flex; align-items: center; gap: 28px;
  padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--hair);
}
.brand { font-weight: 600; letter-spacing: 2px; white-space: nowrap; }
.nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); white-space: nowrap; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--fg); }
.nav a.on { color: var(--fg); border-bottom-color: var(--fg); }
.top .meta { margin-left: auto; display: flex; gap: 20px; align-items: center; white-space: nowrap; }
.top .meta button { color: var(--muted); }
.top .meta button:hover { color: var(--fg); }

.page { padding: 32px 24px 80px; max-width: 1280px; margin: 0 auto; }
.page.narrow { max-width: 560px; }
.h1 { font-size: 22px; font-weight: 500; letter-spacing: 2px; margin-bottom: 4px; }
.h2 { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; padding: 28px 0 10px; border-bottom: 1px solid var(--fg); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.h2:first-child { padding-top: 0; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 1px solid var(--fg);
  background: transparent; white-space: nowrap; transition: background .12s, color .12s;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.primary:hover { opacity: .88; }
.btn.block { width: 100%; }
.btn.big { min-height: 64px; font-size: 15px; letter-spacing: 2px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 11px; }
.btn:disabled { opacity: .3; pointer-events: none; }
.btn.on { background: var(--fg); color: var(--bg); }
.link { color: var(--muted); border-bottom: 1px solid transparent; }
.link:hover { color: var(--fg); border-bottom-color: var(--fg); }
.link.danger:hover { color: var(--neg); border-bottom-color: var(--neg); }

/* ---------- Поля ---------- */
.field { display: block; }
.field > span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 2px; background: transparent;
  border: 0; border-bottom: 1px solid var(--fg); outline: none; border-radius: 0;
}
textarea.input { height: 72px; padding-top: 10px; resize: vertical; text-transform: none; letter-spacing: .2px; }
.input.nocase, input[type=password].input { text-transform: none; letter-spacing: 1px; }
.input:focus { border-bottom-width: 2px; }
.input.money { font: 500 22px var(--mono); letter-spacing: 0; height: 52px; }
.input.money.huge { font-size: 40px; height: 72px; }
select.input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--fg) 50%), linear-gradient(-45deg, transparent 50%, var(--fg) 50%); background-position: right 8px center, right 3px center; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--bg); color: var(--fg); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--fg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.err { color: var(--neg); min-height: 18px; font-size: 11px; }

/* ---------- Сегменты ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 1px; background: var(--fg); border: 1px solid var(--fg); }
.seg > button { flex: 1 1 auto; min-height: 44px; padding: 6px 14px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.seg > button.on { background: var(--fg); color: var(--bg); }
.seg > button.on .xs { color: inherit; opacity: .7; }

/* ---------- Списки-строки (как список туров) ---------- */
.rows { border-top: 1px solid var(--hair); }
.r { display: grid; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); min-height: 52px; }
.r.click { cursor: pointer; }
.r.click:hover { background: var(--hover); }
.r.void { color: var(--faint); }
.r.void .num { text-decoration: line-through; }
.r .sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.empty { padding: 40px 0; color: var(--faint); text-align: center; }

/* ---------- Показатели ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--fg); }
.stat { padding: 18px 20px 20px 0; border-bottom: 1px solid var(--hair); }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--hair); }
.stat .v { font: 500 26px/1.2 var(--mono); letter-spacing: -.5px; margin-top: 8px; }
.stat .v small { font-size: 11px; color: var(--muted); letter-spacing: 1px; font-family: var(--sans); margin-left: 4px; }
.stat .d { font-size: 10px; color: var(--muted); margin-top: 6px; }
.nowrow { grid-template-columns: 1.2fr 1fr 1fr 1fr auto; border-bottom: 1px solid var(--fg) !important; padding: 22px 0 !important; }
.live { display: inline-block; width: 7px; height: 7px; background: var(--fg); border-radius: 50%; margin-right: 8px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .2; } }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 24px; }
.login .head { display: flex; justify-content: space-between; }
.login .center { width: 100%; max-width: 440px; margin: 0 auto; align-self: center; }
.login .title { font-size: 34px; font-weight: 500; letter-spacing: 6px; line-height: 1.1; margin-bottom: 6px; }
.login .names .r { grid-template-columns: 1fr auto; font-size: 15px; letter-spacing: 2px; }
.login .foot { display: flex; justify-content: space-between; }

/* ---------- Касса ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; height: calc(100vh - var(--top)); }
.pos .left { display: flex; flex-direction: column; min-width: 0; }
.cats { display: flex; gap: 28px; padding: 18px 24px 0; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.cats button { padding: 0 0 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.cats button.on { color: var(--fg); border-bottom-color: var(--fg); }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-rows: 118px; align-content: start; }
.tile { text-align: left; padding: 16px 18px; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); display: flex; flex-direction: column; justify-content: space-between; transition: background .1s; }
.tile:hover { background: var(--hover); }
.tile:active { background: var(--fg); color: var(--bg); }
.tile:active .xs { color: inherit; }
.tile .n { font-size: 14px; font-weight: 500; letter-spacing: 1.5px; }
.tile .p { font: 400 13px var(--mono); }

.order { border-left: 1px solid var(--fg); display: flex; flex-direction: column; min-height: 0; }
.order .oh { display: flex; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--hair); }
.order .lines { flex: 1; overflow-y: auto; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 20px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.line:hover { background: var(--hover); }
.line .nm { font-weight: 500; }
.line .md { grid-column: 1 / -1; font-size: 10px; color: var(--muted); }
.line .ctl { display: flex; align-items: center; gap: 2px; }
.qty { width: 30px; height: 30px; border: 1px solid var(--hair); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); }
.qty:hover { border-color: var(--fg); }
.order .foot { border-top: 1px solid var(--fg); padding: 14px 20px 20px; }
.order .sumrow { display: flex; justify-content: space-between; padding: 3px 0; }
.order .total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 14px; }
.order .total .num { font-size: 30px; font-weight: 500; }
.pay { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pay .btn { min-height: 60px; }

/* ---------- Модальные окна ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); animation: fade .12s; }
.modal { background: var(--bg); border: 1px solid var(--fg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { max-width: 760px; }
.modal .mh { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 24px; border-bottom: 1px solid var(--hair); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.modal .mh .t { font-size: 16px; font-weight: 500; letter-spacing: 2px; }
.modal .mb { padding: 20px 24px; }
.modal .mb > * + * { margin-top: 18px; }
.modal .mf { padding: 16px 24px 24px; display: flex; gap: 10px; }
.modal .mf .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--fg); color: var(--bg); padding: 14px 22px; max-width: calc(100vw - 32px); animation: fade .15s; }
.toast.err { background: var(--neg); color: #fff; }

/* ---------- Таблицы ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 10px; color: var(--muted); font-weight: 400; text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--fg); white-space: nowrap; }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--hover); }
.table .num { white-space: nowrap; }
.table th.right, .table td.right { text-align: right; }
.scroll-x { overflow-x: auto; }

/* ---------- Диаграммы ---------- */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--fg); padding-top: 12px; }
.bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bars .col > i { display: block; width: 100%; max-width: 48px; background: var(--fg); border-radius: 4px 4px 0 0; }
.bars .col:hover > i { opacity: .6; }
.bars-x { display: flex; gap: 2px; margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 9px; color: var(--muted); letter-spacing: 0; overflow: hidden; }
.meter { height: 4px; background: var(--hair); margin-top: 6px; }
.meter > i { display: block; height: 100%; background: var(--fg); }
.tip { position: fixed; z-index: 80; pointer-events: none; background: var(--fg); color: var(--bg); padding: 8px 10px; font-size: 11px; white-space: nowrap; }

/* ---------- Админ: меню ---------- */
.menu-grid { display: grid; grid-template-columns: 240px 1fr; gap: 40px; }
.side a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--hair); color: var(--muted); }
.side a.on, .side a:hover { color: var(--fg); }
.vrow { display: grid; grid-template-columns: 1fr 160px 32px; gap: 12px; align-items: end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--hair); padding: 6px 10px; font-size: 11px; display: inline-flex; gap: 8px; align-items: center; }
.chip button { color: var(--muted); }
.tag { display: inline-block; font-size: 9px; border: 1px solid currentColor; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; color: var(--muted); }

@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr 340px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
  .top { height: auto; flex-wrap: wrap; padding: 12px 16px 0; gap: 10px 16px; }
  .top .nav { order: 3; width: 100%; padding-bottom: 10px; }
  .top .meta { gap: 14px; }
  .top .meta .who, .top .meta [data-clock] { display: none; }
  .page .r { grid-template-columns: 1fr auto !important; gap: 6px 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--hair); }
  .stat .v { font-size: 20px; }
  .nowrow > .gap { grid-column: 1 / -1; }
  .h1 { font-size: 18px; }
  .page { padding: 24px 16px 80px; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .order { border-left: 0; border-top: 1px solid var(--fg); }
  .grid2, .grid3, .menu-grid { grid-template-columns: 1fr; }
}
@media print {
  .top, .noprint { display: none !important; }
}
