* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --accent: #e11d48; --accent-dark: #be123c; --accent-soft: #fff1f2;
  --bg: #f4f5f7; --line: #e5e7eb; --muted: #6b7280; --text: #1f2328;
}
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 340px; }
.login-card h1 { font-size: 20px; margin: 0 0 16px; }
.error-text { color: #dc2626; min-height: 1em; margin: 8px 0 0; }

/* ---------- Шапка ---------- */
header {
  background: #111827; color: #fff; padding: 10px 18px; display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 16px; flex: none; }
/* Все вкладки — одной строкой; если не влезают на узком мониторе, строка прокручивается по горизонтали */
nav { display: flex; gap: 4px; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; align-items: center; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav button { background: transparent; color: #d1d5db; border: 0; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; flex: none; }
nav button:hover { background: #374151; color: #fff; }
nav button.active { background: #374151; color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
nav button.pos-tab {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; padding: 11px 22px;
  border-radius: 8px; box-shadow: 0 2px 8px rgba(225, 29, 72, .4); margin-right: 6px;
}
nav button.pos-tab:hover { background: var(--accent-dark); }
nav button.pos-tab.active { background: var(--accent-dark); box-shadow: none; }
.count:not(:empty) { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 12px; margin-left: 2px; }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #d1d5db; flex: none; }
.role-badge { background: #374151; border-radius: 4px; padding: 1px 6px; font-size: 11px; text-transform: uppercase; }
/* Кнопка «кто работает» — та же геометрия, что у «Новый заказ», только светлая */
.acct-btn {
  background: #f3f4f6; color: #111827; border: 0; font-weight: 700; font-size: 16px; padding: 11px 22px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; font-family: inherit; line-height: inherit;
}
.acct-btn:hover { background: #fff; }

main { padding: 16px; max-width: 1600px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }

/* ---------- Сетки и карточки ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2.narrow-left { grid-template-columns: 1fr 2fr; }
.grid-2.wide-left { grid-template-columns: 3fr 2fr; }
@media (max-width: 1000px) { .grid-2, .grid-2.narrow-left, .grid-2.wide-left { grid-template-columns: 1fr; } }
.card { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07); margin-bottom: 16px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h2 .small, h2 .hint { margin-left: auto; font-weight: 400; }

/* ---------- Формы ---------- */
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 9px; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #fecdd3; border-color: var(--accent); }
textarea { resize: vertical; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 100px; }
.row > .grow, .row > label.grow { flex: 2; }
form.row { margin-bottom: 10px; }
.qty { width: 80px; }
.filter { width: 100%; margin: 10px 0 0; }
details { margin-bottom: 9px; font-size: 13px; color: var(--muted); }
details summary { cursor: pointer; margin-bottom: 6px; }
kbd { background: #f3f4f6; border: 1px solid #d1d5db; border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: 11px; }

button { font: inherit; padding: 7px 12px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; white-space: nowrap; color: var(--text); }
button:hover { background: #f3f4f6; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); }
button.big { padding: 11px 16px; font-size: 15px; font-weight: 600; }
button.wide { width: 100%; }
button.small { padding: 2px 8px; font-size: 12px; }
button.ghost { background: transparent; border-color: transparent; color: inherit; }
header button.ghost { color: #d1d5db; border-color: #4b5563; }
button.danger { color: #b91c1c; }
button.success { background: #16a34a; border-color: #16a34a; color: #fff; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chips button { border-radius: 16px; padding: 4px 12px; font-size: 13px; }
.chips button.active { background: #111827; border-color: #111827; color: #fff; }
.small-chips button { padding: 2px 10px; font-size: 12px; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 6px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl tr.low td { background: #fef2f2; }
.tbl tr.group-row td { background: #f9fafb; font-weight: 600; font-size: 12px; color: var(--muted); }
.tbl tr.inactive td { opacity: .5; }
.muted { color: #9ca3af; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 5px; background: #e5e7eb; color: #374151; vertical-align: 1px; }
.tag.set { background: #fde68a; color: #92400e; }
.tag.pack { background: #e0e7ff; color: #3730a3; }
.plus { color: #16a34a; } .minus { color: #dc2626; }

.totals { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin: 10px 0; line-height: 1.7; }
.totals .line { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; border-top: 1px dashed #fda4af; margin-top: 4px; padding-top: 4px; }
.totals .warn { color: #b91c1c; font-weight: 600; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1250px) { .pos { grid-template-columns: 1fr 1fr; } .pos-client { grid-column: 1 / -1; } }
@media (max-width: 800px) { .pos { grid-template-columns: 1fr; } }
.pos .card { margin-bottom: 0; }
.pos-cart { position: sticky; top: 70px; }
/* Касса на ПК: три колонки на высоту экрана, каждая прокручивается отдельно */
@media (min-width: 1251px) {
  .pos { height: calc(100vh - var(--hdr, 64px) - 32px); align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  body:has(#tab-pos.active) { overflow: hidden; } /* сама страница на кассе не листается — только колонки */
  .pos > .card { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
  .pos-cart { position: static; }
  .pos-menu { display: flex; flex-direction: column; }
  .pos-menu > #pos-grid { overflow-y: auto; min-height: 0; flex: 1; align-content: start; }
  .pos > .pos-menu { overflow: hidden; }
}
/* Категории — одной строкой, лишнее прокручивается вбок */
#pos-categories { flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
#pos-categories button, #pos-categories .pos-subcats { flex: none; white-space: nowrap; }
#pos-categories button { font-size: 12px; padding: 3px 9px; }
/* Касса: без полос прокрутки — листается колесом / пальцем */
.pos > .card, .pos #pos-grid, #pos-categories, #pos-results { scrollbar-width: none; -ms-overflow-style: none; }
.pos > .card::-webkit-scrollbar, .pos #pos-grid::-webkit-scrollbar, #pos-categories::-webkit-scrollbar, #pos-results::-webkit-scrollbar { display: none; }
#pos-categories .pos-subcats { display: flex; gap: 6px; border: 0; border-left: 1px dashed #d1d5db; margin: 0; padding: 0 0 0 6px; }
.search-box { position: relative; margin-bottom: 8px; }
#pos-search { width: 100%; font-size: 17px; padding: 11px 14px; border-width: 2px; }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; z-index: 15;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 420px; overflow: auto;
}
.result { display: flex; justify-content: space-between; gap: 8px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.result.active, .result:hover { background: var(--accent-soft); }
.result mark { background: #fde68a; border-radius: 2px; }
.result .price { font-weight: 600; white-space: nowrap; }
.result small { color: var(--muted); display: block; }
.result.empty { color: var(--muted); cursor: default; }
.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  text-align: left; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 4px; min-height: 76px; white-space: normal;
}
.tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.tile b { font-weight: 600; font-size: 13px; }
.tile span { color: var(--muted); font-size: 12px; margin-top: auto; }
.cart { max-height: 38vh; overflow: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.cart-line.flash { animation: flash .6s; }
@keyframes flash { from { background: #fde68a; } to { background: transparent; } }
.cart-line .name { font-size: 13px; }
.cart-line .name small { display: block; color: var(--muted); font-size: 11px; }
.cart-line .q { display: flex; align-items: center; gap: 2px; }
.cart-line .q button { padding: 2px 8px; }
.cart-line .q input { width: 44px; text-align: center; padding: 4px; }
.cart-line .sum { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.cart-empty { color: var(--muted); padding: 16px 0; text-align: center; }
.cutlery { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper span { flex: 1; }
.stepper input { width: 52px; text-align: center; }
.stepper button { padding: 4px 11px; }
.segmented { display: flex; margin-bottom: 10px; }
.segmented button { flex: 1; border-radius: 0; margin-left: -1px; padding: 8px 4px; }
.segmented button:first-child { border-radius: 6px 0 0 6px; }
.segmented button:last-child { border-radius: 0 6px 6px 0; }
.segmented button.active { background: #111827; border-color: #111827; color: #fff; }

/* ---------- Заказы ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.order { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07); border-left: 4px solid #d1d5db; display: flex; flex-direction: column; gap: 5px; }
.order.new { border-left-color: #2563eb; } .order.cooking { border-left-color: #f59e0b; }
.order.ready { border-left-color: #16a34a; } .order.picked_up, .order.on_the_way { border-left-color: #7c3aed; }
.order.delivered { border-left-color: #10b981; opacity: .85; } .order.cancelled { border-left-color: #ef4444; opacity: .7; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-head b { font-size: 16px; }
.order small { color: var(--muted); }
.order .items { background: #f9fafb; border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.order .items small { display: block; padding-left: 14px; }
.order .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.order .actions select { flex: 1; min-width: 120px; padding: 5px; }
.elapsed { font-size: 12px; font-weight: 600; color: var(--muted); }
.elapsed.late { color: #d97706; } .elapsed.very-late { color: #dc2626; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #e5e7eb; }
.badge.new { background: #dbeafe; color: #1d4ed8; } .badge.cooking { background: #fef3c7; color: #b45309; }
.badge.ready { background: #dcfce7; color: #15803d; } .badge.picked_up, .badge.on_the_way { background: #ede9fe; color: #6d28d9; }
.badge.delivered { background: #d1fae5; color: #047857; } .badge.cancelled { background: #fee2e2; color: #b91c1c; }
.empty-state { color: var(--muted); padding: 40px; text-align: center; grid-column: 1 / -1; }

/* ---------- Финансы ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.kpi small { color: var(--muted); display: block; font-size: 12px; }
.kpi b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi.main b { color: var(--accent); }

#toast {
  position: fixed; bottom: 20px; right: 20px; padding: 12px 18px; border-radius: 8px; color: #fff; background: #16a34a;
  opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; max-width: 420px; z-index: 100; white-space: pre-line;
}
#toast.show { opacity: 1; transform: none; }
#toast.error { background: #dc2626; }
#toast.warn { background: #d97706; }

/* ---------- Сотрудники / зарплата ---------- */
.pay-block { background: #f9fafb; border-radius: 8px; padding: 10px 10px 2px; margin-bottom: 10px; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays input { padding: 6px 4px; text-align: center; }
.on-shift { color: #16a34a; font-weight: 600; font-size: 12px; }
.paid-row td { color: #6b7280; }
.calc-note { font-size: 11px; color: var(--muted); max-width: 340px; }
.adj-plus { color: #16a34a; } .adj-minus { color: #dc2626; }
.single-check { display: flex; flex-direction: row; align-items: center; gap: 4px; margin: 0; font-size: 12px; color: var(--text); }

/* ---------- Мобильные экраны для панели ---------- */
@media (max-width: 700px) {
  header { padding: 8px 10px; gap: 8px; }
  .logo img { height: 30px; } .logo .logo-word { height: 21px; }
  nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav button { flex: none; }
  nav button.pos-tab { padding: 9px 16px; font-size: 14px; }
  .acct-btn { padding: 9px 16px; font-size: 14px; }
  .me { margin-left: auto; }
  main { padding: 10px; }
  .card { padding: 12px; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .orders-grid { grid-template-columns: 1fr; }
  .weekdays { grid-template-columns: repeat(4, 1fr); }
  input, select, textarea { font-size: 16px; } /* iOS не зумит поле при фокусе */
}

/* ---------- Модальное окно ---------- */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 120; display: grid; place-items: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 20px; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-box h2 { font-size: 18px; margin: 0 0 6px; }
.modal-box p { color: var(--muted); margin: 0 0 14px; }
.modal-buttons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.modal-buttons button { text-align: left; }
.modal-buttons small { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.modal-box > .ghost { width: 100%; color: var(--muted); }

/* ---------- Тип заказа и время ---------- */
.type-badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #e0f2fe; color: #0369a1; margin-right: auto; margin-left: 6px; }
.type-badge.pickup { background: #fef3c7; color: #92400e; }
.when { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.when .elapsed { margin-left: auto; }
.when.soon { color: #d97706; }
.when.late { color: #dc2626; }
.warn-text { color: #d97706; }
#pos-type, #pos-time-mode { margin-bottom: 10px; }

/* ---------- Оплата при выдаче ---------- */
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-methods button { padding: 12px 4px; font-weight: 600; }
.pay-methods button.active { background: #111827; border-color: #111827; color: #fff; }
.pay-box .wide { margin-top: 6px; }
.change-out { font-size: 18px; font-weight: 700; color: #16a34a; margin-bottom: 8px; }

/* ---------- Касса ---------- */
.reg-date { margin-left: auto; font-size: 13px; padding: 4px 6px; }
.reg-formula { display: grid; gap: 4px; font-size: 15px; }
.reg-formula .line { display: flex; justify-content: space-between; padding: 4px 0; }
.reg-formula .minus span:last-child { color: #dc2626; }
.reg-formula .result { font-size: 22px; font-weight: 700; border-top: 2px solid #111827; padding-top: 8px; }
.reg-formula .result span:last-child { color: var(--accent); }
.reg-extra { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reg-extra div { background: #f9fafb; border-radius: 8px; padding: 8px 10px; }
.reg-extra small { display: block; color: var(--muted); font-size: 12px; }
.photo-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.btn-like { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; border: 1px dashed #9ca3af;
  border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; margin: 0; }
#exp-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.exp { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f1f3; }
.exp:last-child { border-bottom: 0; }
.exp .thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; background: #f3f4f6; }
.exp .nothumb { width: 56px; height: 56px; border-radius: 6px; display: grid; place-items: center; background: #fef3c7; color: #92400e; font-size: 11px; text-align: center; }
.exp small { color: var(--muted); display: block; }
.exp .amt { text-align: right; font-weight: 700; white-space: nowrap; }
.exp.rejected { opacity: .55; }
.exp.rejected .amt { text-decoration: line-through; }
.photo-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 130; display: grid; place-items: center; cursor: zoom-out; }
.photo-viewer img { max-width: 95vw; max-height: 92vh; border-radius: 6px; }
@media (max-width: 700px) { .reg-extra { grid-template-columns: 1fr 1fr; } }

.reg-formula .sub { color: var(--muted); font-size: 13px; padding-top: 0; }
.exp .nothumb.salary { background: #dcfce7; color: #166534; font-size: 22px; }
@media (min-width: 701px) and (max-width: 1500px) {
  nav button { padding: 7px 9px; font-size: 13.5px; } header { gap: 10px; }
  /* на узком мониторе две крупные кнопки чуть компактнее — но по-прежнему одинаковые */
  nav button.pos-tab, .acct-btn { padding: 10px 16px; font-size: 15px; }
}

/* ---------- Финансы по дням ---------- */
.fd-wrap { overflow-x: auto; }
.tbl.fd th, .tbl.fd td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl.fd th:first-child, .tbl.fd td:first-child { text-align: left; }
.tbl.fd th { position: sticky; top: 0; background: #fff; }
.tbl.fd td.neg { color: #dc2626; }
.tbl.fd td.cum { background: #f8fafc; font-weight: 600; }
.tbl.fd tr.weekend td:first-child { color: #e11d48; }
.tbl.fd tr.empty td:not(:first-child) { color: #cbd5e1; }
.fund-tag { font-size: 11px; border-radius: 4px; padding: 0 5px; background: #e0f2fe; color: #0369a1; margin-left: 4px; }
.fund-tag.cash { background: #dcfce7; color: #166534; }

/* ---------- Предзаказы ---------- */
input.full { width: 100%; margin-bottom: 6px; }
.preorder-hint { background: #ede9fe; color: #5b21b6; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.slot-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-bottom: 8px; }
.slot-chips button { padding: 7px 6px; font-size: 13px; text-align: center; line-height: 1.2; }
.slot-chips button small { display: block; font-size: 11px; color: var(--muted); }
.slot-chips button.active { background: #111827; border-color: #111827; color: #fff; }
.slot-chips button.active small { color: #d1d5db; }
.slot-chips button:disabled { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.pre-badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #ede9fe; color: #6d28d9; }
.chips .hol { border-color: #c4b5fd; }
.chips .hol.active { background: #6d28d9; border-color: #6d28d9; }
.plan { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 1000px) { .plan { grid-template-columns: 1fr; } }
.plan .card { margin: 0; }
.plan h3 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.date-pick { display: inline-flex; align-items: center; gap: 4px; }
.date-pick input { padding: 3px 6px; font-size: 13px; border-radius: 16px; }
.sched-box label { margin-bottom: 8px; }
.date-head { grid-column: 1 / -1; font-weight: 700; font-size: 15px; text-transform: capitalize; padding: 6px 2px 0; color: #5b21b6; }
.date-pick { border: 1px solid #d1d5db; border-radius: 16px; padding: 0 0 0 8px; }
.date-pick.active { background: #6d28d9; border-color: #6d28d9; }
.date-pick input { border: 0; background: transparent; }
.plan-title { margin-bottom: 12px; }
.plan-title h2 { text-transform: none; }
#pos-time-mode button, #pos-type button { font-size: 12.5px; padding: 8px 2px; white-space: normal; line-height: 1.15; }
.pre-box { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 10px; padding: 10px 10px 2px; margin-bottom: 10px; }
.pre-box .segmented button.active { background: #6d28d9; border-color: #6d28d9; }
#pos-type button[data-kind=preorder].active { background: #6d28d9; border-color: #6d28d9; }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.limits-grid label { margin: 0; }
.limits-grid input { text-align: center; }
tr.limits-row td { background: #f5f3ff; }
.lim-tag { font-size: 11px; background: #ede9fe; color: #5b21b6; border-radius: 4px; padding: 0 5px; margin-left: 4px; }

/* ---------- Бонусы ---------- */
.bonus-box { background: #fefce8; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.bonus-info { font-size: 13.5px; }
.bonus-info b { color: #a16207; font-size: 15px; }
.bonus-spend { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.bonus-spend label { flex: 1; min-width: 140px; margin: 0; }
.bonus-box .hint { margin-top: 6px; line-height: 1.45; }
.totals .line.bonus { color: #a16207; font-weight: 600; }
.bonus-line { font-size: 12.5px; color: #a16207; }
.client-note { margin-top: 4px; padding: 4px 8px; background: #fff7ed; border-radius: 6px; color: #9a3412; font-size: 12.5px; }
.warn-text { color: #b45309; font-weight: 600; }
.plus { color: #15803d; font-weight: 600; display: block; }
.minus { color: #b91c1c; font-weight: 600; display: block; }
.tag.new { background: #dcfce7; color: #166534; }
button.primary-ghost { border-color: var(--accent); color: var(--accent); }

/* ---------- Поиск по заказам ---------- */
.orders-search { width: 300px; max-width: 100%; }
@media (max-width: 700px) { .orders-search { width: 100%; } }

/* ---------- Редактирование заказа ---------- */
.modal-box.edit-box { max-width: 900px; max-height: 94vh; overflow: auto; }
.edit-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.edit-grid .segmented { margin-bottom: 8px; }
.edit-grid .search-box { margin: 8px 0; position: relative; }
.edit-grid .cart { max-height: 300px; overflow: auto; }
@media (max-width: 760px) { .edit-grid { grid-template-columns: 1fr; } }

/* ---------- Клиенты ---------- */
.clients-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.clients-side { position: sticky; top: 64px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.clients-side input { width: 100%; font-size: 15px; padding: 10px; }
.clients-list { overflow: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.client-row { display: flex; justify-content: space-between; gap: 8px; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; width: 100%; }
.client-row:hover { border-color: #d1d5db; background: #fafafa; }
.client-row.active { border-color: var(--accent); background: var(--accent-soft); }
.client-row small { display: block; color: var(--muted); font-size: 12px; }
.client-bal { text-align: right; white-space: nowrap; color: #a16207; font-weight: 600; }
.client-bal small { color: var(--muted); font-weight: 400; }
.client-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.client-head h2 { margin: 0 0 4px; }
.client-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-card .tier-text { font-weight: 600; margin-bottom: 6px; }
.tier-bar { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.tier-bar span { display: block; height: 100%; background: linear-gradient(90deg, #facc15, #f59e0b); }
.tier-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.tier-steps span { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f3f4f6; color: var(--muted); }
.tier-steps span.done { background: #fef3c7; color: #92400e; font-weight: 600; }
.mini-order { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-order:last-child { border-bottom: 0; }
.mini-order small { display: block; color: var(--muted); }
.mini-order .num { text-align: right; white-space: nowrap; }
.client-history td small { display: block; color: var(--muted); }
.tier-row { align-items: flex-end; }
@media (max-width: 900px) {
  .clients-layout { grid-template-columns: 1fr; }
  .clients-side { position: static; max-height: 45vh; }
}
#client-card .tbl td.num { white-space: nowrap; }
.kpi b.sm { font-size: 15px; }
.tag.online { background: #dbeafe; color: #1e40af; }
.site-src { color: #1d4ed8; }
.link-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.link-req { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid #dbeafe; }
.link-req small { display: block; color: var(--muted); }
.link-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.photo-row { align-items: flex-end; }
.photo-preview { display: flex; gap: 8px; align-items: center; }
.photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Склад ---------- */
.st-nav { margin-bottom: 12px; }
.st-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.st-filters input[type=search] { min-width: 240px; flex: 1; }
.tbl-wrap { overflow-x: auto; }
.st-table td small, .inv td small { display: block; font-size: 11.5px; }
.st-table td { vertical-align: top; }
.st-table .group-row td { background: #f3f4f6; font-weight: 700; padding-top: 10px; }
.st-table tr.low td { background: #fff7ed; }
.up { color: #b91c1c; font-weight: 600; } .down { color: #15803d; font-weight: 600; }
.kpi.warn b { color: #b45309; }
.inv-lines input { width: 100%; min-width: 80px; }
.inv-lines td:first-child { min-width: 260px; }
.inv-lines input.bad { border-color: #f59e0b; background: #fffbeb; }
.inv-lines .qty-in { width: 110px; }
.inv-total { font-size: 16px; margin: 10px 0; }
details.inv { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; }
details.inv summary { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; flex-wrap: wrap; }
details.inv summary .inv-sum { margin-left: auto; font-weight: 700; }
details.inv .inv-date { font-variant-numeric: tabular-nums; color: var(--muted); }
details.inv.cancelled { opacity: .6; }
details.inv table { margin: 0 12px; width: calc(100% - 24px); }
.inv-foot { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--muted); flex-wrap: wrap; }
.inv-foot button { margin-left: auto; }
.modal-box.wide-box { max-width: 860px; max-height: 92vh; overflow: auto; }
.danger-text { color: #b91c1c !important; }
.imp-rep { background: #f9fafb; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.imp-rep.ok { background: #f0fdf4; }
.fd td.wd { color: #6d28d9; }

/* ---------- v4.1: счета, черновики накладных, скан чеков ---------- */
.st-nav .scan-btn { background: #1f6feb; color: #fff; border-color: #1f6feb; font-weight: 600; }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #d97706; color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.tag.draft { background: #fff3cd; color: #8a5a00; }
.tag.tocheck { background: #e0f2fe; color: #075985; }
.tag.posted { background: #e8f5e9; color: #2e7d32; }
.tag.warn { background: #fde2e2; color: #b42318; }
details.inv.draft { border-left: 4px solid #f0b429; }
.acc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.net-tag { display: block; color: #6d28d9; font-size: 12px; }
label.inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; margin-left: 8px; }
label.inline input { width: auto; }
#acc-table td small { display: block; }
/* v4.3: карточка продукта, словарь названий, объединение поставщиков */
.modal-box { max-height: 92vh; overflow: auto; position: relative; }
.modal-box.product-box { max-width: 620px; }
.modal-x { position: sticky; top: 0; float: right; margin: -6px -6px 0 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f1f3f5; font-size: 16px; cursor: pointer; z-index: 2; }
.modal-actions { position: sticky; bottom: -20px; background: #fff; padding: 10px 0 4px; margin-top: 8px; border-top: 1px solid #eee; }
.mini-h { font-size: 14px; margin: 14px 0 4px; }
.convert-box { background: #fff7e6; border: 1px solid #f3d38b; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.aliases { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.alias-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3ff; border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 13px; }
.alias-chip small { color: var(--muted); }
.alias-chip button { border: 0; background: transparent; cursor: pointer; color: #b42318; }
/* v4.3.2 — диагностика Gemini */
.rc-diag:empty { display: none; }
.rc-diag { margin: 6px 0 10px; font-size: 13px; }
.rc-diag-t { width: 100%; border-collapse: collapse; }
.rc-diag-t td { padding: 4px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.rc-diag-t td:nth-child(3) { white-space: nowrap; color: #666; }
/* v4.4 — отсрочка платежа, карты */
.debt-tag { color: #b45309; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { outline: 2px solid #f59e0b; }
/* v4.5 — предоплата */
.paid-badge { background: #16a34a; color: #fff; font-weight: 800; border-radius: 6px; padding: 2px 8px; font-size: 13px; letter-spacing: .3px; }
.order:has(.paid-badge) { box-shadow: inset 4px 0 #16a34a; }
button.success-ghost { border: 1.5px solid #16a34a; color: #15803d; background: #fff; }
.prepaid-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 8px 10px; border: 1px dashed #16a34a; border-radius: 8px; background: #f0fdf4; cursor: pointer; }
.prepaid-check input { width: 18px; height: 18px; }
.pay-card select { width: 100%; }
tr.suspect td { background: #fff7ed; }
tr.suspect .flag { color: #b45309; font-size: 12px; font-weight: 600; margin-top: 2px; }
/* v4.6 — расчёт смены */
.stl-h { margin: 16px 4px 6px; }
.stl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; align-items: start; }
.stl-card.done { box-shadow: inset 4px 0 #16a34a; } .stl-card.short { box-shadow: inset 4px 0 #dc2626; } .stl-card.admin { background: #f8fafc; }
.stl-top { display: flex; flex-direction: column; margin-bottom: 6px; } .stl-top b { font-size: 17px; }
.stl-calc { margin: 6px 0; }
.stl-l { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted #e5e7eb; font-size: 14px; }
.stl-l.m b { color: #b91c1c; } .stl-l.p b { color: #15803d; }
.stl-l.total { border-top: 2px solid #111827; border-bottom: 0; margin-top: 4px; padding-top: 6px; font-size: 16px; }
.stl-l.total b { font-size: 19px; }
.stl-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; } .stl-act input { width: 120px; }
.stl-rec { background: #f0fdf4; border-radius: 8px; padding: 6px 8px; margin: 8px 0; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stl-t td, .stl-t th { font-size: 13px; padding: 4px 6px; } .stl-t tr.exp td { color: #b45309; }
.stl-reg { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 900px) { .stl-reg { grid-template-columns: 1fr; } }
.stl-diff { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-weight: 700; } .stl-diff small { display: block; font-weight: 400; }
.stl-diff.ok { background: #f0fdf4; color: #15803d; } .stl-diff.bad { background: #fef2f2; color: #b91c1c; }
.tag.ok { background: #dcfce7; color: #166534; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.tag.warn { background: #fef3c7; color: #92400e; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.stl-card.wide { grid-column: 1 / -1; }
.stl-t { width: 100%; } .stl-t td.num, .stl-t td:last-child { white-space: nowrap; }
#tab-settlement .st-head h2 { display: flex !important; align-items: center; gap: 8px; justify-content: flex-start !important; flex-wrap: wrap; }
/* v4.8 — обещанное время */
.eta-line { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; font-size: 14px; }
.eta-line button { margin-left: 4px; } .eta-line small { display: block; margin-top: 4px; }
.eta-left { font-weight: 700; color: #1d4ed8; } .eta-left.soon { color: #b45309; } .eta-left.late { color: #dc2626; }
.small-link { font-size: 13px; font-weight: 400; margin-left: auto; }
#speed-body h3 { margin: 14px 0 6px; font-size: 15px; }
.addr-note { background: #fef9c3; border-radius: 6px; padding: 3px 8px; font-size: 13px; margin: 3px 0; }

/* Соусники в корзине: бесплатные по роллам + платные доп. */
.sauces-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin: -4px 0 12px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; font-size: 14px; }
.sauces-line small { display: block; color: #64748b; font-size: 12px; }
/* Итог дня: крупно карты / наличка */
.stl-l.sub { font-weight: 600; }
.stl-big { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.stl-big small { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.stl-big b { font-size: 24px; } .stl-big b.pos { color: #15803d; } .stl-big b.neg { color: #b91c1c; }
.stl-big span { color: #64748b; font-size: 12px; }
.cnt-sum { margin: -4px 0 10px; font-size: 14px; }
.ok-text { color: #15803d; font-weight: 600; }

/* Выбор банка при нехватке наличных в кассе */
.bank-pick { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.bank-pick-sheet { background: #fff; color: #1f2328; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.bank-pick-sheet h3 { margin: 0; font-size: 18px; } .bank-pick-sheet p { margin: 0 0 6px; font-size: 14px; color: #4b5563; }
.bank-pick-sheet button { font: inherit; text-align: left; border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; }
.bank-pick-sheet button small { color: #6b7280; font-size: 13px; }
.bank-pick-sheet button.mine { border-color: #7c3aed; background: #f5f3ff; }
.bank-pick-sheet button.cancel { text-align: center; background: transparent; }
@media (min-width: 700px) { .bank-pick { align-items: center; } .bank-pick-sheet { border-radius: 18px; } }
body.dark .bank-pick-sheet { background: #111a2e; color: #e5e7eb; } body.dark .bank-pick-sheet button { background: #0f172a; border-color: #334155; color: #e5e7eb; }
body.dark .bank-pick-sheet button.mine { background: #1e1b4b; border-color: #7c3aed; } body.dark .bank-pick-sheet p { color: #9ca3af; }
/* Касса: состав чека самовывоза по нажатию на строку */
#reg-pickups .reg-row { cursor: pointer; }
#reg-pickups .reg-row:hover td { background: #f8fafc; }
#reg-pickups .reg-row.open td { background: #f1f5f9; font-weight: 600; }
#reg-pickups .reg-detail td { background: #f8fafc; padding: 0; }
.reg-od { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.reg-od-top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.reg-od-items { width: 100%; border-collapse: collapse; }
.reg-od-items td { padding: 4px 0; border: 0 !important; background: transparent !important; }
.reg-od-items td.q { width: 34px; color: #64748b; }
.reg-od-items small { display: block; color: #64748b; font-size: 12px; }
.reg-od-extras { display: flex; gap: 6px; flex-wrap: wrap; }
.reg-od-extras span { border: 1px solid #e5e7eb; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #64748b; background: #fff; }
.reg-od-extras b { color: #1f2328; }
.reg-od-comment { font-style: italic; background: #fff; border-radius: 8px; padding: 6px 10px; }
.reg-od-sum { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.reg-od-pay { color: #166534; font-weight: 600; }
/* Касса: закупка продуктов — строки «продукт + вес + сумма» */
.exp-prod { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.exp-prod[hidden] { display: none; }
.exp-prod-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.exp-line { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) auto; gap: 6px; align-items: center; padding-bottom: 8px; border-bottom: 1px dashed #e5e7eb; }
.exp-line [data-k=name] { grid-column: 1 / -1; }
.exp-line input, .exp-line select { width: 100%; margin: 0; }
.exp-line input.bad { border-color: #dc2626; background: #fef2f2; }

/* ---------- Табель смен (зарплата) ---------- */
.tb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 8px; }
.tb-head h2 { margin: 0; }
.tb-nav { display: flex; align-items: center; gap: 6px; }
.tb-nav b { min-width: 130px; text-align: center; font-size: 15px; text-transform: capitalize; }
.tb-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tb-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 10px; }
.tb { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; min-width: 100%; }
.tb th, .tb td { border-bottom: 1px solid #eef0f2; border-right: 1px solid #eef0f2; padding: 4px 8px; white-space: nowrap; }
.tb thead th { position: sticky; top: 0; z-index: 2; background: #f9fafb; font-size: 12px; font-weight: 700; text-align: center; }
.tb thead th small { display: block; font-weight: 400; color: var(--muted); }
.tb th.tb-date, .tb td.tb-date { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 600; font-size: 13px; }
.tb thead th.tb-date { z-index: 3; background: #f9fafb; }
.tb td.cell { text-align: right; cursor: pointer; min-width: 92px; }
.tb td.cell:hover { background: #eff6ff; }
.tb td.cell.zero { color: #c3c7cd; }
.tb td.cell.has { color: var(--text); font-weight: 600; }
.tb td.cell.paid-cell { background: #f0fdf4; }
.tb .tb-c { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 12px; font-weight: 700; margin-right: 6px; vertical-align: -3px;
  border: 1.5px solid #cfd4da; color: transparent; }
.tb-legend .tb-c { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.tb-c.paid { background: #16a34a; border-color: #16a34a; color: #fff; }
.tb-c.due { background: #fef3c7; border: 1.5px solid #d97706; color: #b45309; }
.tb-c.open { background: #dbeafe; border: 1.5px solid #2563eb; color: #2563eb; font-size: 9px; }
.tb tr.we td.tb-date { color: var(--accent); }
.tb tr.we td { background-color: #fcfcfd; }
.tb tr.today td { box-shadow: inset 0 1px 0 #2563eb, inset 0 -1px 0 #2563eb; }
.tb tr.today td.tb-date::after { content: ' • сегодня'; color: #2563eb; font-weight: 400; font-size: 11px; }
.tb tr.wk td { border-top: 2px solid #9ca3af; }
.tb td.tb-day { text-align: right; font-weight: 700; background: #f9fafb; }
.tb tfoot td { position: sticky; bottom: 0; background: #f3f4f6; font-weight: 700; text-align: right; border-top: 2px solid #9ca3af; font-size: 12px; }
.tb tfoot td small { display: block; font-weight: 400; color: var(--muted); }
.tb tfoot td.tb-date { z-index: 3; background: #f3f4f6; }
.tb .grp { border-left: 3px solid #6b7280 !important; }
.tb thead tr.tb-groups th { font-size: 12px; text-transform: none; background: #eef2f7; color: var(--text); padding: 6px 8px; }
#payroll-summary tr.pr-group td { background: #eef2f7; font-weight: 700; font-size: 13px; padding-top: 10px; }
#payroll-summary tr.pr-sub td { background: #f9fafb; color: var(--muted); }
#payroll-summary tr.pr-total td { border-top: 2px solid #9ca3af; }

/* ---------- «Клиент уже оплатил» — кнопка-переключатель ---------- */
.prepaid-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0; padding: 12px 14px; text-align: left;
  border: 2px dashed #86efac; border-radius: 12px; background: #fff; color: var(--text); cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.prepaid-btn:hover { background: #f0fdf4; border-color: #22c55e; }
.prepaid-btn .pp-ic { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 2px solid #9ca3af;
  color: transparent; font-weight: 800; font-size: 16px; background: #fff; }
.prepaid-btn .pp-txt { min-width: 0; white-space: normal; line-height: 1.3; }
.prepaid-btn .pp-txt b { display: block; font-size: 15px; }
.prepaid-btn .pp-txt small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.prepaid-btn.on { background: #16a34a; border: 2px solid #16a34a; color: #fff; }
.prepaid-btn.on .pp-ic { background: #fff; border-color: #fff; color: #16a34a; }
.prepaid-btn.on .pp-txt small { color: #dcfce7; }
.prepaid-btn.on .pp-txt b::after { content: ' — ОПЛАЧЕН'; }
.prepaid-btn:disabled { opacity: .45; cursor: not-allowed; }
/* ---------- Поиск клиента по цифрам телефона ---------- */
.phone-ac { position: relative; }
.hint-in { font-size: 11px; color: #9ca3af; font-weight: 400; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% - 6px); z-index: 40; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.15); max-height: 320px; overflow: auto; padding: 4px; }
.ac-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0;
  background: none; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.ac-list button:hover, .ac-list button.sel { background: #eff6ff; }
.ac-list .ac-ph { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ac-list .ac-ph mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.ac-list .ac-nm { color: var(--muted); font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-list .ac-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }

/* ---------- Личные промокоды ---------- */
.promo-box { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: #fffbeb; border: 2px solid #fbbf24; animation: promo-pulse 1.6s ease-in-out 3; }
.promo-box.applied { background: #f0fdf4; border-color: #16a34a; animation: none; }
@keyframes promo-pulse { 50% { box-shadow: 0 0 0 4px rgba(251,191,36,.35); } }
.promo-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.promo-chips { display: flex; flex-direction: column; gap: 6px; }
.promo-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; text-align: left; white-space: normal;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: var(--text); }
.promo-chip:hover { border-color: #f59e0b; }
.promo-chip .pc-ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #9ca3af; font-weight: 800; color: #fff; }
.promo-chip .pc-v { flex: none; font-weight: 800; font-size: 16px; color: #b45309; min-width: 56px; }
.promo-chip .pc-t { min-width: 0; } .promo-chip .pc-t b { display: block; font-size: 13px; letter-spacing: .5px; }
.promo-chip .pc-t small { display: block; font-size: 11px; color: var(--muted); }
.promo-chip.on { border-color: #16a34a; background: #dcfce7; }
.promo-chip.on .pc-ic { background: #16a34a; border-color: #16a34a; } .promo-chip.on .pc-v { color: #15803d; }
.line.promo { color: #b45309; font-weight: 600; }
.promo-flag { color: #b45309; }
/* карточка клиента */
.promo-list .pr-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f1f3; }
.promo-list .pr-v { font-weight: 800; font-size: 16px; min-width: 64px; color: #b45309; }
.promo-list .pr-main { flex: 1; min-width: 0; } .promo-list .pr-main b { letter-spacing: .5px; } .promo-list .pr-main small { display: block; color: var(--muted); }
.promo-list .pr-row.used .pr-v, .promo-list .pr-row.cancelled .pr-v, .promo-list .pr-row.expired .pr-v { color: #9ca3af; }
.promo-list .pr-row.used, .promo-list .pr-row.cancelled, .promo-list .pr-row.expired { opacity: .7; }
.pr-state { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #f3f4f6; white-space: nowrap; }
.pr-state.active { background: #fef3c7; color: #92400e; } .pr-state.used { background: #dcfce7; color: #166534; }
.pr-state.expired, .pr-state.cancelled { background: #f3f4f6; color: #6b7280; }
.promo-gen { display: flex; gap: 6px; align-items: flex-end; } .promo-gen label { flex: 1; margin: 0; }
.segmented.wrap { flex-wrap: wrap; gap: 6px; } .segmented.wrap button { flex: 0 0 auto; border-radius: 16px !important; margin-left: 0; padding: 6px 12px; }
.promo-list h3 { display: flex; align-items: center; gap: 8px; }

/* поиск блюд: количество впереди */
.result { align-items: center; }
.result .res-qty { flex: none; min-width: 34px; text-align: center; font-weight: 800; font-size: 14px; padding: 3px 6px; border-radius: 8px; background: #f3f4f6; color: #6b7280; }
.result .res-qty.many { background: var(--accent); color: #fff; }
.result .res-name { flex: 1; min-width: 0; }
.result .price { text-align: right; } .result .price small { display: block; font-weight: 400; font-size: 11px; }
.gift-tag { color: #15803d !important; font-weight: 600; }
.tiers-ed input { width: 90px; display: inline-block; } .tiers-ed td { padding: 3px 6px; }
/* ---------- 💬 Жалобы ---------- */
.cmp-layout { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .cmp-layout { grid-template-columns: 1fr; } }
.cmp-list-card { max-height: 80vh; overflow: auto; }
.cmp-row { padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; }
.cmp-row:hover { background: #f9fafb; } .cmp-row.active { background: var(--accent-soft); border-color: #fecdd3; }
.cmp-row.unread b::before { content: '● '; color: var(--accent); }
.cmp-tags { margin: 3px 0; font-size: 12px; }
.cmp-st { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #f3f4f6; }
.cmp-st.admin { background: #fee2e2; color: #b91c1c; font-weight: 700; } .cmp-st.open { background: #dbeafe; color: #1d4ed8; } .cmp-st.resolved { background: #dcfce7; color: #166534; }
.cmp-head { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cmp-head h2 { margin: 0 0 4px; } .cmp-head h2 a { font-size: 13px; font-weight: 400; }
.cmp-order { font-size: 12px; background: #f9fafb; border-radius: 8px; padding: 6px 8px; margin-top: 6px; }
.cmp-promo { font-size: 13px; background: #fffbeb; border-radius: 8px; padding: 6px 8px; margin-top: 6px; }
.cmp-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 190px; }
.cmp-msgs { max-height: 55vh; overflow: auto; padding: 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.cmsg { display: flex; } .cmsg.client { justify-content: flex-start; } .cmsg.ai, .cmsg.staff, .cmsg.system { justify-content: flex-end; }
.cmsg-b { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: #f3f4f6; font-size: 14px; line-height: 1.4; }
.cmsg.ai .cmsg-b { background: #eff6ff; } .cmsg.staff .cmsg-b { background: #fdf2f8; } .cmsg.system .cmsg-b { background: #fffbeb; }
.cmsg-b small { display: block; color: var(--muted); font-size: 11px; } .cmsg-b small.t { text-align: right; margin-top: 2px; }
.cmsg-b img { max-width: 260px; max-height: 260px; border-radius: 10px; margin-top: 6px; display: block; }
.cmp-reply { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.cmp-reply textarea { flex: 1; }
/* ---------- Настройки плитками ---------- */
.set-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .set-top h2 { margin: 0; }
.set-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.set-tiles button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; text-align: left; border: 1px solid var(--line);
  border-radius: 16px; background: #fff; cursor: pointer; font: inherit; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .1s, box-shadow .15s, border-color .15s; }
.set-tiles button:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.set-tiles button span { font-size: 30px; line-height: 1; } .set-tiles button b { font-size: 16px; } .set-tiles button small { color: var(--muted); font-size: 12px; }
#tab-settings [data-set] { display: none; }
#tab-settings.set-open [data-set].set-on { display: block; }
#tab-settings.set-open > .grid-2 { display: block; max-width: 1000px; }
#tab-settings.set-open > .grid-2 > div { display: contents; }
#tab-settings:not(.set-open) > .grid-2 { display: none; }
#tab-settings.set-open > .card.set-on { max-width: 1000px; }

#tabs .nav-in-settings { display: none !important; }
.back-settings { margin-bottom: 10px; }
/* верхнее меню — в одну строку на обычном мониторе */
@media (min-width: 1200px) { nav { gap: 2px; } nav button { padding: 8px 8px; font-size: 13.5px; } }
#assistant-form textarea { width: 100%; font: inherit; }
.dir-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: #f9fafb; margin: 0 6px 6px 0; font-size: 13px; }
.callback-line { background: #fef3c7; border-radius: 8px; padding: 5px 8px; font-weight: 600; margin: 4px 0; }
.trip-line { background: #e0f2fe; color: #075985; border-radius: 8px; padding: 4px 8px; font-size: 13px; margin: 4px 0; }
.trip-pick { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; margin-bottom: 10px; }
.trip-pick button { text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.trip-pick button:hover { border-color: var(--accent); background: var(--accent-soft); } .trip-pick small { display: block; color: var(--muted); }
.pos-client-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.addon-banner { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #fff4e0; border: 1px solid #f3c27a; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.paid-badge.part { background: #fff1d6; color: #8a4b00; border-color: #f3c27a; }
.prepaid-edit { background: #e9f9ee; border: 1px solid #9bd8ae; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.prepaid-edit small { display: block; color: var(--muted); margin-top: 2px; }
.inv-yield { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.inv-yield input { width: 64px; padding: 2px 4px; }
.danger-card { border: 1px solid #f3b4b4; }
.reset-parts { display: grid; gap: 6px; margin: 8px 0; } .reset-parts b { margin-left: 4px; }
.imp-b { background: #eef6ff; border: 1px solid #bcd8f5; border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.imp-sup td:first-child { width: 55%; } .imp-sup select { width: 100%; }
.logo { display: flex; align-items: center; gap: 8px; } .logo img { height: 38px; width: auto; } .logo .logo-word { height: 27px; }
.login-logo { width: 200px; height: auto; display: block; margin: 0 auto 10px; }

/* Цены по фудкосту */
.modal-box.pricing-box { max-width: 1000px; }
.pr-wrap { max-height: 62vh; overflow: auto; margin: 8px 0; }
.pr-tbl th, .pr-tbl td { padding: 4px 6px; }
.pr-tbl thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.pr-cat th { background: #f2f7d6; text-align: left; font-weight: 400; }
.pr-cat .pr-target { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px; }
.pr-cat .pr-target input { width: 56px; }
.pr-price { width: 76px; }
.pr-odd td { background: #fff7ed; }
.pr-up { color: #15803d; font-weight: 600; }
.pr-down { color: #b91c1c; font-weight: 600; }
.pricing-box .row { align-items: flex-end; }
.pricing-box .row label { flex: 0 0 auto; }
.pricing-box .row select { width: auto; }
.pr-cat .pr-target { flex-direction: row; display: inline-flex; font-size: 13px; }
.pr-cat .pr-target input { padding: 2px 4px; height: 26px; }
/* Выгрузка / загрузка таблицей */
.sheet-btns { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.sheet-btns button { font-weight: 400; }
.sheet-src { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin: 10px 0; }
.sheet-wrap { max-height: 46vh; overflow: auto; }
.sheet-errors { margin: 6px 0; }
.modal-box.sheet-box { max-width: 760px; }

a.btn-link { display: inline-block; padding: 3px 8px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: inherit; text-decoration: none; font-size: 13px; }
a.btn-link:hover { background: #f3f4f6; }
/* Меню: вкладки, полуфабрикаты, справочник ингредиентов */
.menu-nav { margin-bottom: 12px; }
.preps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; }
.prep-card h3 { margin: 0; }
.prep-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prep-meta { margin: 6px 0; font-size: 14px; }
.prep-add { margin-top: 8px; }
.prep-add select { min-width: 0; }
#ing-ref-table .grp-row th { background: #f3f4f6; text-align: left; }
@media (max-width: 600px) { .preps-grid { grid-template-columns: 1fr; } }

/* Склад → Импорт: части меню по отдельности */
.mi-parts { display: grid; gap: 8px; margin: 8px 0; }
.mi-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
.mi-row .hint { margin: 2px 0 0; }
.mi-btns { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 600px) { .mi-row { flex-direction: column; align-items: stretch; } }

/* Техкарта окном поверх меню */
.modal-box.recipe-box { max-width: 1100px; width: 96vw; }
#recipe-editor.in-modal .card { box-shadow: none; border: 1px solid #e5e7eb; }
#recipe-editor.in-modal label:has(#recipe-product) { display: none; }

/* Подкатегории */
#categories-table tr.cat-sub td:first-child { padding-left: 22px; }
#categories-table select { max-width: 150px; }
.pos-subcats { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px dashed #e5e7eb; margin-top: 2px; }
.pos-subcats button { font-size: 12px; padding: 3px 10px; }
#recipe-editor .grid-2:has(> #set-card[hidden]) { grid-template-columns: 1fr; }

/* ---- Меню → Блюда: список карточками + окно блюда (v5.17) ---- */
.prod-add { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 4px 0 12px; padding: 16px;
  border: 2px dashed #d1d5db; border-radius: 12px; background: #fff; font-size: 15px; color: var(--text); cursor: pointer; }
.prod-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.prod-add-plus { font-size: 22px; color: var(--accent); line-height: 1; }
.prod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 8px; }
@media (max-width: 700px) { .prod-list { grid-template-columns: 1fr; } }
.prod-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.prod-row:hover { border-color: #fda4af; }
.prod-row.off { opacity: .55; }
.prod-thumb { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #ecfdf5; display: grid; place-items: center; font-size: 20px; }
.prod-thumb.set { background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-info { flex: 1; min-width: 0; }
.prod-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-meta, .prod-cost { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-cost b { color: var(--text); font-weight: 600; }
.prod-cost .warn-text { font-weight: 500; }
.pr-comp { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.prod-edit { flex: 0 0 auto; font-size: 16px; padding: 6px 10px; }
.prod-empty { grid-column: 1 / -1; text-align: center; padding: 24px 0; }
.switch { position: relative; flex: 0 0 auto; width: 42px; height: 24px; margin: 0; display: inline-block; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d1d5db; border-radius: 12px; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: #16a34a; }
.switch input:checked + span::before { transform: translateX(18px); }

.modal-box.pe-box { max-width: 560px; }
.modal-box.pe-box.pe-wide { max-width: 1100px; width: 96vw; }
.pe-tabs { margin: 8px 0 12px; }
.pe-head { display: flex; gap: 12px; align-items: flex-end; }
.pe-head > label.grow { flex: 1; }
label.pe-photo { flex: 0 0 76px; margin-bottom: 9px; cursor: pointer; }
.pe-photo-img { width: 76px; height: 76px; border-radius: 10px; border: 1.5px dashed #d1d5db; overflow: hidden; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 20px; line-height: 1.1; }
.pe-photo-img small { font-size: 11px; }
.pe-photo-img img { width: 100%; height: 100%; object-fit: cover; }
.pe-photo-actions:not(:empty) { margin: -4px 0 8px; }
.pe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.pe-url { margin-top: -2px; }
.pe-url input { margin-top: 6px; width: 100%; }
.pe-foot { position: sticky; bottom: -20px; background: #fff; margin: 12px -20px -20px; padding: 10px 20px 14px; border-top: 1px solid var(--line); }
.pe-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #f9fafb; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13.5px; }
.pe-sum label.check { margin: 0; }
.pe-btns { display: flex; gap: 8px; }
.pe-btns button { flex: 1; padding: 10px; }
.link-danger { display: block; margin: 10px auto 0; background: none; border: 0; color: #b42318; font-size: 13px; text-decoration: underline; cursor: pointer; }
@media (max-width: 700px) {
  .modal-box.pe-box { padding: 16px; }
  .pe-foot { margin: 12px -16px -16px; padding: 10px 16px 12px; bottom: -16px; }
}
.pe-head > label.grow { min-width: 0; }
.pe-head > label.grow input { width: 100%; min-width: 0; box-sizing: border-box; }
.pe-grid select, .pe-grid input { min-width: 0; width: 100%; box-sizing: border-box; }
#recipe-editor.in-modal .card { overflow-x: auto; }
#recipe-editor.in-modal #recipe-form > select, #recipe-editor.in-modal #set-form > select { min-width: 0; }
.pe-box.pe-wide [data-pe-del] { display: none; }
@media (max-width: 700px) {
  #recipe-editor.in-modal .card { padding: 10px; }
  #recipe-editor.in-modal #recipe-form > select, #recipe-editor.in-modal #set-form > select { flex: 1 1 100%; }
  #recipe-editor.in-modal #recipe-form > input { flex: 1; min-width: 0; }
  #recipe-editor.in-modal .hint { display: none; }
}

/* ---- Автономная касса: плашка связи и список заказов без интернета ---- */
.net-bar { position: sticky; top: 0; z-index: 150; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; font-size: 14px; line-height: 1.35; }
.net-bar.off { background: #b91c1c; color: #fff; }
.net-bar.err { background: #fef3c7; color: #92400e; border-bottom: 1px solid #fcd34d; }
.net-bar.wait { background: #e0f2fe; color: #075985; }
.net-bar button { flex: 0 0 auto; }
.net-bar.off button { background: #fff; color: #b91c1c; border-color: #fff; }
.off-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.off-row small { display: block; }
.off-row.bad { background: #fffbeb; }
.off-btns { display: flex; gap: 6px; align-items: flex-start; flex: 0 0 auto; }
.lp-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lp-box h3 { margin: 0 0 6px; font-size: 15px; }
.lp-box code { background: #f3f4f6; padding: 0 4px; border-radius: 4px; font-size: 12px; }
.set-h3 { font-size: 15px; margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
#shop-form .set-h3:first-child { border-top: 0; padding-top: 0; margin-top: 4px; }
.paylink-line { background: #eff6ff !important; color: #1e40af; }
.week-times { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.week-times label { margin: 0; text-align: center; }
.week-times input { min-width: 0; padding: 6px 2px; text-align: center; }
@media (max-width: 700px) { .week-times { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ===== Заказы строками (v5.27): одинаковые «невидимые колонки» у всех строк и у шапки ===== */
.orders-rows { display: flex; flex-direction: column; gap: 4px; --ocols: 86px 54px 64px 120px 92px 200px minmax(0, 1fr) minmax(0, 1.2fr) 104px 150px 250px 16px; }
.order.orow { padding: 0; gap: 0; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.orow-line, .orow-head { display: grid; grid-template-columns: var(--ocols); gap: 10px; align-items: center; padding: 8px 10px; }
.orow-line { cursor: pointer; font-size: 13.5px; }
.orow-line > span, .orow-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow-head { position: sticky; top: var(--hdr, 64px); z-index: 2; padding-top: 4px; padding-bottom: 4px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: #6b7280; background: var(--bg, #f3f4f6); border-left: 4px solid transparent; }
.orow-line:hover { background: #f9fafb; }
.orow .c-created, .orow .c-cook { color: #6b7280; font-variant-numeric: tabular-nums; }
.orow .c-when, .orow .c-timer, .orow .c-sum { font-variant-numeric: tabular-nums; }
.orow .c-client small { color: var(--muted, #6b7280); }
.orow .c-items { color: #374151; }
.orow .c-timer.late { color: #dc2626; font-weight: 700; }
.orow .c-timer.soon { color: #ea580c; font-weight: 600; }
.orow .c-status { display: flex; gap: 4px; align-items: center; }
.orow .c-act { display: flex; gap: 4px; justify-content: flex-start; }
.orow .c-act button { white-space: nowrap; }
.orow .c-chev { color: #9ca3af; transition: transform .15s; text-align: center; }
.orow.open .c-chev { transform: rotate(180deg); }
.orow .flag { font-size: 12px; background: #f3f4f6; border-radius: 6px; padding: 1px 5px; }
.orow .flag.call { background: #fef3c7; } .orow .flag.ok { background: #dcfce7; }
.orow-details { padding: 6px 14px 12px; border-top: 1px dashed #e5e7eb; }
.orow-details .order-full { display: flex; flex-direction: column; gap: 5px; }
.orow.unacc { background: #fef2f2; border-left-color: #dc2626; }
.orow.held { background: #f8fafc; }
.orow.held .orow-line { opacity: .75; }
.orow.cancelled .orow-line { opacity: .55; } .orow.cancelled .c-items, .orow.cancelled .c-num { text-decoration: line-through; }
.orow.fresh { animation: orow-fresh 1s ease-in-out 4; }
@keyframes orow-fresh { 50% { box-shadow: 0 0 0 3px #f59e0b; } }
button.warn-btn { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
button.danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 700; }
/* «Новые» и вкладка «Заказы» мигают, пока есть непринятый заказ */
.chips button.blink, nav button.blink-new { animation: blink-red 1s steps(1) infinite; }
@keyframes blink-red { 50% { background: #dc2626; border-color: #dc2626; color: #fff; } }
/* Узкий экран — прячем колонки по одной (одинаково у шапки и строк) */
@media (max-width: 1450px) {
  .orders-rows { --ocols: 82px 50px 58px 112px 86px 180px minmax(0, 1fr) 100px 140px 240px 16px; }
  .orow-line > .c-items, .orow-head > span:nth-child(8) { display: none; }
}
@media (max-width: 1150px) {
  .orders-rows { --ocols: 80px 48px 54px 108px 82px minmax(0, 1fr) 96px 230px 16px; }
  .orow-line > .c-addr, .orow-head > span:nth-child(7), .orow-line > .c-status, .orow-head > span:nth-child(10) { display: none; }
}
/* Карточка клиента: правка адресов */
.cl-addr-edit { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.cl-addr-row { display: flex; gap: 6px; align-items: center; } .cl-addr-row input { flex: 1; }
.cl-addr-row.removed input { text-decoration: line-through; opacity: .45; }

/* Тип заказа у номера чека: цветная полоска + подпись словом (синий — доставка, оранжевый — самовывоз) */
.orow .c-num { display: flex; align-items: center; gap: 8px; }
.otype-bar { flex: none; width: 4px; height: 30px; border-radius: 0; }
.otype-bar.d { background: #2563eb; } .otype-bar.p { background: #f97316; }
.otype-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.otype-txt small { font-size: 11px; font-weight: 600; }
.otype-txt small.d { color: #1d4ed8; } .otype-txt small.p { color: #c2410c; }

/* План дня: загрузка по часам */
.plan-load .load-bar { position: relative; display: inline-block; width: 70px; height: 8px; background: #f3f4f6; border-radius: 4px; margin-right: 8px; vertical-align: middle; }
.plan-load .load-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #f97316; border-radius: 4px; }
.plan-load .load-bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #111827; text-decoration: none; }
.plan-load tr.peak td { background: #fff7ed; font-weight: 600; }

/* 📈 Когда заказывают */
.demand-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.demand-controls .segmented { margin: 0; }
.demand-controls .segmented button { flex: 0 0 auto; padding: 6px 12px; }
.demand-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.demand-kpi > div { background: #f9fafb; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.demand-kpi b { font-size: 22px; } .demand-kpi small { color: #6b7280; }
.heat-wrap { overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.heat th { color: #6b7280; font-weight: 600; padding: 2px 4px; text-align: center; }
.heat td { width: 38px; height: 30px; text-align: center; border-radius: 4px; color: #111827; border: 1px solid #f3f4f6; }
.demand-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.demand-top li { margin: 4px 0; }
.bar-cell { width: 40%; } .bar-cell i { display: block; height: 8px; background: #2563eb; border-radius: 4px; }

/* «✕ Выход» в шапке — маленькая аккуратная кнопка справа от кнопки аккаунта */
.logout-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #4b5563; background: transparent; color: #9ca3af;
  font-size: 15px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.logout-x:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Опции блюд: бортик, острота, лапша */
.cart-line .opt-row { grid-column: 1 / -1; margin-top: -2px; }
.cart-subline { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 4px 0 6px 14px; border-bottom: 1px solid #f3f4f6; font-size: 12px; }
.cart-subline .name { color: var(--accent, #c2410c); font-weight: 600; }
.cart-subline .q { display: flex; align-items: center; gap: 4px; }
.cart-subline .q button { padding: 1px 8px; }
.cart-subline .sum { min-width: 72px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.opt-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px dashed #f59e0b; background: transparent; color: inherit; cursor: pointer; font-weight: 500; }
.opt-chip.on { border-style: solid; background: #fef3c7; color: #92400e; }
.opt-chip small { opacity: .7; }
body.dark .opt-chip.on, [data-theme=dark] .opt-chip.on { background: #78350f; color: #fde68a; }
.opt-group.off { opacity: .6; }
.opt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-head input[type=checkbox] { flex: none; width: auto; }
.opt-head .grow { flex: 1 1 160px; min-width: 120px; }
.opt-head label { display: flex; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; margin: 0; font-size: 13px; color: var(--text); }
.opt-head .danger { margin-left: auto; }
.opt-ghead { margin-bottom: 8px; }
.opt-ghead [data-gk=name] { font-weight: 700; font-size: 15px; }
.opt-price { width: 64px; }
.opt-item { border: 1px solid #eef0f3; border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.opt-item.muted { opacity: .55; }
.opt-recipe { margin-top: 6px; }
.opt-rrow { display: flex; gap: 6px; margin-top: 4px; }
.opt-rrow select { flex: 1; min-width: 0; }
.opt-rrow input { width: 90px; flex: none; }
.opt-new { border-top: 1px dashed #e5e7eb; padding-top: 8px; }
.opt-prods { margin-top: 8px; font-size: 13px; }
.opt-pick { max-height: 55vh; overflow: auto; margin: 8px 0; }
.opt-pick details { border-bottom: 1px solid #f3f4f6; padding: 4px 0; }
.opt-pick details > label.check { display: block; padding: 2px 0 2px 24px; }
.opt-pick summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cart-subline .sub-chips { grid-column: 1 / -1; }
.cart-subline .sub-chips .opt-chips { margin-top: 0; }
