/* Портал ClinicSoft - фирменный стиль: медицинский бирюзовый #0B7A75, глубокий синий #0B2A3C,
   коралловый акцент #FF6B4A, мятный #DDF3EF; Manrope - заголовки, Golos Text - текст. */
:root {
    --brand: #0B7A75; --brand-deep: #096965; --ink: #0B2A3C; --ink-2: #3C5565; --ink-3: #5B7484;
    --mint: #DDF3EF; --tint: #F4F7F8; --line: #E2EAEE; --coral: #FF6B4A; --bg: #fff;
    --bs-body-font-family: 'Golos Text', system-ui, sans-serif; --bs-primary: #0B7A75; --bs-primary-rgb: 11, 122, 117;
    --bs-link-color: #0B7A75; --bs-link-color-rgb: 11, 122, 117; --bs-border-radius: 12px;
}
body { background: var(--tint); color: var(--ink); font-family: 'Golos Text', system-ui, sans-serif; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .brand-name, .num { font-family: Manrope, sans-serif; }
.vp-shell { --side-w: 240px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.vp-side { background: var(--ink); color: #D3E0E6; padding: 20px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; z-index: 1020; }
.vp-side .brand-row { display: flex; align-items: flex-start; gap: 4px; padding-bottom: 14px; }
.vp-side .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px; flex: 1; min-width: 0; }
.vp-side .side-menu { flex: 1; }
.sidebar-toggle { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent;
    color: #8FB3C2; margin-top: 2px; }
.sidebar-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-toggle .arrow { transition: transform .2s ease; transform-origin: 14px 12px; }
/* Сотрудник внизу меню: имя, роль, выпадающее меню (инструкция, пароль, выход) */
.side-user-wrap { margin-top: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .06);
    color: #fff; text-align: left; }
.side-user:hover { background: rgba(255, 255, 255, .1); }
.side-user .avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand); font-weight: 800; }
.side-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { font-size: 12px; color: #8FB3C2; }
.side-user > i { color: #8FB3C2; }
@media (min-width: 992px) {
    html.sidebar-collapsed .vp-shell { --side-w: 72px; }
    html.sidebar-collapsed .vp-side { padding-left: 12px; padding-right: 12px; overflow: visible; }
    html.sidebar-collapsed .vp-side .brand-row { justify-content: center; }
    html.sidebar-collapsed .vp-side .brand { display: none; }
    html.sidebar-collapsed .sidebar-toggle .arrow { transform: scaleX(-1); }
    html.sidebar-collapsed .vp-side nav a { justify-content: center; padding: 10px 0; gap: 0; }
    html.sidebar-collapsed .vp-side nav a > span { display: none; }
    html.sidebar-collapsed .vp-side nav a i { font-size: 17px; }
    html.sidebar-collapsed .vp-side .section { font-size: 0; padding: 0; margin: 10px 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
    html.sidebar-collapsed .side-user { justify-content: center; padding: 6px 0; background: transparent; }
    html.sidebar-collapsed .side-user .who, html.sidebar-collapsed .side-user > i { display: none; }
    html.sidebar-collapsed .side-user-wrap .dropdown-menu { min-width: 240px; }
}
.vp-side .brand-name { font-weight: 800; font-size: 21px; letter-spacing: -.5px; }
.vp-side .brand-name span { color: #5FD0C6; }
.vp-side nav a { display: flex; align-items: center; gap: 10px; color: #D3E0E6; text-decoration: none; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.vp-side nav a i { width: 18px; text-align: center; color: #8FB3C2; }
.vp-side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.vp-side nav a.active { background: var(--brand); color: #fff; }
.vp-side nav a.active i { color: #fff; }
.vp-side .section { text-transform: uppercase; font-size: 11px; letter-spacing: .12em; color: #7E9BAA; padding: 16px 10px 6px; font-weight: 700; }
.vp-main { padding: 28px 32px 48px; min-width: 0; }
.vp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.vp-head h1 { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -.5px; }
.card { border: 1px solid var(--line); border-radius: 16px; }
.btn-brand { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--brand-deep);
    --bs-btn-hover-border-color: var(--brand-deep); --bs-btn-hover-color: #fff; --bs-btn-active-bg: #085A57; --bs-btn-active-color: #fff; font-weight: 700; }
.btn-coral { --bs-btn-bg: var(--coral); --bs-btn-border-color: var(--coral); --bs-btn-color: var(--ink); --bs-btn-hover-bg: #FF5029;
    --bs-btn-hover-border-color: #FF5029; --bs-btn-hover-color: var(--ink); font-weight: 800; }
.btn-outline-brand { --bs-btn-color: var(--brand); --bs-btn-border-color: #B9DCD9; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: var(--brand); font-weight: 600; }
.tile { padding: 18px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); height: 100%; }
.tile span { display: block; color: var(--ink-3); font-size: 14px; font-weight: 600; }
.tile b { display: block; font-family: Manrope, sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.tile.mint { background: var(--mint); border-color: transparent; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st-NEW { background: #FFE3DC; color: #9A2C12; } .st-IN_WORK { background: #DCEBFA; color: #17457A; } .st-DEMO { background: var(--mint); color: #075955; }
.st-WON { background: #DDF5E6; color: #1E6B43; } .st-LOST { background: #EEF1F2; color: #5B7484; }
.st-ACTIVE { background: var(--mint); color: #075955; } .st-EXPIRED, .st-DELETED { background: #EEF1F2; color: #5B7484; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars div { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div.alt { background: var(--coral); }
.muted { color: var(--ink-3); }
.cred { font-family: ui-monospace, Menlo, monospace; background: var(--mint); padding: 2px 8px; border-radius: 6px; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; margin-bottom: 8px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--mint); padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px; box-shadow: 0 16px 40px rgba(11, 42, 60, .12); }
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 2000; }
.menu-toggle { display: none; }
/* Телефон и планшет: сверху полоса с логотипом и кнопкой "Меню"; меню раскрывается под ней списком по разделам */
@media (max-width: 991.98px) {
    .vp-shell { grid-template-columns: minmax(0, 1fr); }
    .vp-side { height: auto; max-height: 100vh; padding: 10px 12px; }
    .vp-side .brand-row { align-items: center; padding-bottom: 0; }
    .vp-side .brand-name { font-size: 19px; }
    .sidebar-toggle { display: none; }
    .menu-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 60%; height: 40px; padding: 0 14px; border: 0; border-radius: 12px;
        background: rgba(255, 255, 255, .08); color: #fff; font-weight: 700; font-size: 14px; }
    .menu-toggle:hover, .vp-side.open .menu-toggle { background: rgba(255, 255, 255, .14); }
    .menu-current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .vp-side .side-menu, .vp-side .side-user-wrap { display: none; }
    .vp-side.open .side-menu { display: block; padding-top: 8px; }
    .vp-side.open .side-user-wrap { display: block; padding-bottom: 4px; }
    .vp-side .section { padding-top: 12px; }
    .vp-main { padding: 20px 16px 40px; }
}

[hidden] { display: none !important; }

/* Метрика */
.mtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.mtabs a { padding: 9px 14px; font-weight: 700; color: var(--ink-3); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.mtabs a:hover { color: var(--ink); }
.mtabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.mbars div { display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.mbars div i { display: block; background: var(--coral); width: 100%; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.tile small { font-size: 12px; }
.tile.sig.bad b { color: #C2410C; }
.snippet { background: var(--ink); color: #DDF3EF; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
tr.clickable { cursor: pointer; }
.kv td:first-child { color: var(--ink-3); width: 40%; }
.kv td { white-space: pre-line; word-break: break-word; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
.timeline .ev { display: grid; grid-template-columns: 70px 150px minmax(0, 1fr); gap: 8px; padding: 4px 8px 4px 14px; font-size: 13.5px; position: relative; border-radius: 6px; }
.timeline .ev:hover { background: var(--tint); }
.timeline .ev::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #B9DCD9; }
.timeline .ev.bad::before { background: var(--coral); } .timeline .ev.bad .k { color: #C2410C; }
.timeline .ev.good::before { background: #1E6B43; } .timeline .ev.good .k { color: #1E6B43; }
.timeline .ev .t { color: var(--ink-3); font-variant-numeric: tabular-nums; } .timeline .ev .k { font-weight: 700; }
#player .rr-player { box-shadow: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 100%; }
@media (max-width: 575.98px) { .timeline .ev { grid-template-columns: 60px minmax(0, 1fr); } .timeline .ev .l { grid-column: 1 / -1; } }

/* Навигация назад к списку (над заголовком страницы формы) */
.vp-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 6px; }
.vp-back:hover { color: var(--brand); }
.vp-title { margin-bottom: 20px; }
.vp-title h1 { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -.5px; }
/* Действия в строках - иконки с подсказкой (title + data-bs-toggle="tooltip") */
.btn-icon { --bs-btn-padding-x: 0; --bs-btn-padding-y: 0; width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px;
    color: var(--ink-3); border: 1px solid transparent; background: transparent; }
.btn-icon:hover, .btn-icon:focus-visible { color: var(--brand); background: var(--mint); }
.btn-icon.danger:hover, .btn-icon.danger:focus-visible { color: #B42318; background: #FDE7E4; }
.row-actions { display: inline-flex; gap: 2px; white-space: nowrap; }
/* Форма в карточке: секции с заголовками */
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.form-section h2 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 24px; }
/* Оформление демо */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.demo-preview-col { position: sticky; top: 20px; }
.br-color { display: flex; gap: 6px; }
.br-color .form-control-color { width: 44px; flex: none; padding: 4px; }
.br-preset { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 13px; font-weight: 600; }
.br-preset i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.br-preset:hover { border-color: var(--brand); }
.br-logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.br-logo-box { height: 84px; border: 1px dashed #C7D6DD; border-radius: 12px; display: grid; place-items: center; background: #fff; padding: 8px; }
.br-logo-box.dark { background: #0B2A3C; border-color: #0B2A3C; }
.br-logo-box img { max-width: 100%; max-height: 64px; }
.br-logo-box .empty { color: var(--ink-3); font-size: 13px; }
.brp { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--tint); font-family: var(--brp-font, inherit); color: var(--ink); }
.brp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface, #fff); border-bottom: 1px solid var(--line); font-weight: 800; }
.brp-head img { max-height: 28px; max-width: 140px; }
.brp-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-strong); display: inline-block; flex: none; }
.brp-body { display: grid; grid-template-columns: 120px minmax(0, 1fr); min-height: 230px; }
.brp-side { padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.brp-side span { padding: 7px 8px; border-radius: 8px; color: var(--ink-soft, var(--ink)); }
.brp-side span.active { background: var(--brand-strong); color: #fff; }
.brp-main { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.brp-card { background: var(--surface, #fff); border-radius: 12px; padding: 12px; border: 1px solid var(--line); font-size: 13px; }
.brp-muted { color: var(--ink-soft, #5B7484); }
.brp-badge { display: inline-block; background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.brp-btn { display: inline-block; padding: 7px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--brand-strong); color: #fff; }
.brp-btn.accent { background: var(--accent); color: var(--accent-ink); }
.brp-link { color: var(--brand-link, var(--brand-strong)); font-weight: 600; font-size: 13px; }
@media (max-width: 1199.98px) { .demo-grid { grid-template-columns: minmax(0, 1fr); } .demo-preview-col { position: static; } }
@media (max-width: 575.98px) { .br-logos { grid-template-columns: minmax(0, 1fr); } }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus, .form-control:focus, .form-select:focus { border-color: #7CC4BE; box-shadow: 0 0 0 .2rem rgba(11, 122, 117, .18); }

/* Инструкция: оглавление сбоку */
.help-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1180px; }
.help-toc { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { color: var(--ink-2); text-decoration: none; padding: 5px 8px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.help-toc a:hover { background: var(--mint); color: var(--brand); }
.help-body section { scroll-margin-top: 16px; }
.help-body h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.help-body h3 { font-size: 16px; font-weight: 800; margin: 14px 0 8px; }
.help-body li, .help-body p, .help-body dd { line-height: 1.55; }
.help-body li + li { margin-top: 4px; }
.help-body dt { margin-top: 10px; }
@media (max-width: 991.98px) { .help-grid { grid-template-columns: minmax(0, 1fr); } .help-toc { position: static; } }
.help-shot { margin: 14px 0 4px; }
.help-shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 18px rgba(11, 42, 60, .08); }
.help-shot a:hover img { border-color: #B9DCD9; }
.help-shot figcaption { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.help-toc a.active { background: var(--mint); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }

/* Счета и акты: статусы документа */
.st-DRAFT { background: #EEF1F2; color: #5B7484; }
.st-ISSUED { background: #FFF3D6; color: #7A5300; }
.st-PAID { background: var(--mint); color: #075955; }
.st-CANCELLED { background: #EEF1F2; color: #8A97A6; text-decoration: line-through; }
/* Документы: окно как в проводнике - дерево папок, путь, содержимое списком или значками */
.fx { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 560px; height: calc(100vh - 230px); overflow: hidden; background: #fff; }
.fx-side { border-right: 1px solid var(--line); background: var(--tint); overflow: auto; padding: 10px 6px; }
.fx-node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-size: 14px;
    user-select: none; }
.fx-node > span { overflow: hidden; text-overflow: ellipsis; }
.fx-node > i { color: var(--brand); width: 16px; text-align: center; }
.fx-node:hover { background: rgba(11, 122, 117, .08); }
.fx-node.on { background: var(--mint); font-weight: 600; }
.fx-caret { border: 0; background: none; width: 18px; padding: 0; color: var(--ink-3); font-size: 11px; flex: none; }
.fx-caret:disabled { visibility: hidden; }
.fx-main { position: relative; display: flex; flex-direction: column; min-width: 0; }
.fx-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fx-crumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 200px; overflow: hidden; }
.fx-crumb { border: 0; background: none; padding: 4px 8px; border-radius: 8px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-size: 15px; }
button.fx-crumb:hover { background: var(--tint); color: var(--brand); }
.fx-crumb.current { color: var(--ink); }
.fx-sep { font-size: 10px; color: var(--ink-3); }
.fx-tools { display: flex; align-items: center; gap: 8px; }
.fx-search { position: relative; }
.fx-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13px; }
.fx-search input { padding-left: 30px; width: 200px; }
.fx-views { display: flex; gap: 2px; }
.fx-views .btn-icon.active { background: var(--mint); color: var(--brand); }
.fx-items { flex: 1; overflow: auto; padding: 6px 8px 16px; outline: none; user-select: none; }
.fx-items:focus-visible { box-shadow: inset 0 0 0 2px rgba(11, 122, 117, .35); }
.fx-item { cursor: default; border-radius: 8px; }
.fx-item.sel { background: var(--mint); }
.fx-items:focus .fx-item.sel { background: #BFE7E0; }
.fx-item.drop, .fx-node.drop, .fx-crumb.drop { background: var(--brand) !important; color: #fff; }
.fx-item.drop i, .fx-node.drop i, .fx-item.drop .fx-cell { color: #fff !important; }
.fx-list .fx-head, .fx-list .fx-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px 120px; align-items: center; gap: 12px; padding: 6px 10px; }
.fx-list .fx-head { position: sticky; top: -6px; background: #fff; z-index: 1; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
.fx-th { border: 0; background: none; padding: 0; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.fx-th.on { color: var(--ink); }
.fx-cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-cell-name > i { font-size: 18px; width: 20px; text-align: center; flex: none; }
.fx-cell-name .fx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-cell { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.fx-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; align-content: start; padding-top: 12px; }
.fx-icons .fx-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; text-align: center; }
.fx-pic { width: 76px; height: 64px; display: grid; place-items: center; }
.fx-pic i { font-size: 50px; }
.fx-pic img { max-width: 76px; max-height: 64px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.fx-icons .fx-name { font-size: 13px; line-height: 1.3; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fx-meta { font-size: 11px; color: var(--ink-3); }
.fx-rename { font-size: 13px; padding: 2px 6px; min-width: 0; }
.fx-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 80px 20px; color: var(--ink-3); }
.fx-empty > i { font-size: 44px; opacity: .5; }
.fx-status { border-top: 1px solid var(--line); padding: 6px 14px; font-size: 12px; color: var(--ink-3); background: var(--tint); }
.fx-dropzone { position: absolute; inset: 56px 12px 40px; border: 2px dashed var(--brand); border-radius: 14px; background: rgba(221, 243, 239, .92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--brand-deep); font-weight: 600;
    pointer-events: none; }
.fx-dropzone[hidden] { display: none; }
.fx-dropzone i { font-size: 40px; }
/* Своё меню, не .dropdown-menu: обработчики Bootstrap ищут у такого меню кнопку-переключатель */
.fx-menu { display: none; position: fixed; z-index: 1080; min-width: 200px; padding: 6px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.fx-menu.show { display: block; }
.fx-upload { position: fixed; right: 24px; bottom: 24px; width: 320px; padding: 14px; z-index: 1070; }
@media (max-width: 991px) {
    .fx { grid-template-columns: minmax(0, 1fr); height: auto; }
    .fx-side { display: none; }
    .fx-list .fx-head, .fx-list .fx-item { grid-template-columns: minmax(0, 1fr) 90px; }
    .fx-list .fx-head > :nth-child(2), .fx-list .fx-head > :nth-child(4), .fx-list .fx-item > :nth-child(2), .fx-list .fx-item > :nth-child(4) { display: none; }
    .fx-items { min-height: 400px; }
}

/* -- Техподдержка: очередь и заявка (support/*.html) -- */
.side-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-style: normal;
    font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
html.sidebar-collapsed .side-badge { position: absolute; margin: -18px 0 0 18px; }
.sp-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sp-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-tile:hover { border-color: var(--brand); color: var(--ink); }
.sp-tile b { display: block; font-family: Manrope, sans-serif; font-size: 26px; font-weight: 800; line-height: 1.1; }
.sp-tile span:not(.sp-tile-ico) { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sp-tile-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--brand); font-size: 17px; }
.sp-tile.hot { border-color: #FFC7B8; background: #FFF6F3; } .sp-tile.hot .sp-tile-ico { background: var(--coral); color: #fff; }
.sp-tile.warn .sp-tile-ico { background: #FFE9C7; color: #9A5B00; }
.sp-tile.ok .sp-tile-ico { background: #DDF5E6; color: #1E6B43; }
.sp-filters { padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.sp-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-tabs a { padding: 7px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: 14px; text-decoration: none; background: var(--tint); }
.sp-tabs a em { font-style: normal; margin-left: 4px; color: var(--ink-3); font-weight: 600; }
.sp-tabs a.on { background: var(--ink); color: #fff; } .sp-tabs a.on em { color: #A9C3CF; }
.sp-filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-filter-row .form-select { width: auto; min-width: 190px; }
.sp-search { position: relative; flex: 1; min-width: 240px; margin: 0; }
.sp-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.sp-search .form-control { padding-left: 38px; }
.sp-list { display: flex; flex-direction: column; gap: 8px; }
.sp-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto 170px 16px; align-items: center; gap: 16px; padding: 14px 18px 14px 20px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; position: relative; overflow: hidden; }
.sp-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #CBD7DD; }
.sp-row.pr-CRITICAL::before { background: #D92D20; } .sp-row.pr-HIGH::before { background: var(--coral); } .sp-row.pr-MEDIUM::before { background: #E8B04B; }
.sp-row.pr-LOW::before { background: #9FB6C1; }
.sp-row:hover { border-color: var(--brand); color: var(--ink); box-shadow: 0 8px 24px rgba(11, 42, 60, .06); }
.sp-row.done { opacity: .75; }
.sp-num b { display: block; font-family: Manrope, sans-serif; font-weight: 800; }
.sp-num span { font-size: 12px; color: var(--ink-3); }
.sp-title { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.sp-title > span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-title > i { color: var(--brand); flex: none; }
.sp-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sub b { color: var(--ink-2); }
.sp-new-reply { flex: none; padding: 1px 8px; border-radius: 999px; background: #FFE3DC; color: #9A2C12; font-size: 11px; font-weight: 800; }
.sp-pr, .sp-st { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sp-pr.pr-CRITICAL { background: #D92D20; color: #fff; } .sp-pr.pr-HIGH { background: #FFE3DC; color: #9A2C12; }
.sp-pr.pr-MEDIUM { background: #FFF1D6; color: #7A5300; } .sp-pr.pr-LOW { background: #EEF1F2; color: #5B7484; }
.sp-st.st-NEW { background: var(--ink); color: #fff; } .sp-st.st-IN_PROGRESS { background: #DCEBFA; color: #17457A; }
.sp-st.st-WAITING { background: #FFF1D6; color: #7A5300; } .sp-st.st-RESOLVED { background: #DDF5E6; color: #1E6B43; }
.sp-st.st-CLOSED { background: #EEF1F2; color: #5B7484; } .sp-st.st-REJECTED { background: #EEF1F2; color: #8A97A6; text-decoration: line-through; }
.sp-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.sp-who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-ava { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 12px; }
.sp-ava.none { background: var(--tint); color: var(--ink-3); border: 1px dashed #B9C9D1; }
.sp-go { color: #A9BDC7; }
.sp-empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sp-empty > span { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--mint); color: var(--brand); font-size: 22px; }
.sp-h1 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.sp-h1-num { color: var(--ink-3); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.sp-chip i { color: var(--brand); }
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sp-side { position: sticky; top: 16px; }
.sp-card { padding: 20px 22px; }
.sp-h2 { font-size: 16px; font-weight: 800; margin: 0 0 14px; }
.sp-facts { display: grid; gap: 12px; }
.sp-fact { padding: 14px 16px; border-radius: 14px; background: var(--tint); border-left: 4px solid #B9C9D1; }
.sp-fact.exp { border-left-color: var(--brand); background: #F0FAF8; } .sp-fact.act { border-left-color: var(--coral); background: #FFF6F3; }
.sp-fact > span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.sp-fact p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.sp-shots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sp-shot { width: 160px; height: 110px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; background: var(--tint);
    color: var(--ink-2); font-size: 12px; text-decoration: none; }
.sp-shot img { width: 100%; height: 100%; object-fit: cover; }
.sp-shot span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; text-align: center; word-break: break-all; }
.sp-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sp-empty-thread { color: var(--ink-3); font-size: 14px; }
.sp-msg { max-width: 86%; padding: 12px 14px; border-radius: 14px; background: var(--tint); }
.sp-msg.staff { align-self: flex-end; background: #E6F4F2; }
.sp-msg.note { align-self: flex-end; background: #FFF6DB; border: 1px dashed #E8C66B; }
.sp-msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.sp-msg-head span { color: var(--ink-3); } .sp-msg-head time { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.sp-msg p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.sp-msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 13px; }
.sp-msg-files:empty { display: none; }
.sp-sys { align-self: center; font-size: 12px; color: var(--ink-3); padding: 3px 12px; border-radius: 999px; background: var(--tint); }
.sp-sys.int { background: #FFF6DB; }
.sp-reply { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sp-reply-mode { display: flex; gap: 6px; }
.sp-reply-mode label { margin: 0; cursor: pointer; } .sp-reply-mode input { position: absolute; opacity: 0; }
.sp-reply-mode span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.sp-reply-mode input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.sp-reply-mode input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.sp-reply-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-reply-btns { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sp-btn-wrap { display: inline-flex; }
.sp-dl { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.sp-dl dt { color: var(--ink-3); font-weight: 600; } .sp-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sp-mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
@media (max-width: 1199.98px) { .sp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-layout { grid-template-columns: 1fr; } .sp-side { position: static; } }
@media (max-width: 767.98px) {
    .sp-tiles { grid-template-columns: 1fr 1fr; }
    .sp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
    .sp-row .sp-num { grid-column: 1; display: flex; gap: 8px; align-items: baseline; }
    .sp-row .sp-main { grid-column: 1 / -1; grid-row: 2; }
    .sp-row .sp-pr { grid-column: 2; grid-row: 1; justify-self: end; }
    .sp-row .sp-st { grid-row: 3; justify-self: start; }
    .sp-row .sp-who { grid-row: 3; grid-column: 2; }
    .sp-row .sp-go { display: none; }
    .sp-filter-row .form-select { flex: 1 1 140px; min-width: 0; }
    .sp-msg { max-width: 100%; }
    .sp-reply-btns { margin-left: 0; width: 100%; }
}

/* -- Мои уведомления (notify.html) -- */
.nt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.nt-card { padding: 20px; }
.nt-card.off { opacity: .6; }
.nt-head { display: flex; align-items: center; gap: 12px; }
.nt-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nt-head b { font-family: Manrope, sans-serif; font-size: 17px; } .nt-head span { font-size: 13px; color: var(--ink-3); }
.nt-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: #fff; background: var(--brand); }
.nt-ico.tg { background: #229ED9; } .nt-ico.push { background: var(--coral); }
.nt-switch { width: 2.6em !important; height: 1.4em; cursor: pointer; }
.nt-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
.nt-ok { color: #1E6B43; font-weight: 700; } .nt-ok i { margin-right: 6px; }
.nt-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nt-result { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.nt-result span { display: inline-flex; gap: 6px; align-items: center; } .nt-result .ok { color: #1E6B43; } .nt-result .bad { color: #B42318; }
@media (max-width: 991.98px) { .nt-grid { grid-template-columns: 1fr; } }

/* Роли сотрудника: несколько отметок карточками */
.role-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.role-wrap { display: block; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--brand); background: var(--mint); }
.role-opt:has(input:disabled) { cursor: not-allowed; opacity: .75; }
.role-opt .form-check-input { margin-top: 3px; flex: none; }
.role-opt b { display: block; font-size: 14px; }
.role-opt small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
@media (max-width: 767px) { .role-pick { grid-template-columns: 1fr; } }

/* Маршрутизация номеров */
.rt-sync { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--mint); color: var(--ink-2); font-size: 14px; }
.rt-sync > i { color: var(--brand); }
.rt-sync.bad { background: #FFF1EC; }
.rt-sync.bad > i { color: var(--coral); }
.rt-sync .btn { margin-left: auto; }
.rt-add { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.rt-off td { color: var(--ink-3); }
@media (max-width: 991px) { .rt-add { grid-template-columns: 1fr; } }
