/* Self-hosted fonts (SIL OFL 1.1) — Manrope + Space Grotesk. Licenses: fonts/OFL-Manrope.txt, fonts/OFL-SpaceGrotesk.txt */
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/manrope-400-cyrillic.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/manrope-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/manrope-400-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/manrope-500-cyrillic.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/manrope-500-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/manrope-500-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/manrope-600-cyrillic.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/manrope-600-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/manrope-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/manrope-700-cyrillic.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/manrope-700-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/manrope-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('../fonts/manrope-800-cyrillic.woff2') format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('../fonts/manrope-800-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Manrope';font-style:normal;font-weight:800;font-display:swap;src:url('../fonts/manrope-800-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/spacegrotesk-500-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/spacegrotesk-500-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/spacegrotesk-600-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/spacegrotesk-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/spacegrotesk-700-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/spacegrotesk-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
/* Kitchen Display — light, high-contrast, touch-first. Zero external deps.
   Fonts self-hosted (SIL OFL 1.1): Manrope (body + Cyrillic) and Space Grotesk
   (numeric/latin display accents; it has no Cyrillic → Manrope is the fallback
   so Russian text stays crisp). @font-face rules are prepended above. */
:root {
  --bg: #f5f6f8;
  --ink: #14161a;
  --muted: #6b7280;
  --line: #e6e8ec;
  --card: #ffffff;
  --blue: #2563eb;
  --font-body: 'Manrope', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Space Grotesk', 'Manrope', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font-body);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

@keyframes kds-ring { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.45);} 70% { box-shadow: 0 0 0 12px rgba(37,99,235,0);} 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0);} }
@keyframes kds-dot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes kds-shake { 10%,90%{transform:translateX(-1px)} 30%,70%{transform:translateX(-4px)} 50%{transform:translateX(4px)} }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.conn.ok .conn-dot { background: #16a34a; }
.conn.off { color: #c81e1e; } .conn.off .conn-dot { background: #dc2626; animation: kds-dot 1s infinite; }
.upd { font-size: 13px; color: var(--muted); }
.demo-tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: #6d28d9; background: #f0eafb; padding: 5px 9px; border-radius: 999px; }
.ghost-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 10px; min-height: 40px; cursor: pointer; }

/* ── Tabbar (narrow) ────────────────────────────────────── */
.tabbar { flex: none; display: none; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  font-weight: 800; font-size: 16px; color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab.active .count-badge { background: rgba(255,255,255,.22); color: #fff; }
.tab-label { letter-spacing: -.01em; }

.count-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: #eef1f5; color: var(--ink); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

/* ── Board ──────────────────────────────────────────────── */
.board { flex: 1; min-height: 0; display: grid; gap: 14px; padding: 14px; }
.column { min-height: 0; display: flex; flex-direction: column; background: #eef0f3; border-radius: 16px; padding: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.col-title { font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.col-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px; -webkit-overflow-scrolling: touch; }
.empty { text-align: center; color: #b6bcc6; font-size: 22px; padding: 24px 0; }

/* Kanban (wide): 3 columns, hide tabbar */
body.mode-kanban .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.mode-kanban .tabbar { display: none; }
body.mode-kanban .column { display: flex; }

/* Tabs (narrow / tablet portrait): one column, cards stacked vertically */
body.mode-tabs .board { grid-template-columns: 1fr; }
body.mode-tabs .tabbar { display: flex; }
body.mode-tabs .column { display: none; background: transparent; padding: 0; }
body.mode-tabs .column.active { display: flex; }
body.mode-tabs .col-head { display: none; }

/* ── Card (matches KdsTicket.dc.html) ───────────────────── */
.card {
  position: relative; box-sizing: border-box; width: 100%;
  background: var(--card); border: 1.5px solid var(--line); border-left: 6px solid #475569;
  border-radius: 16px; padding: 20px;
  box-shadow: 0 1px 2px rgba(20,22,26,.05), 0 6px 16px rgba(20,22,26,.05);
}
.card.is-new { border: 2px solid var(--blue); border-left: 6px solid #475569; animation: kds-ring 1.8s ease-out infinite; }
.card.is-overdue { border: 2px solid #dc2626; border-left: 6px solid #6d28d9; }

.new-badge { position: absolute; top: -12px; right: 14px; display: flex; align-items: center; gap: 6px; background: var(--blue); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .06em; padding: 6px 9px; border-radius: 999px; z-index: 2; }
.new-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: kds-dot 1s infinite; }

.card-head { display: flex; align-items: flex-start; gap: 14px; }
.type-icon { flex: none; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.type-icon svg { width: 26px; height: 26px; }
.title-wrap { flex: 1; min-width: 0; }
.card-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; color: var(--ink); letter-spacing: -.01em; }
.card-sub { margin-top: 5px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.card-meta { flex: none; text-align: right; }
.serve { padding: 6px 9px; border-radius: 9px; background: #f0eafb; color: #6d28d9; }
.serve.urgent { background: #fdeaea; color: #c81e1e; }
.serve-label { font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.serve-time { margin-top: 3px; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.ago { margin-top: 6px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-weight: 600; font-size: 15px; color: var(--muted); }
.ago.overdue { color: #dc2626; }
.ago-icon svg { width: 14px; height: 14px; display: block; }

.divider { height: 1px; background: #eceef1; margin: 16px 0; }

.items { display: flex; flex-direction: column; gap: 12px; }
.item { display: flex; align-items: flex-start; gap: 10px; }
.qty { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 30px; text-align: center; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 19px; line-height: 1.25; color: var(--ink); }
.mods { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; background: #fff4ec; border: 1px solid #fde0cd; color: #c2410c; font-weight: 600; font-size: 14px; padding: 4px 8px; border-radius: 7px; }
.item-note { margin-top: 4px; font-weight: 600; font-size: 13px; color: #6b7280; }

.comment { margin-top: 16px; display: flex; align-items: flex-start; gap: 8px; background: #fff8e6; border: 1.5px solid #fce6a8; border-radius: 10px; padding: 10px 12px; }
.comment-icon { flex: none; margin-top: 1px; color: #b45309; }
.comment-icon svg { width: 18px; height: 18px; display: block; }
.comment-text { font-weight: 700; font-size: 15px; line-height: 1.35; color: #92400e; }

.overdue-banner { margin-top: 16px; display: flex; align-items: center; gap: 7px; background: #fdeaea; border: 1.5px solid #f5b5b5; border-radius: 10px; padding: 8px 12px; color: #c81e1e; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.overdue-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: kds-dot .9s infinite; }

.action-btn { margin-top: 16px; width: 100%; min-height: 56px; border: none; border-radius: 12px; color: #fff; font-weight: 800; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; }
.action-btn:active { transform: translateY(2px); }
.btn-arrow svg { width: 20px; height: 20px; display: block; }
.done-chip { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 12px; background: #eaf7ee; color: #15803d; font-weight: 800; font-size: 18px; }
.done-icon svg { width: 20px; height: 20px; display: block; }

/* ── Enrollment ─────────────────────────────────────────── */
.enroll { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.enroll-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 34px 30px 30px; box-shadow: 0 10px 40px rgba(20,22,26,.08); text-align: center; }
.enroll-logo { font-weight: 800; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.enroll-title { margin: 10px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.enroll-hint { margin: 0 0 22px; color: var(--muted); font-size: 16px; font-weight: 500; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; background: #e2e6eb; transition: transform .1s, background .1s; }
.pin-dot.filled { background: var(--blue); transform: scale(1.15); }
.enroll-error { min-height: 22px; color: #dc2626; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.enroll-error.shake { animation: kds-shake .4s; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pad-key { min-height: 72px; border: 1.5px solid var(--line); background: #fff; border-radius: 16px; font-weight: 700; font-size: 30px; color: var(--ink); cursor: pointer; user-select: none; }
.pad-key:active { background: #eef1f5; transform: translateY(1px); }
.pad-key.spacer { border: none; background: transparent; cursor: default; }
.pad-key.back { font-size: 26px; color: var(--muted); }
.pad.busy { opacity: .5; pointer-events: none; }

/* ── Toast ──────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 20px; opacity: 0; pointer-events: none; background: #14161a; color: #fff; font-weight: 700; font-size: 15px; padding: 13px 20px; border-radius: 12px; transition: opacity .2s, translate .2s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast.error { background: #c81e1e; }
