/*
 * Панель YOI — Yield, Orders & Inventory.
 *
 * Один набор токенов и компонентов на всю панель: и на новые разделы, и на
 * унаследованные страницы админки. Часть правил намеренно с !important —
 * у старых страниц цвета зашиты в inline-стилях, и перебить их иначе нельзя,
 * а переписывать 400 КБ разметки ради смены палитры дороже, чем эти правила.
 */

:root {
    --yoi-bg: #f4f4ef;
    --yoi-surface: #ffffff;
    --yoi-surface-2: #e8efe6;
    --yoi-border: #d9dfd5;
    --yoi-border-strong: #afc2b1;
    --yoi-green: #3d654f;
    --yoi-green-dark: #294936;
    --yoi-green-light: #e8efe6;
    /* Самый мягкий зелёный: подложка панелей-подсказок и выделенных полос,
       где --yoi-green-light уже читается как «выбрано». */
    --yoi-green-soft: #f1f5ee;
    --yoi-coral: #bc7655;
    --yoi-text: #26312b;
    --yoi-muted: #58645c;
    --yoi-red: #b4232f;
    --yoi-amber: #8a541d;
    --yoi-blue: #26658e;
    --yoi-radius: 12px;
    --yoi-focus: 0 0 0 3px rgba(61, 101, 79, .3);
    --yoi-shadow: 0 3px 10px rgba(23, 51, 59, .09);
    --yoi-z-dropdown: 20;
    --yoi-z-sticky: 30;
    --yoi-z-backdrop: 90;
    --yoi-z-modal: 100;
    --yoi-z-toast: 120;
}

/* ── База ─────────────────────────────────────────────────────────────────── */

body.yoi {
    margin: 0;
    background: var(--yoi-bg);
    color: var(--yoi-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.yoi * { box-sizing: border-box; }

/* Заставки при входе на страницу больше нет: она держала экран 2,4 секунды
   на каждом переходе, а на кассовых машинах и в WebView ещё и дёргалась.
   Панель должна открываться сразу — это рабочий инструмент, не витрина. */

/* ── Боковое меню ─────────────────────────────────────────────────────────── */

#sidebar {
    background: var(--yoi-surface) !important;
    border-right: 1px solid var(--yoi-border);
}

#sidebar > div {
    border-color: var(--yoi-border) !important;
}

.sidebar-brand {
    position: relative;
    min-height: 82px;
    padding: 16px 14px 16px 76px;
    border-bottom: 1px solid var(--yoi-border);
    overflow: hidden;
    background: var(--yoi-surface-2);
}

.sidebar-brand::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 52px;
    height: 52px;
    z-index: 1;
    border-radius: 18px;
    background: var(--yoi-green-light) url('/images/yoi-raccoon.png') center / 48px 48px no-repeat;
    transform: translateY(-50%);
}

.sidebar-brand-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-copy { min-width: 0; }

.sidebar-brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--yoi-green-dark);
}

/* Вход и первоначальная настройка используют тот же бренд-каркас, что и экран
   входа в приложении YOI для Windows: тёмно-зелёный градиент, белая карточка
   по центру и ничего вокруг. Один и тот же сотрудник входит то с компьютера,
   то из браузера — и должен узнавать один и тот же экран. */
body.yoi-auth-page {
    position: relative;
    min-height: 100vh;
    background: radial-gradient(120% 90% at 50% -10%, #0f766e 0%, #0b5f59 42%, #08403d 100%) !important;
    color: var(--yoi-text);
    overflow-x: hidden;
}

/* Мягкое пятно света за карточкой: вход не должен выглядеть как окно ошибки. */
body.yoi-auth-page::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 760px;
    height: 760px;
    margin: -380px 0 0 -380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(213, 240, 232, .28) 0%, rgba(213, 240, 232, 0) 62%);
    pointer-events: none;
}

.yoi-auth-brand { position: relative; text-align: center; }
.yoi-auth-mascot {
    width: 104px !important;
    height: 104px !important;
    margin: 0 auto 12px !important;
    object-fit: contain;
    opacity: 1 !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .3));
}
.yoi-auth-brand h1 { color: #ffffff !important; }
.yoi-auth-brand p { color: rgba(233, 247, 243, .82) !important; }
.yoi-auth-card {
    position: relative;
    background: rgba(255, 255, 255, .97) !important;
    border: 1px solid rgba(255, 255, 255, .5) !important;
    border-radius: 22px !important;
    box-shadow: 0 24px 60px rgba(4, 40, 38, .38) !important;
    backdrop-filter: none !important;
}
.yoi-auth-page :where(input, select, textarea) {
    border-color: var(--yoi-border-strong) !important;
    color: var(--yoi-text) !important;
}
.yoi-auth-page :where(input, select, textarea):focus {
    border-color: var(--yoi-green) !important;
    box-shadow: var(--yoi-focus) !important;
}
.yoi-auth-page button[type="submit"],
.yoi-auth-page button.yoi-auth-primary {
    background: var(--yoi-green) !important;
    color: #fffefb !important;
    box-shadow: none !important;
}
.yoi-auth-page button[type="submit"]:hover,
.yoi-auth-page button.yoi-auth-primary:hover { background: var(--yoi-green-dark) !important; }
.yoi-auth-note {
    background: var(--yoi-green-light);
    border-color: var(--yoi-border-strong) !important;
    color: var(--yoi-green-dark);
}

.sidebar-brand-sub {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .015em;
    color: var(--yoi-muted);
    margin-top: 3px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--yoi-muted) !important;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: background .16s ease, color .16s ease;
    cursor: pointer;
}

.sidebar-link:hover {
    color: var(--yoi-green-dark) !important;
    background: var(--yoi-green-light) !important;
}

.sidebar-link.active {
    color: var(--yoi-green-dark) !important;
    background: var(--yoi-green-light) !important;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--yoi-green);
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px 18px; }
.sidebar-group { margin: 2px 0; }
.sidebar-group > summary {
    min-height: 42px; display: flex; align-items: center; padding: 0 12px;
    border-radius: 10px; color: var(--yoi-text); font-size: 13px; font-weight: 750;
    cursor: pointer; list-style: none; user-select: none;
}
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary::after { content: '›'; margin-left: auto; color: var(--yoi-muted); transition: transform .16s ease; }
.sidebar-group[open] > summary::after { transform: rotate(90deg); }
.sidebar-group > summary:hover, .sidebar-group[open] > summary { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
.sidebar-group > .sidebar-link { min-height: 36px; margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--yoi-border); border-radius: 0 9px 9px 0; font-size: 12px; }
/* Блюда, заготовки, добавки, продукты и товары — это виды номенклатуры, а не
   отдельные разделы склада наравне с накладными и остатками. Отступ показывает
   подчинение, оставаясь одним плоским списком: приложение для Windows строит
   меню по этим же ссылкам и вложенную разметку не разберёт. */
.sidebar-group > .sidebar-link-sub { margin-left: 38px; }

/* «Быстрый доступ» — последний пункт меню и единственный вне групп. Черта над
   ним отделяет сводку дня от разделов работы, чтобы он не читался как ещё один
   пункт «Курьеров». */
.sidebar-nav > .sidebar-link-summary {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--yoi-border);
    border-radius: 0 0 10px 10px;
}

.sidebar-link svg { flex: 0 0 auto; }

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--yoi-muted) !important;
    padding: 14px 14px 4px;
}

/* Сектор с вложенными разделами */
.sidebar-sector > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--yoi-text);
    cursor: pointer;
    user-select: none;
}

.sidebar-sector > summary::-webkit-details-marker { display: none; }
.sidebar-sector > summary:hover { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
.sidebar-sector[open] > summary { color: var(--yoi-green-dark); }
.sidebar-sector.current > summary { background: var(--yoi-green-light); color: var(--yoi-green-dark); }

.sidebar-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 6px 16px;
    padding-left: 10px;
    border-left: 1px solid var(--yoi-border);
}

.sidebar-sub .sidebar-link {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.sidebar-sub .sidebar-link.active {
    border-left: none;
    padding-left: 10px;
}

/* Подкатегории номенклатуры (Блюда/Заготовки/Продукты/Товары) — вложены ещё на уровень */
.sidebar-sub-nested {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 1px 0 4px 10px;
    padding-left: 10px;
    border-left: 1px dashed var(--yoi-border);
}

.sidebar-sub-nested .sidebar-link {
    padding: 5px 10px;
    font-size: 12.5px;
}

/* ── Топбар и каркас ──────────────────────────────────────────────────────── */

.yoi-topbar {
    background: var(--yoi-surface);
    border-bottom: 1px solid var(--yoi-border);
    min-height: 68px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: var(--yoi-z-sticky);
}

.yoi-topbar h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--yoi-text);
}

.yoi-topbar .yoi-crumbs {
    font-size: 12px;
    color: var(--yoi-muted);
    margin-top: 2px;
}

.yoi-topbar a { color: var(--yoi-green-dark); text-decoration: none; font-weight: 600; font-size: 13px; }
.yoi-topbar a:hover { text-decoration: underline; }
.yoi-topbar a.yoi-btn-primary { color: #fff; }
.yoi-topbar a.yoi-btn:hover { text-decoration: none; }

.yoi-wrap { padding: 20px 24px 48px; }
.yoi-wrap-narrow { max-width: 1100px; }

/* ── Карточки и сетки ─────────────────────────────────────────────────────── */

.yoi-panel {
    background: var(--yoi-surface);
    border: 1px solid var(--yoi-border);
    border-radius: var(--yoi-radius);
    padding: 18px;
    margin-bottom: 16px;
}

/* Заголовок панели — это строка «название + кнопка справа». Она обязана
   переноситься: длинные названия («Расходы, которых система не знает») вместе с
   кнопкой не влезали в узкое окно, и панель уезжала за правый край экрана
   вместе с горизонтальной прокруткой всей страницы. */
.yoi-panel > h2 {
    margin: 0 0 14px;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--yoi-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.yoi-panel > h2 > span { min-width: 0; overflow-wrap: anywhere; }
.yoi-panel > h2 > span:first-child { flex: 1 1 auto; }
.yoi-panel > h2 > .yoi-btn { flex: 0 0 auto; }

.yoi-grid { display: grid; gap: 14px; }
.yoi-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.yoi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yoi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.yoi-grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

@media (max-width: 1100px) {
    .yoi-grid-3, .yoi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .yoi-grid-2, .yoi-grid-3, .yoi-grid-4 { grid-template-columns: 1fr; }
    .yoi-wrap { padding: 16px; }
}

/* Плитка сектора на главной */
.yoi-tile {
    display: block;
    background: var(--yoi-surface);
    border: 1px solid var(--yoi-border);
    border-radius: var(--yoi-radius);
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.yoi-tile:hover {
    border-color: var(--yoi-green);
    transform: translateY(-2px);
    background: var(--yoi-surface-2);
}

.yoi-tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--yoi-green-light);
    color: var(--yoi-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.yoi-tile-title { font-size: 15px; font-weight: 700; }
.yoi-tile-desc { font-size: 12.5px; color: var(--yoi-muted); margin-top: 4px; line-height: 1.45; }
.yoi-tile-meta { font-size: 12px; color: var(--yoi-green-dark); margin-top: 10px; font-weight: 600; }

/* Показатель */
.yoi-stat { background: var(--yoi-surface); border: 1px solid var(--yoi-border); border-radius: var(--yoi-radius); padding: 16px; }
.yoi-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--yoi-muted); font-weight: 700; }
.yoi-stat-value { font-size: 24px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.yoi-stat-sub { font-size: 12px; color: var(--yoi-muted); margin-top: 2px; }

/* ── Таблицы ──────────────────────────────────────────────────────────────── */

.yoi-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    line-height: 1.35;
}

.yoi-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--yoi-muted);
    font-weight: 700;
    height: 42px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--yoi-border);
    white-space: nowrap;
    background: var(--yoi-surface-2);
    vertical-align: middle;
}

