/* MultiBar 1.9.5 */

/* ---------- Шапка: вместо названия приложения — название открытой вкладки (и подпись экрана) ---------- */
.header-title-row h1#header-title { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; height: 34px; line-height: 1.1; min-width: 0; max-width: 46%; flex: 0 1 auto; overflow: hidden; opacity: 1; }
#header-title .ht-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
#header-title .ht-sub { display: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; opacity: .6; line-height: 1.15; }
#header-title.has-sub .ht-name { font-size: 15px; }
#header-title.has-sub .ht-sub { display: block; }
@media (max-width: 390px) { #header-title .ht-name { font-size: 16px; } #header-title.has-sub .ht-name { font-size: 14px; } }
@media (max-width: 340px) { #header-title .ht-name { font-size: 14px; } #header-title.has-sub .ht-name { font-size: 13px; } #header-title .ht-sub { font-size: 9.5px; } }

/* ---------- Нижняя лента вкладок: все разделы в одну строку, на экране не больше 6, остальные — свайпом ---------- */
body.nav-tabs-bar .tabs {
    justify-content: flex-start; overflow-x: auto !important; overflow-y: hidden;
    scroll-snap-type: x proximity; scroll-padding-left: 4px; scroll-padding-right: 4px; scrollbar-width: none; -ms-overflow-style: none;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
body.nav-tabs-bar .tabs::-webkit-scrollbar { display: none; }
body.nav-tabs-bar .tabs > .tab-btn:not(.hidden-tab):not([hidden]):not([aria-hidden="true"]) {
    flex: 0 0 calc(100% / var(--tabs-vis, 6)); width: calc(100% / var(--tabs-vis, 6)); scroll-snap-align: start; box-sizing: border-box;
}
/* подсказка «есть ещё вкладки»: мягкая кромка и стрелка у края ленты, пока там есть что листать */
.tabs .tabs-fade { position: sticky; flex: 0 0 0; width: 0; align-self: stretch; z-index: 3; pointer-events: none; }
.tabs .tabs-fade.l { left: 0; }
.tabs .tabs-fade.r { right: 0; }
.tabs .tabs-fade::after { content: ''; position: absolute; top: 0; bottom: 0; width: 20px; opacity: 0; transition: opacity .15s ease; }
.tabs .tabs-fade.l::after { left: 0; background: linear-gradient(to right, var(--k-face, var(--card)) 25%, transparent); }
.tabs .tabs-fade.r::after { right: 0; background: linear-gradient(to left, var(--k-face, var(--card)) 25%, transparent); }
.tabs .tabs-fade::before { content: ''; position: absolute; top: calc(50% - 3px); width: 6px; height: 6px; border-top: 2px solid var(--primary); border-right: 2px solid var(--primary); opacity: 0; transition: opacity .15s ease; z-index: 1; }
.tabs .tabs-fade.r::before { right: 3px; transform: translateY(-50%) rotate(45deg); }
.tabs .tabs-fade.l::before { left: 5px; transform: translateY(-50%) rotate(-135deg); }
.tabs.can-r .tabs-fade.r::after, .tabs.can-l .tabs-fade.l::after { opacity: 1; }
.tabs.can-r .tabs-fade.r::before, .tabs.can-l .tabs-fade.l::before { opacity: .75; }
body:not(.nav-tabs-bar) .tabs .tabs-fade { display: none; }

/* ---------- Экраны Накладные/Графики/Табель/Меню/Зал как вкладки: без «брови», без затухания при переключении ---------- */
.nkl-overlay.mb-as-tab, .nkl-overlay.mb-noanim { transition: none !important; }
.nkl-overlay.mb-as-tab .nkl-screen, .nkl-overlay.mb-noanim .nkl-screen { transition: none !important; transform: none !important; }
.nkl-overlay.mb-as-tab .nkl-header { display: none !important; }
.p2-acts { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: 0 0 auto; }
.p2-acts .chat-head-btn { width: 36px; height: 36px; flex: 0 0 36px; }
.hall-top { display: flex; align-items: center; gap: 6px; margin: 8px 12px 6px; flex: 0 0 auto; }
.hall-top .hall-seg { flex: 1 1 auto; margin: 0; min-width: 0; }
.hall-overlay.is-edit .hall-top { display: none; }
.sch-bar .p2-acts, .em-tools .p2-acts { margin-left: 0; }
.sch-bar .sch-today + .p2-acts { margin-left: auto; }

.em-tools { gap: 6px; padding-left: 12px; padding-right: 8px; }
.em-tools .em-search { min-width: 0; flex: 1 1 90px; }
.em-tools .em-add { padding-left: 12px !important; padding-right: 12px !important; }

/* ---------- Нейтральный экран «нет доступа» / «разделы не назначены» ---------- */
.gate-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px 22px 20px; text-align: center; box-shadow: 0 10px 34px rgba(0, 0, 0, .10); }
.gate-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: rgba(var(--primary-rgb), .12); color: var(--primary); }
.gate-ico::before { content: ''; width: 30px; height: 30px; background: currentColor; -webkit-mask: var(--gate-mask) center / contain no-repeat; mask: var(--gate-mask) center / contain no-repeat; }
#account-access-gate[data-mode="wait"] { --gate-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10.5' width='16' height='10' rx='2.5'/%3E%3Cpath d='M8 10.5V8a4 4 0 018 0v2.5'/%3E%3C/svg%3E"); }
#account-access-gate[data-mode="empty"] { --gate-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.5'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.5' stroke-dasharray='2 2.4'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.5' stroke-dasharray='2 2.4'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.5' stroke-dasharray='2 2.4'/%3E%3C/svg%3E"); }
.gate-title { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.gate-text { margin: 0 0 12px; font-size: 14px; line-height: 1.45; opacity: .78; }
.gate-mail { margin: 0 auto 16px; display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: rgba(127, 127, 127, .12); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-actions { display: flex; flex-direction: column; gap: 8px; }
.gate-actions .btn-main { width: 100%; }

/* ---------- Боковое меню (≡): без отмеченных пунктов кнопки нет ---------- */
body.no-menu-items .global-search-bar .drawer-toggle-btn { display: none !important; }
body.no-menu-items #header-status-user { cursor: pointer; }

/* ---------- Заказы: «в пути» — приятный жёлтый; «привезли всё» — цвет темы (зелёного в интерфейсе нет, решение 1.8.1) (1.9.5) ---------- */
:root { --mb-transit: #f2b705; --mb-transit-rgb: 242, 183, 5; --mb-transit-ink: #8a5a00; }
[data-theme^="dark"], [data-theme="purple"] { --mb-transit-ink: #fcd34d; }
.orders-supplier-status.is-sent, .orders-supplier-status.is-partial,
[data-theme^="dark"] .orders-supplier-status.is-sent, [data-theme="purple"] .orders-supplier-status.is-sent {
    color: var(--mb-transit-ink) !important; background: rgba(var(--mb-transit-rgb), .20) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--mb-transit-rgb), .55);
}
.orders-supplier-status.is-sent .osr-count, .orders-supplier-status.is-partial .osr-count { border-left-color: rgba(var(--mb-transit-rgb), .6); }
.orders-supplier-status.is-delivered { background: rgba(var(--primary-rgb), .20) !important; box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .45); }
.orders-supplier-status.is-delivered .osr-count { border-left-color: rgba(var(--primary-rgb), .5); }
.orders-supplier-card.supplier-sent { border-color: rgba(var(--mb-transit-rgb), .75); }
.orders-supplier-card.supplier-delivered { border-color: rgba(var(--primary-rgb), .6); box-shadow: 0 0 0 1px rgba(var(--primary-rgb), .25); }
.orders-group-title .orders-group-deliv { color: var(--mb-transit-ink); background: rgba(var(--mb-transit-rgb), .2); box-shadow: inset 0 0 0 1px rgba(var(--mb-transit-rgb), .55); }
.orders-group-title .orders-group-deliv.all { color: var(--primary); background: rgba(var(--primary-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .4); }

/* ---------- Чаты: «Поддержка» — кнопка в шапке рядом с «Новый чат» ---------- */
.chat-support-btn { position: relative; color: var(--k-ink); }
.chat-support-btn .chat-support-dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: #ef4444; color: #fff; font: 800 10px/16px system-ui, sans-serif; font-style: normal; text-align: center; }
.chat-support-btn .chat-support-dot[hidden] { display: none; }
.chat-list-pane .chat-header { gap: 2px; }

/* ---------- Прозрачность из «Внешнего вида» — и в вкладках страницы 2 (нижние панели, шапки внутри экранов) ---------- */
html[data-wallpaper]:not([data-wallpaper="none"]) .nkl-overlay .nkl-bottom,
html[data-wallpaper]:not([data-wallpaper="none"]) .nkl-overlay .hall-foot {
    background: var(--card) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* ---------- Зал: статус «Гости ушли», «без брони» ---------- */
.hb.st-done { opacity: .62; }
.hb-pill.st-done { border-color: rgba(127, 127, 127, .45); background: rgba(127, 127, 127, .15); }
.hall-chip.st-done.on { border-color: #6b7280; color: inherit; background: rgba(127, 127, 127, .22); }

/* ---------- Зал: редактор схемы на весь экран; горизонтально — схема слева, инструменты справа ---------- */
.hall-overlay.is-edit.mb-as-tab.open, .hall-overlay.is-edit.open {
    position: fixed !important; left: 0 !important; right: 0 !important; top: var(--vv-top, 0px) !important;
    height: var(--vvh, 100dvh) !important; z-index: 9200 !important; padding: 0 !important;
    background: rgb(var(--bg-rgb)) !important;
}
.hall-overlay.is-edit .nkl-screen, body .nkl-overlay.mb-as-tab.hall-overlay.is-edit .nkl-screen {
    max-width: none !important; width: 100% !important; height: 100% !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important;
}
.hall-overlay.is-edit .nkl-header, .hall-overlay.is-edit.mb-as-tab .nkl-header, .hall-overlay.is-edit .hall-foot { display: none !important; }
.hall-overlay.is-edit .hall-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.hall-ed {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.hall-ed-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.hall-ed-done { height: 38px; padding: 0 14px 0 10px; border: 0; border-radius: 11px; background: var(--primary); color: #fff; font: inherit; font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.hall-ed-title { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hall-ed-zoom { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 11px; overflow: hidden; background: rgb(var(--card-rgb)); flex: 0 0 auto; }
.hall-ed-zoom button { height: 35px; min-width: 34px; padding: 0 8px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 800; }
.hall-ed-zoom .hall-ed-zv { font-size: 12px; min-width: 50px; }
.hall-ed-more { width: 38px; height: 38px; flex: 0 0 auto; border: 1.5px solid var(--border); border-radius: 11px; background: rgb(var(--card-rgb)); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.hall-ed-main { flex: 1 1 0; min-height: 150px; min-width: 0; display: flex; }
.hall-ed-main .hall-cvwrap { flex: 1 1 auto; min-width: 0; height: 100%; overflow: auto; display: flex; border-radius: 12px; background: rgb(var(--card-rgb)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.hall-ed-main .hall-cv { margin: auto; flex: 0 0 auto; }
.hall-ed-side { flex: 0 1 auto; max-height: 46%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0; }
.hall-ed-side .hall-props { margin-top: 6px; }
.hall-ed-side .hp-acts { flex-wrap: wrap; }
.hall-ed-side .hp-acts .btn-main { flex: 1 1 120px; }
@media (orientation: landscape) and (max-height: 620px) {
    .hall-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); grid-template-rows: auto minmax(0, 1fr); gap: 8px 10px; }
    .hall-ed-main { grid-column: 1; grid-row: 1 / -1; min-height: 0; }
    .hall-ed-bar { grid-column: 2; grid-row: 1; flex-wrap: wrap; }
    .hall-ed-title { display: none; }
    .hall-ed-zoom { margin-left: auto; }
    .hall-ed-side { grid-column: 2; grid-row: 2; max-height: none; }
    .hall-ed-side { display: flex; flex-direction: column; }
    .hall-ed-side #hall-props { order: -1; margin: 0 0 6px; }
    .hall-ed-side .hall-props { margin-top: 0; }
    .hall-ed-side .hall-tools { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; gap: 5px; }
    .hall-ed-side .hall-tool { width: calc((100% - 20px) / 5); height: 46px; gap: 2px; padding: 2px; font-size: 9.5px; }
    .hall-ed-side .hall-hint { display: none; }
}
/* просмотр схемы лёжа: панель действий и список — не вылезают за экран */
@media (orientation: landscape) and (max-height: 620px) {
    .hall-overlay:not(.is-edit) .hall-top { margin-top: 4px; margin-bottom: 2px; }
    .hall-overlay:not(.is-edit) .hall-bar { padding-bottom: 4px; }
}

/* телефон лёжа: на экране «Зал» поиск по приложению прячем — место нужно схеме и броням */
@media (orientation: landscape) and (max-height: 520px) {
    body[data-p2="hall"] #app-root .global-search-bar { display: none; }
}

/* ---------- Кнопки «Удалить»: сплошная красная — белый текст; контурная («secondary danger», зал) — красный контур и текст ---------- */
.btn-main.danger { color: #fff; }
.btn-main.secondary.danger, .hp-acts .btn-main.secondary.danger { background: transparent !important; color: #ef4444 !important; border: 1.5px solid rgba(239, 68, 68, .65) !important; }
.btn-main.secondary.danger:active { background: rgba(239, 68, 68, .12) !important; }
