/* MultiBar 1.8.3 — на ПК рабочая область не растягивается на весь экран (как в «Накладных»: до 1100 px по центру) */
#app-root { max-width: 1100px !important; margin-left: auto !important; margin-right: auto !important; }
body.nav-tabs-bar .tabs {
    left: max(0px, calc(50% - 550px)) !important; right: max(0px, calc(50% - 550px)) !important; width: auto !important;
}
@media (min-width: 1140px) {
    body.nav-tabs-bar .tabs { border-radius: 16px 16px 0 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
.settings-screen .settings-box { max-width: 1100px !important; margin: 0 auto !important; }
.settings-screen.open { background: var(--bg); }
#activity-log-overlay .overlay-box { max-width: 1100px !important; margin: 0 auto; }

/* Меню (шторка) открывается поверх любого отдельного экрана */
#drawer-overlay { z-index: 12890 !important; }
#side-drawer { z-index: 12900 !important; }
/* кнопка ☰ в шапках чатов / контактов / аккаунтов */
#contacts-overlay .overlay-header, #account-admin-overlay .overlay-header { padding-left: 56px !important; padding-right: 52px !important; min-height: 56px; box-sizing: border-box; }

/* ===== Чаты: кнопки записи, голосовые, видеосообщения, профиль ===== */
.chat-rec-btn { width: 42px; height: 42px; flex: 0 0 42px; border: 0; border-radius: 50%; background: transparent; color: var(--text); opacity: .75; display: none; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.chat-rec-btn:active { background: rgba(var(--primary-rgb), .14); opacity: 1; }
.chat-rec-btn .mb-icon { color: var(--primary); }
.chat-composer.is-empty .chat-rec-btn { display: inline-flex; }
.chat-composer.is-empty .chat-send-btn { display: none; }
.chat-composer.no-rec .chat-rec-btn { display: none !important; }
.chat-composer.no-rec.is-empty .chat-send-btn { display: inline-flex; }
/* панель записи голосового */
.chat-rec-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border); }
.chat-rec-bar[hidden] { display: none !important; }
.chat-rec-cancel, .chat-rec-send { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-rec-cancel { background: rgba(var(--danger-rgb, 239, 68, 68), .14); color: var(--danger); }
.chat-rec-send { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .35); }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: 0 0 10px; animation: mbRecPulse 1s ease-in-out infinite; }
@keyframes mbRecPulse { 50% { opacity: .25; transform: scale(.8); } }
.chat-rec-time { font-variant-numeric: tabular-nums; font-size: 16px; min-width: 44px; }
.chat-rec-level { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 3px; overflow: hidden; }
.chat-rec-level i { flex: 1 1 0; min-width: 2px; max-width: 5px; height: calc(var(--h, .12) * 100%); min-height: 3px; border-radius: 3px; background: var(--primary); opacity: .85; transition: height .08s linear; }
/* голосовое в сообщении */
.chat-voice { display: flex; align-items: center; gap: 10px; width: min(250px, 66vw); padding: 6px 8px 4px 4px; box-sizing: border-box; }
.cv-btn { width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: var(--primary); color: #fff; position: relative; }
.chat-msg.own .cv-btn { background: rgba(255, 255, 255, .95); color: rgb(var(--primary-rgb)); }
.cv-btn .cv-ico-pause { display: none; } .chat-voice.is-playing .cv-ico-pause { display: inline-flex; } .chat-voice.is-playing .cv-ico-play { display: none; }
.cv-ico { display: inline-flex; }
.chat-voice.is-loading .cv-btn { opacity: .6; }
.cv-wave { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 2px; cursor: pointer; position: relative; --p: 0; }
.cv-wave i { flex: 1 1 0; min-width: 2px; height: calc(var(--h) * 100%); border-radius: 2px; background: currentColor; opacity: .3; transition: opacity .1s linear; }
.cv-wave i.on { opacity: 1; }
.chat-msg:not(.own) .cv-wave i.on { background: var(--primary); }
.cv-time { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 32px; text-align: right; }
/* видеосообщение-кружок */
.chat-vid { position: relative; display: block; width: min(210px, 60vw); aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%; overflow: hidden; background: rgba(var(--primary-rgb), .18); color: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.chat-vid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-vplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .18); }
.cv-vplay .mb-icon { width: 46px; height: 46px; padding: 10px; box-sizing: border-box; border-radius: 50%; background: rgba(0, 0, 0, .45); }
.cv-vdur { position: absolute; left: 10px; bottom: 10px; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: rgba(0, 0, 0, .55); }
.chat-msg.has-att .chat-bubble:has(.chat-vid) { background: transparent !important; box-shadow: none !important; border-color: transparent !important; padding: 0 !important; }
.chat-msg:has(.chat-vid) .chat-meta { position: static; justify-content: flex-end; }
/* окно записи видеосообщения */
.mb-vrec, .mb-vplay { position: fixed; inset: 0; z-index: 13500; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s ease; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.mb-vrec[hidden], .mb-vplay[hidden] { display: none !important; }
.mb-vrec.open, .mb-vplay.open { opacity: 1; }
.mb-vrec-box { position: relative; width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 16px 20px; box-sizing: border-box; color: #fff; }
.mb-vrec-x, .mb-vplay-x { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mb-vrec-stage { position: relative; width: min(78vw, 330px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.mb-vrec-canvas, .mb-vrec-review { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.mb-vrec-canvas[hidden], .mb-vrec-review[hidden] { display: none; }
.mb-vrec-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.mb-vrec-ring circle { fill: none; stroke: #ffffff; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 302; stroke-dashoffset: 302; transition: stroke-dashoffset .12s linear; }
.mb-vrec[data-state="idle"] .mb-vrec-ring circle, .mb-vrec[data-state="live"] .mb-vrec-ring circle, .mb-vrec[data-state="review"] .mb-vrec-ring circle { stroke-dashoffset: 302; }
.mb-vrec-time { font-size: 20px; font-variant-numeric: tabular-nums; }
.mb-vrec-bar2 { display: flex; gap: 10px; width: min(88vw, 360px); }
.mb-vrec-bar2[hidden] { display: none; }
.mb-vrec-bar2 .btn-main { flex: 1; }
/* просмотр видеосообщения */
.mb-vplay { flex-direction: column; gap: 14px; }
.mb-vplay-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 18px; color: #fff; }
.mb-vplay-who { display: flex; flex-direction: column; min-width: 0; } .mb-vplay-who small { opacity: .7; }
.mb-vplay-x { position: static; }
.mb-vplay-stage { position: relative; width: min(86vw, 70vh, 420px); width: min(86vw, 70dvh, 420px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12); }
.mb-vplay-video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.mb-vplay-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mb-vplay-spin[hidden] { display: none; }
/* профиль собеседника */
.chat-profile-head { padding-bottom: 6px; }
.chat-profile-photo { border: 0; padding: 0; background: transparent; border-radius: 50%; cursor: zoom-in; }
.chat-profile-rows { display: flex; flex-direction: column; margin: 4px 0 6px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.chat-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; }
.chat-profile-row + .chat-profile-row { border-top: 1px solid var(--border); }
.chat-profile-row span { opacity: .65; flex: 0 0 auto; } .chat-profile-row b { min-width: 0; overflow-wrap: anywhere; text-align: right; font-weight: 700; }
.chat-msg > .mb-avatar, .chat-author { cursor: pointer; }

/* уведомления и разрешения */
#notify-card-body .notify-status { padding: 10px 12px; border-radius: 12px; background: rgba(var(--primary-rgb), .08); margin-bottom: 10px; }
#notify-card-body .notify-status[data-state="ok"] { background: rgba(46, 160, 90, .14); }
#notify-card-body .notify-status[data-state="bad"] { background: rgba(220, 70, 70, .12); }
#notify-card-body .notify-status b { display: block; font-size: 14px; }
#notify-card-body .notify-status small { display: block; margin-top: 4px; opacity: .8; line-height: 1.35; }
#notify-card-body .notify-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
#notify-card-body .notify-actions .settings-wide-btn { flex: 1 1 140px; justify-content: center; }
#notify-card-body .notify-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; font-size: 14px; }
#notify-card-body .notify-row input { width: 20px; height: 20px; accent-color: var(--primary); }

/* 1.8.3: фильтр заказов — ровная сетка */
.of-status-list { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px !important; margin-bottom: 14px !important; }
.of-status { padding: 7px 9px !important; gap: 7px !important; font-size: 13px !important; border-radius: 10px !important; }
.of-status i { flex-basis: 14px !important; width: 14px !important; height: 14px !important; }
.of-status.active i::after { inset: 2px !important; }
.of-status b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-status small { min-width: 20px !important; padding: 0 6px !important; font-size: 11px !important; }
.of-chips { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
.of-pill { width: 100%; min-height: 40px; justify-content: flex-start; border-radius: 12px !important; padding: 8px 10px !important; font-size: 13px !important; }
.of-pill span { flex: 1; min-width: 0; text-align: left; }
@media (min-width: 700px) { .of-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } .of-status-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 1.8.3: поставщик — минималка выезжает под строкой (как категории) */
.oa-row.oa-row-sup { grid-template-columns: 34px minmax(0, 1fr) 36px !important; align-items: center; }
.oa-row.oa-row-sup .oa-row-toggle { display: flex !important; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; border: 0; background: none; color: var(--text); text-align: left; font: inherit; padding: 2px 22px 2px 0; position: relative; cursor: pointer; -webkit-line-clamp: unset; }
.oa-row-toggle b { font-size: 14.5px; font-weight: 800; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oa-row-toggle small { font-size: 12px; font-weight: 700; opacity: .6; }
.oa-row-chev { position: absolute; right: 2px; top: 50%; margin-top: -7px; opacity: .55; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.oa-row.open .oa-row-chev { transform: rotate(180deg); }
.oa-row.oa-row-sup .oa-row-panel { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .8, .2, 1), opacity .25s ease; opacity: 0; }
.oa-row.oa-row-sup.open .oa-row-panel { grid-template-rows: 1fr; opacity: 1; }
.oa-row-panel-in { overflow: hidden; min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oa-row.open .oa-row-panel-in { padding-top: 6px; }
.oa-row.oa-row-sup .oa-money { width: 132px !important; }

/* 1.8.3: перенос позиции — чёткая «поднятая» плашка */
.orders-drag-ghost { display: flex !important; align-items: center; gap: 10px; min-width: 190px; padding: 12px 16px 12px 12px !important; border-radius: 14px !important; border: 2.5px solid var(--primary) !important; background: var(--card) !important; opacity: 1 !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 5px rgba(var(--primary-rgb), .28) !important; white-space: normal !important; }
.orders-drag-ghost .odg-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.orders-drag-ghost .odg-txt { min-width: 0; display: flex; flex-direction: column; }
.orders-drag-ghost b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-drag-ghost small { font-size: 11.5px; font-weight: 700; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-swipe-shell.orders-dragging { opacity: .5 !important; outline: 2px dashed var(--primary); outline-offset: -2px; }
body.orders-dnd-active #orders-list .orders-group-title { outline: 1.5px dashed rgba(var(--primary-rgb), .55); outline-offset: -2px; }
#orders-dnd-target-bar { padding: 12px 18px !important; font-size: 14px !important; }

/* ПК: кнопки позиции видны, перенос только за ручку */
.orders-pc-tools { display: none; }
@media (hover: hover) and (pointer: fine) {
  .orders-swipe-shell { overflow: visible; }
  .orders-item { position: relative; }
  .orders-pc-tools { display: flex; align-items: center; gap: 4px; position: absolute; top: 6px; right: 8px; z-index: 3; opacity: .35; transition: opacity .15s; }
  .orders-item:hover .orders-pc-tools, .orders-pc-tools:focus-within { opacity: 1; }
  .orders-pc-btn, .orders-grip { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
  .orders-pc-btn:hover { border-color: var(--primary); }
  .orders-pc-btn.danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, .08); }
  .orders-grip { cursor: grab; border-style: dashed; }
  .orders-grip:active { cursor: grabbing; }
  .orders-item .orders-item-main { padding-right: 120px; box-sizing: border-box; }
  .orders-pc-tools { opacity: .7 !important; }
}

/* история заказов */
.oh-box { max-width: 560px; }
.oh-sub { font-size: 12px; font-weight: 700; opacity: .6; margin-bottom: 6px; }
.oh-day { margin: 12px 2px 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); }
.oh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; margin-bottom: 5px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--bg); }
.oh-main, .oh-side { display: flex; flex-direction: column; min-width: 0; }
.oh-side { align-items: flex-end; flex: 0 0 auto; }
.oh-row b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.oh-row small { font-size: 11.5px; font-weight: 700; opacity: .6; }
.oh-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 12px; text-align: center; opacity: .7; }

/* сканер документа */
.mb-scan { position: fixed; inset: 0; z-index: 13000; display: flex; flex-direction: column; background: #0d1117; color: #fff; opacity: 0; transition: opacity .18s ease; }
.mb-scan.open { opacity: 1; }
.mb-scan[hidden] { display: none; }
.mb-scan-top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
.mb-scan-title { flex: 1; text-align: center; font-size: 15px; }
.mb-scan-x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.mb-scan-skip { border: 0; background: none; color: #9fb3c8; font: inherit; font-size: 13px; font-weight: 700; padding: 8px; }
.mb-scan-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.mb-scan-stage canvas { position: absolute; max-width: 100%; max-height: 100%; }
#mb-scan-ov { touch-action: none; cursor: crosshair; }
.mb-scan-busy { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: rgba(13, 17, 23, .72); font-weight: 700; z-index: 3; }
.mb-scan-busy.on { display: flex; }
.mb-scan-busy i { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: mbscanspin .8s linear infinite; }
@keyframes mbscanspin { to { transform: rotate(360deg); } }
.mb-scan-hint { text-align: center; font-size: 12.5px; opacity: .7; padding: 6px 16px 0; min-height: 18px; }
.mb-scan-bar { display: flex; flex-direction: column; gap: 10px; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
.mb-scan-bar:not(:has(.mb-scan-modes)) { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.mb-scan-row { display: flex; gap: 10px; justify-content: center; }
.mb-scan-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.mb-scan-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; flex: 1 1 120px; max-width: 220px; }
.mb-scan-modes { display: flex; gap: 8px; justify-content: center; }
.mb-scan-mode { flex: 1; max-width: 140px; min-height: 40px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .2); background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 700; }
.mb-scan-mode.on { background: #fff; color: #0d1117; border-color: #fff; }

/* нижние вкладки — ярче и читаемее */
body.nav-tabs-bar .tab-btn { opacity: .88 !important; font-size: 10.5px !important; font-weight: 700 !important; }
body.nav-tabs-bar .tab-btn:not(.active) { color: var(--text) !important; }
body.nav-tabs-bar .tab-btn:not(.active) .mb-icon { opacity: .9; }
body.nav-tabs-bar .tab-btn.active { opacity: 1 !important; font-weight: 800 !important; }
body.nav-tabs-bar .tab-btn.active .mb-icon { filter: drop-shadow(0 0 6px rgba(var(--primary-rgb), .45)); }

/* калькулятор в шапке: 1.8.9 — такая же клавиша, как «отмена/повтор» */
#header-calc-btn svg { width: 22px; height: 22px; }

/* задачи на ПК: кнопки «изменить» и «удалить» на карточке */
.task-pc-tools { display: none; }
@media (hover: hover) and (pointer: fine) {
  .task-card { position: relative; }
  .task-pc-tools { display: flex; gap: 4px; position: absolute; top: 8px; right: 8px; z-index: 3; opacity: .4; transition: opacity .15s; }
  .task-card:hover .task-pc-tools, .task-pc-tools:focus-within { opacity: 1; }
  .task-pc-btn { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
  .task-pc-btn:hover { border-color: var(--primary); }
  .task-pc-btn.danger:hover { border-color: var(--danger); background: rgba(239, 68, 68, .08); }
  .task-card .task-main { padding-right: 72px; }
}
.oa-row.oa-row-sup .oa-row-ico { display: inline-flex !important; }
.oa-row.oa-row-sup { padding-left: 8px !important; }
.of-status { min-height: 40px; }
.of-status b { white-space: normal !important; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; font-size: 12.5px; }
.of-status { padding: 5px 8px !important; }
.of-status i { display: none !important; }
.of-status.active { box-shadow: inset 0 0 0 1px var(--primary); }
.of-status b { font-size: 12px; }