.yoi-table td {
    height: 44px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--yoi-border);
    color: var(--yoi-text);
    vertical-align: middle;
}
.yoi-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
.yoi-table tbody tr { background: var(--yoi-surface); transition: background .14s ease; }
.yoi-table tbody tr:nth-child(even) { background: #fbfcfa; }
.yoi-table tbody tr:hover { background: var(--yoi-green-light); }
.yoi-table tr:last-child td { border-bottom: none; }
.yoi-table th.yoi-num,
.yoi-table td.yoi-num,
.yoi-num { text-align: right; font-variant-numeric: tabular-nums; }
.yoi-scroll {
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--yoi-border);
    border-radius: 12px;
    background: var(--yoi-surface);
    scrollbar-gutter: stable;
}
.yoi-scroll > .yoi-table { margin: 0; }

/* Список номенклатуры: колонки фиксированы через <colgroup>, иначе цена и
   остаток «уезжают» при каждой перерисовке — их ширина зависела от самой
   длинной ячейки на странице (длинное название, бейдж, подстрока продукта). */
.yoi-table-nom { table-layout: fixed; min-width: 900px; }
.yoi-table-nom th, .yoi-table-nom td { white-space: normal; overflow-wrap: anywhere; }
.yoi-table-nom td:first-child { line-height: 1.35; }

/* Номенклатура устроена как файловый проводник: дерево папок слева, рабочая
   таблица справа. Это масштабируется на любую глубину без горизонтальных карточек. */
