/* Рабочее место оператора HingalCham.
   Направление: раздача на кухне — холодная сталь, вывесочный шрифт, один
   тёплый акцент (тыква). Шрифты лежат локально: внешних ресурсов нет. */

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/assets/fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/assets/fonts/golos-text-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/assets/fonts/golos-text-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113;
}
@font-face {
  font-family: 'Sofia Sans Condensed';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url('/assets/fonts/sofia-sans-condensed-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Sofia Sans Condensed';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url('/assets/fonts/sofia-sans-condensed-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Sofia Sans Condensed';
  font-style: normal;
  font-display: swap;
  font-weight: 1 1000;
  src: url('/assets/fonts/sofia-sans-condensed-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113;
}

:root {
  /* Палитра */
  --steel: #eef1f4;
  --steel-deep: #e2e7ec;
  --sheet: #ffffff;
  --sheet-raised: #f7f9fb;
  --ink: #16202b;
  --ink-soft: #3b4a59;
  --muted: #5a6878;
  --line: #d5dce4;
  --line-strong: #b9c3ce;
  --pumpkin: #b8520a;
  --pumpkin-deep: #9a4307;
  --pumpkin-tint: #fdf1e6;
  --pumpkin-bright: #f2a54a;

  /* Тона статусов: текст / фон */
  --ok: #1b6e45;
  --ok-bg: #e3f3ea;
  --wait: #2f5d8a;
  --wait-bg: #e4edf6;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --plum: #7a2e6e;
  --plum-bg: #f4e6f1;
  --idle: #4a5868;
  --idle-bg: #e9edf1;

  /* Шрифты */
  --font-body: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  --font-sign: 'Sofia Sans Condensed', 'Bahnschrift', 'Arial Narrow', sans-serif;

  /* Шкала отступов */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  --radius: 6px;
  --radius-lg: 10px;

  /* Слои: основа → приподнятый → плавающий */
  --shadow-raised: 0 1px 0 rgb(22 32 43 / 4%), 0 1px 3px rgb(22 32 43 / 6%);
  --shadow-float: 0 2px 4px rgb(22 32 43 / 6%), 0 12px 32px rgb(22 32 43 / 16%);

  --ease-spring: cubic-bezier(0.2, 0.9, 0.3, 1.15);
  --rail: 92px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--steel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--pumpkin);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--pumpkin-bright);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Вывесочная типографика ─────────────────────────────────────────── */

.sign {
  font-family: var(--font-sign);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.eyebrow {
  font-family: var(--font-sign);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.num {
  font-family: var(--font-sign);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

/* ── Каркас ─────────────────────────────────────────────────────────── */

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Сигнальная лента демонстрационного режима */
.demo-band {
  flex: none;
  padding: 6px var(--s4);
  background: repeating-linear-gradient(-45deg, var(--pumpkin-bright) 0 14px, #f7c078 14px 28px);
  color: var(--ink);
  font-family: var(--font-sign);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 2px solid var(--ink);
}

.offline-band {
  flex: none;
  padding: 6px var(--s4);
  background: var(--bad);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}

.rail {
  background: var(--ink);
  color: #dfe6ee;
  display: flex;
  flex-direction: column;
  padding: var(--s3) 0;
  overflow-y: auto;
}

.rail-brand {
  padding: 0 var(--s2) var(--s3);
  text-align: center;
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
}

.rail-brand span {
  display: block;
  color: var(--pumpkin-bright);
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-link {
  position: relative;
  display: block;
  padding: 10px var(--s2);
  border: 0;
  background: none;
  color: #c3ced9;
  font-family: var(--font-sign);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.rail-link:hover {
  color: #fff;
  background: rgb(255 255 255 / 7%);
}

.rail-link:active {
  background: rgb(255 255 255 / 12%);
}

.rail-link[aria-current='page'] {
  color: #fff;
  background: rgb(255 255 255 / 10%);
}

.rail-link[aria-current='page']::before {
  content: '';
  position: absolute;
  inset: 6px auto 6px 0;
  width: 4px;
  background: var(--pumpkin-bright);
  border-radius: 0 3px 3px 0;
}

.rail-count {
  display: inline-block;
  min-width: 20px;
  margin-top: 2px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}

.rail-foot {
  margin-top: auto;
  padding: var(--s3) var(--s2) 0;
  text-align: center;
  /* Узкий шрифт вывески: «Администратор» и «Старший оператор» помещаются в рейку без разрыва слова. */
  font-family: var(--font-sign);
  font-size: 13px;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: #9fadbb;
  overflow-wrap: break-word;
}

.rail-foot strong {
  display: block;
  color: #fff;
  font-weight: 600;
}

.view {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.page {
  padding: var(--s5);
  max-width: 1280px;
}

.page-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s3) var(--s4);
  margin-bottom: var(--s4);
}

.page-head h1 {
  font-family: var(--font-sign);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.page-head .grow {
  flex: 1;
}

/* ── Кнопки ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms var(--ease-spring);
}

.btn:hover {
  border-color: var(--ink-soft);
  background: var(--sheet-raised);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--pumpkin-deep);
  background: var(--pumpkin);
  color: #fff;
  box-shadow: 0 1px 0 rgb(154 67 7 / 50%), 0 2px 6px rgb(184 82 10 / 25%);
}

.btn-primary:hover {
  border-color: var(--pumpkin-deep);
  background: var(--pumpkin-deep);
}

.btn-danger {
  border-color: var(--bad);
  color: var(--bad);
}

.btn-danger:hover {
  background: var(--bad-bg);
  border-color: var(--bad);
}

.btn-quiet {
  border-color: transparent;
  background: none;
  color: var(--ink-soft);
}

.btn-quiet:hover {
  background: var(--steel-deep);
  border-color: transparent;
}

.btn-wide {
  width: 100%;
  min-height: 42px;
  font-size: 15px;
}

.btn-small {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 13px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ── Поля ───────────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--sheet);
}

.textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-soft);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--steel);
  color: var(--muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  cursor: pointer;
}

.check input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--pumpkin);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
}

.row .grow {
  flex: 1;
  min-width: 0;
}

/* ── Знак статуса: фигура + цвет + слово ────────────────────────────── */

.tone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 3px;
  border-radius: 12px;
  background: var(--idle-bg);
  color: var(--idle);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.tone::before {
  content: '–';
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentcolor;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  -webkit-text-fill-color: #fff;
}

.tone[data-tone='ok'] {
  background: var(--ok-bg);
  color: var(--ok);
}

.tone[data-tone='ok']::before {
  content: '✓';
}

.tone[data-tone='wait'] {
  background: var(--wait-bg);
  color: var(--wait);
}

.tone[data-tone='wait']::before {
  content: '…';
}

.tone[data-tone='bad'] {
  background: var(--bad-bg);
  color: var(--bad);
}

.tone[data-tone='bad']::before {
  content: '!';
}

.tone[data-tone='plum'] {
  background: var(--plum-bg);
  color: var(--plum);
}

.tone[data-tone='plum']::before {
  content: '◆';
  font-size: 9px;
}

/* ── Табло заказа: четыре параллельные дорожки ──────────────────────── */

.lanes {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sheet);
  overflow: hidden;
}

.lane {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: stretch;
  min-height: 38px;
}

.lane + .lane {
  border-top: 1px solid var(--line);
}

.lane-name {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-sign);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.lane-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 6px 10px;
  background: var(--idle-bg);
  color: var(--idle);
  font-weight: 600;
  border-left: 5px solid currentcolor;
}

.lane-state small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  flex-basis: 100%;
}

.lane-state[data-tone='ok'] {
  background: var(--ok-bg);
  color: var(--ok);
}

.lane-state[data-tone='wait'] {
  background: var(--wait-bg);
  color: var(--wait);
}

.lane-state[data-tone='bad'] {
  background: var(--bad-bg);
  color: var(--bad);
}

.lane-state[data-tone='plum'] {
  background: var(--plum-bg);
  color: var(--plum);
}

.lane-state.changed {
  animation: lane-pulse 700ms var(--ease-spring) 1;
}

@keyframes lane-pulse {
  0% {
    opacity: 0.35;
    transform: translateX(-6px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

/* Мини-табло для строк списков: четыре ячейки в том же порядке */
.mini-lanes {
  display: inline-grid;
  grid-template-columns: repeat(4, 12px);
  gap: 2px;
  vertical-align: middle;
}

.mini-lanes i {
  height: 12px;
  border-radius: 2px;
  background: var(--line-strong);
}

.mini-lanes i[data-tone='ok'] {
  background: var(--ok);
}

.mini-lanes i[data-tone='wait'] {
  background: var(--wait);
  border-radius: 50%;
}

.mini-lanes i[data-tone='bad'] {
  background: var(--bad);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 0;
}

.mini-lanes i[data-tone='plum'] {
  background: var(--plum);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  border-radius: 0;
}

/* ── Рабочий экран: три области ─────────────────────────────────────── */

.desk {
  height: 100%;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 392px;
  min-height: 0;
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--sheet);
}

.pane + .pane {
  border-left: 1px solid var(--line);
}

.pane-head {
  flex: none;
  padding: var(--s3) var(--s3) var(--s2);
  border-bottom: 1px solid var(--line);
}

.pane-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.desk-tabs {
  display: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: var(--s2) 0;
}

.chip {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--sheet);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip:active {
  background: var(--steel-deep);
}

.chip[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.conv {
  position: relative;
  display: block;
  width: 100%;
  padding: 10px var(--s3) 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}

.conv:hover {
  background: var(--sheet-raised);
}

.conv:active {
  background: var(--steel);
}

.conv[aria-current='true'] {
  background: var(--pumpkin-tint);
}

.conv[aria-current='true']::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--pumpkin);
}

.conv-top {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}

.conv-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-time {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.conv-preview {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--pumpkin);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.tag {
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 17px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tag[data-tone='bad'] {
  border-color: var(--bad);
  color: var(--bad);
}

.tag[data-tone='wait'] {
  border-color: var(--wait);
  color: var(--wait);
}

.tag[data-tone='demo'] {
  border-color: var(--pumpkin);
  background: var(--pumpkin-tint);
  color: var(--pumpkin-deep);
}

/* Переписка */
.thread-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
}

.thread-title {
  flex: 1;
  min-width: 0;
}

.thread-title h2 {
  overflow: hidden;
  font-family: var(--font-sign);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s4);
  background: var(--steel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg {
  max-width: 76%;
  padding: 7px 11px 5px;
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-raised);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg.is-new {
  animation: msg-in 180ms var(--ease-spring) 1;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.msg[data-dir='in'] {
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.msg[data-dir='out'] {
  align-self: flex-end;
  background: #dff0e4;
  border-bottom-right-radius: 2px;
}

.msg[data-kind='note'] {
  align-self: flex-end;
  background: #fff6d6;
  border: 1px dashed #b89a2e;
  box-shadow: none;
}

.msg[data-kind='system'] {
  align-self: center;
  max-width: 88%;
  padding: 3px 10px;
  background: none;
  box-shadow: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: center;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: normal;
}

.msg-status[data-tone='bad'] {
  color: var(--bad);
  font-weight: 700;
}

.msg-status[data-tone='ok'] {
  color: var(--ok);
  font-weight: 600;
}

.msg-attach {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.msg-attach img {
  display: block;
  max-width: 260px;
  max-height: 220px;
  border-radius: var(--radius);
}

.composer {
  flex: none;
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--line);
  background: var(--sheet);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
}

.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
}

.composer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.notice {
  padding: 8px 12px;
  border-left: 4px solid var(--wait);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--wait-bg);
  color: var(--ink);
  font-size: 13px;
}

.notice[data-tone='bad'] {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.notice[data-tone='ok'] {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.notice[data-tone='demo'] {
  border-color: var(--pumpkin);
  background: var(--pumpkin-tint);
}

.notice ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* Главное действие черновика всегда на виду, даже когда форма длиннее экрана. */
.card-section.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--sheet);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 16px rgb(22 32 43 / 8%);
}

.composer-tools .select {
  width: auto;
  max-width: 220px;
}

/* Карточка клиента и заказа */
.card-section {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
}

.card-section > .eyebrow {
  display: block;
  margin-bottom: var(--s2);
}

.order-title {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}

.order-title .num {
  font-size: 28px;
  line-height: 1;
}

.order-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--s2);
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-strong);
}

.item-name {
  font-weight: 600;
}

.item-mods {
  grid-column: 1;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.item-sum {
  font-family: var(--font-sign);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--sheet);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.qty button:hover {
  border-color: var(--ink);
}

.qty button:active {
  background: var(--steel-deep);
}

.qty output {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--s3);
  margin-top: var(--s2);
}

.totals dt,
.totals dd {
  margin: 0;
}

.totals dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.totals .grand {
  padding-top: 4px;
  border-top: 2px solid var(--ink);
  font-family: var(--font-sign);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.kv {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 3px var(--s2);
  margin: 0;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.panel .kv {
  grid-template-columns: 170px minmax(0, 1fr);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
}

.history li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: var(--s2);
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.history time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: var(--s6) var(--s4);
  text-align: center;
  color: var(--ink-soft);
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-sign);
  font-size: 20px;
  color: var(--ink);
}

/* ── Таблицы разделов ───────────────────────────────────────────────── */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-raised);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
}

.data th,
.data td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data th {
  background: var(--sheet-raised);
  font-family: var(--font-sign);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.data tr:last-child td {
  border-bottom: 0;
}

.data tbody tr.clickable {
  cursor: pointer;
}

.data tbody tr.clickable:hover {
  background: var(--sheet-raised);
}

.data td.right,
.data th.right {
  text-align: right;
}

.panel {
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-raised);
}

.panel + .panel {
  margin-top: var(--s4);
}

.panel > h2 {
  margin-bottom: var(--s3);
  font-family: var(--font-sign);
  font-size: 20px;
  font-weight: 800;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.toolbar .field {
  min-width: 180px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.stat {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sheet);
}

.stat .num {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.stat[data-tone='bad'] {
  border-left-color: var(--bad);
}

.stat[data-tone='ok'] {
  border-left-color: var(--ok);
}

/* ── Диалог ─────────────────────────────────────────────────────────── */

dialog.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

dialog.modal.wide {
  width: min(860px, calc(100vw - 32px));
}

dialog.modal::backdrop {
  background: rgb(22 32 43 / 55%);
}

.modal-head {
  padding: var(--s4) var(--s5) var(--s2);
}

.modal-head h2 {
  font-family: var(--font-sign);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
}

.modal-body {
  padding: var(--s2) var(--s5) var(--s4);
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line);
  background: var(--sheet-raised);
}

.confirm-sum {
  font-family: var(--font-sign);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

/* ── Всплывающие сообщения ──────────────────────────────────────────── */

.toasts {
  /* Сброс стандартного оформления popover: контейнер сам невидим. */
  position: fixed;
  inset: auto auto var(--s4) calc(var(--rail) + var(--s4));
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  flex-direction: column;
  gap: var(--s2);
  width: 264px;
  max-width: calc(100vw - 32px);
}

.toasts:popover-open {
  display: flex;
}

.toast {
  padding: 10px 14px;
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-float);
  animation: msg-in 200ms var(--ease-spring) 1;
}

.toast[data-tone='bad'] {
  border-left-color: #ff8f85;
}

.toast[data-tone='ok'] {
  border-left-color: #7fd6a4;
}

/* ── Вход ───────────────────────────────────────────────────────────── */

.login {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--s5);
  background:
    radial-gradient(900px 500px at 12% 8%, rgb(242 165 74 / 22%), transparent 60%),
    radial-gradient(700px 480px at 92% 96%, rgb(47 93 138 / 16%), transparent 60%),
    var(--steel);
}

.login-card {
  width: min(400px, 100%);
  padding: var(--s6) var(--s5) var(--s5);
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-float);
}

.login-card h1 {
  margin-bottom: 2px;
  font-family: var(--font-sign);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.login-card h1 span {
  color: var(--pumpkin);
}

/* ── Экран кухни: талоны ────────────────────────────────────────────── */

.tickets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s4);
  align-items: start;
}

.ticket {
  border: 1px solid var(--ink);
  border-top: 8px solid var(--ink);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--sheet);
  box-shadow: var(--shadow-raised);
}

.ticket[data-state='new'] {
  border-top-color: var(--pumpkin);
}

.ticket-head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: var(--s3) var(--s4) var(--s2);
  border-bottom: 1px dashed var(--line-strong);
}

.ticket-head .num {
  font-size: 40px;
  line-height: 1;
}

.ticket-body {
  padding: var(--s3) var(--s4);
}

.ticket-items {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.ticket-items li {
  padding: 4px 0;
}

.ticket-items b {
  font-family: var(--font-sign);
  font-size: 20px;
}

.ticket-items small {
  display: block;
  padding-left: 30px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.ticket-foot {
  padding: var(--s3) var(--s4) var(--s4);
  border-top: 1px dashed var(--line-strong);
}

/* ── Узкий экран: области переключаются вкладками ───────────────────── */

@media (max-width: 1180px) {
  .desk {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .desk-tabs {
    display: flex;
    gap: 4px;
    padding: var(--s2) var(--s3);
    border-bottom: 1px solid var(--line);
    background: var(--sheet);
  }

  .desk .pane {
    display: none;
    border-left: 0;
  }

  .desk[data-pane='list'] .pane[data-pane='list'],
  .desk[data-pane='thread'] .pane[data-pane='thread'],
  .desk[data-pane='card'] .pane[data-pane='card'] {
    display: flex;
  }
}

@media (max-width: 720px) {
  .demo-band {
    font-size: 12.5px;
    letter-spacing: 0.02em;
  }

  .toasts {
    inset: auto var(--s3) var(--s3) var(--s3);
    width: auto;
    max-width: none;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .rail {
    flex-direction: row;
    align-items: center;
    padding: 0;
    overflow-x: auto;
  }

  .rail-brand,
  .rail-foot {
    display: none;
  }

  .rail nav {
    flex-direction: row;
  }

  .rail-link[aria-current='page']::before {
    inset: auto 6px 0;
    width: auto;
    height: 4px;
    border-radius: 3px 3px 0 0;
  }

  .page {
    padding: var(--s4);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .msg {
    max-width: 90%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