.yoi-nom-browser { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 14px; align-items: start; }
.yoi-nom-browser-single { grid-template-columns: minmax(0, 1fr); }
.yoi-nom-content { min-width: 0; }
.yoi-group-explorer {
    position: sticky;
    top: 78px;
    overflow: hidden;
    border: 1px solid var(--yoi-border);
    border-radius: 12px;
    background: var(--yoi-surface);
}
.yoi-group-explorer-head { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--yoi-border); }
.yoi-group-explorer-head strong { font-size: 13px; }
.yoi-group-sections { max-height: calc(100vh - 154px); overflow: auto; padding: 7px; scrollbar-gutter: stable; }
.yoi-tree-node[aria-expanded="true"] > .yoi-tree-row .yoi-tree-folder { color: var(--yoi-green-dark); }
.yoi-tree-row { display: flex; align-items: center; min-height: 34px; padding-left: calc(var(--tree-depth, 0) * 16px); border-radius: 7px; color: var(--yoi-text); }
.yoi-tree-row:hover { background: var(--yoi-surface-2); }
.yoi-tree-row.is-selected { color: var(--yoi-green-dark); background: var(--yoi-green-light); }
.yoi-tree-toggle,
.yoi-tree-select,
.yoi-tree-action { border: 0; color: inherit; background: transparent; cursor: pointer; }
.yoi-tree-toggle { flex: 0 0 22px; height: 30px; padding: 0; font-size: 20px; line-height: 1; }
.yoi-tree-toggle:disabled { cursor: default; }
.yoi-tree-select { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; padding: 5px 3px; text-align: left; }
.yoi-tree-folder { flex: 0 0 18px; width: 18px; height: 18px; color: #b27a23; }
.yoi-tree-folder svg { width: 18px; height: 18px; }
.yoi-tree-folder-root { color: var(--yoi-green-dark); }
.yoi-tree-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.yoi-tree-count { margin-left: auto; color: var(--yoi-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.yoi-tree-action { display: none; flex: 0 0 26px; width: 26px; height: 28px; padding: 6px; border-radius: 6px; }
.yoi-tree-action svg { width: 14px; height: 14px; }
.yoi-tree-row:hover .yoi-tree-action,
.yoi-tree-row:focus-within .yoi-tree-action { display: inline-flex; align-items: center; justify-content: center; }
.yoi-tree-action:hover { background: rgba(62, 99, 56, .12); }
.yoi-tree-node.is-inactive { opacity: .58; }
.yoi-group-first { display: grid; gap: 10px; justify-items: start; padding: 14px 8px; color: var(--yoi-muted); }
.yoi-group-first p { margin: 0; font-size: 12px; }
.yoi-input[readonly] { color: var(--yoi-muted); background: var(--yoi-bg) !important; cursor: not-allowed; }

@media (max-width: 980px) {
    .yoi-nom-browser { grid-template-columns: 1fr; }
    .yoi-group-explorer { position: static; }
    .yoi-group-sections { max-height: 280px; }
}

/* Бейдж типа и «в продукт» кнопка внутри узких колонок — inline-block с
   white-space:nowrap, поэтому overflow-wrap на td их не спасает: длинное
   значение («Заготовка») просто вылезает за границу ячейки и визуально
   наезжает на соседнюю колонку, из-за чего значения кажутся «не под своими
   заголовками». Реальная фиксированная ширина колонки должна быть жёсткой
   границей для содержимого, а не пожеланием. */
.yoi-table-nom td { overflow: hidden; }
.yoi-table-nom td .yoi-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* Технологическая карта и акт проработки: настоящая сетка, как в Excel —
   без вертикальных границ строка заголовков читается сплошным текстом, а не
   таблицей. Инпуты внутри ячеек прозрачные и без рамки в состоянии покоя,
   чтобы сетку задавали границы ячеек, а не хаос из мелких боксов. */
.yoi-table-tech { border: 0; }
.yoi-table-tech th, .yoi-table-tech td {
    border-right: 1px solid var(--yoi-border);
    border-bottom: 1px solid var(--yoi-border);
}
.yoi-table-tech th:last-child, .yoi-table-tech td:last-child { border-right: none; }
.yoi-table-tech tr:last-child td { border-bottom: none; }
.yoi-table-tech th {
    font-size: 11.5px;
    color: var(--yoi-green-dark);
    background: #e8f1d8;
    border-bottom: 2px solid var(--yoi-border-strong);
}
.yoi-table-tech tbody tr:nth-child(even) { background: var(--yoi-surface-2); }
.yoi-table-tech tbody tr:hover { background: var(--yoi-green-light); }
.yoi-table-tech td { padding: 6px 8px; }
.yoi-table-tech .yoi-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 5px;
    font-size: 12.5px;
    background: transparent;
}
.yoi-table-tech .yoi-input:focus {
    outline: none;
    background: var(--yoi-surface);
    border-color: var(--yoi-green);
    box-shadow: 0 0 0 2px var(--yoi-green-light);
}

/* Строка-заготовка — обычная строка той же сетки (номер вместо значка «+»,
   поля ровно по своим колонкам), а не отдельная форма под таблицей. Заполнил
   хотя бы название — строка становится настоящей, а на её месте появляется
   следующая пустая под тем же номером+1. */
.yoi-table-tech .yoi-draft-row { background: var(--yoi-surface-2) !important; }
.yoi-table-tech .yoi-draft-row td { border-top: 1px dashed var(--yoi-border-strong); }
.yoi-table-tech .yoi-draft-row .yoi-input,
.yoi-table-tech .yoi-draft-row .yoi-select { background: var(--yoi-surface); }

.yoi-tech-total {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding: 10px 16px;
    background: var(--yoi-green-light);
    border: 1px solid var(--yoi-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--yoi-green-dark);
}

/* ── Элементы управления ──────────────────────────────────────────────────── */

.yoi-btn {
    border: none;
    border-radius: 9px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    justify-content: center;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.yoi-btn-primary { background: var(--yoi-green); color: #fff; }
.yoi-btn-primary:hover { background: var(--yoi-green-dark); }
.yoi-btn-outline { background: var(--yoi-surface); color: var(--yoi-green-dark); border: 1px solid var(--yoi-border-strong); }
.yoi-btn-outline:hover { background: var(--yoi-green-light); }
.yoi-btn-ghost { background: transparent; color: var(--yoi-muted); }
.yoi-btn-ghost:hover { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
.yoi-btn-danger { background: #fef2f2; color: var(--yoi-red); }
.yoi-btn-danger:hover { background: #fee2e2; }
.yoi-btn-sm { padding: 5px 10px; font-size: 12px; }
.yoi-btn:disabled { opacity: .5; cursor: not-allowed; }
.yoi-btn:active:not(:disabled), .yoi-icon-btn:active:not(:disabled) { transform: translateY(1px); }
.yoi-btn:focus-visible, .yoi-icon-btn:focus-visible,
.sidebar-link:focus-visible, .sidebar-sector > summary:focus-visible,
.yoi-tab:focus-visible, .hbtn:focus-visible {
    outline: none;
    box-shadow: var(--yoi-focus);
}

.yoi-icon-btn {
    border: 1px solid var(--yoi-border-strong);
    background: var(--yoi-surface);
    color: var(--yoi-green-dark);
    border-radius: 9px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.yoi-icon-btn:hover { background: var(--yoi-green-light); border-color: var(--yoi-green); }
.yoi-icon-btn svg { width: 16px; height: 16px; }
.yoi-icon-btn.yoi-icon-btn-primary { background: var(--yoi-green); border-color: var(--yoi-green); color: #fff; }
.yoi-icon-btn.yoi-icon-btn-primary:hover { background: var(--yoi-green-dark); border-color: var(--yoi-green-dark); }

.yoi-input, .yoi-select, .yoi-textarea {
    border: 1px solid var(--yoi-border-strong);
    border-radius: 9px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--yoi-text);
    background: var(--yoi-surface);
    outline: none;
    width: 100%;
}

.yoi-input::placeholder, .yoi-textarea::placeholder { color: #657269; opacity: 1; }
.yoi-input:focus, .yoi-select:focus, .yoi-textarea:focus { border-color: var(--yoi-green); box-shadow: var(--yoi-focus); }
.yoi-textarea { min-height: 90px; resize: vertical; }
.yoi-order-editor { max-width: 760px; }
.yoi-order-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.yoi-order-edit-wide { grid-column: 1 / -1; }
.yoi-order-edit-button { min-height: 34px; padding: 6px 10px; white-space: nowrap; }

.yoi-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.yoi-label { font-size: 12px; font-weight: 600; color: var(--yoi-muted); }
.yoi-hint { font-size: 11.5px; color: var(--yoi-muted); line-height: 1.4; }

.yoi-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.yoi-check input { width: 16px; height: 16px; accent-color: var(--yoi-green); }
.yoi-color-swatch { display: inline-block; width: 16px; height: 16px; border: 1px solid var(--yoi-border-strong); border-radius: 5px; vertical-align: -3px; margin-right: 7px; }
.yoi-input.yoi-color-input {
    flex: 0 0 58px;
    width: 58px;
    max-width: 58px;
    min-height: 42px;
    padding: 5px;
    cursor: pointer;
}
.yoi-color-field { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }

.yoi-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Метки ────────────────────────────────────────────────────────────────── */

.yoi-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
}

.yoi-badge-green { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
.yoi-badge-red { background: #fef2f2; color: var(--yoi-red); }
.yoi-badge-amber { background: #fffbeb; color: var(--yoi-amber); }
.yoi-badge-blue { background: #eff6ff; color: var(--yoi-blue); }
.yoi-badge-gray { background: #f1f5f4; color: var(--yoi-muted); }
.yoi-badge-ai { background: #f5f3ff; color: #7c3aed; }

.yoi-muted { color: var(--yoi-muted); font-size: 12.5px; }
.yoi-empty { padding: 28px; text-align: center; color: var(--yoi-muted); font-size: 13px; }

/* ── Вкладки ──────────────────────────────────────────────────────────────── */

.yoi-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--yoi-border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.yoi-tab {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--yoi-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.yoi-tab:hover { color: var(--yoi-green-dark); }
.yoi-tab.active { color: var(--yoi-green-dark); border-bottom-color: var(--yoi-green); }

/* ── Модальное окно ───────────────────────────────────────────────────────── */

.yoi-modal-bd {
    position: fixed;
    inset: 0;
    background: rgba(39, 43, 56, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: var(--yoi-z-modal);
}

.yoi-modal-bd.open { display: flex; }

.yoi-modal {
    background: var(--yoi-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px;
    box-shadow: 0 8px 18px rgba(39, 43, 56, .16);
}

.yoi-modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; }

/* Карточка номенклатуры: у техкарты 16 колонок, узкая модалка вечно прячет
   половину за скролл. На широких экранах даём место всем сразу; на узких —
   .yoi-scroll вокруг таблицы остаётся страховкой. */
.yoi-modal-wide { max-width: 1600px; }
@media (max-width: 900px) {
    .yoi-modal-bd { padding: 8px; }
}

/* ── Всплывающее уведомление ──────────────────────────────────────────────── */

.yoi-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--yoi-green-dark);
    color: #fff;
    padding: 11px 18px;
    border-radius: 11px;
    font-size: 13px;
    z-index: var(--yoi-z-toast);
    display: none;
    max-width: 420px;
    box-shadow: 0 12px 32px -12px rgba(39, 43, 56, .45);
}

.yoi-toast.error { background: var(--yoi-red); }
.yoi-toast.show { display: block; }

/* ── Значок ИИ ────────────────────────────────────────────────────────────── */

.yoi-ai-note {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #6b21a8;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.yoi-ai-off {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* ── Унаследованные рабочие страницы внутри секторов YOI ─────────────────── */

/*
 * Эти экраны сохраняют проверенные формы и API, но включаются в новый дизайн
 * только явным body-классом. Так стили панели не протекают на клиентский сайт.
 */
.yoi-legacy {
    min-width: 320px;
    background: var(--yoi-bg) !important;
    color: var(--yoi-text);
}

.yoi-legacy #main-content {
    width: calc(100% - 240px);
    max-width: 1680px;
    margin-right: auto;
}

.yoi-legacy #sidebar { box-shadow: none !important; }
.yoi-legacy .sidebar-link.active {
    padding-left: 14px !important;
    border-left: 0 !important;
}

.yoi-legacy h1,
.yoi-legacy h2,
.yoi-legacy h3 { color: var(--yoi-text) !important; }

.yoi-legacy .card,
.yoi-legacy .main-card,
.yoi-legacy .chart-card,
.yoi-legacy .stat-card {
    border: 1px solid var(--yoi-border) !important;
    border-radius: var(--yoi-radius) !important;
    background: var(--yoi-surface) !important;
    box-shadow: none !important;
}

.yoi-legacy .main-card + .main-card { border-top-color: var(--yoi-border) !important; }

.yoi-legacy input:not([type="checkbox"]):not([type="radio"]),
.yoi-legacy select,
.yoi-legacy textarea,
.yoi-legacy .form-input,
.yoi-legacy .field-input,
.yoi-legacy .field-select,
.yoi-legacy .search-input,
.yoi-legacy .date-input {
    border-color: var(--yoi-border-strong) !important;
    border-radius: 10px !important;
    background: var(--yoi-surface) !important;
    color: var(--yoi-text) !important;
}

.yoi-legacy :where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--yoi-green) !important;
    outline-offset: 2px !important;
    box-shadow: var(--yoi-focus) !important;
}

.yoi-legacy input:not([type="checkbox"]):not([type="radio"]):focus,
.yoi-legacy select:focus,
.yoi-legacy textarea:focus,
.yoi-legacy .form-input:focus,
.yoi-legacy .field-input:focus,
.yoi-legacy .field-select:focus,
.yoi-legacy .search-input:focus,
.yoi-legacy .date-input:focus {
    border-color: var(--yoi-green) !important;
}

.yoi-legacy .btn,
.yoi-legacy .btn-save,
.yoi-legacy .save-btn,
.yoi-legacy .apply-btn,
.yoi-legacy button[style*="background:#16a34a"],
.yoi-legacy button[style*="background: #16a34a"] {
    border-color: var(--yoi-green) !important;
    background: var(--yoi-green) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.yoi-legacy .btn:hover,
.yoi-legacy .btn-save:hover,
.yoi-legacy .save-btn:hover,
.yoi-legacy .apply-btn:hover,
.yoi-legacy button[style*="background:#16a34a"]:hover,
.yoi-legacy button[style*="background: #16a34a"]:hover {
    background: var(--yoi-green-dark) !important;
}

.yoi-legacy .btn-ghost,
.yoi-legacy .btn-cancel,
.yoi-legacy .cancel-btn,
.yoi-legacy .sort-btn,
.yoi-legacy .action-btn,
.yoi-legacy .act-edit {
    min-height: 40px;
    border-color: var(--yoi-border-strong) !important;
    background: var(--yoi-surface) !important;
    color: var(--yoi-text) !important;
    box-shadow: none !important;
}

.yoi-legacy .btn-ghost:hover,
.yoi-legacy .btn-cancel:hover,
.yoi-legacy .cancel-btn:hover,
.yoi-legacy .sort-btn:hover,
.yoi-legacy .action-btn:hover,
.yoi-legacy .act-edit:hover {
    border-color: var(--yoi-green) !important;
    background: var(--yoi-green-light) !important;
    color: var(--yoi-green-dark) !important;
}

.yoi-legacy .pbtn.active,
.yoi-legacy .seg.active,
.yoi-legacy .sort-btn.active,
.yoi-legacy .type-btn.selected,
.yoi-legacy .sel-chip {
    border-color: var(--yoi-green) !important;
    background: var(--yoi-green-light) !important;
    color: var(--yoi-green-dark) !important;
}

.yoi-legacy .pbtn.active { background: var(--yoi-green) !important; color: #fff !important; }
.yoi-legacy .pbtn:hover { background: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; }
.yoi-legacy .toggle-sw input:checked + .toggle-track { background: var(--yoi-green) !important; }

.yoi-legacy .hbtn {
    border-color: var(--yoi-border-strong) !important;
    background: var(--yoi-surface) !important;
    box-shadow: none !important;
}
.yoi-legacy .hbtn:hover { border-color: var(--yoi-green) !important; background: var(--yoi-green-light) !important; }
.yoi-legacy .feature-li svg { color: var(--yoi-green) !important; }

.yoi-legacy main [style*="overflow-x:auto"],
.yoi-legacy main [style*="overflow-x: auto"] {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    scrollbar-color: var(--yoi-border-strong) transparent;
}

.yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) {
    color: var(--yoi-text);
}

.yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) th {
    border-color: var(--yoi-border) !important;
    background: var(--yoi-surface-2) !important;
    color: var(--yoi-muted) !important;
}

.yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) td {
    border-color: var(--yoi-border) !important;
    color: var(--yoi-text);
}

.yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) tbody tr:hover td {
    background: var(--yoi-green-light) !important;
}

.yoi-legacy .modal-overlay { background: rgba(39, 43, 56, .58) !important; }
.yoi-legacy .modal-card,
.yoi-legacy .modal-box {
    border: 1px solid var(--yoi-border) !important;
    border-radius: 18px !important;
    background: var(--yoi-surface) !important;
    box-shadow: 0 24px 70px rgba(39, 43, 56, .22) !important;
}
.yoi-legacy .modal-head,
.yoi-legacy .modal-header {
    border-color: var(--yoi-border) !important;
    background: var(--yoi-surface-2) !important;
}
.yoi-legacy .modal-head #modal-title,
.yoi-legacy .modal-header #modalTitle { color: var(--yoi-text) !important; }

@media (max-width: 900px) {
    .yoi-legacy #main-content {
        width: 100%;
        max-width: none;
        padding: 16px 14px 36px !important;
    }
    .yoi-legacy #sidebar { box-shadow: 12px 0 36px rgba(39, 43, 56, .16) !important; }
    .yoi-legacy #mob-bd { background: rgba(39, 43, 56, .48) !important; }
}

@media (max-width: 560px) {
    .yoi-order-edit-grid { grid-template-columns: 1fr; }
    .yoi-order-edit-wide { grid-column: auto; }
    .yoi-legacy #stat-grid { grid-template-columns: 1fr !important; }
    .yoi-legacy #chart-row { grid-template-columns: 1fr !important; }
    .yoi-legacy .stat-card,
    .yoi-legacy .main-card,
    .yoi-legacy .chart-card,
    .yoi-legacy .card { padding: 16px !important; }
    .yoi-legacy .main-card[style*="overflow-x:auto"] { padding: 0 !important; }
    .yoi-legacy :where(button, .btn, .btn-ghost, .btn-save, .btn-cancel, .save-btn, .cancel-btn, .apply-btn, .sort-btn, .action-btn, .act-btn) {
        min-height: 48px;
    }
    .yoi-legacy input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    .yoi-legacy select,
    .yoi-legacy textarea { min-height: 48px; }
    .yoi-legacy main [style*="overflow-x:auto"],
    .yoi-legacy main [style*="overflow-x: auto"] { margin-inline: -2px; }
    .yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) { min-width: 680px; }
    .yoi-legacy .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
    .yoi-legacy .modal-card,
    .yoi-legacy .modal-box {
        width: 100% !important;
        max-width: none !important;
        max-height: 94dvh !important;
        border-radius: 18px 18px 0 0 !important;
    }
}

@media (max-width: 900px) {
    .yoi-topbar { min-height: 62px; padding: 10px 16px; }
    .yoi-topbar h1 { font-size: 16px; line-height: 1.25; }
    .yoi-topbar .yoi-crumbs { white-space: normal; }
    .yoi-wrap { padding: 16px 14px 36px; }
    .yoi-panel { padding: 14px; }
}

@media (max-width: 560px) {
    .yoi-topbar { align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px 12px; }
    .yoi-topbar > :first-child { flex: 1 1 220px; min-width: 0; }
    .yoi-topbar > :first-child > div { min-width: 0; }
    .yoi-topbar > .yoi-row { flex: 1 0 100%; gap: 8px; }
    .yoi-topbar > .yoi-row .yoi-btn { flex: 1 1 0; }
    .yoi-btn { min-height: 48px; }
    .yoi-icon-btn { width: 48px; height: 48px; }
    .yoi-input, .yoi-select { min-height: 48px; }
    .hbtn { width: 48px !important; height: 48px !important; }
    .sidebar-group > summary, .sidebar-group > .sidebar-link { min-height: 48px; }
    .yoi-panel > .yoi-row .yoi-input, .yoi-panel > .yoi-row .yoi-select { flex: 1 1 220px; max-width: none !important; }
    .yoi-panel > .yoi-row .yoi-input.yoi-color-input { flex: 0 0 58px; width: 58px; max-width: 58px !important; }
    .yoi-panel > .yoi-row .yoi-btn { flex: 1 1 160px; }
    .yoi-mobile-cards-wrap { border: 0; background: transparent; overflow: visible; }
    .yoi-mobile-cards, .yoi-mobile-cards tbody { display: block; width: 100%; }
    .yoi-mobile-cards thead { display: none; }
    .yoi-mobile-cards tbody tr {
        display: block;
        margin-bottom: 10px;
        padding: 4px 12px;
        border: 1px solid var(--yoi-border);
        border-radius: var(--yoi-radius);
        background: var(--yoi-surface) !important;
    }
    .yoi-mobile-cards tbody td {
        display: grid;
        grid-template-columns: minmax(88px, 36%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 48px;
        height: auto;
        padding: 8px 0;
        overflow-wrap: anywhere;
    }
    .yoi-mobile-cards tbody td::before {
        content: attr(data-label);
        color: var(--yoi-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .02em;
        text-transform: uppercase;
    }
    .yoi-mobile-cards tbody td:last-child { border-bottom: 0; }
    .yoi-mobile-cards tbody td:last-child .yoi-btn { width: 100%; }
    .yoi-modal { padding: 16px; border-radius: 12px; }
    .yoi-scroll { margin-inline: -4px; border-radius: 10px; }
}



/* ────────────────────────────────────────────────────────────────────────
   Кухня: касса (создание заказа) и доска активных заказов.
   Обе страницы работают весь день на одном экране, поэтому у них свои
   плотные раскладки, а не общая сетка панели: касса — «меню + чек» в две
   колонки, доска — канбан по стадиям готовки.
   ──────────────────────────────────────────────────────────────────────── */

/* Атрибут hidden должен побеждать раскладку: display:grid/flex у панели заказа
   и у полей времени иначе показывают то, что скрыто скриптом (раздельная
   оплата и точное время «висели» открытыми при снятой галочке). */
.yoi [hidden] { display: none !important; }

.yoi-reg { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 16px; align-items: start; }
.yoi-reg-menu { min-width: 0; }
.yoi-reg-cats { flex-wrap: wrap; }
.yoi-reg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.yoi-reg-tile {
    position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 92px;
    padding: 12px 13px; border: 1px solid var(--yoi-border); border-radius: 13px;
    background: var(--yoi-surface); color: var(--yoi-text); text-align: left; cursor: pointer;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.yoi-reg-tile:hover:not(:disabled) { border-color: var(--yoi-green); box-shadow: 0 6px 18px rgba(15, 118, 110, .13); transform: translateY(-1px); }
.yoi-reg-tile:disabled { cursor: not-allowed; opacity: .55; }
.yoi-reg-tile-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.yoi-reg-tile-meta { margin-top: auto; color: var(--yoi-green-dark); font-size: 13px; font-weight: 800; }
.yoi-reg-tile-stop { color: var(--yoi-red); font-size: 11px; font-weight: 700; }
/* Папка склада в кассе: та же плитка, но ведёт вглубь, а не в чек. */
.yoi-reg-tile.is-folder { background: var(--yoi-green-soft); border-style: dashed; }
.yoi-reg-tile.is-folder .yoi-reg-tile-name { color: var(--yoi-green-dark); }
.yoi-reg-tile-sku { color: var(--yoi-muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.yoi-reg-up {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px;
    padding: 7px 12px; border: 1px solid var(--yoi-border); border-radius: 10px;
    background: var(--yoi-green-light); color: var(--yoi-green-dark);
    font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.yoi-reg-tile-badge {
    position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 7px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
    background: var(--yoi-green); color: #fff; font-size: 12px; font-weight: 800;
}

.yoi-reg-ticket { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; }
.yoi-reg-lines { display: grid; gap: 8px; }
.yoi-reg-line { padding: 10px 11px; border: 1px solid var(--yoi-border); border-radius: 12px; background: var(--yoi-surface-2); }
.yoi-reg-line-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.yoi-reg-line-name { min-width: 0; font-size: 13.5px; }
.yoi-reg-line-sum { white-space: nowrap; color: var(--yoi-green-dark); }
.yoi-reg-line-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.yoi-reg-stepper { display: flex; align-items: center; gap: 6px; }
.yoi-reg-step {
    width: 32px; height: 32px; border: 1px solid var(--yoi-border-strong); border-radius: 9px;
    background: var(--yoi-surface); color: var(--yoi-green-dark); font-size: 17px; line-height: 1; cursor: pointer;
}
.yoi-reg-step:hover { background: var(--yoi-green-light); }
.yoi-reg-line-comment { flex: 1; min-width: 0; height: 36px; font-size: 12.5px; }
.yoi-reg-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--yoi-border); }
.yoi-reg-total b { font-size: 22px; }
.yoi-reg-head { margin: 18px 0 8px; font-size: 14px; font-weight: 750; color: var(--yoi-text); }
.yoi-reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.yoi-reg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.yoi-reg-chip {
    min-height: 38px; padding: 0 15px; border: 1px solid var(--yoi-border-strong); border-radius: 999px;
    background: var(--yoi-surface); color: var(--yoi-muted); font-size: 13px; font-weight: 700; cursor: pointer;
}
.yoi-reg-chip:hover { color: var(--yoi-green-dark); background: var(--yoi-green-light); }
.yoi-reg-chip.is-active { border-color: var(--yoi-green); background: var(--yoi-green-light); color: var(--yoi-green-dark); font-weight: 800; }
.yoi-reg-req { color: var(--yoi-red); font-weight: 700; }
.yoi-reg-opt { color: var(--yoi-muted); font-weight: 500; }
.yoi-reg-phone { display: flex; align-items: stretch; }
.yoi-reg-phone-prefix {
    display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--yoi-border-strong);
    border-right: 0; border-radius: 10px 0 0 10px; background: var(--yoi-green-light);
    color: var(--yoi-green-dark); font-size: 15px; font-weight: 800;
}
.yoi-reg-phone .yoi-input { border-radius: 0 10px 10px 0; }
.yoi-reg-time { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.yoi-reg-time-input { width: 96px; font-size: 19px; font-weight: 800; letter-spacing: .06em; text-align: center; }
.yoi-reg-suggest-wrap { position: relative; }
.yoi-reg-suggest {
    position: absolute; top: 100%; left: 0; right: 0; z-index: var(--yoi-z-dropdown);
    max-height: 260px; overflow-y: auto; margin-top: 4px; border: 1px solid var(--yoi-border-strong);
    border-radius: 12px; background: var(--yoi-surface); box-shadow: var(--yoi-shadow);
}
.yoi-reg-suggest[hidden] { display: none; }
.yoi-reg-suggest-item {
    display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 9px 13px;
    border: 0; border-bottom: 1px solid var(--yoi-border); background: transparent; text-align: left; cursor: pointer;
}
.yoi-reg-suggest-item:last-child { border-bottom: 0; }
.yoi-reg-suggest-item:hover, .yoi-reg-suggest-item.is-active { background: var(--yoi-green-light); }
.yoi-reg-suggest-title { color: var(--yoi-text); font-size: 13.5px; font-weight: 700; }
.yoi-reg-suggest-sub { color: var(--yoi-muted); font-size: 11.5px; }
.yoi-reg-error { margin-top: 6px; padding: 8px 11px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 12.5px; }
.yoi-reg-error[hidden] { display: none; }
.yoi-reg-submit { position: sticky; bottom: 0; display: grid; gap: 6px; margin: 16px -18px -18px; padding: 14px 18px; border-top: 1px solid var(--yoi-border); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }

/* Доска активных заказов — канбан по стадиям готовки. */
.yoi-board-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.yoi-board-bar .yoi-input { max-width: 260px; }
.yoi-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.yoi-board-col { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--yoi-border); border-radius: var(--yoi-radius); background: var(--yoi-surface-2); }
.yoi-board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--yoi-border); }
.yoi-board-col-title { font-size: 13px; font-weight: 800; color: var(--yoi-text); }
.yoi-board-col-count { min-width: 24px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--yoi-surface); color: var(--yoi-muted); font-size: 12px; font-weight: 800; }
.yoi-board-col-body { display: grid; gap: 10px; padding: 11px; min-height: 96px; max-height: calc(100vh - 250px); overflow-y: auto; }
.yoi-board-col-empty { padding: 18px 6px; color: var(--yoi-muted); font-size: 12.5px; text-align: center; }

.yoi-kcard { border: 1px solid var(--yoi-border); border-left: 4px solid var(--yoi-green); border-radius: 12px; background: var(--yoi-surface); padding: 11px 12px; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.yoi-kcard:hover, .yoi-kcard:focus-visible { box-shadow: 0 8px 22px rgba(15, 118, 110, .14); transform: translateY(-1px); outline: none; }
.yoi-kcard.is-warm { border-left-color: #d19a27; }
.yoi-kcard.is-hot { border-left-color: var(--yoi-red); }
.yoi-kcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yoi-kcard-num { font-size: 16px; font-weight: 800; }
.yoi-kcard-age { padding: 2px 8px; border-radius: 999px; background: var(--yoi-surface-2); color: var(--yoi-muted); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.yoi-kcard.is-warm .yoi-kcard-age { background: #fffbeb; color: var(--yoi-amber); }
.yoi-kcard.is-hot .yoi-kcard-age { background: #fef2f2; color: var(--yoi-red); }
.yoi-kcard-when { margin: 7px 0 2px; color: var(--yoi-green-dark); font-size: 13px; font-weight: 800; }
/* Срок на карточке. «Как можно скорее» и «ко времени» раньше выглядели
   одинаково («Ждут к 19:30»), и заказ на вечер готовили как срочный. Теперь
   срочный — зелёной плашкой, а заказ ко времени и предзаказ — янтарной: их
   видно в колонке, не открывая карточку. */
.yoi-kcard-when.is-asap,
.yoi-kcard-when.is-timed { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 14px; }
.yoi-kcard-when.is-asap { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
.yoi-kcard-when.is-timed { background: #fef3c7; color: var(--yoi-amber); box-shadow: inset 0 0 0 1px #f3c96b; }
.yoi-kcard-when-note { color: var(--yoi-muted); font-size: 12px; font-weight: 700; }
/* Адрес на карточке идёт одной строкой целиком — город, улица, дом, подъезд,
   этаж, квартира, домофон и как найти гостя («частный дом», «вход со двора»).
   Делить его на «куда ехать» и «куда звонить» на карточке не надо: читают всё
   сразу, и разорванный адрес только сбивает. Деление осталось там, где оно и
   нужно: навигатору курьера и чеку, который уезжает с заказом. */
.yoi-kcard-where {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--yoi-text);
    font-size: 12.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
/* Комментарий гостя к заказу («побольше имбиря»). Раньше на карточке был только
   значок «комментарий», и текст читали, открыв заказ, — то есть обычно не
   читали вовсе. */
.yoi-kcard-comment {
    margin-top: 4px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #fffbeb;
    border-left: 3px solid var(--yoi-amber);
    color: var(--yoi-text);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.yoi-kcard-meta { margin-top: 4px; color: var(--yoi-muted); font-size: 11.5px; }
.yoi-kcard-items { margin: 9px 0 0; padding: 9px 0 0; border-top: 1px dashed var(--yoi-border); font-size: 12.5px; line-height: 1.6; }
.yoi-kcard-items b { font-variant-numeric: tabular-nums; }
.yoi-kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.yoi-kcard-sum { font-size: 14px; font-weight: 800; }
.yoi-kcard-actions { display: flex; gap: 6px; }
.yoi-kcard-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

@media (max-width: 1180px) {
    .yoi-reg { grid-template-columns: minmax(0, 1fr); }
    .yoi-reg-ticket { position: static; max-height: none; }
}

@media (max-width: 680px) {
    .yoi-reg-grid { grid-template-columns: minmax(0, 1fr); }
    /* На телефоне стадии складываются в одну колонку: горизонтальная прокрутка
       канбана на узком экране требует двух рук, а кухня работает одной. */
    .yoi-board { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
    .yoi-board-col-body { max-height: none; }
}

/* ── Без анимации ─────────────────────────────────────────────────────────────
   Переходы, всплытия и сдвиги в панели убраны намеренно: смена работает на
   слабых машинах и внутри WebView, где они шли рывками и читались как
   поломка интерфейса. Состояние меняется мгновенно — так виднее, что нажатие
   сработало. */
.yoi, .yoi *, .yoi *::before, .yoi *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Скидки на кассе: поле процента у позиции и скидка на весь чек. */
.yoi-reg-line-discount { width: 92px; flex-shrink: 0; }
.yoi-reg-discount {
    display: flex; align-items: center; gap: 8px; padding: 10px 0;
    border-top: 1px solid var(--yoi-border);
}
.yoi-reg-discount .yoi-input { width: 80px; }
.yoi-reg-discount .yoi-muted { flex: 1; }

/* ── Карточка заказа на доске кухни ───────────────────────────────────────
 *
 * Разметка карточки (`yoi/kitchen-board.html`) существовала, а стилей к ней не
 * было ни одного: все классы `yoi-order-*` были объявлены только в шаблоне.
 * Поэтому «модалка» не всплывала над доской, а разворачивалась простым блоком
 * в потоке страницы — поля в столбик во всю ширину, крестик обычной кнопкой,
 * список заказов уезжал вниз. Открыть заказ было можно, работать — тяжело.
 *
 * Здесь те же приёмы и токены, что у общей `.yoi-modal-bd`: одинаковая
 * подложка, радиус и тень, чтобы карточка заказа не выглядела чужой. Своя
 * пара классов, а не переиспользование общей, нужна из-за `hidden`: доска
 * переключает видимость атрибутом, а не классом `.open`.
 */

.yoi-order-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 20px;
    overflow-y: auto;
    background: rgba(39, 43, 56, .45);
    z-index: var(--yoi-z-modal);
}

/* Доска прячет карточку атрибутом hidden — display:flex перебил бы его. */
.yoi-order-modal[hidden] { display: none; }

/* Пока карточка открыта, страница под ней не прокручивается: иначе колесо
   мыши над карточкой уводит доску, и заказ «убегает» из-под курсора. */
body.yoi-modal-open { overflow: hidden; }

.yoi-order-dialog {
    width: 100%;
    max-width: 860px;
    /* Центрируем только по горизонтали. Вертикальный auto-margin во flex-боксе
       с прокруткой обрезает верх карточки, когда она выше экрана, — и добраться
       до заголовка со статусом уже нельзя: прокрутка начинается ниже него. */
    margin: 0 auto;
    padding: 22px;
    border-radius: 16px;
    background: var(--yoi-surface);
    box-shadow: 0 8px 18px rgba(39, 43, 56, .16);
}

.yoi-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.yoi-order-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.yoi-order-head .yoi-muted { font-size: 12px; }

.yoi-order-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid var(--yoi-border);
    border-radius: 10px;
    background: var(--yoi-surface);
    color: var(--yoi-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.yoi-order-close:hover { border-color: var(--yoi-border-strong); color: var(--yoi-text); }

/* Две колонки: карточка заказа — это пары «подпись → значение», и в один
   столбец она растягивается на два экрана прокрутки. */
.yoi-order-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.yoi-order-span-2 { grid-column: 1 / -1; }

/* Как найти гостя («вход со двора», «шлагбаум») — текст гостя, а не поле формы:
   его не правят, его читают перед выездом. */
.yoi-order-address-note {
    grid-column: 1 / -1;
    margin-top: -6px;
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(233, 139, 95, .14);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.yoi-order-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--yoi-border);
}

.yoi-order-section-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.yoi-order-section-head b { font-size: 17px; font-weight: 800; color: var(--yoi-green-dark); }

.yoi-order-items { display: grid; gap: 8px; }

.yoi-order-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--yoi-border);
    border-radius: 12px;
    background: var(--yoi-surface-2);
}

.yoi-order-item-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yoi-order-item-copy b { font-size: 14px; font-weight: 700; }
.yoi-order-item-copy .yoi-muted { font-size: 12px; }

/* Подпись только для экранного диктора. В панели этого класса не было вовсе —
   и «Количество» из строки состава печаталось на экране обычным текстом. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.yoi-order-qty { text-align: center; }
.yoi-order-line-total { font-size: 14px; font-weight: 800; white-space: nowrap; }
.yoi-order-line-total s { font-weight: 500; color: var(--yoi-muted); margin-right: 2px; }
/* Скидка заказа под составом: сколько и откуда — сотрудник или промокод. */
.yoi-order-discount {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 8px; padding: 10px 12px;
    border: 1px dashed var(--yoi-border-strong); border-radius: 12px;
    font-size: 13px; color: var(--yoi-muted);
}
.yoi-order-discount b { color: var(--yoi-text); font-size: 13.5px; }

.yoi-order-remove {
    width: 30px;
    height: 30px;
    border: 1px solid var(--yoi-border);
    border-radius: 9px;
    background: var(--yoi-surface);
    color: var(--yoi-red);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.yoi-order-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.yoi-order-add-row .yoi-select { flex: 1; min-width: 0; }

.yoi-order-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--yoi-border);
}

/* «Сохранить» уезжает вправо: это единственное действие, которое меняет сам
   заказ, — остальные кнопки рядом с ним относятся к статусу и печати. */
.yoi-order-actions .yoi-btn-primary { margin-left: auto; }

.yoi-order-error {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(180, 35, 47, .35);
    border-radius: 10px;
    background: #fef2f2;
    color: var(--yoi-red);
    font-size: 13px;
}

.yoi-order-error[hidden] { display: none; }

@media (max-width: 900px) {
    .yoi-order-modal { padding: 10px; }
    .yoi-order-dialog { padding: 16px; }
    .yoi-order-form-grid { grid-template-columns: 1fr; }
    .yoi-order-span-2 { grid-column: auto; }
    /* На узком экране название занимает всю ширину, а количество, сумма и
       крестик выстраиваются под ним одной строкой: четыре колонки в 360
       пикселях превращают название блюда в один слог на строку. */
    .yoi-order-item-row { grid-template-columns: 84px minmax(0, 1fr) auto; }
    .yoi-order-item-copy { grid-column: 1 / -1; }
    .yoi-order-line-total { text-align: right; }
    .yoi-order-actions .yoi-btn-primary { margin-left: 0; }
}

/* ── Быстрый доступ: часы и боковая колонка ───────────────────────────────── */

/* График слева, действия справа: график читают взглядом, по действиям кликают.
   На узком экране колонки встают друг под друга — столбики часов остаются
   читаемыми до самой ширины телефона. */
.yoi-quick-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    align-items: stretch;
}

.yoi-quick-side { display: flex; flex-direction: column; justify-content: flex-start; }

.yoi-hours {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 150px;
    padding: 12px 4px 0;
}

.yoi-hour { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }

.yoi-hour-bar {
    background: var(--yoi-green);
    border-radius: 3px 3px 0 0;
    min-height: 0;
    transition: height .2s ease;
}

.yoi-hour-label {
    font-size: 10px;
    color: var(--yoi-muted);
    text-align: center;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .yoi-quick-row { grid-template-columns: minmax(0, 1fr); }
    /* Каждый второй час — иначе подписи сливаются в полосу. */
    .yoi-hour:nth-child(even) .yoi-hour-label { visibility: hidden; }
}


/* ── Панель как приложение на iPhone ──────────────────────────────────────────
 *
 * Своего клиента под iOS у нас нет, и курьер ставит панель на домашний экран —
 * Safari в этом режиме показывает её без адресной строки, то есть как
 * приложение. Вместе с полным экраном приходят две области, которых нет в
 * браузере: вырез сверху и полоса жеста снизу. Не учесть их — значит спрятать
 * под ними шапку и нижнюю кнопку.
 *
 * Отступы берём из системы, а не из чисел: у разных айфонов они разные, и
 * подобранные вручную превращаются в щель на одном и в наползание на другом.
 */
@supports (padding: env(safe-area-inset-top)) {
    .yoi-topbar {
        padding-top: calc(12px + env(safe-area-inset-top));
        padding-left: calc(24px + env(safe-area-inset-left));
        padding-right: calc(24px + env(safe-area-inset-right));
    }

    .yoi-wrap {
        padding-bottom: calc(48px + env(safe-area-inset-bottom));
        padding-left: calc(24px + env(safe-area-inset-left));
        padding-right: calc(24px + env(safe-area-inset-right));
    }

    /* На телефоне поля уже, и прибавлять к ним настольные 24px нельзя —
       содержимое ужалось бы вдвое на экране, где места и так нет. */
    @media (max-width: 900px) {
        .yoi-wrap {
            padding: 16px;
            padding-bottom: calc(16px + env(safe-area-inset-bottom));
            padding-left: calc(16px + env(safe-area-inset-left));
            padding-right: calc(16px + env(safe-area-inset-right));
        }
        .yoi-topbar {
            padding-left: calc(16px + env(safe-area-inset-left));
            padding-right: calc(16px + env(safe-area-inset-right));
        }
    }

    #sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Модальное окно на телефоне занимает почти весь экран: его кнопки не
       должны оказаться под полосой жеста. */
    .yoi-modal {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* ── Рабочий экран курьера ────────────────────────────────────────────────────
 *
 * Те же числа и цвета, что в приложении YOI на телефоне
 * (work-app/src/yoi/theme.ts и CourierScreen.tsx): курьер на айфоне должен
 * видеть ровно то же, что курьер на андроиде. Своего клиента под iOS у нас нет,
 * и эта страница его заменяет — «похоже» здесь недостаточно.
 *
 * Токены продублированы намеренно: панель живёт на своей палитре, а этот экран
 * обязан совпадать с приложением, и подмешивать его цвета в общие переменные
 * значит менять вид всей панели заодно.
 */
/* Отступы внутрь, а не сверх ширины: без этого кнопка шириной 100% с полями
   по 16 выезжает за край экрана. */
.courier-app *,
.courier-app *::before,
.courier-app *::after { box-sizing: border-box; }

.courier-app {
    --cr-canvas: #F4FBF9;
    --cr-surface: #FFFFFF;
    --cr-surface-soft: #EAF7F3;
    --cr-leaf: #0F766E;
    --cr-leaf-strong: #0B5F59;
    --cr-bamboo: #D5F0E8;
    --cr-ink: #17333B;
    --cr-muted: #526A70;
    --cr-outline: #C9DDD8;
    --cr-outline-strong: #9FBFB7;
    --cr-overlay: rgba(23,51,59,0.36);
    --cr-danger: #B4232F;
    --cr-danger-soft: #FCEBEC;
    --cr-warning: #8A541D;

    margin: 0;
    min-height: 100vh;
    background: var(--cr-canvas);
    color: var(--cr-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Шапка ─────────────────────────────────────────────────────────────────── */

.cr-appbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    background: var(--cr-surface);
    border-bottom: 1px solid var(--cr-outline);
}

.cr-appbar-mark { width: 34px; height: 34px; object-fit: contain; }
.cr-appbar-word { font-size: 16px; font-weight: 900; letter-spacing: .04em; color: var(--cr-leaf-strong); }
.cr-appbar-divider { width: 1px; height: 22px; background: var(--cr-outline); }
.cr-appbar-text { flex: 1; min-width: 0; }
.cr-appbar-title { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-appbar-sub { display: block; font-size: 12px; color: var(--cr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cr-icon-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 24px;
    border: none;
    background: var(--cr-bamboo);
    color: var(--cr-leaf-strong);
    font-size: 20px;
    cursor: pointer;
}

/* ── Содержимое ────────────────────────────────────────────────────────────── */

/* Снизу — высота нижнего меню, кнопки «Я довёз заказ!» и полосы жеста:
   последний блок обязан долистываться целиком. */
.cr-main {
    padding: 16px;
    padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Спрятанное обязано быть спрятанным.
 *
 * Атрибут hidden прячет элемент правилом браузера display:none — но любое
 * собственное правило с display перебивает его, и раздел, помеченный скрытым,
 * продолжал рисоваться. Вкладки при этом переключались исправно: в разметке
 * скрыт был ровно один раздел, а на экране лежали все три друг на друге.
 *
 * Поэтому display задаётся только видимым разделам, а hidden закрепляется
 * отдельным правилом — оно защищает и всё остальное, что прячется на этом
 * экране: кнопку доставки, счётчик заказов, подсказку про установку. */
.courier-app [hidden] { display: none !important; }

.cr-main > section:not([hidden]) { display: flex; flex-direction: column; gap: 12px; }

/* Блок адреса. Подъезд, этаж и квартира отдельной строкой: в общей строке они
   теряются ровно тогда, когда курьер уже у двери. */
.cr-route {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: var(--cr-surface);
}

.cr-route-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 16px;
    background: var(--cr-leaf);
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-route-body { min-width: 0; }
.cr-route-label { font-size: 12px; color: var(--cr-muted); }
/* Адрес курьеру — одной строкой целиком: город, улица, дом, подъезд, этаж,
   квартира, домофон и как найти гостя («частный дом, зелёный забор»). Делить
   его на карточке не надо, читают всё сразу; деление осталось навигатору. */
.cr-address { font-size: 18px; line-height: 23px; font-weight: 800; margin-top: 3px; overflow-wrap: anywhere; }

.cr-info-row { display: flex; gap: 10px; }

.cr-info {
    flex: 1 1 0;
    min-height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    border-radius: 12px;
    background: var(--cr-surface);
}

.cr-info-label { font-size: 12px; color: var(--cr-muted); }
.cr-info-value { font-size: 15px; font-weight: 800; margin-top: 2px; }
/* «Оплачено» у курьера — самая важная строка карточки: по такому заказу он
   ничего не берёт. Зелёная плашка, а не мелкая подпись: ошибка здесь стоит
   либо скандала с гостем, либо недостачи в конце смены. */
.cr-paid {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    white-space: nowrap;
}
/* Неоплаченный заказ: под суммой — чем её берут (наличные или терминал). */
.cr-pay-method { display: block; font-size: 12px; font-weight: 600; color: var(--yoi-muted); margin-top: 2px; }

.cr-warn {
    padding: 12px 14px;
    border-radius: 12px;
    background: #FFF7E8;
    color: var(--cr-warning);
    font-size: 13px;
    font-weight: 800;
}

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

.cr-primary,
.cr-tonal,
.cr-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.cr-primary { background: var(--cr-leaf); color: #fff; }
.cr-primary:disabled { opacity: .5; }
.cr-tonal { background: var(--cr-bamboo); color: var(--cr-leaf-strong); }
.cr-danger { background: var(--cr-danger-soft); color: var(--cr-danger); }

/* ── Пустые состояния ──────────────────────────────────────────────────────── */

.cr-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 20px;
}

.cr-raccoon-halo {
    width: 132px;
    height: 132px;
    border-radius: 66px;
    background: var(--cr-bamboo);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* В приложении енот в этом состоянии подпрыгивает, здесь — нет: панель
 * намеренно живёт без анимаций (смена идёт на слабых машинах и в WebView, где
 * движение шло рывками), и общий стиль гасит их принудительно. Ожидание
 * показываем кольцом потемнее — разницу видно, а рывков нет. */
.cr-raccoon-halo.is-busy { box-shadow: inset 0 0 0 3px var(--cr-leaf); }
.cr-raccoon { width: 96px; height: 96px; object-fit: contain; }

.cr-state-title { font-size: 18px; font-weight: 900; }
.cr-state-text { font-size: 13.5px; line-height: 19px; color: var(--cr-muted); margin-top: 6px; max-width: 320px; }

/* ── История и профиль ─────────────────────────────────────────────────────── */

.cr-history-row,
.cr-shift-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cr-outline);
}

.cr-shift-card { padding: 12px; border-radius: 12px; border-bottom: none; background: var(--cr-surface); }

.cr-history-icon,
.cr-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 22px;
    background: var(--cr-bamboo);
    color: var(--cr-leaf-strong);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-avatar { border-radius: 14px; width: 46px; height: 46px; }
.cr-history-body { min-width: 0; }
.cr-history-title { font-size: 15px; font-weight: 800; }
.cr-history-sub { font-size: 12.5px; line-height: 18px; color: var(--cr-muted); margin-top: 3px; }
.cr-history-paid { flex-shrink: 0; padding: 4px 9px; border-radius: 999px; background: #E8F7EE; color: #16a34a; font-size: 11px; font-weight: 800; }
.cr-hint { font-size: 13px; line-height: 18px; color: var(--cr-muted); }

/* ── Нижняя кнопка и меню ──────────────────────────────────────────────────── */

/* «Я довёз заказ!» живёт отдельно от прокрутки: до неё дотягиваются не глядя,
   и уезжать вместе со списком она не должна. */
.cr-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    padding: 12px 16px;
    background: var(--cr-surface);
    border-top: 1px solid var(--cr-outline);
}

.cr-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    background: var(--cr-surface);
    border-top: 1px solid var(--cr-outline);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cr-tab {
    position: relative;
    flex: 1 1 0;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 800;
    color: var(--cr-muted);
    cursor: pointer;
}

.cr-tab.is-active { color: var(--cr-leaf-strong); }
.cr-tab-icon { font-size: 20px; line-height: 1; }

.cr-tab-badge {
    position: absolute;
    /* Счётчик стоит у плеча значка, а не поверх него: наложенный, он съедал
       стрелку и читался как её часть. Белое кольцо отделяет его от значка. */
    top: 5px;
    left: 50%;
    transform: translateX(8px);
    box-shadow: 0 0 0 2px var(--cr-surface);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--cr-leaf);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

/* Сообщение не должно ложиться на нижнее меню и на кнопку «Я довёз заказ!». */
.courier-app .yoi-toast {
    left: 16px;
    right: 16px;
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

/* Значки рисуются контуром, а не заливкой: так они совпадают с приложением и
   не зависят от того, какие эмодзи рисует конкретный телефон. */
.courier-app svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cr-route-icon svg { width: 26px; height: 26px; stroke-width: 1.6; }
.cr-tab-icon { width: 22px; height: 22px; }
/* Стрелка направления — единственная заливкой: контуром она читается как угол. */
.cr-route-icon svg path,
.cr-tab[data-tab="orders"] svg path { fill: currentColor; stroke-width: 1.2; }

/* ── Шторки: выбор навигатора и состав заказа ─────────────────────────────────
 *
 * Те же размеры и радиусы, что у navigatorSheet в приложении
 * (work-app/src/yoi/CourierScreen.tsx): шторка снизу, ручка сверху, список на
 * мягком фоне. Приложение поднимает её над системной панелью жестов через
 * safe-area-insets — здесь то же самое через env().
 */
.cr-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    background: var(--cr-overlay);
}

.cr-sheet {
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background: var(--cr-surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cr-sheet-handle {
    width: 44px;
    height: 4px;
    border-radius: 2px;
    align-self: center;
    background: var(--cr-outline-strong);
    margin-bottom: 2px;
}

.cr-sheet-title { font-size: 21px; font-weight: 900; text-align: center; }
.cr-sheet-address { font-size: 13px; line-height: 18px; color: var(--cr-muted); text-align: center; margin: 0 20px; }

.cr-sheet-list {
    border-radius: 16px;
    overflow: hidden;
    background: var(--cr-surface-soft);
}

.cr-sheet-row {
    min-height: 64px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--cr-outline);
    text-decoration: none;
    color: inherit;
}
.cr-sheet-row:last-child { border-bottom: none; }

.cr-sheet-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--cr-bamboo);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cr-sheet-icon svg { width: 20px; height: 20px; fill: currentColor; stroke-width: 1.2; color: var(--cr-leaf-strong); }

.cr-sheet-label { flex: 1; font-size: 15px; font-weight: 800; }
.cr-sheet-qty { font-size: 15px; font-weight: 800; color: var(--cr-ink); }
.cr-sheet-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.cr-detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.cr-detail-label { font-size: 13px; color: var(--cr-muted); }
.cr-detail-value { font-size: 14px; font-weight: 800; }
.cr-detail-total { font-size: 18px; }

/* ── Рестораны → Персоны ─────────────────────────────────────────────────── */
.yoi-persons-check { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.yoi-persons-check-head { display: flex; align-items: center; gap: 10px; flex: none; }
.yoi-persons-check-head .yoi-muted { font-size: 14px; }
.yoi-persons-check-n { min-width: 26px; text-align: center; font-size: 18px; }
.yoi-persons-check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.yoi-persons-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
    background: var(--yoi-green-soft); border: 1px solid var(--yoi-border); font-size: 13px;
}
.yoi-persons-pill b { color: var(--yoi-green-dark); }
.yoi-persons-pill small { color: var(--yoi-muted); }
.yoi-persons-pill.is-picked { background: var(--yoi-green-light); border-color: var(--yoi-green); }
.yoi-persons-pill button { border: 0; background: none; color: var(--yoi-muted); font-size: 15px; cursor: pointer; padding: 0 2px; }
.yoi-persons-pill button:hover { color: var(--yoi-red, #c0392b); }

/* Заголовок раздела с кнопкой «+ Добавить» справа. */
.yoi-persons-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.yoi-persons-head h2 {
    display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 12px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--yoi-muted);
}
.yoi-persons-head h2 > span:first-child { color: var(--yoi-text); }
.yoi-persons-head .yoi-hint { margin: 0; }
.yoi-persons-head .yoi-btn { flex: none; }

.yoi-persons-table td { vertical-align: middle; }
.yoi-persons-normcell { min-width: 170px; }
.yoi-persons-row { cursor: pointer; }
.yoi-persons-row:hover td { background: var(--yoi-green-soft); }
.yoi-persons-off td { opacity: .55; }
.yoi-persons-off:hover td { opacity: .8; }

.yoi-persons-item { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.yoi-persons-item img, .yoi-persons-noimg {
    width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none;
    background: var(--yoi-green-light);
}
.yoi-persons-noimg {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--yoi-green-dark); font-weight: 800; font-size: 16px;
}
.yoi-persons-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.yoi-persons-edit {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1px solid var(--yoi-border); border-radius: 9px; background: var(--yoi-surface);
    color: var(--yoi-muted); cursor: pointer;
}
.yoi-persons-edit svg { width: 16px; height: 16px; }
.yoi-persons-edit:hover, .yoi-persons-row:hover .yoi-persons-edit {
    color: var(--yoi-green-dark); border-color: var(--yoi-green);
}

/* Переключатель «Выдавать»: галочка с «да/нет» читалась хуже и была мелкой целью. */
.yoi-persons-switch {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px;
    user-select: none; position: relative;
}
.yoi-persons-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yoi-persons-switch-track {
    position: relative; width: 38px; height: 22px; border-radius: 999px; flex: none;
    background: var(--yoi-border); transition: background .15s;
}
.yoi-persons-switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.yoi-persons-switch input:checked + .yoi-persons-switch-track { background: var(--yoi-green); }
.yoi-persons-switch input:checked + .yoi-persons-switch-track::after { transform: translateX(16px); }
.yoi-persons-switch input:focus-visible + .yoi-persons-switch-track { outline: 2px solid var(--yoi-green); outline-offset: 2px; }

.yoi-persons-empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px;
    border: 1px dashed var(--yoi-border); border-radius: 12px; text-align: center;
}
.yoi-persons-empty span { color: var(--yoi-muted); font-size: 13px; }
.yoi-persons-empty .yoi-btn { margin-top: 8px; }

/* Шкала «на 1…6 персон». */
.yoi-persons-scale { display: flex; gap: 4px; }
.yoi-persons-scale span {
    display: flex; flex-direction: column; align-items: center; min-width: 36px; padding: 3px 6px;
    border-radius: 8px; background: var(--yoi-green-soft); border: 1px solid var(--yoi-border);
}
.yoi-persons-scale small { font-size: 10.5px; color: var(--yoi-muted); }
.yoi-persons-scale b { font-size: 13px; color: var(--yoi-green-dark); }
.yoi-persons-preview { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.yoi-persons-preview .yoi-muted { font-size: 12px; }

/* ── Карточка позиции ──
   На ПК — две колонки: слева выбор со склада (длинный список), справа
   «кому и сколько». Шапка и кнопки не уезжают — прокручиваются только колонки. */
.yoi-persons-modal {
    max-width: 940px; padding: 0; display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.yoi-persons-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 64px 14px 22px; border-bottom: 1px solid var(--yoi-border);
}
.yoi-persons-modal-head h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yoi-persons-close {
    position: absolute; top: 13px; right: 16px;
    width: 32px; height: 32px; border: 0; border-radius: 8px; background: none;
    color: var(--yoi-muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.yoi-persons-close:hover { background: var(--yoi-green-soft); color: var(--yoi-text); }
.yoi-persons-modal-body {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; flex: 1;
}
.yoi-persons-col { padding: 18px 22px; overflow-y: auto; min-height: 0; }
.yoi-persons-col-pick { display: flex; flex-direction: column; border-right: 1px solid var(--yoi-border); background: var(--yoi-green-soft); }
.yoi-persons-col-pick .yoi-input, .yoi-persons-col-pick .yoi-persons-options { background: var(--yoi-surface); }
.yoi-persons-col .yoi-field:last-of-type { margin-bottom: 18px; }
.yoi-persons-modal-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 22px; border-top: 1px solid var(--yoi-border); background: var(--yoi-surface);
}

.yoi-persons-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 30px; align-items: center; }
.yoi-persons-options {
    margin-top: 8px; max-height: 220px; overflow-y: auto; border: 1px solid var(--yoi-border);
    border-radius: 10px; background: var(--yoi-surface);
}
/* Список склада тянется на всю высоту колонки, а не обрывается на 220px. */
.yoi-persons-options-main { max-height: none; flex: 1; min-height: 240px; }
.yoi-persons-option {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0;
    border-bottom: 1px solid var(--yoi-border); background: none; text-align: left; cursor: pointer;
    font-size: 13.5px; color: var(--yoi-text);
}
.yoi-persons-option:last-child { border-bottom: 0; }
.yoi-persons-option span { flex: 1; min-width: 0; }
.yoi-persons-option small { color: var(--yoi-muted); white-space: nowrap; }
.yoi-persons-option input { accent-color: var(--yoi-green); }
.yoi-persons-option:hover { background: var(--yoi-green-soft); }
.yoi-persons-option.is-active { background: var(--yoi-green-light); font-weight: 700; }
/* Папки номенклатуры в правиле «к блюдам». */
.yoi-persons-sub { margin: 12px 0 0; font-size: 12px; font-weight: 700; color: var(--yoi-text); }
.yoi-persons-sub small { font-weight: 400; color: var(--yoi-muted); }
#f-groups, #f-dishes { max-height: 180px; }
.yoi-persons-folder { display: inline-flex; align-items: center; gap: 7px; }
.yoi-persons-folder svg, .yoi-persons-pill.is-group svg, .yoi-persons-tag-group svg { width: 14px; height: 14px; flex: none; color: var(--yoi-green-dark); }
.yoi-persons-option.is-covered { cursor: default; color: var(--yoi-muted); }
.yoi-persons-option.is-covered:hover { background: none; }
.yoi-persons-tag-group {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
    background: var(--yoi-surface); border: 1px solid var(--yoi-green); color: var(--yoi-green-dark);
    font-size: 11.5px; font-weight: 700;
}
.yoi-persons-norm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.yoi-persons-norm .yoi-input { width: 90px; }

@media (min-width: 861px) {
    /* Фиксированная высота: при переключении «Кому» окно не прыгает. */
    .yoi-persons-modal { height: min(680px, 88vh); }
}
@media (max-width: 860px) {
    .yoi-persons-modal { max-width: 560px; }
    .yoi-persons-modal-body { display: block; overflow-y: auto; }
    .yoi-persons-col { overflow: visible; }
    .yoi-persons-col-pick { border-right: 0; border-bottom: 1px solid var(--yoi-border); }
    .yoi-persons-options-main { max-height: 260px; min-height: 0; }
    .yoi-persons-head { flex-wrap: wrap; }
}
.yoi-kcard-persons {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    background: var(--yoi-green-light); color: var(--yoi-green-dark); font-size: 12px; font-weight: 700;
}

/* ── Карточки своих доставок ──────────────────────────────────────────────────
   Курьер может везти сразу несколько заказов. Свёрнутая карточка — номер,
   ко скольки, адрес и деньги; развёрнутая — всё для работы у двери. Внутри
   карточки блоки адреса и инфо — на мягком фоне, чтобы не сливаться с ней. */
.cr-card { border-radius: 16px; background: var(--cr-surface); overflow: hidden; }
.cr-card-head {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; min-height: 72px;
    border: 0; background: transparent; text-align: left; font: inherit; color: var(--cr-ink); cursor: pointer;
}
div.cr-card-head { cursor: default; }
.cr-card-index {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 17px; background: var(--cr-leaf); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900;
}
.cr-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cr-card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cr-card-number { font-size: 17px; font-weight: 900; }
.cr-card-time { font-size: 14px; font-weight: 800; color: var(--cr-leaf-strong); white-space: nowrap; }
.cr-card-address { font-size: 14.5px; line-height: 20px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.cr-card-money {
    align-self: flex-start; margin-top: 8px; padding: 4px 9px; border-radius: 999px;
    background: #FFF7E8; color: var(--cr-warning); font-size: 12.5px; font-weight: 800;
}
.cr-card-money.is-paid { background: #E8F7EE; color: #23745E; }
.cr-card-chevron { font-size: 20px; color: var(--cr-muted); }
.cr-card-body { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 14px; }
.cr-card-body .cr-route, .cr-card-body .cr-info { background: var(--cr-surface-soft); }
.cr-paid-toggle {
    display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px;
    border-radius: 12px; background: #FFF7E8; cursor: pointer;
}
.cr-paid-toggle.is-on { background: #E8F7EE; }
.cr-paid-toggle input { width: 24px; height: 24px; accent-color: #23745E; flex-shrink: 0; }
.cr-paid-toggle-title { font-size: 15px; font-weight: 900; color: var(--cr-warning); }
.cr-paid-toggle.is-on .cr-paid-toggle-title { color: #23745E; }

/* Чат поддержки */
.yoi-support-badge { margin-left: 6px; min-width: 18px; padding: 1px 6px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.yoi-chat { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; height: calc(100vh - 150px); min-height: 420px; }
.yoi-chat-list, .yoi-chat-view { background: var(--yoi-surface); border: 1px solid var(--yoi-border); border-radius: var(--yoi-radius); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.yoi-chat-items { overflow-y: auto; flex: 1; }
.yoi-chat-item { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--yoi-border); background: transparent; cursor: pointer; color: inherit; font: inherit; }
.yoi-chat-item:hover, .yoi-chat-item.active { background: rgba(127,127,127,.12); }
.yoi-chat-item .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.yoi-chat-item .prev { font-size: 12.5px; color: var(--yoi-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yoi-chat-item .dot { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; flex: 0 0 auto; margin-top: 6px; }
.yoi-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--yoi-border); font-weight: 700; }
.yoi-chat-head small { display: block; font-weight: 400; color: var(--yoi-muted); }
.yoi-chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.yoi-msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; background: rgba(127,127,127,.14); white-space: pre-wrap; word-break: break-word; }
.yoi-msg.staff { align-self: flex-end; background: var(--yoi-green, #2f9e6b); color: #fff; }
.yoi-msg.sys { align-self: center; max-width: 90%; font-size: 12px; color: var(--yoi-muted); background: transparent; text-align: center; }
.yoi-msg time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.yoi-chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--yoi-border); }
.yoi-chat-form textarea { flex: 1; resize: none; }
.yoi-chat-empty { margin: auto; color: var(--yoi-muted); }
@media (max-width: 860px) {
    .yoi-chat { grid-template-columns: 1fr; height: auto; }
    .yoi-chat-list { max-height: 260px; }
    .yoi-chat-view { height: 70vh; }
}
.yoi-order-card { padding: 10px 16px; border-bottom: 1px solid var(--yoi-border); font-size: 13px; background: rgba(127,127,127,.06); }
.yoi-order-card .oc-head { display: flex; justify-content: space-between; gap: 8px; }
.yoi-order-card .oc-meta { color: var(--yoi-muted); margin-top: 3px; }
.yoi-order-card .oc-items { margin-top: 6px; max-height: 84px; overflow-y: auto; }
.yoi-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px 0; border-top: 1px solid var(--yoi-border); }
.yoi-suggest .sg-label { font-size: 11.5px; color: var(--yoi-muted); width: 100%; }
.yoi-suggest .sg-chip { text-align: left; max-width: 100%; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--yoi-border); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.yoi-suggest .sg-chip:hover { background: rgba(127,127,127,.14); }
.yoi-suggest + .yoi-chat-form { border-top: 0; }

/* Пункт «Рестораны ВсеКафе» — вход в кабинет сетей и ресторанов из панели. */
.sidebar-nav > .sidebar-link-biz {
    margin-bottom: 8px;
    font-weight: 700;
    background: var(--yoi-green-light);
    color: var(--yoi-green-dark);
}
.yoi-welcome { display:flex; justify-content:space-between; gap:24px; min-height:160px; overflow:hidden; margin-bottom:20px; padding:24px 30px; border-radius:18px; background:var(--brand-green-wash); }
.yoi-welcome h2 { margin:0; font-size:clamp(1.35rem,2vw,1.9rem); line-height:1.15; }
.yoi-welcome p:not(.yoi-welcome-kicker) { max-width:58ch; margin:9px 0 0; color:var(--brand-muted); line-height:1.5; }
.yoi-welcome-kicker { margin:0 0 8px; font-size:.7rem; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color:var(--brand-green-strong); }
.yoi-welcome img { width:150px; height:150px; margin-bottom:-42px; align-self:end; object-fit:contain; }
.yoi-welcome-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:16px; }
.yoi-live-count { display:flex; align-items:baseline; gap:8px; margin-right:8px; color:var(--brand-green-strong); }
.yoi-live-count strong { font-size:2rem; line-height:1; }
.yoi-live-count span { font-size:.78rem; font-weight:700; }
@media(max-width:580px){ .yoi-welcome { padding:18px; min-height:120px; }.yoi-welcome img { width:96px; height:96px; margin-right:-26px; margin-bottom:-26px; } }

/* Shared brand / YOI workspace. Content density stays suited to operations. */
body.yoi { background:var(--yoi-bg); font-family:Inter,'Segoe UI',system-ui,sans-serif; }
.sidebar-brand { background:var(--brand-green-wash); }
.sidebar-brand::before { background:var(--brand-green-wash) url('/images/yoi-raccoon-work.webp') center / contain no-repeat; }
.sidebar-brand-title span { display:block; font-size:10px; font-weight:700; letter-spacing:.06em; color:var(--brand-muted); }
.sidebar-brand-sub { font-size:10px; }
.sidebar-group > summary { min-height:44px; }
.sidebar-group > .sidebar-link { min-height:38px; }
.yoi-topbar { background:var(--brand-paper); border-bottom:1px solid var(--brand-line); }
.yoi-card, .yoi-tile, .yoi-stat { border-color:var(--yoi-border); box-shadow:none; }
.yoi-btn, .hbtn { min-height:44px; }
.yoi-table-wrap, .yoi-table-scroll { max-width:100%; overflow-x:auto; }
body.yoi-auth-page { background:var(--brand-cream)!important; color:var(--brand-charcoal); padding:20px!important; }
body.yoi-auth-page::before { display:none; }
.yoi-signin-layout { width:min(1160px,100%); min-height:min(690px,calc(100dvh - 40px)); display:grid; grid-template-columns:minmax(0,1.05fr) minmax(340px,.95fr); overflow:hidden; border:1px solid var(--brand-line); border-radius:28px; background:var(--brand-paper); box-shadow:var(--brand-shadow); }
.yoi-signin-story { position:relative; min-height:600px; overflow:hidden; padding:clamp(28px,4vw,56px); background:#dce9d7; }
.yoi-signin-back { display:inline-block; position:relative; z-index:2; color:var(--brand-green-strong); font-weight:700; text-decoration:none; }
.yoi-signin-kicker { margin:48px 0 12px; color:var(--brand-green-strong); font-size:.75rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.yoi-signin-story h1 { position:relative; z-index:1; max-width:12ch; margin:54px 0 0; font-size:clamp(2.5rem,4.5vw,4.6rem); line-height:1.05; letter-spacing:-.055em; }
.yoi-signin-story h1 em { color:var(--brand-green-strong); font-style:normal; }
.yoi-signin-story > p:not(.yoi-signin-kicker) { position:relative; z-index:1; max-width:45ch; margin:20px 0 0; color:var(--brand-muted); line-height:1.6; }
.yoi-signin-capabilities { position:relative; z-index:2; display:flex; flex-wrap:wrap; gap:8px; margin-top:24px; max-width:470px; }
.yoi-signin-capabilities span { padding:9px 12px; border-radius:999px; background:rgba(255,253,248,.78); font-size:.79rem; font-weight:700; color:var(--brand-green-strong); }
.yoi-signin-hero-image { position:absolute; width:320px; right:-16px; bottom:-54px; filter:drop-shadow(0 12px 18px rgba(38,49,43,.16)); }
.yoi-signin-form-column { align-self:center; width:min(420px,100%); margin:auto; padding:32px; }
.yoi-auth-brand { margin-bottom:20px; }
.yoi-auth-brand h2 { color:var(--brand-charcoal)!important; font-size:1.55rem!important; }
.yoi-auth-brand p { color:var(--brand-muted)!important; }
.yoi-auth-mascot { width:68px!important; height:68px!important; filter:none; }
.yoi-auth-card { background:#fff!important; border:1px solid var(--brand-line)!important; border-radius:18px!important; box-shadow:none!important; }
.yoi-auth-page :where(input, button) { min-height:48px; }
.yoi-auth-page button.yoi-auth-primary { background:var(--brand-green)!important; }
@media(max-width:790px){ .yoi-signin-layout { grid-template-columns:1fr; }.yoi-signin-story { min-height:260px; padding:24px; }.yoi-signin-story h1 { margin-top:24px; max-width:18ch; font-size:clamp(2rem,8vw,3rem); }.yoi-signin-story > p:not(.yoi-signin-kicker),.yoi-signin-capabilities { display:none; }.yoi-signin-hero-image { width:175px; right:-28px; bottom:-48px; }.yoi-signin-form-column { padding:24px; } }
@media(max-width:480px){ body.yoi-auth-page { padding:0!important; align-items:stretch!important; }.yoi-signin-layout { min-height:100dvh; border:0; border-radius:0; }.yoi-signin-story { min-height:245px; }.yoi-signin-story h1 { max-width:11ch; }.yoi-signin-form-column { padding:20px; }.yoi-auth-brand { margin-bottom:14px; }.yoi-auth-mascot { display:none; } }
