/* ================================================================
   SMIT Theme — Light & Dark modes
   Palette based on smit34.ru / support.smit34.ru
   Toggle: body[data-theme="light"] / body[data-theme="dark"]

   Colors:
   - Green primary:    #43b77a
   - Green dark:       #379963
   - Green light bg:   #e8f5e9
   - Accent teal:      #3cbfae
   - Dark bg:          #1a1d23
   - Dark surface:     #22262e
   - Dark card:        #2a2e37
   - Text light:       #e4e6ea
   - Border dark:      #353940
   ================================================================ */

/* ================================================================
   DESIGN TOKENS вынесены в отдельный файл (build 490, 2026-05-07):
   billing/static/css/tokens.css — единый источник правды для админки + ЛК.
   Подключается в base_adminlte.html ПЕРЕД этим файлом.
   ================================================================ */

/* ================================================================
   ЕДИНЫЙ СТИЛЬ INFO-ИКОНОК (build 1226+, 2026-06-18)
   Канон: контурный серый кружок с «i» → фирменный зелёный при наведении.
   Применяется ГЛОБАЛЬНО (раньше .int-info-icon жил только в integrations.html).
   К этому виду все варианты приводит smitNormalizeInfoIcons() в base_adminlte.html.
   ================================================================ */
.int-info-icon,
.smit-info-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border: 1px solid #adb5bd; border-radius: 50%;
    color: #6c757d; font-size: .65em; font-style: normal; font-weight: 600;
    margin-left: 6px; text-decoration: none;
    transition: all .15s ease;
    vertical-align: middle; line-height: 1;
    cursor: help; flex-shrink: 0;
}
.int-info-icon:hover, .int-info-icon:focus,
.smit-info-icon:hover, .smit-info-icon:focus {
    background: #43b77a; color: #fff; border-color: #43b77a; text-decoration: none;
}
.int-info-icon:focus-visible, .smit-info-icon:focus-visible {
    outline: 2px solid #43b77a; outline-offset: 2px;
}
body.dark-theme .int-info-icon, [data-bs-theme="dark"] .int-info-icon,
body.dark-theme .smit-info-icon, [data-bs-theme="dark"] .smit-info-icon {
    border-color: #5a6268; color: #a8b8cc;
}
body.dark-theme .int-info-icon:hover, [data-bs-theme="dark"] .int-info-icon:hover,
body.dark-theme .smit-info-icon:hover, [data-bs-theme="dark"] .smit-info-icon:hover {
    background: #43b77a; color: #fff; border-color: #43b77a;
}
@media (prefers-reduced-motion: reduce) {
    .int-info-icon, .smit-info-icon { transition: none; }
}
/* Скрываем исходный <i> внутри ссылки после нормализации (JS добавляет .smit-info-done) */
.int-info-icon.smit-info-done > i, .smit-info-icon.smit-info-done > i { display: none; }

@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]):not(.light-theme) {
        --surface-page:    #1a1d23;
        --surface-card:    #22262e;
        --surface-muted:   #2a2e37;
        --surface-toolbar: #2a2e37;
        --border-subtle:   #353940;
        --border-default:  #3a3f47;
    }
}

/* ============================================
   Navbar compact
   ============================================ */
.layout-navbar-fixed .wrapper .content-wrapper {
    margin-top: calc(2.5rem + 0.1px) !important;
}

/* ============================================
   Logo — matches smit34.ru
   ============================================ */
.smit-logo {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 0 0.5rem !important;
    text-decoration: none !important;
    line-height: 1;
}
.smit-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #43b77a, #3cbfae);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    border-radius: 6px;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1;
}
.smit-logo-icon-sm {
    width: 22px;
    height: 22px;
    font-size: 13px;
    border-radius: 5px;
}
.smit-logo-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1;
}
.smit-logo-caps {
    font-weight: 800;
}

/* === Org selector (multi-org) — build 1073 === */
/* Desktop: сокращаем длинное название организации в шапке через ellipsis.
   «Все организации» в шаблоне → короткое «Все»; реальные имена («АЙТИ Консалтинг»)
   обрезаются до «АЙТИ Консал…». */
#org-selector .org-sel-name {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
@media (min-width: 1200px) {
    #org-selector .org-sel-name { max-width: 140px; }
}
/* Mobile: компактный чип «иконка + Все/4 символа» рядом с логотипом СмИТ */
#org-selector-mobile .org-mobile-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 .45rem;
    height: 30px;
    border-radius: 7px;
    background: rgba(67, 183, 122, .18);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
#org-selector-mobile .org-mobile-chip::after { margin-left: 1px; }
#org-selector-mobile .org-mobile-chip > i { font-size: .9rem; color: #7ee0ab; }
#org-selector-mobile .org-mobile-name {
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar brand logo */
.brand-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 0.8rem !important;
    height: 40px;
    min-height: 40px;
}
.brand-link .brand-text {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Theme toggle button */
#theme-toggle {
    font-size: 0.85rem;
    padding: 0 0.4rem !important;
    opacity: 0.6;
    transition: opacity .2s;
    line-height: 1;
}
#theme-toggle:hover {
    opacity: 1;
}


/* ================================================================
   LIGHT THEME (default)
   ================================================================ */

/* --- Navbar --- */
.main-header.navbar {
    background-color: #fff !important;
    border-bottom: 2px solid #e8e8e8 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    min-height: 40px;
    height: 40px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.main-header .navbar-nav {
    height: 40px;
    align-items: center;
}
/* Navbar: profile dropdown must not be clipped by navbar overflow */
.main-header.navbar { overflow: visible !important; }

/* PLAN 2026 pill (только для is_superuser, в навбаре рядом с theme toggle) */
.main-header .smit-plan-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 5px 12px !important;
    background: linear-gradient(135deg, #10b981, #14b8a6) !important;
    color: #fff !important;
    font-size: .78rem !important;
    font-weight: 700 !important;
    letter-spacing: .5px;
    border-radius: 100px !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: transform .15s, box-shadow .15s, filter .15s;
    text-decoration: none !important;
    border: none;
    line-height: 1.2;
}
.main-header .smit-plan-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
    filter: brightness(1.08);
    color: #fff !important;
}
.main-header .smit-plan-pill:focus { outline: 2px solid #34d399; outline-offset: 2px; }
#nav-main > .nav-item:last-child { flex-shrink: 0; }
#nav-main > .nav-item:last-child .nav-link > span {
    display: inline !important;
}
.main-header .nav-link {
    color: #555 !important;
    font-size: 0.82rem;
    padding: 0.3rem 0.55rem !important;
    transition: color .15s, background .15s;
    line-height: 1.2;
    height: auto;
}
.main-header .nav-link:hover {
    color: #43b77a !important;
    background: rgba(67,183,122,.06);
    border-radius: 4px;
}
.main-header .nav-item.active > .nav-link {
    color: #fff !important;
    background-color: #43b77a !important;
    border-radius: 4px;
}
.main-header .smit-logo .smit-logo-text {
    color: #2d3a2e;
}
.main-header [data-widget="pushmenu"] {
    color: #666 !important;
    padding: 0 0.5rem !important;
}
.main-header [data-widget="pushmenu"]:hover {
    color: #43b77a !important;
}
#theme-toggle { color: #666 !important; }
#theme-toggle:hover { color: #43b77a !important; }

/* Dropdown */
.main-header .dropdown-menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.main-header .dropdown-item { color: #333 !important; }
.main-header .dropdown-item:hover {
    background-color: #e8f5e9 !important;
    color: #2d3a2e !important;
}

/* --- Sidebar --- */
.main-sidebar {
    background-color: #1e2b1f !important;
}
.main-sidebar .brand-link {
    /* build 929: полупрозрачный фон вместо плотного #1a241b — лучше смотрится
       поверх матового стекла sidebar'а (build 919+). */
    background-color: #00000026 !important;
    border-bottom: 1px solid #3a5a3b !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
}
/* build 700/710: brand-link в свёрнутом виде. build 710: упрощено — один селектор. */
body.sidebar-collapse .main-sidebar .brand-link {
    padding: 0 !important;
    justify-content: center !important;
    width: 4.6rem !important;
    overflow: hidden !important;
}
body.sidebar-collapse .main-sidebar .brand-link .smit-logo-icon {
    margin: 0 !important;
}
body.sidebar-collapse .main-sidebar .brand-link .brand-text {
    display: none !important;
}
.main-sidebar .brand-text,
.main-sidebar .smit-logo-text {
    color: #fff !important;
}
.main-sidebar .smit-logo-caps { color: #fff; }
.main-sidebar .nav-link { color: #b0c4b0 !important; }
/* build 1258: на мобиле/планшете сайдбар контрастнее и читаемее —
   текст ярче (почти белый), пункты крупнее, иконки заметнее, фон темнее. */
@media (max-width: 991.98px) {
    .main-sidebar { background-color: #16211a !important; }
    .main-sidebar .nav-sidebar .nav-link { color: #eaf2ea !important; font-size: 1rem; padding: 0.62rem 0.9rem !important; }
    .main-sidebar .nav-sidebar .nav-link p { font-weight: 500; }
    .main-sidebar .nav-sidebar .nav-link .nav-icon { color: #7fd6a8 !important; font-size: 1.05rem; opacity: 1; }
    .main-sidebar .nav-treeview > .nav-item > .nav-link { color: #cfe0cf !important; }
    .main-sidebar .nav-link.active { background-color: #43b77a !important; color: #fff !important; }
    .main-sidebar .nav-link:hover { background-color: rgba(67,183,122,.28) !important; color: #fff !important; }
    /* file-tree папки абонентов — контрастнее на мобиле */
    .main-sidebar .sidebar-filetree .ft-label { color: #eaf2ea !important; }
    .main-sidebar .sidebar-filetree .nav-treeview > .nav-item > .ft-link .ft-label { color: #dbe7db !important; }
}
.main-sidebar .nav-link:hover {
    color: #fff !important;
    background-color: rgba(67,183,122,.2) !important;
}
.main-sidebar .nav-link.active {
    background-color: #43b77a !important;
    color: #fff !important;
}
.main-sidebar .nav-treeview > .nav-item > .nav-link { color: #8fa88f !important; }
.main-sidebar .nav-treeview > .nav-item > .nav-link:hover { color: #fff !important; }
.main-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(67,183,122,.3) !important;
    color: #fff !important;
}
[class*="sidebar-dark"] { background-color: #1e2b1f !important; }
[class*="sidebar-dark"] .brand-link { border-bottom-color: #3a5a3b !important; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: #43b77a !important;
    color: #fff !important;
}

/* --- Content --- */
body { background-color: #343a40 !important; }  /* Match navbar bg — eliminates white strip between navbar and content */
.content-wrapper { background-color: #f5f6f8 !important; }
#top-alerts:empty, #top-alerts:not(:has(*)) { display: none; padding: 0; margin: 0; }
#top-alerts { margin: 0; padding: 0; }
.content-wrapper > .content { padding-top: 0 !important; }
.content-wrapper > .content.pt-2 { padding-top: 15px !important; }
.container-fluid {
    padding-right: 0 !important;
    padding-left: 1.5rem !important;
}
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.5rem !important;
    }
}
.content-wrapper textarea {
    height: auto;
    min-height: 0;
}
.form-row.row > .span4 {
    padding-left: 0px;
}
.comment-row {
    align-items: baseline;
}

/* --- Sub-tabs (merged tab groups) --- */
.sub-tabs {
    background: #f8f9f8;
    border: 1px solid #d5ddd5;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: .88em;
    display: inline-flex;
    margin: 0 auto 12px;
}
.sub-tabs .nav-link {
    padding: 5px 16px;
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
}
.sub-tabs .nav-link:hover {
    color: #43b77a;
    background: rgba(67,183,122,.06);
}
.sub-tabs .nav-link.active {
    color: #43b77a !important;
    border-bottom: 2px solid #43b77a !important;
    background: #fff;
}
.sub-tabs-wrap {
    text-align: center;
}
body.dark-theme .sub-tabs {
    background: #1e222a;
    border-color: #3a3f47;
}
body.dark-theme .sub-tabs .nav-link {
    color: #9ea3ad;
}
body.dark-theme .sub-tabs .nav-link:hover {
    background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
body.dark-theme .sub-tabs .nav-link.active {
    color: var(--brand-primary) !important;
    border-bottom-color: var(--brand-primary) !important;
    background: #22262e;
}

/* --- Row-fluid desktop fix --- */
.row-fluid {
    margin-right: 0;
    margin-left: 0;
}

/* --- Sidebar no horizontal scroll --- */
.main-sidebar .sidebar {
    overflow-x: hidden !important;
}

/* --- Button icon colors --- */
/* build 542 (/critique part 2): clean btn-outline-secondary — белый фон + чистый
   border + brand-hover, как у toolbar-чипов «Месяц/Квартал/30д».
   Раньше был background:#dcdcdc — давало «серую губую выпуклость» AdminLTE, которую
   пользователь явно отметил как «выглядит как гавно». */
.btn-outline-secondary {
    background: #fff !important;
    color: #495057 !important;
    border: 1px solid #ced4da !important;
    box-shadow: none !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #f1f8f4 !important;
    color: #2f8556 !important;
    border-color: #43b77a !important;
}
/* Высокая специфичность — иначе AdminLTE с :not(:disabled):not(.disabled).active побеждает */
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.btn-check:checked + .btn-outline-secondary:not(:disabled):not(.disabled),
.show > .btn-outline-secondary.dropdown-toggle:not(:disabled):not(.disabled) {
    background: #43b77a !important;
    background-color: #43b77a !important;
    color: #fff !important;
    border-color: #3aa86e !important;
    box-shadow: none !important;
}
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
    background: #fff !important;
    color: #adb5bd !important;
    border-color: #e9ecef !important;
}
/* btn-outline-primary — тот же чистый язык, brand-зелёный по умолчанию */
.btn-outline-primary {
    background: #fff !important;
    color: #2f8556 !important;
    border: 1px solid #43b77a !important;
    box-shadow: none !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: #43b77a !important;
    color: #fff !important;
    border-color: #3aa86e !important;
}
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background: #379963 !important;
    color: #fff !important;
    border-color: #2f8556 !important;
}
#exportitem .fa-download,
a[id="exportitem"] .fa-download {
    color: #28a745;
}
#exportitem:hover .fa-download,
a[id="exportitem"]:hover .fa-download {
    color: #fff;
}
.btn .fa-print {
    color: #8B5E3C;
}
.btn:hover .fa-print {
    color: #fff;
}
.head-navbar a[id="additem_folder"] .fa-plus-circle {
    color: #e67e22;
}
.head-navbar a[id="additem_folder"]:hover .fa-plus-circle {
    color: #fff;
}

/* --- Buttons --- */
.btn-primary {
    background-color: #43b77a !important;
    border-color: #3aa86e !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #379963 !important;
    border-color: #2f8556 !important;
}
.btn-success {
    background-color: #43b77a !important;
    border-color: #3aa86e !important;
}
.btn-success:hover, .btn-success:focus {
    background-color: #379963 !important;
    border-color: #2f8556 !important;
}
.btn-danger {
    background-color: #e05555 !important;
    border-color: #d44848 !important;
}
.btn-danger:hover { background-color: #c93c3c !important; }
.btn-warning {
    background-color: #f0ad4e !important;
    border-color: #eea236 !important;
    color: #fff !important;
}
.btn-warning:hover { background-color: #ec971f !important; }
.btn-info {
    background-color: #5bc0de !important;
    border-color: #46b8da !important;
}
.btn-outline-primary {
    color: #43b77a !important;
    border-color: #43b77a !important;
}
.btn-outline-primary:hover {
    background-color: #43b77a !important;
    color: #fff !important;
}

/* --- Toolbar --- */
.head-navbar {
    background: #f8f9f8 !important;
    border: 1px solid #d5ddd5 !important;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    width: 100%;
    padding: 8px 12px !important;
    flex-wrap: wrap;
}
.head-navbar .search-button,
.head-navbar #qf_search_button {
    background-color: #43b77a !important;
    border-color: #3aa86e !important;
    color: #fff !important;
}
.head-navbar .search-button:hover,
.head-navbar #qf_search_button:hover {
    background-color: #379963 !important;
}

/* --- Desktop navbar dropdown menus --- */
#nav-main .nav-dropdown-toggle {
    cursor: pointer;
}
#nav-main .nav-dropdown-toggle::after {
    display: none; /* hide default caret */
}
#nav-main .nav-dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
    padding: 6px;
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
}
#nav-main .nav-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: #4a5568;
    border-radius: 6px;
    transition: background .2s, color .2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#nav-main .nav-dropdown-menu .dropdown-item .sidebar-sub-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    transition: color .2s;
}
#nav-main .nav-dropdown-menu .dropdown-item:hover {
    background: rgba(67,183,122,.08);
    color: #1a6b46;
}
#nav-main .nav-dropdown-menu .dropdown-item:hover .sidebar-sub-icon {
    color: #43b77a;
}
#nav-main .nav-dropdown-menu .dropdown-item.active {
    background: rgba(67,183,122,.12);
    color: #1a6b46;
    font-weight: 600;
}
#nav-main .nav-dropdown-menu .dropdown-item.active .sidebar-sub-icon {
    color: #43b77a;
}

/* --- Rich nav-dropdown items: title + sub-text (build 632) --- */
#nav-main .nav-dropdown-rich { min-width: 280px; padding: 8px; }
#nav-main .nav-dropdown-rich .dropdown-item {
    align-items: flex-start;
    padding: 9px 12px;
    gap: 12px;
    white-space: normal;
}
#nav-main .nav-dropdown-rich .dropdown-item .sidebar-sub-icon {
    width: 20px;
    font-size: 14px;
    margin-top: 2px;
}
#nav-main .nav-dropdown-rich .dd-item-body {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}
#nav-main .nav-dropdown-rich .dd-item-title {
    font-size: .88rem;
    font-weight: 500;
    color: #2d3748;
}
#nav-main .nav-dropdown-rich .dd-item-sub {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: 1px;
    font-weight: 400;
    letter-spacing: .005em;
}
#nav-main .nav-dropdown-rich .dropdown-item:hover .dd-item-title,
#nav-main .nav-dropdown-rich .dropdown-item.active .dd-item-title {
    color: #1a6b46;
}
#nav-main .nav-dropdown-rich .dropdown-item:hover .dd-item-sub {
    color: #5a7d6c;
}
#nav-main .nav-dropdown-rich .dropdown-divider {
    margin: 4px 0;
    border-color: #e9ecef;
    opacity: .8;
}
body.dark-theme #nav-main .nav-dropdown-rich .dd-item-title { color: #e2e8f0; }
body.dark-theme #nav-main .nav-dropdown-rich .dd-item-sub { color: #6b7686; }
body.dark-theme #nav-main .nav-dropdown-rich .dropdown-item:hover .dd-item-title,
body.dark-theme #nav-main .nav-dropdown-rich .dropdown-item.active .dd-item-title { color: #65d0a0; }
body.dark-theme #nav-main .nav-dropdown-rich .dropdown-item:hover .dd-item-sub { color: #8fa898; }

/* --- Tabs (match original Carbon style) --- */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 12px;
    padding-left: 0;
    gap: 2px;
}
.nav-tabs .nav-item {
    margin-bottom: -2px;
}
.nav-tabs .nav-link {
    color: #6c757d !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    padding: 8px 14px !important;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
    transition: color .25s ease, border-color .25s ease, background .25s ease;
    border-radius: 6px 6px 0 0 !important;
    position: relative;
    white-space: nowrap;
}
.nav-tabs .nav-link:hover {
    color: #2d8a5e !important;
    border-bottom-color: #43b77a !important;
    background: rgba(67,183,122,.06) !important;
}
.nav-tabs .nav-link.active {
    color: #1a6b46 !important;
    border-bottom: 2px solid #43b77a !important;
    font-weight: 600;
    background: rgba(67,183,122,.08) !important;
}

/* --- Form subgroups — see bs-compat.css for layout --- */

/* --- Tables --- */
#choice_list td,
#result_list td,
.table td {
    vertical-align: top;
}
#choice_list tbody tr:hover,
#result_list tbody tr:hover {
    background-color: #e8f5e9 !important;
}
#choice_list thead th,
#result_list thead th {
    background: #f0f5f0 !important;
    color: #2d3a2e;
    border-bottom: 2px solid #43b77a;
    font-size: 12px;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .3px;
    font-weight: 600;
    white-space: nowrap;
}
#choice_list td {
    vertical-align: middle;
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Unified action buttons (all pages) --- */
.actions-cell {
    white-space: nowrap;
    width: 1%;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    padding: 3px;
    transition: color .2s;
    text-decoration: none;
    background: none;
    border: none;
}
.action-btn:hover {
    color: #43b77a;
    text-decoration: none;
}
.action-btn.action-delete:hover {
    color: #dc3545;
}
.action-btn.action-play:hover {
    color: #22863a;
}

/* Override Bootstrap blue accent everywhere */
a { color: #2d8a5e; }
a:hover { color: #1a6b46; }
.card-primary > .card-header,
.card-outline.card-primary { border-top-color: #43b77a !important; }
.btn-primary { background-color: #43b77a !important; border-color: #3aa86e !important; }
.btn-primary:hover { background-color: #379963 !important; border-color: #2f8956 !important; }
.btn-outline-primary { color: #43b77a !important; border-color: #43b77a !important; }
.btn-outline-primary:hover { background-color: #43b77a !important; color: #fff !important; }

/* --- Select/input spacing fix --- */
.form-select, select.form-control {
    padding-top: .375rem;
    padding-bottom: .375rem;
}
fieldset { margin: 0; padding: 0; border: none; }
fieldset + fieldset { margin-top: 0; }

/* --- Focus --- */
.content-wrapper input:focus,
.content-wrapper select:focus,
.content-wrapper textarea:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 0.2rem rgba(67,183,122,.25) !important;
}

/* --- Pagination --- */
.page-item.active .page-link {
    background-color: #43b77a !important;
    border-color: #3aa86e !important;
}
.page-link { color: #43b77a; }
.page-link:hover { color: #379963; }

/* --- Select2 --- */
.select2-container--bootstrap-5 .select2-dropdown {
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border-color: #dee2e6;
    overflow: hidden;
}
.select2-container--bootstrap-5 .select2-results__option {
    padding: 6px 12px;
    font-size: .9rem;
    transition: background .1s;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
}
.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #43b77a !important;
    color: #fff !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #86cfaa;
    box-shadow: 0 0 0 .2rem rgba(67,183,122,.2);
}
.select2-container * {
    padding-left: inherit !important;
}

/* --- Checkboxes --- */
.form-check {
    padding-left: 0;
}
.form-check-label {
    padding-left: 1.2em;
    vertical-align: middle;
}

/* --- Footer --- */
.main-footer {
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    color: #777;
    font-size: 0.8rem;
    padding: 8px 15px;
}

/* --- Selector icons --- */
.selector-icons a:hover { color: #43b77a !important; }

/* --- Badges --- */
.badge-primary, .bg-primary { background-color: #43b77a !important; }
.badge-warning, .bg-warning { background-color: #f0ad4e !important; }
.badge-danger, .bg-danger { background-color: #e05555 !important; }


/* ================================================================
   DARK THEME
   ================================================================ */
body.dark-theme,
body[data-theme="dark"] {
    color: #e4e6ea;
}

/* --- Navbar dark --- */
body.dark-theme .main-header.navbar {
    background-color: #1a1d23 !important;
    border-bottom-color: #353940 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
body.dark-theme .main-header .smit-logo .smit-logo-text {
    color: #e4e6ea;
}
body.dark-theme .main-header .nav-link {
    color: #9ca3af !important;
}
body.dark-theme .main-header .nav-link:hover {
    color: #fff !important;
    background: rgba(67,183,122,.15) !important;
}
body.dark-theme .main-header .nav-item.active > .nav-link {
    color: #fff !important;
    background-color: #43b77a !important;
}
body.dark-theme .main-header .smit-logo .smit-logo-text {
    color: #e4e6ea;
}
body.dark-theme .main-header [data-widget="pushmenu"] { color: #9ca3af !important; }
body.dark-theme #theme-toggle { color: #f0c040 !important; }

/* Profile dropdown: user info card */
.main-header .dropdown-menu .dropdown-user-card strong { color: #212529; }
.main-header .dropdown-menu .dropdown-user-card small { color: #6c757d; }

/* Navbar dropdown divider header label */
.main-header .dropdown-menu .dropdown-header {
    color: #9aa0a8;
    font-size: .68rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: .06em;
}

/* Navbar dropdown dark */
body.dark-theme .main-header .dropdown-menu {
    background: #22262e;
    border-color: #353940;
}
body.dark-theme .main-header .dropdown-item { color: #c0c4cc !important; }
body.dark-theme .main-header .dropdown-item:hover {
    background-color: #2a2e37 !important;
    color: #fff !important;
}
body.dark-theme .main-header .dropdown-menu .dropdown-user-card strong { color: #dee2e6; }
body.dark-theme .main-header .dropdown-menu .dropdown-user-card small { color: #6c757d; }
body.dark-theme .main-header .dropdown-menu .border-bottom { border-color: #3a3f47 !important; }

/* --- Sidebar dark --- */
body.dark-theme .main-sidebar {
    background-color: #0d0f14 !important;
}
body.dark-theme .main-sidebar .brand-link {
    /* build 929: полупрозрачный — лучше смотрится поверх матового стекла */
    background-color: rgba(0, 0, 0, .35) !important;
    border-bottom-color: #1a1d24 !important;
}
body.dark-theme [class*="sidebar-dark"] {
    background-color: #0d0f14 !important;
}

/* --- Content dark --- */
body.dark-theme .content-wrapper {
    background-color: #1a1d23 !important;
    color: #e4e6ea;
}

/* --- Cards / subgroups dark --- */
body.dark-theme .form-subgroup {
    background: #22262e !important;
    border-color: #353940 !important;
    box-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4) !important;
}
body.dark-theme .form-subgroup legend {
    background: #2d8f5e !important;
    color: #fff !important;
    border-bottom: none !important;
}
body.dark-theme .card {
    background: #22262e !important;
    border-color: #353940 !important;
    box-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4) !important;
}
body.dark-theme .card.card-primary > .card-header {
    background: #2d8f5e !important;
    color: #fff !important;
}
body.dark-theme .card-header {
    background: #2a2e37 !important;
    border-bottom-color: #353940 !important;
    color: #c0c4cc !important;
}
body.dark-theme .card-body {
    color: #e4e6ea;
}

/* --- Form inputs dark --- */
body.dark-theme .content-wrapper input[type="text"],
body.dark-theme .content-wrapper input[type="number"],
body.dark-theme .content-wrapper input[type="email"],
body.dark-theme .content-wrapper input[type="password"],
body.dark-theme .content-wrapper input[type="url"],
body.dark-theme .content-wrapper input[type="tel"],
body.dark-theme .content-wrapper input[type="date"],
body.dark-theme .content-wrapper input[type="datetime-local"],
body.dark-theme .content-wrapper input[type="time"],
body.dark-theme .content-wrapper select,
body.dark-theme .content-wrapper textarea {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #e4e6ea !important;
}
body.dark-theme .content-wrapper input:focus,
body.dark-theme .content-wrapper select:focus,
body.dark-theme .content-wrapper textarea:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 0.2rem rgba(67,183,122,.2) !important;
}

/* --- Toolbar dark --- */
body.dark-theme .head-navbar {
    background: #22262e !important;
    border-color: #353940 !important;
}

/* --- Tabs dark --- */
body.dark-theme .nav-tabs {
    border-bottom-color: #353940 !important;
}
body.dark-theme .nav-tabs .nav-link {
    color: #9ca3af !important;
    background: transparent !important;
}
body.dark-theme .nav-tabs .nav-link:hover {
    color: #43b77a !important;
    background: transparent !important;
}
body.dark-theme .nav-tabs .nav-link.active {
    color: #43b77a !important;
    border-bottom-color: #43b77a !important;
}

/* --- Tables dark --- */
body.dark-theme #choice_list,
body.dark-theme #result_list {
    border-color: #353940 !important;
}
body.dark-theme #choice_list thead th,
body.dark-theme #result_list thead th {
    background: #2a2e37 !important;
    color: #c0c4cc;
    border-bottom-color: #43b77a;
}
body.dark-theme #choice_list tbody td,
body.dark-theme #result_list tbody td {
    border-color: #2a2e37 !important;
    color: #d0d3d8;
}
body.dark-theme #choice_list tbody tr:hover,
body.dark-theme #result_list tbody tr:hover {
    background-color: rgba(67,183,122,.08) !important;
}
/* build 731: единая переменная --table-border-dark = #404653.
   Старый #353940 давал контраст ~2:1 c фоном таблицы #22262e — линии невидимы.
   #404653 даёт контраст ~3:1 — границы читаемы, но не «кричат». */
body.dark-theme,
[data-bs-theme="dark"] {
    --table-border-dark: #404653;
    --table-border-strong-dark: #4a5161;
}
body.dark-theme .table { color: #d0d3d8; }
body.dark-theme .table td, body.dark-theme .table th {
    border-color: var(--table-border-dark);
}

/* --- Well / alerts dark --- */
body.dark-theme .well {
    background-color: #22262e !important;
    border-color: #353940 !important;
    color: #d0d3d8;
}
body.dark-theme .alert-info {
    background-color: #1c3545;
    border-color: #2a4a5c;
    color: #8ecae6;
}
body.dark-theme .alert-danger {
    background-color: #3a1f1f;
    border-color: #6d3535;
    color: #ff8080;
}
body.dark-theme .alert-warning {
    background-color: #3a3520;
    border-color: #6d5f35;
    color: #ffd080;
}
body.dark-theme .alert-success {
    background-color: #1f3a25;
    border-color: #356d40;
    color: #80ff90;
}
/* Block status — reduce oversized text */
body.dark-theme .alert { font-size: 0.95rem; }

/* ============================================
   Panel Left — slide menu navigation
   ============================================ */
.panel-left-menu {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.panel-left-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.panel-left-item {
    margin: 2px 0;
}

.panel-left-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}

.panel-left-link:hover {
    background: rgba(67,183,122,.06);
    color: #334155;
}

.panel-left-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: all .25s ease;
}

.panel-left-link:hover .panel-left-dot {
    background: #43b77a;
    box-shadow: 0 0 0 3px rgba(67,183,122,.15);
}

.panel-left-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Счётчик-бейдж справа от пункта меню (как папки FreeScout) */
.panel-left-badge {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
    font-size: .74rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}
.panel-left-item.active .panel-left-badge {
    background: #43b77a;
    color: #fff;
}
[data-bs-theme="dark"] .panel-left-badge,
.dark-theme .panel-left-badge {
    background: #2a2f37;
    color: #aab4bf;
}

/* Active item */
.panel-left-item.active .panel-left-link {
    background: linear-gradient(135deg, rgba(67,183,122,.10), rgba(60,191,174,.08));
    color: #1e7a4a;
    font-weight: 600;
}

.panel-left-item.active .panel-left-dot {
    background: #43b77a;
    box-shadow: 0 0 0 3px rgba(67,183,122,.20);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(67,183,122,.20); }
    50% { box-shadow: 0 0 0 5px rgba(67,183,122,.10); }
}

.panel-left-item.active .panel-left-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #43b77a, #3cbfae);
    border-radius: 0 3px 3px 0;
}

/* Dark theme */
body.dark-theme .panel-left-menu {
    background: #22262e;
    border-color: #353940;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

body.dark-theme .panel-left-link {
    color: #a0a6b0;
}

body.dark-theme .panel-left-link:hover {
    background: rgba(67,183,122,.08);
    color: #d0d3d8;
}

body.dark-theme .panel-left-dot {
    background: #454950;
}

body.dark-theme .panel-left-link:hover .panel-left-dot {
    background: #5cc98d;
    box-shadow: 0 0 0 3px rgba(92,201,141,.15);
}

body.dark-theme .panel-left-item.active .panel-left-link {
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 15%, transparent), color-mix(in srgb, var(--brand-primary) 8%, transparent));
    color: var(--brand-primary);
}

body.dark-theme .panel-left-item.active .panel-left-dot {
    background: var(--brand-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

body.dark-theme .panel-left-item.active .panel-left-link::before {
    background: var(--brand-primary);
}

/* --- Divider in panel-left --- */
.panel-left-divider {
    margin: 8px 0 4px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.panel-left-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,.10);
}
.panel-left-divider-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .06em;
    color: #9aa0a8;
    white-space: nowrap;
}
body.dark-theme .panel-left-divider::before {
    background: rgba(255,255,255,.10);
}
body.dark-theme .panel-left-divider-label {
    color: #6c757d;
}

/* --- Icon in panel-left --- */
.panel-left-icon {
    width: 18px;
    text-align: center;
    font-size: .82em;
    color: #94a3b8;
    flex-shrink: 0;
    transition: color .2s;
}
.panel-left-link:hover .panel-left-icon { color: #43b77a; }
.panel-left-item.active .panel-left-icon { color: #1e7a4a; }
body.dark-theme .panel-left-icon { color: #5a6270; }
body.dark-theme .panel-left-link:hover .panel-left-icon { color: #5cc98d; }
body.dark-theme .panel-left-item.active .panel-left-icon { color: var(--brand-primary); }

/* --- Submenu in panel-left --- */
.panel-left-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 4px 28px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.panel-left-item.has-sub.active .panel-left-sub,
.panel-left-item.has-sub.open .panel-left-sub {
    max-height: 500px;
}
.panel-left-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: .78rem;
    color: #64748b;
    text-decoration: none !important;
    border-radius: 5px;
    transition: all .15s;
}
.panel-left-sublink:hover {
    background: rgba(67,183,122,.06);
    color: #334155;
}
.panel-left-sublink.active {
    color: #1e7a4a;
    font-weight: 600;
    background: rgba(67,183,122,.08);
}
/* build 702/703: иконки sub-элементов — мельче, зелёные (admin запрос) */
.panel-left-sub-icon {
    font-size: .7rem;
    width: 14px;
    text-align: center;
    color: var(--brand-primary, #43b77a);
    opacity: .75;
    flex-shrink: 0;
}
.panel-left-sublink:hover .panel-left-sub-icon,
.panel-left-sublink.active .panel-left-sub-icon {
    opacity: 1;
}
.panel-left-sub-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    margin: 0 5px;
}
.panel-left-sublink:hover .panel-left-sub-icon,
.panel-left-sublink.active .panel-left-sub-icon {
    color: var(--brand-primary, #43b77a);
}
.panel-left-sub-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.dark-theme .panel-left-sublink { color: #7a8290; }
body.dark-theme .panel-left-sublink:hover { background: rgba(67,183,122,.08); color: #c0c4ca; }
body.dark-theme .panel-left-sublink.active { color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 10%, transparent); }
body.dark-theme .panel-left-sub-icon { color: #7a8290; }
body.dark-theme .panel-left-sub-dot { background: #4a5057; }

/* build 705/710: panel-left в свёрнутом виде. build 710: убраны агрессивные
   width: 100% !important + max-width: 4.6rem !important с .panel-left-link/-item/-nav —
   они применялись на ВСЕ страницы (когда body.sidebar-collapse) и ломали верстку
   panel-left на /admin/Abonents/AdminAccounts/ и др. (admin: «поломалась верстка»). */
body.sidebar-collapse .panel-left-menu {
    padding: 4px 0;
}
body.sidebar-collapse .panel-left-link {
    padding: 8px 0 !important;
    justify-content: center !important;
    gap: 0 !important;
}
body.sidebar-collapse .panel-left-text,
body.sidebar-collapse .panel-left-sub-text {
    display: none !important;
}
body.sidebar-collapse .panel-left-icon {
    margin: 0 !important;
    font-size: 1.05rem !important;
    width: 22px !important;
    text-align: center;
}

/* ═══ build 705: подменю активного has-sub в collapsed-режиме —
   светло-зелёный фон + все sub-icons видимы вертикально ═══
   admin: «При активном пункте вложенного меню в свернутом виде показывать
   развернутое вложенное меню этой категории с светло-зеленым фоном». */
/* build 708: показываем подменю ТОЛЬКО при .open (не .active).
   admin: «перед тем как показывать иконки выбранного раздела сначала сворачиваются
   все остальные». .active помечает URL-привязку, .open — что подменю развёрнуто.
   JS на load: ставит .open только активному разделу. Клик: переключает .open,
   снимая со всех остальных. */
body.sidebar-collapse .panel-left-item.has-sub .panel-left-sub {
    display: none !important;
}
body.sidebar-collapse .panel-left-item.has-sub.open .panel-left-sub {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 4px 0 !important;
    margin: 4px 4px 6px 4px !important;
    background: rgba(67, 183, 122, .08) !important;
    border-radius: 6px;
    border: 1px solid rgba(67, 183, 122, .18);
}
body.dark-theme.sidebar-collapse .panel-left-item.has-sub.open .panel-left-sub,
[data-bs-theme="dark"] body.sidebar-collapse .panel-left-item.has-sub.open .panel-left-sub {
    background: rgba(67, 183, 122, .15) !important;
    border-color: rgba(67, 183, 122, .25);
}

body.sidebar-collapse .panel-left-sublink {
    padding: 5px 0 !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
}
/* Иконки sub-элементов в collapsed — меньше и зелёные (admin: «меньше и зелёного цвета») */
body.sidebar-collapse .panel-left-sub-icon {
    font-size: .75rem !important;
    width: 18px !important;
    margin: 0 !important;
    color: var(--brand-primary, #43b77a) !important;
    opacity: .8;
}
body.sidebar-collapse .panel-left-sublink:hover .panel-left-sub-icon,
body.sidebar-collapse .panel-left-sublink.active .panel-left-sub-icon {
    opacity: 1 !important;
}
body.sidebar-collapse .panel-left-sub-dot {
    margin: 0 auto !important;
}
/* Разделитель «ОБСЛУЖИВАНИЕ» — только полоска */
body.sidebar-collapse .panel-left-divider-label {
    display: none !important;
}
body.sidebar-collapse .panel-left-divider {
    margin: 6px 8px !important;
    height: 1px;
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 0 !important;
}
body.sidebar-collapse .panel-left-divider::before,
body.sidebar-collapse .panel-left-divider::after {
    display: none !important;
}
body.dark-theme.sidebar-collapse .panel-left-divider,
[data-bs-theme="dark"] body.sidebar-collapse .panel-left-divider {
    border-top-color: rgba(255,255,255,.08);
}
/* Активная иконка sublink */
body.sidebar-collapse .panel-left-sublink.active {
    background: rgba(67,183,122,.22) !important;
    box-shadow: inset 3px 0 0 var(--brand-primary, #43b77a);
}
body.sidebar-collapse .panel-left-sublink.active .panel-left-sub-icon {
    color: var(--brand-primary, #43b77a) !important;
}

/* build 705/710/711: блокировка раскрытия sidebar при hover/click.
   build 711: восстановлено base правило `body.sidebar-collapse .main-sidebar`
   (build 710 ошибочно убрал — sidebar при загрузке оставался 250px). */
body.sidebar-collapse .main-sidebar,
body.sidebar-collapse .main-sidebar:hover,
body.sidebar-collapse .main-sidebar.sidebar-focused,
body.sidebar-collapse .main-sidebar.sidebar-focused:hover,
body.sidebar-collapse.sidebar-mini-expand-on-hover .main-sidebar:hover {
    width: 4.6rem !important;
}

/* build 708: убрать скроллбар в свёрнутом сайдбаре (admin: «не должно быть скроллбара»).
   Скрываем все варианты — OverlayScrollbars, webkit, firefox. Скролл функционально
   работает (overflow-y:auto), но визуально полоса не отображается. */
body.sidebar-collapse .main-sidebar .os-scrollbar,
body.sidebar-collapse .main-sidebar .os-scrollbar-handle,
body.sidebar-collapse .main-sidebar:hover .os-scrollbar {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
body.sidebar-collapse .main-sidebar .sidebar::-webkit-scrollbar,
body.sidebar-collapse .main-sidebar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}
body.sidebar-collapse .main-sidebar .sidebar::-webkit-scrollbar-thumb,
body.sidebar-collapse .main-sidebar::-webkit-scrollbar-thumb {
    background: transparent !important;
}
body.sidebar-collapse .main-sidebar .sidebar,
body.sidebar-collapse .main-sidebar {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* --- Divider improved --- */
.panel-left-divider {
    margin: 12px 0 6px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-left-divider::before {
    content: '';
    flex: 0 0 18px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.12));
}
.panel-left-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,0,0,.12), transparent);
}
body.dark-theme .panel-left-divider::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,.1)); }
body.dark-theme .panel-left-divider::after { background: linear-gradient(90deg, rgba(255,255,255,.1), transparent); }

/* Arrow for has-sub items */
.panel-left-item.has-sub > .panel-left-link::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: .65em;
    color: #94a3b8;
    transition: transform .2s;
}
.panel-left-item.has-sub.active > .panel-left-link::after,
.panel-left-item.has-sub.open > .panel-left-link::after {
    transform: rotate(180deg);
    color: #43b77a;
}

/* --- Footer dark --- */
body.dark-theme .main-footer {
    background-color: #1a1d23 !important;
    border-top-color: #353940 !important;
    color: #777;
}

/* --- Links dark --- */
body.dark-theme a { color: #5cc98d; }
body.dark-theme a:hover { color: #7ddba7; }
body.dark-theme .btn a { color: inherit; }

/* --- Select2 dark --- */
body.dark-theme .select2-container--bootstrap-5 .select2-selection,
body.dark-theme .select2-container .select2-selection,
body.dark-theme .select2-selection {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #e4e6ea !important;
}
body.dark-theme .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
body.dark-theme .select2-selection--single .select2-selection__rendered,
body.dark-theme .select2-selection__rendered {
    color: #dee2e6 !important;
    background-color: transparent !important;
}
body.dark-theme .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}
body.dark-theme .select2-selection--single .select2-selection__clear {
    color: #9ca3af !important;
}
body.dark-theme .select2-selection--multiple .select2-selection__choice {
    background-color: #353940 !important;
    border-color: #454950 !important;
    color: #dee2e6 !important;
}
body.dark-theme .select2-selection--multiple .select2-selection__choice__remove {
    color: #9ca3af !important;
}
body.dark-theme .select2-container--bootstrap-5 .select2-selection__arrow b,
body.dark-theme .select2-selection__arrow b {
    border-color: #9ca3af transparent transparent transparent !important;
}
body.dark-theme .select2-dropdown,
body.dark-theme .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #22262e !important;
    border-color: #353940 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
body.dark-theme .select2-search__field {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #dee2e6 !important;
}
body.dark-theme .select2-results__option { color: #d0d3d8; }
body.dark-theme .select2-results__option--highlighted {
    background-color: rgba(67,183,122,.15) !important;
    color: #8fdeb5 !important;
}
body.dark-theme .select2-results__option--selected {
    background-color: #43b77a !important;
    color: #fff !important;
}

/* --- Modals dark --- */
body.dark-theme .modal-content {
    background-color: #22262e !important;
    border-color: #353940;
    color: #e4e6ea;
}
body.dark-theme .modal-header { border-bottom-color: #353940; }
body.dark-theme .modal-footer { border-top-color: #353940; }

/* --- Paginator dark --- */
body.dark-theme .page-link {
    background-color: #22262e;
    border-color: #353940;
    color: #9ca3af;
}
body.dark-theme .page-link:hover {
    background-color: #2a2e37;
    color: #43b77a;
}

/* --- Misc dark --- */
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6 {
    color: #e4e6ea;
}
body.dark-theme label { color: #c0c4cc !important; }
body.dark-theme .text-muted { color: #777 !important; }
body.dark-theme hr { border-color: #353940; }

/* --- Form labels dark (override responsive.css specificity) --- */
body.dark-theme .form-row.row > .span4 label,
body.dark-theme .form-row.row > .col-md-4 label {
    color: #c0c4cc !important;
}
body.dark-theme .form-row.row > .span4,
body.dark-theme .form-row.row > .col-md-4 {
    color: #c0c4cc !important;
}
body.dark-theme .form-subgroup > legend {
    color: #fff !important;
    background: #2d8f5e !important;
    border-bottom: none !important;
}
body.dark-theme .content-wrapper label,
body.dark-theme .content-wrapper .control-label {
    color: #c0c4cc !important;
}
/* Сброс цвета для тёмной темы. Раньше селектор был обычным (0,2,2) и
   перебивал ЛЮБОЙ класс-цвет у span/p/div: так трижды теряли семафор —
   .smit-badge, .fo-income/.fo-expense, приглушённые подписи становились
   монохромными. :where() даёт нулевую специфичность: наследование по-прежнему
   чинится для элементов без своих правил, а осознанный цвет (бейдж, статус,
   ссылка) выигрывает естественным образом, без гонки !important. */
body.dark-theme :where(.content-wrapper p, .content-wrapper span, .content-wrapper div) {
    color: inherit;
}
body.dark-theme .content-wrapper .form-subgroup {
    color: #d0d3d8;
}
/* Dark: balance table */
body.dark-theme .acc-balance-table thead th {
    color: #6c757d;
    border-bottom-color: #353940;
}
body.dark-theme .acc-balance-table tbody td {
    color: #c0c4cc;
}
body.dark-theme .acc-balance-table tbody td.acc-row-label,
body.dark-theme .acc-balance-table tbody th.acc-row-label {
    color: #adb5bd;
}
/* th[scope=row] in balance table — keep regular weight, no header styling */
.acc-balance-table tbody th.acc-row-label {
    font-weight: inherit;
    text-align: inherit;
    background: none;
}
body.dark-theme .acc-balance-table tbody td.acc-op {
    color: #6c757d;
}
body.dark-theme .acc-section-title {
    color: #adb5bd;
}
body.dark-theme .acc-field-row > label {
    color: #adb5bd;
}

/* --- Finance info 3-column grid --- */
.acc-grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    margin-left: 15px;
    margin-right: 15px;
}
.acc-grid-cell {
    text-align: center;
}
.acc-grid-label {
    font-size: .78em;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acc-grid-cell .form-control {
    text-align: center;
    font-size: .85em;
}
body.dark-theme .acc-grid-label {
    color: #9ea3ad;
}
body.dark-theme .acc-readonly {
    background: #2a2e37 !important;
    border-color: #353940 !important;
    color: #c0c4cc !important;
}

/* --- White bar fix: ensure no light borders/gaps leak in dark mode --- */
body.dark-theme .main-header.navbar {
    border-bottom: 2px solid #353940 !important;
}
body.dark-theme .content-wrapper {
    border-top: none !important;
}
body.dark-theme .navbar + .content-wrapper,
body.dark-theme .content-wrapper::before {
    border: none !important;
}
body.dark-theme {
    background-color: #1a1d23 !important;
}
body.dark-theme .wrapper {
    background-color: #1a1d23 !important;
}
body.dark-theme .content {
    background-color: transparent !important;
}
body.dark-theme .content-header {
    background-color: transparent !important;
    border-bottom: none !important;
}

/* --- Toolbar/buttons text dark --- */
body.dark-theme .head-navbar .btn {
    color: #e4e6ea;
}
body.dark-theme .head-navbar .btn-default,
body.dark-theme .head-navbar .btn-light {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .head-navbar .btn-default:hover,
body.dark-theme .head-navbar .btn-light:hover {
    background-color: #353940 !important;
    color: #fff !important;
}
body.dark-theme .head-navbar label {
    color: #c0c4cc !important;
}
body.dark-theme .head-navbar input[type="text"] {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #e4e6ea !important;
}

/* --- Inline forms / tab content dark --- */
body.dark-theme .tab-content { color: #d0d3d8; }
body.dark-theme .inline-related { border-color: #353940; }

/* --- Balance table dark --- */
table#balance_table {
    padding: 10px;
    background: #f8f9fa;
    margin: 0 10px 20px;
    width: 97% !important;
}
body.dark-theme #balance_table { color: #d0d3d8; background: #22262e; }
body.dark-theme #balance_table td { border-color: var(--table-border-dark); }


/* ============================================
   Sidebar tree navigation (Abonents)
   ============================================ */
.main-sidebar .nav-treeview {
    padding-left: 0.5rem;
}
.main-sidebar .nav-treeview .nav-link {
    padding: 0.2rem 0.5rem 0.2rem 0.8rem !important;
    font-size: 0.78rem;
}
.main-sidebar .nav-treeview .nav-icon {
    font-size: 0.4rem;
    width: 1rem;
}
.main-sidebar .nav-treeview .nav-treeview .nav-link {
    padding-left: 1.2rem !important;
    font-size: 0.75rem;
}
.main-sidebar .menu-open > .nav-treeview {
    background: rgba(0,0,0,.1);
}
.main-sidebar .nav-sidebar .nav-link p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.main-sidebar .nav-sidebar > .nav-item > .nav-link > .nav-icon.fa-folder {
    color: #f0ad4e;
}

/* ============================================
   Sidebar recent pages navigation
   ============================================ */
.nav-sidebar .nav-header {
    color: #6b7f6b;
    font-size: 0.7rem;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem 0.25rem;
}
.nav-sidebar.nav-compact .nav-link {
    padding: 0.3rem 0.5rem 0.3rem 1rem !important;
}
.nav-sidebar.nav-compact .nav-link p {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.nav-sidebar.nav-compact .nav-icon {
    font-size: 0.45rem;
    margin-right: 0.4rem;
    width: auto;
}
.nav-sidebar.nav-flat .nav-link {
    border-radius: 0;
}

/* Sidebar width tweak for readability */
.main-sidebar {
    width: 260px;
}
.main-sidebar .brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-theme .nav-sidebar .nav-header {
    color: #5a6370;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #aaa; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #888; }

body.dark-theme ::-webkit-scrollbar-track { background: #1a1d23; }
body.dark-theme ::-webkit-scrollbar-thumb { background: #454950; }
body.dark-theme ::-webkit-scrollbar-thumb:hover { background: #5a5f68; }

/* ============================================
   Dashboard & Operations — Dark mode
   ============================================ */

/* Stat cards: restore colored gradients in dark mode (overrides generic .card rule) */
body.dark-theme .stat-card { box-shadow: 0 2px 8px rgba(0,0,0,.5) !important; }
body.dark-theme .stat-card.bg-gradient-info {
    background-color: #006478 !important;
    background-image: linear-gradient(to bottom right, #00bcd4, #0277bd) !important;
}
body.dark-theme .stat-card.bg-gradient-success {
    background-color: #1b5e20 !important;
    background-image: linear-gradient(to bottom right, #00695c, #2e7d32) !important;
}
body.dark-theme .stat-card.bg-gradient-warning {
    background-color: #bf360c !important;
    background-image: linear-gradient(to bottom right, #e64a19, #f9a825) !important;
}
body.dark-theme .stat-card.sc-teal {
    background-color: #004d40 !important;
    background-image: linear-gradient(to bottom right, #00695c, #00897b) !important;
}
/* build 1713: карточка sc-amber рассчитана на светлый янтарный фон и задаёт
   тёмный текст (#2c2c2c). В тёмной теме фон у неё обычный тёмный, а раньше
   тёмный текст глушило общее правило inherit. После перевода того правила на
   :where() цвет стал проходить — возвращаем светлый текст явно. */
body.dark-theme .stat-card.sc-amber .stat-number,
body.dark-theme .stat-card.sc-amber .stat-label,
[data-bs-theme="dark"] .stat-card.sc-amber .stat-number,
[data-bs-theme="dark"] .stat-card.sc-amber .stat-label { color: #d0d3d8 !important; }
body.dark-theme .stat-card.sc-orange {
    background-color: #bf360c !important;
    background-image: linear-gradient(to bottom right, #d84315, #f57c00) !important;
}
body.dark-theme .stat-card.sc-blue {
    background-color: #0d47a1 !important;
    background-image: linear-gradient(to bottom right, #1565c0, #1e88e5) !important;
}

/* Info-boxes (AdminLTE) in dark */
body.dark-theme .info-box { background: #22262e !important; }
body.dark-theme .info-box-text { color: #9ca3af !important; }
body.dark-theme .info-box-number { color: #e4e6ea !important; }

/* Finance summary cards (operations_log) */
body.dark-theme .summary-card { background: #22262e !important; border-color: #353940 !important; }
body.dark-theme .summary-card.income { border-left-color: #28a745 !important; }
body.dark-theme .summary-card.expense { border-left-color: #dc3545 !important; }
body.dark-theme .summary-card.count { border-left-color: #17a2b8 !important; }

/* Filter bars — all variants */
body.dark-theme .filter-bar,
body.dark-theme .hdsk-filter-bar,
body.dark-theme [class*="filter-bar"] { background: #22262e !important; border-color: #353940 !important; }
body.dark-theme .hdsk-filter-field label { color: #9ca3af !important; }

/* Generic light bg containers in dark mode */
body.dark-theme .bg-light,
body.dark-theme .bg-white {
    background-color: #2a2e37 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .card,
body.dark-theme .card-header {
    background-color: #22262e !important;
    border-color: #353940 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .card-header.bg-light {
    background-color: #262a33 !important;
}
body.dark-theme .table {
    color: #d0d3d8 !important;
    --bs-table-bg: transparent;
}
body.dark-theme .table th {
    color: #9ca3af !important;
    border-color: var(--table-border-dark) !important;
}
body.dark-theme .table td {
    border-color: var(--table-border-dark) !important;
}
body.dark-theme .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,.07) !important;
}
body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,.03) !important;
    --bs-table-bg-type: transparent;
}
body.dark-theme .table td,
body.dark-theme .table th,
body.dark-theme td,
body.dark-theme th {
    border-color: var(--table-border-dark) !important;
    color: #d0d3d8 !important;
}
/* build 731: усиленный border у заголовка thead — отделение шапки от данных */
body.dark-theme .table thead th,
body.dark-theme thead th,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] thead th {
    border-bottom-color: var(--table-border-strong-dark) !important;
    border-bottom-width: 2px !important;
}
body.dark-theme .table thead th,
body.dark-theme thead th,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] thead th {
    background-color: #1e222a !important;
    /* build 688: было #9ca3af (контраст ~3.5:1 — ниже WCAG AA).
       #d0d8e3 даёт ~9:1, заголовки колонок читаются однозначно. */
    color: #d0d8e3 !important;
    font-weight: 600;
    letter-spacing: .02em;
}
/* Folder-table — особый кейс — ещё ярче для важных списков абонентов */
body.dark-theme .folder-table thead th,
[data-bs-theme="dark"] .folder-table thead th {
    color: #e9ecef !important;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    font-size: .72rem;
}
/* Ссылки-сортировки внутри заголовка (class="text-dark") в тёмной теме */
body.dark-theme .folder-table thead th a,
body.dark-theme .folder-table thead th a.text-dark,
[data-bs-theme="dark"] .folder-table thead th a,
[data-bs-theme="dark"] .folder-table thead th a.text-dark {
    color: #e9ecef !important;
    text-decoration: none;
}
body.dark-theme .folder-table thead th a:hover,
[data-bs-theme="dark"] .folder-table thead th a:hover {
    color: var(--brand-primary, #43b77a) !important;
}
/* Иконка-замок для блокировки в списке абонентов — чуть крупнее, видимая */
.abonent-block-icon {
    font-size: .9rem;
    vertical-align: middle;
    cursor: help;
}
body.dark-theme .abonent-block-icon.text-warning,
[data-bs-theme="dark"] .abonent-block-icon.text-warning {
    color: #ffc857 !important;
}
body.dark-theme .abonent-block-icon.text-danger,
[data-bs-theme="dark"] .abonent-block-icon.text-danger {
    color: #ff6b6b !important;
}
/* jqGrid / legacy tables */
body.dark-theme .ui-jqgrid,
body.dark-theme .ui-jqgrid-bdiv,
body.dark-theme .ui-jqgrid-hdiv,
body.dark-theme .ui-jqgrid tr.jqgrow td {
    background-color: #22262e !important;
    color: #d0d3d8 !important;
    border-color: var(--table-border-dark) !important;
}
body.dark-theme .ui-jqgrid tr.jqgrow:hover td {
    background-color: #2a2e37 !important;
}
body.dark-theme .ui-jqgrid .ui-jqgrid-htable th {
    background-color: #1e222a !important;
    color: #d0d8e3 !important;
    border-color: var(--table-border-strong-dark) !important;
    border-bottom-width: 2px !important;
}
/* Pagination / pager dark */
body.dark-theme .pagination .page-link {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .pagination .page-item.active .page-link {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}
/* Toolbar / button bar */
body.dark-theme .head-navbar,
body.dark-theme .btn-toolbar,
body.dark-theme .toolbar,
body.dark-theme .content-wrapper > .content-header,
body.dark-theme .content-wrapper > div:first-child,
body.dark-theme .content-wrapper > .container-fluid > div:first-child {
    background-color: #22262e !important;
    border-color: #353940 !important;
}
/* Any stray white/light backgrounds */
body.dark-theme .content-wrapper,
body.dark-theme .content-wrapper * {
    --bs-table-bg: transparent;
}
body.dark-theme .content-wrapper [style*="background:#fff"],
body.dark-theme .content-wrapper [style*="background: #fff"],
body.dark-theme .content-wrapper [style*="background:white"],
body.dark-theme .content-wrapper [style*="background: white"] {
    background-color: #22262e !important;
}
/* Pay sections, system cards */
body.dark-theme .pay-section {
    background-color: #22262e !important;
    border-color: #353940 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .pay-section.bg-light,
body.dark-theme .pay-section.border-0 {
    background-color: #1e222a !important;
}
body.dark-theme .pay-section h6 {
    border-bottom-color: #353940 !important;
    color: #e4e6ea !important;
}
body.dark-theme .system-card {
    border-color: #454950 !important;
    background: #2a2e37 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .system-card.active {
    border-color: var(--brand-primary) !important;
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent) !important;
}
body.dark-theme .system-card:hover {
    border-color: var(--brand-primary) !important;
}
body.dark-theme .section-disabled {
    opacity: 0.4;
}

/* Dashboard cards, quick links, system info */
body.dark-theme .card-body,
body.dark-theme .list-group-item,
body.dark-theme .info-box,
body.dark-theme .small-box,
body.dark-theme .callout {
    background-color: #22262e !important;
    color: #d0d3d8 !important;
}
body.dark-theme .info-box .info-box-text { color: #9ca3af !important; }
body.dark-theme .info-box .info-box-number { color: #e4e6ea !important; }
/* System info / about block light bg.
   Раньше здесь стоял [style*="background:#f"] — префикс «#f» ловил не только
   светло-серые подложки, но и любой яркий цвет на f: жёлтый #ffc107,
   оранжевый #fd7e14. Индикатор «Приост.» в легенде карты становился цветом
   фона, то есть невидимым (аудит 2026-07-22). Перечисляем реально светлые
   значения — их немного и они предсказуемы. */
body.dark-theme .content-wrapper .bg-light,
body.dark-theme .content-wrapper .rounded.bg-light,
body.dark-theme .content-wrapper [style*="background:#fff"],
body.dark-theme .content-wrapper [style*="background: #fff"],
body.dark-theme .content-wrapper [style*="background:#f8f9fa"],
body.dark-theme .content-wrapper [style*="background: #f8f9fa"],
body.dark-theme .content-wrapper [style*="background:#f8fafc"],
body.dark-theme .content-wrapper [style*="background: #f8fafc"],
body.dark-theme .content-wrapper [style*="background:#f1f5f9"],
body.dark-theme .content-wrapper [style*="background: #f1f5f9"],
body.dark-theme .content-wrapper [style*="background:#f1f3f5"],
body.dark-theme .content-wrapper [style*="background: #f1f3f5"],
body.dark-theme .content-wrapper [style*="background:#f4f6f9"],
body.dark-theme .content-wrapper [style*="background: #f4f6f9"],
body.dark-theme .content-wrapper [style*="background:#f0f0f0"],
body.dark-theme .content-wrapper [style*="background: #f0f0f0"],
body.dark-theme .content-wrapper [style*="background:#fbfcfe"],
body.dark-theme .content-wrapper [style*="background: #fbfcfe"] {
    background-color: #2a2e37 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .modal-content {
    background-color: #22262e !important;
    border-color: #353940 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    border-color: #353940 !important;
}
body.dark-theme .text-muted { color: #9ca3af !important; }
body.dark-theme .border { border-color: #353940 !important; }
body.dark-theme hr { border-color: #353940 !important; opacity: .5; }
body.dark-theme .nav-tabs .nav-link { color: #9ca3af; }
body.dark-theme .nav-tabs .nav-link.active {
    background-color: #22262e !important;
    border-color: #353940 #353940 #22262e !important;
    color: #e4e6ea !important;
}
body.dark-theme .nav-tabs { border-bottom-color: #353940 !important; }
body.dark-theme .badge { opacity: .9; }
body.dark-theme a { color: #5cc98d; }
body.dark-theme a:hover { color: #7ddba7; }
body.dark-theme .btn-outline-primary { color: #5cc98d; border-color: #5cc98d; }
body.dark-theme .btn-outline-primary:hover { background: #5cc98d; color: #fff; }

/* Select options readable in dark */
body.dark-theme select option,
body.dark-theme .form-select option {
    background-color: #2a2e37 !important;
    color: #e4e6ea !important;
}
/* Catch-all: any input/select/textarea in dark */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #e4e6ea !important;
}
body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #6c757d !important;
}
body.dark-theme label,
body.dark-theme .form-label,
body.dark-theme .control-label {
    color: #d0d3d8 !important;
}
body.dark-theme .form-text,
body.dark-theme .help-text {
    color: #9ca3af !important;
}

/* Quick period buttons */
body.dark-theme .quick-btn { color: #9ca3af !important; border-color: #454950 !important; }
body.dark-theme .quick-btn:hover { color: #e4e6ea !important; background: #2a2e37 !important; }
body.dark-theme .quick-btn.active {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    color: #fff !important;
}

/* Period selector on welcome chart */
body.dark-theme .period-btn { color: #9ca3af !important; border-color: #454950 !important; }
body.dark-theme .period-btn:hover { color: #e4e6ea !important; background: #2a2e37 !important; }
body.dark-theme .period-btn.active {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    color: #fff !important;
}

/* Table hover rows in dark */
body.dark-theme .op-row:hover { background: rgba(67,183,122,.1) !important; }

/* Table-light header in dark */
body.dark-theme .table-light,
body.dark-theme .table-light th,
body.dark-theme thead.table-light th {
    background-color: #2a2e37 !important;
    color: #c0c4cc !important;
    border-color: #353940 !important;
}

/* Table-striped in dark */
body.dark-theme .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,.02);
    color: inherit;
}

/* Form selects/inputs in filter bar */
body.dark-theme .form-select,
body.dark-theme .form-control {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #e4e6ea !important;
}

/* Card footer in dark */
body.dark-theme .card-footer {
    background-color: #2a2e37 !important;
    border-top-color: #353940 !important;
}

/* List-group (quick links) in dark */
body.dark-theme .list-group-item {
    background-color: #22262e !important;
    border-color: #353940 !important;
    color: #d0d3d8 !important;
}
body.dark-theme .list-group-item-action:hover {
    background-color: #2a2e37 !important;
}
body.dark-theme .list-group-item a { color: #5cc98d !important; }
body.dark-theme .list-group-item a:hover { color: #7ddba7 !important; }

/* Finance big numbers */
body.dark-theme .finance-big.text-success { color: #5cc98d !important; }
body.dark-theme .finance-big.text-danger { color: #f07070 !important; }

/* Btn outline in dark — чистый стиль (build 542) */
body.dark-theme .btn-outline-secondary {
    background: #1f2329 !important;
    color: #c5cdd6 !important;
    border-color: #2a2f37 !important;
}
body.dark-theme .btn-outline-secondary:hover,
body.dark-theme .btn-outline-secondary:focus {
    background-color: rgba(67,183,122,.14) !important;
    color: #6fdc92 !important;
    border-color: #43b77a !important;
}
body.dark-theme .btn-outline-secondary:active,
body.dark-theme .btn-outline-secondary.active,
body.dark-theme .btn-check:checked + .btn-outline-secondary {
    background: #43b77a !important;
    color: #fff !important;
    border-color: #3aa86e !important;
}
body.dark-theme .btn-outline-primary {
    color: #5cc98d !important;
    border-color: #5cc98d !important;
}
body.dark-theme .btn-outline-primary:hover {
    background-color: #43b77a !important;
    color: #fff !important;
}
body.dark-theme .btn-outline-danger {
    color: #f07070 !important;
    border-color: #f07070 !important;
}
body.dark-theme .btn-outline-danger:hover {
    background-color: #e05555 !important;
    color: #fff !important;
}

/* Server load block background */
body.dark-theme .load-block { background: #2a2e37 !important; }

/* Sticky header in dark */
body.dark-theme thead.sticky-top th {
    background-color: #2a2e37 !important;
}

/* ─── Compact form fields ─── */
.modal-body .mb-3,
.content-wrapper .mb-3 {
    margin-bottom: 0.6rem !important;
}
.modal-body .form-label,
.content-wrapper .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.875rem;
}
.modal-body .form-text,
.content-wrapper .form-text {
    margin-top: 0.15rem;
    font-size: 0.8rem;
}

/* ─── Input-group fix ─── */
.input-group .form-control { flex: 1 1 auto !important; width: 1% !important; }
.input-group .input-group-text { white-space: nowrap; }

/* ─── Radio & Checkbox fix (AdminLTE/Bootstrap conflict) ─── */
.content-wrapper input[type="radio"],
.content-wrapper input[type="checkbox"]:not(.form-check-input):not(.no-style) {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    width: auto !important;
    height: auto !important;
}
.system-card input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/* ─── Checkbox & Switch fix (AdminLTE/Bootstrap conflict) ─── */
.form-check-input:checked,
.content-wrapper input[type="checkbox"]:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.form-switch .form-check-input:checked {
    background-position: right center !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--brand-primary) 25%, transparent) !important;
    border-color: var(--brand-primary) !important;
}

/* ─── Inline table (tabs: Услуги тарифов, RADIUS-параметры etc.) ─── */
.inline-form td { vertical-align: middle !important; padding: .35rem .5rem !important; }
.inline-form .inline_select { float: none; position: static; margin: 0 2px; display: inline; }
.inline-form .view_obj { display: inline; margin: 0 2px; }
.inline-form td .nowait { white-space: nowrap; }
.inline-form .selector-icons { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.inline-form .selector-icons a { display: inline-flex; }
.inline-form select { max-width: 100%; }
.inline-form .last_th { white-space: nowrap; min-width: 70px; }
/* Action icons in last column — single line */
.inline-form td:last-child { white-space: nowrap; }
.inline-form td:last-child a { margin: 0 2px; }

/* ─── Responsive inline tables ───
   build 1724: мобильная карточная версия .inline-form переехала в
   smit-ui.css (алиас smit-tbl) — правила теперь в одном месте,
   data-label проставляет SmitTable из smit-ui.js. Здесь остались
   только десктопные правила .inline-form выше. */

/* ─── Fix list-group active color (AdminLTE uses blue #007bff) ─── */
.list-group-item.active {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}
.list-group-item.active:hover {
    background-color: #4a9589 !important;
}

/* ─── Fix empty desktop-subsection-header gap ─── */
.desktop-subsection-header h5:empty,
.desktop-subsection-header h1.subsection-h1:empty { display: none; }
.desktop-subsection-header:has(h5:empty),
.desktop-subsection-header:has(h1.subsection-h1:empty) { padding: 0; min-height: 0; margin: 0; }

/* ─── Abonent title bar ─── */
.abonent-title-bar {
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.abonent-title-bar h5,
.abonent-title-bar h1.abonent-title-h1,
.abonent-title-bar .abonent-title-h1 { color: #333; font-size: 1.15rem !important; font-weight: 700; line-height: 1.3 !important; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 0 !important; }
.abonent-title-id { color: #6c757d; font-weight: 600; }
.abonent-title-name { color: #212529; }
.abonent-title-balance { font-size: .85rem; padding: 6px 14px; white-space: nowrap; }
.abonent-title-badge { font-size: .68rem !important; font-weight: 600; padding: 4px 8px !important; vertical-align: middle; line-height: 1.2; }
.abonent-title-badge i { font-size: .7rem; }
/* build 686: info-иконка справа в шапке абонента/папки — ссылка на docs */
.abonent-title-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #6c757d;
    text-decoration: none !important;
    transition: color .15s, background-color .15s;
}
.abonent-title-info:hover,
.abonent-title-info:focus-visible {
    color: var(--brand-primary, #43b77a);
    background-color: rgba(67, 183, 122, .12);
    outline: none;
}
.abonent-title-info i { font-size: 1.05rem; }
body.dark-theme .abonent-title-info,
[data-bs-theme="dark"] .abonent-title-info { color: #a8b3bd; }
body.dark-theme .abonent-title-info:hover,
[data-bs-theme="dark"] .abonent-title-info:hover { color: #5fd29a; background-color: rgba(95, 210, 154, .15); }
body.dark-theme .abonent-title-bar {
    background: linear-gradient(90deg, #2b3035, #343a40) !important;
    border-color: #495057;
}
body.dark-theme .abonent-title-bar h5,
body.dark-theme .abonent-title-bar .abonent-title-h1 { color: #e9ecef !important; }
body.dark-theme .abonent-title-id { color: #adb5bd; }
body.dark-theme .abonent-title-name { color: #f8f9fa; }
body.dark-theme .abonent-title-badge.bg-light { background-color: #495057 !important; color: #e9ecef !important; border-color: #6c757d !important; }
/* Mobile: hide action buttons bar for Abonents, compact title, show back arrow */
@media (max-width: 767.98px) {
    .abonent-title-bar h5,
    .abonent-title-bar h1.abonent-title-h1,
    .abonent-title-bar .abonent-title-h1 { font-size: .95rem !important; }
    .abonent-title-balance { font-size: .75rem; padding: 4px 10px; }
    .abonent-title-badge { font-size: .62rem !important; padding: 3px 6px !important; }
    body.page-abonent-card .head-navbar { display: none !important; }
    .abonent-title-back { display: inline-flex !important; color: #6c757d; font-size: 1rem; text-decoration: none; }
    .abonent-title-back:hover { color: #333; }
    .chip-desktop-only { display: none !important; }
    #abon-summary-right { display: none !important; }
}
body.dark-theme .abonent-title-back { color: #adb5bd; }
body.dark-theme .abonent-title-back:hover { color: #f8f9fa; }

/* ─── Персонал и доступ: подсветка активной группы/роли в тёмной теме ───
   build 1226: в светлой теме .list-group-item.active имеет бирюзовый фон,
   но в тёмной теме фон терялся → выбранная группа была неотличима.
   Двойной селектор (.dark-theme КЛАСС + [data-bs-theme] АТРИБУТ) — см.
   feedback_dark_theme_class_not_attr. */
body.dark-theme .list-group-item.active,
.dark-theme .list-group-item.active,
[data-bs-theme="dark"] .list-group-item.active {
    background-color: #2f7a68 !important;
    border-color: #43b880 !important;
    color: #fff !important;
}
body.dark-theme .list-group-item.active .text-muted,
.dark-theme .list-group-item.active .text-muted,
[data-bs-theme="dark"] .list-group-item.active .text-muted { color: #d7f1e8 !important; }

/* ─── Dark theme: subsection header gradient ─── */
body.dark-theme .desktop-subsection-header {
    background: linear-gradient(90deg, #43b880, #37a896) !important;
    border-bottom-color: #2d8a73;
}
body.dark-theme .desktop-subsection-header h5,
body.dark-theme .desktop-subsection-header h1.subsection-h1,
[data-bs-theme="dark"] .desktop-subsection-header h1.subsection-h1 { color: #fff !important; }
/* build 709: i-иконка (help-link) в шапке subsection-header.
   admin: «в светлой теме серого цвета, в тёмной теме белого цвета». */
.desktop-subsection-header .help-link {
    color: #6c757d !important;
    text-decoration: none;
    transition: color .15s;
}
.desktop-subsection-header .help-link:hover,
.desktop-subsection-header .help-link:focus-visible {
    color: #495057 !important;
    outline: none;
}
body.dark-theme .desktop-subsection-header .help-link,
[data-bs-theme="dark"] .desktop-subsection-header .help-link {
    color: #fff !important;
    opacity: .75;
}
body.dark-theme .desktop-subsection-header .help-link:hover,
body.dark-theme .desktop-subsection-header .help-link:focus-visible,
[data-bs-theme="dark"] .desktop-subsection-header .help-link:hover,
[data-bs-theme="dark"] .desktop-subsection-header .help-link:focus-visible {
    color: #fff !important;
    opacity: 1;
}

/* ─── Dark theme: backup page ─── */
body.dark-theme .backup-config-card { background: #22262e !important; border-color: #3a3f47; }
body.dark-theme .modal-content { background: #1e2530; color: #dee2e6; border-color: #3a3f47; }
body.dark-theme .modal-header { border-color: #3a3f47; }
body.dark-theme .modal-footer { border-color: #3a3f47; }
body.dark-theme .modal-content .form-control,
body.dark-theme .modal-content .form-select { background: #22262e; color: #dee2e6; border-color: #3a3f47; }
body.dark-theme .modal-content .form-control:focus,
body.dark-theme .modal-content .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand-primary) 25%, transparent); }
body.dark-theme .modal-content .btn-close { filter: invert(1); }

/* ─── Dark theme: table row hover gradient ─── */
body.dark-theme .table tbody tr:hover > td,
body.dark-theme .table tbody tr:hover > th,
body.dark-theme #choice_list tbody tr:hover > td,
body.dark-theme #result_list tbody tr:hover > td,
body.dark-theme .content-wrapper table tbody tr:hover > td {
    background: linear-gradient(90deg, rgba(67,184,128,.18), rgba(55,168,150,.10)) !important;
    color: #e0e0e0;
}

/* ─── Dark theme: select/option text readable ─── */
body.dark-theme select,
body.dark-theme select option,
body.dark-theme .form-select,
body.dark-theme .form-select option { color: #dee2e6 !important; background-color: #22262e; }
body.dark-theme select option:checked { background-color: var(--brand-primary); color: #fff !important; }

/* ─── Dark theme: sidebar nav links ─── */
body.dark-theme .nav-sidebar > .nav-item > .nav-link {
    color: #c0c4cc;
}
body.dark-theme .nav-sidebar .nav-treeview > .nav-item > .nav-link {
    color: #9ea3ad;
}
body.dark-theme .nav-sidebar .nav-link:hover {
    background-color: color-mix(in srgb, var(--brand-primary) 12%, transparent) !important;
    color: #e4e6ea;
}
body.dark-theme .nav-sidebar .nav-link.active {
    background-color: color-mix(in srgb, var(--brand-primary) 20%, transparent) !important;
    color: var(--brand-primary) !important;
}

/* ─── Dark theme: sidebar menu icons ─── */
body.dark-theme .main-sidebar .nav-link i,
body.dark-theme .main-sidebar .nav-link .fas,
body.dark-theme .main-sidebar .nav-link .far,
body.dark-theme .main-sidebar .nav-link .fa,
body.dark-theme .panel-left-nav .fas,
body.dark-theme .panel-left-nav .far,
body.dark-theme .panel-left-nav .fa { color: var(--brand-primary); }

/* ─── build 691: ROOT-CAUSE цветного текста на цветном фоне ───
   Bootstrap 5 объявляет `.table-warning { --bs-table-color: #664d03 }` и
   `.table-danger { --bs-table-color: #58151c }` через CSS-переменные,
   которые применяются изнутри через `--bs-table-color-state` и побеждают
   все мои td-правила (build 684-690). Из-за этого на скриншоте admin
   тёмная тема показывала жёлтый/розовый текст на одноимённом фоне.
   Решение: переопределяем нативные Bootstrap-переменные на самой <tr>.
   Тогда Bootstrap «изнутри» сам отрисует правильный цвет. */

/* Light theme — лёгкий фон, текст обычный чёрный */
tr.row-negbal > td { background-color: rgba(220, 53, 69, .08) !important; }
tr.table-warning, tr.table-danger, tr.table-info {
    --bs-table-color: inherit;
    --bs-table-color-state: inherit;
    --bs-table-color-type: inherit;
}

/* Dark theme — переменные для каждого статуса.
   Селекторы намеренно минимальные: tr.<class> > td.
   НЕ трогаем td a, td small, td .text-muted — пусть наследуют
   обычный цвет тёмной темы. */

/* table-danger — отключённые/удалённые абоненты */
body.dark-theme tr.table-danger > td,
[data-bs-theme="dark"] tr.table-danger > td {
    background-color: rgba(220, 53, 69, .14) !important;
    --bs-table-bg: transparent;
}
body.dark-theme tr.table-danger:hover > td,
[data-bs-theme="dark"] tr.table-danger:hover > td {
    background-color: rgba(220, 53, 69, .22) !important;
}

/* table-warning — административная блокировка */
body.dark-theme tr.table-warning > td,
[data-bs-theme="dark"] tr.table-warning > td {
    background-color: rgba(255, 193, 7, .10) !important;
    --bs-table-bg: transparent;
}
body.dark-theme tr.table-warning:hover > td,
[data-bs-theme="dark"] tr.table-warning:hover > td {
    background-color: rgba(255, 193, 7, .18) !important;
}

/* table-info — папки */
body.dark-theme tr.table-info > td,
[data-bs-theme="dark"] tr.table-info > td {
    background-color: rgba(60, 140, 180, .12) !important;
    --bs-table-bg: transparent;
}
body.dark-theme tr.table-info:hover > td,
[data-bs-theme="dark"] tr.table-info:hover > td {
    background-color: rgba(60, 140, 180, .20) !important;
}

/* row-deep-debt — глубокая задолженность (<-500) */
body.dark-theme tr.row-deep-debt > td,
[data-bs-theme="dark"] tr.row-deep-debt > td {
    background-color: rgba(220, 60, 60, .12) !important;
}
body.dark-theme tr.row-deep-debt:hover > td,
[data-bs-theme="dark"] tr.row-deep-debt:hover > td {
    background-color: rgba(220, 60, 60, .20) !important;
}

/* row-negbal — финансовая блокировка (b_negbal). Самый яркий. */
body.dark-theme tr.row-negbal > td,
[data-bs-theme="dark"] tr.row-negbal > td {
    background-color: rgba(220, 53, 69, .18) !important;
}
body.dark-theme tr.row-negbal:hover > td,
[data-bs-theme="dark"] tr.row-negbal:hover > td {
    background-color: rgba(220, 53, 69, .28) !important;
}

/* Двойной класс row-deep-debt.row-negbal — оба применимы. Чуть насыщеннее. */
body.dark-theme tr.row-deep-debt.row-negbal > td,
[data-bs-theme="dark"] tr.row-deep-debt.row-negbal > td {
    background-color: rgba(220, 53, 69, .24) !important;
}
body.dark-theme tr.row-deep-debt.row-negbal:hover > td,
[data-bs-theme="dark"] tr.row-deep-debt.row-negbal:hover > td {
    background-color: rgba(220, 53, 69, .34) !important;
}

/* Двойной класс row-deep-debt + table-warning (адм. блокировка + долг) */
body.dark-theme tr.row-deep-debt.table-warning > td,
[data-bs-theme="dark"] tr.row-deep-debt.table-warning > td {
    background-color: rgba(220, 100, 40, .16) !important;
}
body.dark-theme tr.row-deep-debt.table-warning:hover > td,
[data-bs-theme="dark"] tr.row-deep-debt.table-warning:hover > td {
    background-color: rgba(220, 100, 40, .26) !important;
}

/* Двойной class row-deep-debt + table-danger */
body.dark-theme tr.row-deep-debt.table-danger > td,
[data-bs-theme="dark"] tr.row-deep-debt.table-danger > td {
    background-color: rgba(220, 53, 69, .22) !important;
}
body.dark-theme tr.row-deep-debt.table-danger:hover > td,
[data-bs-theme="dark"] tr.row-deep-debt.table-danger:hover > td {
    background-color: rgba(220, 53, 69, .32) !important;
}

/* build 731: toggle «Цвет маркер» OFF — отключаем подсветку строк в folder-table.
   Bootstrap 5 рисует фон через `box-shadow: inset 0 0 0 9999px var(--bs-table-bg)`,
   поэтому одного background-color: transparent недостаточно — нужно сбросить
   box-shadow и обнулить --bs-table-bg-* CSS-переменные, плюс убрать диагональный
   pattern (background-image у folder-row) и вернуть исходный цвет ссылок. */
.folder-table.no-color-markers tr.table-warning,
.folder-table.no-color-markers tr.table-danger,
.folder-table.no-color-markers tr.table-info,
.folder-table.no-color-markers tr.row-negbal,
.folder-table.no-color-markers tr.row-deep-debt,
.folder-table.no-color-markers tr.folder-row {
    --bs-table-bg: transparent !important;
    --bs-table-bg-type: transparent !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-color: inherit !important;
    --bs-table-color-state: inherit !important;
    --bs-table-hover-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
}
.folder-table.no-color-markers tr.table-warning > td,
.folder-table.no-color-markers tr.table-danger > td,
.folder-table.no-color-markers tr.table-info > td,
.folder-table.no-color-markers tr.row-negbal > td,
.folder-table.no-color-markers tr.row-deep-debt > td,
.folder-table.no-color-markers tr.folder-row > td {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: inherit !important;
}
.folder-table.no-color-markers tr.table-warning:hover > td,
.folder-table.no-color-markers tr.table-danger:hover > td,
.folder-table.no-color-markers tr.table-info:hover > td,
.folder-table.no-color-markers tr.row-negbal:hover > td,
.folder-table.no-color-markers tr.row-deep-debt:hover > td,
.folder-table.no-color-markers tr.folder-row:hover > td {
    background-color: transparent !important;
    box-shadow: none !important;
}
.folder-table.no-color-markers tr.folder-row > td.col-name a {
    color: inherit !important;
    font-weight: normal !important;
}
.folder-table.no-color-markers tr.table-info > td.col-name a {
    color: inherit !important;
    font-weight: normal !important;
}

/* Бейджи внутри проблемных строк — собственные яркие цвета */
body.dark-theme tr.table-danger > td .badge.bg-danger,
body.dark-theme tr.row-negbal > td .badge.bg-danger,
[data-bs-theme="dark"] tr.table-danger > td .badge.bg-danger,
[data-bs-theme="dark"] tr.row-negbal > td .badge.bg-danger {
    background-color: #c0392b !important;
    color: #fff !important;
}
body.dark-theme tr.table-warning > td .badge.bg-warning,
[data-bs-theme="dark"] tr.table-warning > td .badge.bg-warning {
    background-color: #d4a017 !important;
    color: #000 !important;
}

/* ─── Dark theme: tariff badges ─── */
body.dark-theme .badge.bg-success,
body.dark-theme .badge.badge-success {
    background-color: #2d8f5e !important;
    color: #e0f5eb !important;
}
body.dark-theme .badge.bg-info,
body.dark-theme .badge.badge-info {
    background-color: #1f6a7a !important;
    color: #d0eef5 !important;
}

/* ─── Dark theme: datepicker ─── */
body.dark-theme .datepicker,
body.dark-theme .datepicker-dropdown,
body.dark-theme .bootstrap-datetimepicker-widget {
    background-color: #22262e !important;
    border-color: #3a3f47 !important;
    color: #d0d3d8;
}
body.dark-theme .datepicker table tr td,
body.dark-theme .datepicker table tr th,
body.dark-theme .bootstrap-datetimepicker-widget table td,
body.dark-theme .bootstrap-datetimepicker-widget table th {
    color: #c0c4cc;
    border-color: #353940;
}
body.dark-theme .datepicker table tr td.active,
body.dark-theme .datepicker table tr td.active:hover,
body.dark-theme .bootstrap-datetimepicker-widget table td.active {
    background-color: #43b77a !important;
    color: #fff !important;
}
body.dark-theme .datepicker table tr td.today,
body.dark-theme .bootstrap-datetimepicker-widget table td.today {
    background-color: rgba(67, 183, 122, .2) !important;
    color: #43b77a;
}
body.dark-theme .datepicker table tr td:hover,
body.dark-theme .bootstrap-datetimepicker-widget table td:hover {
    background-color: #2a2e37 !important;
}
body.dark-theme .datepicker .datepicker-switch,
body.dark-theme .datepicker .prev,
body.dark-theme .datepicker .next {
    color: #c0c4cc;
}

/* ─── Dark theme: abonent comments block ─── */
body.dark-theme .comment-block,
body.dark-theme [class*="comment"] .card,
body.dark-theme .card.comment-card {
    background-color: #1e222a !important;
    border-color: #353940 !important;
}
body.dark-theme .comments-section {
    margin-top: 8px;
    padding: 10px 12px;
    background: #2a2e37;
    border-radius: 6px;
    border: 1px solid #454950;
}

/* ─── Dark theme: form subgroup legends ─── */
body.dark-theme .form-subgroup .badge,
body.dark-theme .card-header .badge {
    opacity: .85;
}

/* ─── Dark theme: folder rows in abonent table ─── */
body.dark-theme tr td .fa-folder,
body.dark-theme tr td .fa-folder-open {
    color: #e6a817;
}

/* ─── Dark theme: dev_reports toolbar icons ─── */
body.dark-theme #md-card .btn-outline-secondary { color: var(--brand-primary); border-color: #3a3f47; }
body.dark-theme #md-card .btn-outline-secondary:hover { background: var(--brand-primary); color: #fff; }

/* ─── GLOBAL: Replace Bootstrap blue #007bff with green var(--brand-primary) ─── */
.text-primary { color: var(--brand-primary) !important; }
a.text-primary:hover, a.text-primary:focus { color: #4a9589 !important; }
.bg-primary { background-color: var(--brand-primary) !important; }
.btn-primary { background-color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; }
.btn-primary:hover { background-color: #4a9589 !important; border-color: #4a9589 !important; }
.btn-outline-primary { color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; }
.btn-outline-primary:hover { background-color: var(--brand-primary) !important; color: #fff !important; }
.nav-link.active { color: var(--brand-primary) !important; border-bottom-color: var(--brand-primary) !important; }
.nav-tabs .nav-link.active { color: var(--brand-primary) !important; border-bottom: 2px solid var(--brand-primary) !important; }
.page-link { color: var(--brand-primary) !important; }
.page-item.active .page-link { background-color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; color: #fff !important; }
a { color: var(--brand-primary); }
a:hover { color: #4a9589; }

/* ─── GLOBAL: Fix ALL checkboxes (AdminLTE/BS5 conflict) ─── */
.content-wrapper input[type="checkbox"],
.modal input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    width: auto !important;
    height: auto !important;
    accent-color: var(--brand-primary) !important;
}
.perms-options input[type="checkbox"],
#choice_list input[type="checkbox"],
.form-check-input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--brand-primary) !important;
    cursor: pointer;
}

/* ─── Bootstrap 5 toggle switch — preserve pill rendering ─── */
/* Override the default 18×18 square checkbox styles when wrapped in .form-switch */
.form-switch {
    padding-left: 2.5em !important;
}
.form-switch .form-check-input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 2em !important;
    height: 1em !important;
    border-radius: 2em !important;
    background-color: rgba(0,0,0,.15) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    border: 1px solid rgba(0,0,0,.25) !important;
    transition: background-position .15s ease-in-out, background-color .15s ease-in-out !important;
    margin-left: -2.5em !important;
    margin-top: .25em !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}
.form-switch .form-check-input[type="checkbox"]:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    background-position: right center !important;
}
.form-switch .form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand-primary) 25%, transparent) !important;
    border-color: var(--brand-primary) !important;
}
body.dark-theme .form-switch .form-check-input[type="checkbox"] {
    background-color: rgba(255,255,255,.15) !important;
    border-color: rgba(255,255,255,.25) !important;
}

/* ─── build 1658: GLOBAL мобильный вид мультиселекта во всех разделах ───
   (1) маленькие аккуратные чекбоксы в строках-списках (в ячейках таблиц);
   (2) компактное меню массовых действий: строка «N выбрано» отдельной строкой
       по центру, меню действий на всю ширину с аккуратным переносом. */
@media (max-width: 767.98px) {
    /* (1) чекбоксы строк списков — глобальный width:auto!important перебиваем
       большей специфичностью (td/th + [type]); форм-чекбоксы (вне таблиц) не трогаем */
    .content-wrapper td > input[type="checkbox"],
    .content-wrapper th > input[type="checkbox"],
    .content-wrapper td label > input[type="checkbox"] {
        width: 19px !important; height: 19px !important;
        min-width: 0 !important; min-height: 0 !important;
        accent-color: var(--brand-primary) !important;
    }
    /* (2) bulk-тулбары разных разделов → перенос по строкам */
    .sp-bulkbar, .bq-bulk-toolbar, .acc-bulk-toolbar, .rsl-bulk-bar, .tarif-bulk-bar {
        flex-wrap: wrap !important;
        row-gap: 8px !important;
        column-gap: 6px !important;
        padding: 10px 12px !important;
        align-items: center !important;
    }
    /* «N выбрано» — на всю ширину, отдельной строкой, по центру */
    .sp-bulk-count, .bq-bulk-toolbar .bulk-count, .acc-bulk-count,
    .rsl-bulk-count, .tarif-bulk-bar > span:first-child {
        flex: 1 1 100% !important; width: 100% !important;
        text-align: center !important; margin: 0 !important;
        padding-bottom: 6px !important;
        border-bottom: 1px solid rgba(128,128,128,.22) !important;
        white-space: normal !important;
    }
    /* обёртки действий (Support/tarif) — на всю ширину, кнопки переносятся */
    .sp-bulk-actions, .tarif-bulk-bar .btn-group {
        flex: 1 1 100% !important; width: 100% !important;
        display: flex !important; flex-wrap: wrap !important;
        gap: 6px !important; justify-content: center !important;
    }
    /* кнопки-прямые-дети (bank/accounts/reports без обёртки) — растягиваются */
    .bq-bulk-toolbar > .btn, .acc-bulk-toolbar > .btn,
    .rsl-bulk-bar > .btn, .rsl-bulk-bar > .form-select {
        flex: 1 1 auto !important; margin-left: 0 !important; margin-right: 0 !important;
    }
    /* декоративная иконка перед счётчиком (bank) — прячем, чтоб не занимала строку */
    .bq-bulk-toolbar > i.fas { display: none !important; }
    /* компактный размер кнопок массовых действий */
    .sp-bulkbar .btn, .bq-bulk-toolbar .btn, .acc-bulk-toolbar .btn,
    .rsl-bulk-bar .btn, .tarif-bulk-bar .btn {
        font-size: .82rem !important; padding: 6px 10px !important;
    }
}

/* ─── GLOBAL: Compact form rows — reduce vertical spacing ─── */
.form-row.row {
    margin-bottom: 1px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    min-height: 0 !important;
}
.form-row.row > .col-md-4,
.form-row.row > .col-md-8,
.form-row.row > div[class*="col-"] {
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    margin-bottom: 0 !important;
}
/* ALL selects inside form subgroups — compact */
.form-subgroup select,
.form-row select {
    padding: 3px 6px !important;
    height: 30px !important;
    min-height: 0 !important;
    font-size: .88rem !important;
    line-height: 1.3 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* ALL inputs inside form subgroups — compact */
.form-subgroup input[type="text"],
.form-subgroup input[type="number"],
.form-subgroup input[type="email"],
.form-subgroup input[type="password"],
.form-subgroup input[type="url"],
.form-subgroup input.form-control,
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input.form-control {
    padding: 3px 6px !important;
    height: 30px !important;
    font-size: .88rem !important;
}
/* Checkbox alignment — left edge, no centering */
.form-subgroup input[type="checkbox"],
.form-row input[type="checkbox"] {
    margin-left: 0 !important;
    margin-top: 6px !important;
    margin-right: 0 !important;
    display: block !important;
}
/* Select2 compact */
.form-subgroup .select2-container .select2-selection--single,
.form-row .select2-container .select2-selection--single {
    min-height: 30px !important;
    height: 30px !important;
    padding: 1px 6px !important;
}
.form-subgroup .select2-container .select2-selection__rendered,
.form-row .select2-container .select2-selection__rendered {
    line-height: 26px !important;
    font-size: .88rem !important;
    padding-left: 4px !important;
}
.form-subgroup .select2-container .select2-selection__arrow,
.form-row .select2-container .select2-selection__arrow {
    height: 28px !important;
}
/* popup-select row compact */
.popup-select-row select {
    padding: 3px 6px !important;
    height: 30px !important;
}
/* field-with-help flex alignment */
.field-with-help {
    display: flex !important;
    align-items: center !important;
    gap: 4px;
}
.field-with-help select,
.field-with-help input {
    flex: 1;
    min-width: 0;
}

/* ═══ Mobile sidebar overrides — must come AFTER AdminLTE active rules ═══ */
@media (max-width: 767.98px) {
    /* Kill AdminLTE + earlier theme-smit green fill on active */
    .main-sidebar .nav-sidebar > .nav-item > .nav-link.active,
    .sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
    body .main-sidebar .nav-link.active {
        background: color-mix(in srgb, var(--brand-primary) 15%, transparent) !important;
        background-color: color-mix(in srgb, var(--brand-primary) 15%, transparent) !important;
        color: #fff !important;
        box-shadow: inset 3px 0 0 var(--brand-primary) !important;
    }
    .main-sidebar .nav-sidebar .nav-treeview > .nav-item > .nav-link.active,
    .sidebar-dark-primary .nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
        background: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important;
        background-color: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important;
        color: #fff !important;
        box-shadow: none !important;
    }
    /* Dark theme parity */
    body.dark-theme .main-sidebar .nav-sidebar > .nav-item > .nav-link.active {
        background-color: color-mix(in srgb, var(--brand-primary) 20%, transparent) !important;
        color: #fff !important;
        box-shadow: inset 3px 0 0 var(--brand-primary) !important;
    }
    /* Active icon teal */
    .main-sidebar .nav-sidebar > .nav-item > .nav-link.active > .nav-icon,
    .main-sidebar .nav-sidebar .nav-treeview .nav-link.active > .nav-icon,
    .main-sidebar .nav-sidebar .nav-treeview .nav-link.active > .sidebar-sub-icon {
        color: var(--brand-primary) !important;
        opacity: 1 !important;
    }
}

/* ═══ Abonents section — larger top nav items ═══ */
/* On /admin/Abonents/search/ — whole sidebar-main-nav bigger */
body.section-abonents .sidebar-main-nav.nav-compact .nav-link p {
    font-size: 1rem;
    margin: 0 10px;
}
/* (build 634) Old rule for first 3 items — disabled: quick-nav links use own typography */

/* ═══ Abonents sidebar tree — refined UX (build 631+) ═══ */
/* Sticky CTA «Новый абонент» — prominently above the tree */
.sidebar-abonents-nav .sidebar-cta-row {
    position: sticky;
    top: 0;
    z-index: 5;
    /* build 931: убран тёмный gradient-фон (rgba(20,27,35,.98)) — наследует
       фон sidebar'а, по запросу admin'а 2026-05-19 «вокруг кнопки Новый абонент
       не нужен тёмный фон». Sticky-поведение сохранено. */
    background: transparent;
    padding: 10px 14px 8px !important;
    margin: 0 0 4px 0 !important;
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    display: block;
}
.sidebar-abonents-nav .sidebar-cta-row .sidebar-cta-btn {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
}
.sidebar-abonents-nav .sidebar-cta-btn {
    background: var(--brand-primary, #43b77a);
    border-color: var(--brand-primary, #43b77a);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .01em;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(67, 183, 122, .25);
    transition: background-color .15s, box-shadow .15s, transform .12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.sidebar-abonents-nav .sidebar-cta-btn:hover {
    background: #3aa86b;
    border-color: #3aa86b;
    box-shadow: 0 3px 10px rgba(67, 183, 122, .35);
    color: #fff;
}
.sidebar-abonents-nav .sidebar-cta-btn:active { transform: scale(.97); }
.sidebar-abonents-nav .sidebar-cta-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Section labels — small caps separator (Разделы / Папки)
   build 711: контраст усилен с .35 до .6 (admin: «бледные тексты», 35% было ниже WCAG AA) */
.sidebar-abonents-nav .sidebar-tree-label,
.sidebar-abonents-nav .sidebar-section-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .6);
    padding: 8px 14px 4px;
    margin: 4px 0 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sidebar-abonents-nav .sidebar-tree-label i,
.sidebar-abonents-nav .sidebar-section-label i { font-size: .8em; opacity: .8; }
.sidebar-abonents-nav .sidebar-section-label { margin-top: 8px; }
.sidebar-abonents-nav .sidebar-tree-label { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .04); }

/* Quick-nav links (Поиск/Карта/Счета/Фин.опер.) — visually distinct from tree leaves */
.sidebar-abonents-nav .sidebar-quicknav-link {
    padding: 8px 14px !important;
    color: rgba(255, 255, 255, .82) !important;
    font-size: .88rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.2 !important;
}
.sidebar-abonents-nav .sidebar-quicknav-link .nav-icon {
    color: var(--brand-primary, #43b77a) !important;
    width: 20px !important;
    text-align: center !important;
    font-size: .95rem !important;
    opacity: .9 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}
.sidebar-abonents-nav .sidebar-quicknav-link p {
    margin: 0 !important;
    font-size: .88rem !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: rgba(255, 255, 255, .92) !important;
}
.sidebar-abonents-nav .sidebar-quicknav-link:hover { background: rgba(67, 183, 122, .15) !important; }
.sidebar-abonents-nav .sidebar-quicknav-link:hover .nav-icon { opacity: 1 !important; }
.sidebar-abonents-nav .sidebar-quicknav-link.active {
    background: rgba(67, 183, 122, .22) !important;
}
.sidebar-abonents-nav .sidebar-quicknav-link.active p { color: #fff !important; font-weight: 500 !important; }

/* Folder vs leaf — subtle visual hierarchy */
.sidebar-abonents-nav .nav-link {
    transition: background-color .12s, color .12s;
    border-radius: 4px;
    margin: 1px 4px;
}
.sidebar-abonents-nav .nav-link:hover {
    background: rgba(67, 183, 122, .12);
}
.sidebar-abonents-nav .nav-link.active {
    background: var(--brand-primary, #43b77a) !important;
}
/* Leaf items (абоненты — circles) — muted, slightly smaller */
.sidebar-abonents-nav .nav-link i.far.fa-circle,
.sidebar-abonents-nav .nav-link i.fas.fa-circle {
    font-size: .55em !important;
    opacity: .55;
    color: rgba(255, 255, 255, .5) !important;
}
.sidebar-abonents-nav .nav-link:hover i.far.fa-circle { opacity: 1; }

/* ═══ Build 629: Sidebar COLLAPSED mode — clean icon-only view ═══
   Когда body.sidebar-collapse:
   • CTA «Новый абонент» → круглая иконка-кнопка 32×32 по центру
   • Section labels (РАЗДЕЛЫ / ПАПКИ) → полностью скрыты
   • Quick-nav <p> текст → скрыт, остаются только цветные иконки
   • Tree leaves <p> → скрыты
   • Hover на сайдбар (sidebar-mini-expand-on-hover) — текст возвращается
*/
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-row {
    padding: 8px 6px !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-btn {
    padding: 8px 0 !important;
    min-width: 36px;
    width: 36px !important;
    height: 36px;
    border-radius: 50%;
    margin: 0 auto;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-btn > span {
    display: none;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-btn > i {
    margin: 0 !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-section-label,
body.sidebar-collapse .sidebar-abonents-nav .sidebar-tree-label {
    display: none !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link {
    padding: 10px 0 !important;
    justify-content: center !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link p {
    display: none !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link .nav-icon {
    margin: 0 !important;
    width: auto !important;
    font-size: 1.05rem !important;
}
body.sidebar-collapse .sidebar-abonents-nav .nav-link {
    padding: 8px 0 !important;
    text-align: center;
    justify-content: center;
}
body.sidebar-collapse .sidebar-abonents-nav .nav-link > p {
    display: none !important;
}
body.sidebar-collapse .sidebar-abonents-nav .nav-link > i.nav-icon {
    margin: 0 !important;
    width: auto !important;
}
/* Скрыть expand-toggle стрелку у папок в collapsed */
body.sidebar-collapse .sidebar-abonents-nav .nav-link > p > .right {
    display: none !important;
}
/* Treeview — скрыть полностью в collapsed (показываются на hover в AdminLTE) */
body.sidebar-collapse .sidebar-abonents-nav .nav-treeview {
    display: none !important;
}

/* ═══ build 692/704: НЕТ hover-expand. Sidebar остаётся узким при наведении,
   AdminLTE по умолчанию пытается развернуть его — блокируем width на 4.6rem.
   build 704: добавил `.main-sidebar.sidebar-focused:hover` для случая
   когда AdminLTE добавляет sidebar-focused при hover/click. ═══ */
body.sidebar-collapse.sidebar-mini-expand-on-hover .main-sidebar:hover,
body.sidebar-collapse .main-sidebar:hover,
body.sidebar-collapse .main-sidebar.sidebar-focused,
body.sidebar-collapse .main-sidebar.sidebar-focused:hover {
    width: 4.6rem !important;
}
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-cta-btn {
    width: 36px !important;
    padding: 8px 0 !important;
    border-radius: 50% !important;
}
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-cta-btn > span,
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-section-label,
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-tree-label,
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-quicknav-link p,
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .nav-link > p {
    display: none !important;
}
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .sidebar-quicknav-link,
body.sidebar-collapse .main-sidebar:hover .sidebar-abonents-nav .nav-link {
    justify-content: center !important;
    text-align: center;
    padding: 8px 0 !important;
}

/* ═══ build 704: ROOT-CAUSE — AdminLTE применяет `opacity: 0` к содержимому
   .nav-link при sidebar-collapse, но иконки .nav-icon должны остаться видимы.
   Перебиваем всё с !important и явным opacity: 1. ═══ */
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link,
body.sidebar-collapse .sidebar-abonents-nav .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 6px 0 !important;
    min-height: 38px !important;
    border-radius: 0;
    transition: background-color .15s;
    opacity: 1 !important;
    transform: none !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link:hover,
body.sidebar-collapse .sidebar-abonents-nav .nav-link:hover {
    background: rgba(67, 183, 122, .15) !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link:hover .nav-icon,
body.sidebar-collapse .sidebar-abonents-nav .nav-link:hover > i.nav-icon {
    color: var(--brand-primary, #43b77a) !important;
    opacity: 1 !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link.active,
body.sidebar-collapse .sidebar-abonents-nav .nav-link.active {
    background: rgba(67, 183, 122, .22) !important;
    box-shadow: inset 3px 0 0 var(--brand-primary, #43b77a);
}
/* Иконки — ВСЕГДА видимы, opacity:1, размер 18px по центру.
   AdminLTE по умолчанию ставит opacity:0 на .nav-link content при collapse. */
body.sidebar-collapse .sidebar-abonents-nav .sidebar-quicknav-link .nav-icon,
body.sidebar-collapse .sidebar-abonents-nav .nav-link > i.nav-icon,
body.sidebar-collapse .sidebar-abonents-nav .nav-link > i.fas,
body.sidebar-collapse .sidebar-abonents-nav .nav-link > i.far {
    opacity: .85 !important;
    visibility: visible !important;
    transform: none !important;
    font-size: 1.1rem !important;
    width: 22px !important;
    height: 22px;
    line-height: 22px;
    text-align: center;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Кружки leaf-items (последние абоненты) — тонкий контур, центр */
body.sidebar-collapse .sidebar-abonents-nav .nav-link i.far.fa-circle,
body.sidebar-collapse .sidebar-abonents-nav .nav-link i.fas.fa-circle {
    font-size: .7rem !important;
    opacity: .6;
    width: 12px !important;
    height: 12px;
    line-height: 12px;
}
body.sidebar-collapse .sidebar-abonents-nav .nav-link:hover i.far.fa-circle,
body.sidebar-collapse .sidebar-abonents-nav .nav-link:hover i.fas.fa-circle {
    opacity: 1;
}
/* Разделитель между секциями (РАЗДЕЛЫ / ПАПКИ / НЕДАВНИЕ) — тонкая линия */
body.sidebar-collapse .sidebar-abonents-nav .sidebar-tree-label {
    display: block !important;
    visibility: hidden;
    margin: 6px 8px !important;
    border-top: 1px solid rgba(255, 255, 255, .08);
    height: 1px;
    padding: 0 !important;
    overflow: hidden;
}

/* ═══ build 699: collapsed-режим — полировка по фидбеку admin ═══ */

/* Скрыть блок «Недавние» в свёрнутом виде (admin: «Недавние не показывать») */
body.sidebar-collapse .sidebar-recent-nav,
body.sidebar-collapse .sidebar-abonents-nav .sidebar-recent-section {
    display: none !important;
}

/* CTA-кнопка «Новый абонент» в свёрнутом виде — размер как у иконок-навигации (не больше) */
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-row {
    padding: 4px 0 !important;
    text-align: center;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body.sidebar-collapse .sidebar-abonents-nav .sidebar-cta-btn > i {
    font-size: 1.05rem !important;
    margin: 0 !important;
}

/* Горизонтальные тултипы при hover на иконку в свёрнутом виде.
   Используем стандартные title-атрибуты + CSS ::after на :hover.
   Реализуем через JS ниже — здесь только стиль tooltip. */
.smit-collapsed-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2227;
    color: #e7eaf0;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: .8rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    z-index: 10010;
    pointer-events: none;
    border: 1px solid #3a3f47;
}
.smit-collapsed-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1f2227;
}
body.dark-theme .smit-collapsed-tooltip,
[data-bs-theme="dark"] .smit-collapsed-tooltip {
    background: #2a2f37;
    border-color: #4a5057;
}
body.dark-theme .smit-collapsed-tooltip::before,
[data-bs-theme="dark"] .smit-collapsed-tooltip::before {
    border-right-color: #2a2f37;
}

/* build 700: Вложенные меню (treeview) в свёрнутом виде — flyout-стиль.
   Используем JS-driven body-level контейнер .smit-flyout с position:fixed,
   потому что .sidebar имеет overflow-x:hidden !important (строка 310) которое
   нельзя обнулить без поломок прокрутки. JS клонирует <ul.nav-treeview> в
   body на mouseenter, удаляет на mouseleave. */
body.sidebar-collapse .main-sidebar .nav-treeview { display: none !important; }

.smit-flyout-menu {
    position: fixed;
    min-width: 220px;
    background: #1f2227;
    border: 1px solid #3a3f47;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    z-index: 10005;
    padding: 4px 0;
    border-radius: 0 6px 6px 0;
    list-style: none;
    margin: 0;
}
.smit-flyout-menu .nav-item { list-style: none; }
.smit-flyout-menu .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 14px !important;
    text-align: left !important;
    font-size: .85rem !important;
    color: #d0d3d8 !important;
    text-decoration: none;
    line-height: 1.3;
}
.smit-flyout-menu .nav-link p {
    display: inline-block !important;
    margin: 0 !important;
}
.smit-flyout-menu .nav-link i.nav-icon,
.smit-flyout-menu .nav-link i.fas,
.smit-flyout-menu .nav-link i.far {
    margin-right: 10px !important;
    width: 16px !important;
    font-size: .9rem !important;
    text-align: center;
}
.smit-flyout-menu .nav-link:hover {
    background: rgba(67, 183, 122, .15) !important;
    color: #fff !important;
}
.smit-flyout-menu .nav-link.active {
    background: rgba(67, 183, 122, .22) !important;
    color: #fff !important;
}
body.dark-theme .smit-flyout-menu,
[data-bs-theme="dark"] .smit-flyout-menu {
    background: #2a2f37;
    border-color: #4a5057;
}
body:not(.dark-theme) .smit-flyout-menu {
    background: #fff;
    border-color: #dee2e6;
    color: #212529;
}
body:not(.dark-theme) .smit-flyout-menu .nav-link {
    color: #495057 !important;
}
body:not(.dark-theme) .smit-flyout-menu .nav-link:hover {
    background: rgba(67, 183, 122, .12) !important;
    color: #0d6efd !important;
}

body.sidebar-collapse .main-sidebar .nav-sidebar .nav-item.has-treeview { position: relative; }
/* ═══ build 692: убрать визуальный вертикальный скроллбар в сайдбаре ═══
   admin: «в сайдбар меню отображается скроллбар. так быть не должно».
   Сохраняем функциональность скролла, но прячем толстую полосу. */
.main-sidebar .os-scrollbar,
.main-sidebar .os-scrollbar-handle {
    /* OverlayScrollbars — приглушённый, авто-скрытие */
    opacity: .25 !important;
    transition: opacity .2s;
}
.main-sidebar:hover .os-scrollbar { opacity: .55 !important; }
.main-sidebar .sidebar::-webkit-scrollbar { width: 4px; }
.main-sidebar .sidebar::-webkit-scrollbar-track { background: transparent; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
}
.main-sidebar:hover .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
}
.main-sidebar .sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

/* Build 643+: те же правила применяются когда main-sidebar реально узкий
   (например auto-collapse на tablet 768-991px без класса sidebar-collapse).
   Используем атрибутный селектор + max-width на контейнере. AdminLTE при
   collapse даёт sidebar ширину ~4.6rem (~74px). Если sidebar < 100px —
   точно collapsed. */
.main-sidebar:not(:hover) {
    /* container query — но fallback через :has если поддерживается */
}
/* Build 643: body.sidebar-narrow выставляется JS-ResizeObserver когда sidebar < 200px.
   Покрывает все случаи когда sidebar узкий, независимо от того есть ли .sidebar-collapse */
body.sidebar-narrow .sidebar-abonents-nav .sidebar-cta-btn > span,
body.sidebar-narrow .sidebar-abonents-nav .sidebar-section-label,
body.sidebar-narrow .sidebar-abonents-nav .sidebar-tree-label,
body.sidebar-narrow .sidebar-abonents-nav .sidebar-quicknav-link p,
body.sidebar-narrow .sidebar-abonents-nav .nav-link > p {
    display: none !important;
}
body.sidebar-narrow .sidebar-abonents-nav .sidebar-cta-row {
    padding: 8px 6px !important;
}
body.sidebar-narrow .sidebar-abonents-nav .sidebar-cta-btn {
    padding: 8px 0 !important;
    min-width: 36px;
    width: 36px !important;
    height: 36px;
    border-radius: 50%;
    margin: 0 auto;
}
body.sidebar-narrow .sidebar-abonents-nav .sidebar-cta-btn > i {
    margin: 0 !important;
}
body.sidebar-narrow .sidebar-abonents-nav .sidebar-quicknav-link {
    padding: 10px 0 !important;
    justify-content: center !important;
}
body.sidebar-narrow .sidebar-abonents-nav .sidebar-quicknav-link .nav-icon {
    margin: 0 !important;
    width: auto !important;
    font-size: 1.05rem !important;
}
body.sidebar-narrow .sidebar-abonents-nav .nav-link {
    padding: 8px 0 !important;
    text-align: center;
    justify-content: center;
}
body.sidebar-narrow .sidebar-abonents-nav .nav-link > i.nav-icon {
    margin: 0 !important;
    width: auto !important;
}
body.sidebar-narrow .sidebar-abonents-nav .nav-link > p > .right {
    display: none !important;
}
body.sidebar-narrow .sidebar-abonents-nav .nav-treeview {
    display: none !important;
}

/* Build 644: Sidebar — убираем горизонтальный скролл и делаем вертикальный почти невидимым */
.main-sidebar,
.main-sidebar .sidebar,
.main-sidebar .nav-sidebar,
.main-sidebar .sidebar-abonents-nav,
.main-sidebar .sidebar-main-nav {
    overflow-x: hidden !important;
}
/* Длинные имена папок — обрезаем многоточием вместо horizontal-scroll */
.main-sidebar .nav-link > p,
.main-sidebar .sidebar-abonents-nav .nav-link > p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* Стилизация вертикального скроллбара — едва заметный, на hover чуть ярче */
.main-sidebar::-webkit-scrollbar,
.main-sidebar .sidebar::-webkit-scrollbar {
    width: 4px;
    height: 0;
}
.main-sidebar::-webkit-scrollbar-track,
.main-sidebar .sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.main-sidebar::-webkit-scrollbar-thumb,
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
    transition: background-color .2s;
}
.main-sidebar:hover::-webkit-scrollbar-thumb,
.main-sidebar .sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
}
.main-sidebar::-webkit-scrollbar-thumb:hover,
.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .35);
}
/* Firefox */
.main-sidebar,
.main-sidebar .sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .12) transparent;
}
.main-sidebar:hover,
.main-sidebar .sidebar:hover {
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

/* Light theme tweaks for sticky CTA */
body.light-theme .sidebar-abonents-nav .sidebar-cta-row {
    background: linear-gradient(180deg, rgba(20, 27, 35, .98) 0%, rgba(20, 27, 35, .92) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════
   A11Y: UX-аудит build 261 — Sprint 1
   P0-3 focus-visible · P0-2 colour independence · Time-2 prefers-reduced-motion
   P1-3 word-break · P1-4 dark contrast · P1-7 button labels · P0-1 bulk modal
   ═══════════════════════════════════════════════════════════════════════ */

/* P0-3: видимый focus для клавиатурной навигации */
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.page-link:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
a:focus-visible,
.card-tools .btn:focus-visible,
.tariff-type-btn:focus-visible,
.fin-type-btn:focus-visible {
    outline: 2px solid #43b77a !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, 0.25) !important;
    z-index: 5;
}
.select2-container--default.select2-container--focus .select2-selection {
    outline: 2px solid #43b77a !important;
    outline-offset: 1px !important;
}
.nav-tabs .nav-link:focus-visible,
.nav-pills .nav-link:focus-visible {
    outline: 2px solid #43b77a !important;
    outline-offset: -2px !important;
}

/* P1-3: длинные имена в Top-debtors */
.top-debtors-list .debtor-name,
.top-debtors-list td:nth-child(2),
#top-debtors td:nth-child(2),
.dashboard-list .item-name {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Build 289 P0-2 + Build 600 фикс: иконки направления для финопераций.
   Раньше иконка рендерилась только через CSS ::before. С build 289+
   шаблон operations_inline.html сам рисует <i class="fa-arrow-down/up">
   с aria-label — это правильнее (доступно screen-reader'ам). Здесь ::before
   оставляем ТОЛЬКО для legacy-классов .fin-amount-positive/-negative
   (используются в LK/dashboard где нет inline-иконки), но НЕ для
   .ops-income/.ops-expense — там получался дубль ↓↓ или ↑↑. */
.fin-amount-positive::before {
    content: "\f063";
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    margin-right: 4px;
    font-size: 0.85em;
    color: #28a745;
}
.fin-amount-negative::before {
    content: "\f062";
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    margin-right: 4px;
    font-size: 0.85em;
    color: #dc3545;
}

/* P1-4: контраст текста на ECharts в тёмной теме */
body.dark-theme .echarts-tooltip,
body.dark-theme .chart-axis-label {
    color: #a8b8cc !important;
}

/* Time-2 + a11y-motion-sensitivity */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .echarts-container,
    [_echarts_instance_] {
        animation: none !important;
    }
    .main-header {
        animation: none !important;
        background-position: 0 0 !important;
    }
    .small-box:hover,
    .info-box:hover,
    .stat-card:hover {
        transform: none !important;
    }
}

/* P1-7: текст рядом с иконкой на широких экранах */
@media (min-width: 992px) {
    .tariff-type-btn .btn-label,
    .fin-type-btn .btn-label {
        display: inline-block;
        margin-left: 4px;
        font-size: 0.85em;
    }
}
@media (max-width: 991.98px) {
    .tariff-type-btn .btn-label,
    .fin-type-btn .btn-label {
        display: none;
    }
}

/* P0-1: bulk-action confirmation modal */
.bulk-confirm-modal .modal-body .alert-warning {
    border-left: 4px solid #ffc107;
}
.bulk-confirm-modal .preview-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    background: rgba(0,0,0,0.04);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}
body.dark-theme .bulk-confirm-modal .preview-list {
    background: rgba(255,255,255,0.06);
}
.bulk-confirm-modal .confirm-input {
    font-family: "Courier New", monospace;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX AUDIT — Spring 2026, build 408
   Единая система компонентов на design tokens.
   Применяется ко всем страницам админки автоматически.
   Источник: dev_reports/Отчёты/2026-04-30_UX_аудит_полный_прогон_build408.md
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   1. Skip-link (WCAG 2.4.1 Bypass Blocks)
   ───────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 10000;
    background: var(--brand-primary);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: top .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    top: 8px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────
   2. Унифицированные статус-бейджи
   .smit-badge — единый компонент.
   Используется через пары
       .smit-badge.is-success / .is-warning / .is-danger / .is-info / .is-neutral
   Цветовая независимость: иконка + текст — не только цвет.
   ───────────────────────────────────────────── */
.smit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.01em;
}
.smit-badge.is-success {
    color: #1a6b46;
    background: #d4edda;
    border-color: #b8e0c4;
}
.smit-badge.is-warning {
    color: #7a4f0d;
    background: #fff3cd;
    border-color: #ffe1a8;
}
.smit-badge.is-danger {
    color: #842029;
    background: #f8d7da;
    border-color: #f1aeb5;
}
.smit-badge.is-info {
    color: #084056;
    background: #cff4fc;
    border-color: #9eeaf9;
}
.smit-badge.is-neutral {
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-color: var(--border-subtle);
}
body.dark-theme .smit-badge.is-success {
    color: #7fd9a0;
    background: rgba(40, 167, 69, .18);
    border-color: rgba(40, 167, 69, .35);
}
body.dark-theme .smit-badge.is-warning {
    color: #ffd476;
    background: rgba(240, 173, 78, .18);
    border-color: rgba(240, 173, 78, .35);
}
body.dark-theme .smit-badge.is-danger {
    color: #ff9aa0;
    background: rgba(224, 85, 85, .20);
    border-color: rgba(224, 85, 85, .40);
}
body.dark-theme .smit-badge.is-info {
    color: #6ed4ec;
    background: rgba(91, 192, 222, .18);
    border-color: rgba(91, 192, 222, .35);
}
body.dark-theme .smit-badge.is-neutral {
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-color: var(--border-subtle);
}

/* ─────────────────────────────────────────────
   3. Унифицированные чипы фильтров
   .smit-chip-row — обёртка
   .smit-chip — кнопка-фильтр (нажимается, активна)
   ───────────────────────────────────────────── */
.smit-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.smit-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1.4;
    font-weight: 500;
}
.smit-chip:hover {
    color: var(--brand-primary-dark);
    border-color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 6%, var(--surface-card));
}
.smit-chip.is-active,
.smit-chip[aria-pressed="true"] {
    color: #fff;
    background: var(--brand-primary);
    border-color: var(--brand-primary-dark);
}
.smit-chip:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}
body.dark-theme .smit-chip {
    color: var(--text-secondary);
    background: var(--surface-card);
    border-color: var(--border-default);
}

/* ─────────────────────────────────────────────
   4. Toolbar-pattern — единый header для всех
   списков (уже использовался в search.html, finops_list,
   accounts_list — теперь общий компонент).
   ───────────────────────────────────────────── */
.smit-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-toolbar);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-3);
}
.smit-toolbar h1,
.smit-toolbar h2,
.smit-toolbar h3,
.smit-toolbar .smit-toolbar-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.smit-toolbar .smit-toolbar-spacer { flex: 1 1 auto; }
body.dark-theme .smit-toolbar {
    background: var(--surface-toolbar);
    border-color: var(--border-subtle);
}

/* ─────────────────────────────────────────────
   5. Stat-cards (мини-карточки KPI в шапке списка)
   Применяются вместо разрозненных h4/.badge.
   ───────────────────────────────────────────── */
.smit-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.smit-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 90px;
    line-height: 1.2;
}
.smit-stat .stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: 0.04em;
    font-weight: 600;
}
.smit-stat .stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}
.smit-stat.is-success .stat-value { color: var(--status-success); }
.smit-stat.is-warning .stat-value { color: var(--status-warning); }
.smit-stat.is-danger  .stat-value { color: var(--status-danger);  }

/* ─────────────────────────────────────────────
   6. Единые AJAX loading-states
   .smit-loading — overlay для container
   .smit-skeleton — placeholder для row
   ───────────────────────────────────────────── */
.smit-loading {
    position: relative;
    min-height: 80px;
    pointer-events: none;
}
.smit-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.6);
    border-radius: inherit;
    z-index: 1;
}
body.dark-theme .smit-loading::after {
    background: rgba(20,22,28,.55);
}
.smit-loading::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px;
    border: 3px solid rgba(67,183,122,.15);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: smit-spin 0.7s linear infinite;
    z-index: 2;
}
@keyframes smit-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .smit-loading::before { animation: none; }
}
.smit-skeleton {
    display: inline-block;
    height: 1em;
    background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.10) 50%, rgba(0,0,0,.06) 75%);
    background-size: 200% 100%;
    animation: smit-shine 1.4s ease-in-out infinite;
    border-radius: var(--radius-xs);
    min-width: 60px;
}
body.dark-theme .smit-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.05) 75%);
}
@keyframes smit-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .smit-skeleton { animation: none; }
}

/* ─────────────────────────────────────────────
   7. Mobile touch targets (WCAG 2.5.5 AAA — min 44×44)
   Не меняем размеры через !important — только обеспечиваем
   минимум через padding.
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .smit-chip,
    .head-navbar .btn,
    .ops-toolbar .btn,
    .filter-bar .btn,
    button.btn-sm,
    .btn-group-sm > .btn {
        min-height: 38px;
    }
    .smit-chip { padding: 8px 14px; }
}

/* ─────────────────────────────────────────────
   8. Унифицированные модалки
   Все модалки SmitBilling должны использовать одинаковую
   шапку, padding, footer.  Это покрывает 12+ модалок (FinOps,
   Users, Uslugi/Bonus, Tarif, NAS Online, и т.д.)
   ───────────────────────────────────────────── */
.modal-content {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) var(--space-4);
}
.modal-header .modal-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.modal-body { padding: var(--space-4); }
.modal-footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
}
body.dark-theme .modal-content {
    background-color: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
body.dark-theme .modal-header,
body.dark-theme .modal-footer {
    border-color: var(--border-subtle);
}

/* ─────────────────────────────────────────────
   9. Empty state — единый паттерн
   ───────────────────────────────────────────── */
.smit-empty {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--text-muted);
}
.smit-empty .empty-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-3);
}
.smit-empty .empty-title {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    font-weight: 600;
}
.smit-empty .empty-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   10. Унификация отступов между card-body, table, list
       — устраняет «двойные паддинги» наблюдаемые в
       /admin/Abonents/<id>/ и /admin/welcome/
   ───────────────────────────────────────────── */
.card > .card-body > .table:last-child,
.card > .card-body > .list-group:last-child { margin-bottom: 0; }
.card-header > h5, .card-header > h6 { margin: 0; }

/* ─────────────────────────────────────────────
   11. Глобальный focus-visible для всех интерактивов
       (расширяет правила build 261 на новые селекторы:
       .smit-chip, .smit-stat, ссылки в таблицах списков)
   ───────────────────────────────────────────── */
.smit-chip:focus-visible,
.smit-stat:focus-visible,
.tab-content a:focus-visible,
.modal-content [tabindex]:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ─────────────────────────────────────────────
   12. Унификация tooltip'ов и popper'ов
   ───────────────────────────────────────────── */
.tooltip-inner {
    background: #1a1d23;
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    box-shadow: var(--shadow-md);
}
.bs-tooltip-top .tooltip-arrow::before { border-top-color: #1a1d23; }
.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: #1a1d23; }
.bs-tooltip-end .tooltip-arrow::before { border-right-color: #1a1d23; }
.bs-tooltip-start .tooltip-arrow::before { border-left-color: #1a1d23; }

/* ─────────────────────────────────────────────
   13. ARIA-live region для AJAX-нотификаций
   (использовать для статуса bulk-actions, save в модалках)
   ───────────────────────────────────────────── */
.smit-sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─────────────────────────────────────────────
   14. AdminAccounts/Tarif/Usluga list — унификация
   высот строк и hover'а (раньше пять разных стилей)
   ───────────────────────────────────────────── */
table.smit-table tbody tr {
    transition: background .12s ease;
}
table.smit-table tbody tr:hover {
    background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
}
body.dark-theme table.smit-table tbody tr:hover {
    background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
table.smit-table th {
    font-size: var(--font-size-xs);
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 12px;
}
table.smit-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════
   END UX AUDIT 2026-04-30
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   build 455 — UX Day 2 — единый компонент `.smit-kpi`

   Унифицирует .ip-kpi-card (IpPull) / .vp-kpi-card (VLAN) / .dbc-stat
   (DbCleanup) / .nas-kpi (NAS list). Структура:

     <button class="smit-kpi smit-kpi--ok" aria-pressed="true">
       <i class="smit-kpi__icon fas fa-check-circle"></i>
       <div class="smit-kpi__num">42</div>
       <div class="smit-kpi__lbl">Активных</div>
     </button>

   Modifiers (по семантике состояния, не цвету):
     .smit-kpi--ok       — норма / зелёный
     .smit-kpi--warn     — предупреждение / оранжевый
     .smit-kpi--danger   — критично / красный
     .smit-kpi--info     — нейтральная инфо / голубой
     .smit-kpi--muted    — totals / серый

   Используются токены --smit-state-* (build 454).
   ═══════════════════════════════════════════════════════════════════════ */

.smit-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem;
    margin-bottom: .75rem;
}

.smit-kpi {
    padding: .55rem .75rem;
    border-radius: .4rem;
    border: 1px solid #e9ecef;
    background: #fff;
    color: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    text-align: left;
    position: relative;
    min-height: 60px;
    display: block;
}
.smit-kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.smit-kpi[aria-pressed="true"] {
    box-shadow: 0 0 0 2px rgba(67,183,122,.4);
    border-color: var(--brand-primary, #43b77a);
}

.smit-kpi__icon {
    position: absolute;
    top: .55rem;
    right: .75rem;
    font-size: 1.05rem;
    opacity: .55;
}
.smit-kpi__num {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.smit-kpi__lbl {
    font-size: .78em;
    color: var(--text-muted, #6c757d);
    margin-top: .2rem;
}
.smit-kpi__extra {
    font-size: .85em;
    color: var(--text-muted, #6c757d);
    margin-top: .15rem;
}

/* Цветовые варианты по семантике */
.smit-kpi--ok      { background: #d1e7dd; border-color: #a3cfbb; }
.smit-kpi--ok      .smit-kpi__num    { color: #0a3622; }
.smit-kpi--warn    { background: #fff3cd; border-color: #ffe69c; }
.smit-kpi--warn    .smit-kpi__num    { color: #664d03; }
.smit-kpi--danger  { background: #f8d7da; border-color: #f1aeb5; }
.smit-kpi--danger  .smit-kpi__num    { color: #58151c; }
.smit-kpi--info    { background: #cff4fc; border-color: #9eeaf9; }
.smit-kpi--info    .smit-kpi__num    { color: #055160; }
.smit-kpi--muted   { background: #f8f9fa; border-color: #dee2e6; }

/* Dark theme */
[data-bs-theme="dark"] .smit-kpi { background: #1e2024; border-color: #2a2f37; }
[data-bs-theme="dark"] .smit-kpi__lbl, [data-bs-theme="dark"] .smit-kpi__extra { color: #a8b8cc; }
[data-bs-theme="dark"] .smit-kpi--ok      { background: #0f3a26; border-color: #185a3a; }
[data-bs-theme="dark"] .smit-kpi--ok      .smit-kpi__num   { color: #a3cfbb; }
[data-bs-theme="dark"] .smit-kpi--warn    { background: #3a2e10; border-color: #5a4715; }
[data-bs-theme="dark"] .smit-kpi--warn    .smit-kpi__num   { color: #ffe69c; }
[data-bs-theme="dark"] .smit-kpi--danger  { background: #3a161a; border-color: #5a232a; }
[data-bs-theme="dark"] .smit-kpi--danger  .smit-kpi__num   { color: #f1aeb5; }
[data-bs-theme="dark"] .smit-kpi--info    { background: #0a3a44; border-color: #155a6a; }
[data-bs-theme="dark"] .smit-kpi--info    .smit-kpi__num   { color: #9eeaf9; }
[data-bs-theme="dark"] .smit-kpi--muted   { background: #2a2f37; border-color: #353940; }

/* Mobile */
@media (max-width: 480px) {
    .smit-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .smit-kpi__num { font-size: 1.25rem; }
}

/* a11y */
@media (prefers-reduced-motion: reduce) {
    .smit-kpi { transition: none; }
    .smit-kpi:hover { transform: none; }
}

/* ============================================================
   AdminAccounts (build 473) — список + модалка с 5 вкладками
   План: dev_reports/Планы/2026-05-07_План_UX_AdminAccounts_модалки.md
   ============================================================ */

/* === список === */
.acc-page .acc-tbl th { font-size: .84em; white-space: nowrap; }
.acc-page .acc-tbl td { font-size: .88em; vertical-align: middle; }
.acc-page .acc-tbl tr.row-debt    td { background: rgba(220,53,69,.08); }
.acc-page .acc-tbl tr.row-orphan  td { background: rgba(108,117,125,.06); }
.acc-page .acc-tbl tr.row-selected td { background: rgba(67,183,122,.10); }
.acc-page .acc-tbl tr:hover td { cursor: pointer; }
.acc-page .acc-tbl .bal-neg  { color: var(--status-danger, #dc3545); font-weight: 600; }
.acc-page .acc-tbl .bal-pos  { color: var(--status-success, #43b77a); }
.acc-page .acc-tbl .bal-zero { color: var(--text-muted, #6c757d); }

.acc-page .acc-col-chk { width: 30px; }
.acc-page .acc-col-id  { width: 64px; }
.acc-page .acc-col-act { width: 60px; }
.acc-page .acc-search-wrap { max-width: 280px; }
.acc-page .acc-perpage { width: auto; }

.acc-page .acc-th-sort { -webkit-user-select: none; -moz-user-select: none; user-select: none; cursor: pointer; }
.acc-page .acc-th-sort .sort-icon { color: var(--text-muted, #6c757d); font-size: .8em; margin-left: 2px; }

.acc-page tr.acc-row-flash td { animation: accRowFlash 1.5s ease-out; }
@keyframes accRowFlash {
    0%   { background: rgba(67,183,122,.35); }
    100% { background: transparent; }
}

/* dark theme — список */
[data-bs-theme="dark"] .acc-page .acc-tbl tr.row-debt   td { background: rgba(180,40,40,.18); }
[data-bs-theme="dark"] .acc-page .acc-tbl tr.row-orphan td { background: rgba(80,80,80,.18); }
[data-bs-theme="dark"] .acc-page .acc-tbl tr.row-selected td { background: rgba(67,183,122,.18); }
body.dark-theme .acc-page .acc-tbl tr.row-debt   td { background: rgba(180,40,40,.18); }
body.dark-theme .acc-page .acc-tbl tr.row-orphan td { background: rgba(80,80,80,.18); }

/* infinite scroll sentinel — невидимый элемент для IntersectionObserver */
.acc-scroll-sentinel { height: 1px; width: 100%; }

/* Toolbar row: поиск + кнопки в одну линию (поиск растягивается, кнопки справа) */
.acc-search-row {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}
.acc-search-row .acc-search-wrap {
    flex: 1 1 auto;
    min-width: 200px;
    max-width: none;
}
.acc-search-row .acc-toolbar-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
@media (max-width: 575px) {
    .acc-search-row { flex-wrap: wrap; }
    .acc-search-row .acc-search-wrap { flex: 1 1 100%; min-width: 0; }
}

/* === bulk toolbar === */
.acc-bulk-toolbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 12px; margin-bottom: 8px;
    background: linear-gradient(180deg, rgba(67,183,122,.10), rgba(67,183,122,.04));
    border: 1px solid rgba(67,183,122,.35);
    border-radius: 6px;
}
.acc-bulk-toolbar .acc-bulk-count { font-size: .9em; color: var(--text-muted, #6c757d); }
.acc-bulk-toolbar .acc-bulk-count strong { color: var(--brand-primary, #43b77a); }

[data-bs-theme="dark"] .acc-bulk-toolbar {
    background: linear-gradient(180deg, rgba(67,183,122,.18), rgba(67,183,122,.06));
    border-color: rgba(67,183,122,.45);
}

/* === модалка === */
.acc-modal-header {
    background: linear-gradient(90deg, rgba(67,183,122,.12), transparent);
}
.acc-modal-header .acc-modal-balance-badge {
    margin-left: 12px; padding: 2px 10px; border-radius: 14px;
    font-size: .82em; font-weight: 600; vertical-align: middle;
    background: rgba(108,117,125,.15); color: var(--text-muted, #6c757d);
}
.acc-modal-header .acc-modal-balance-badge.is-pos {
    background: rgba(67,183,122,.18); color: #2d8a5a;
}
.acc-modal-header .acc-modal-balance-badge.is-neg {
    background: rgba(220,53,69,.18); color: #b3344a;
}
[data-bs-theme="dark"] .acc-modal-header .acc-modal-balance-badge.is-pos { color: #6fdb9c; }
[data-bs-theme="dark"] .acc-modal-header .acc-modal-balance-badge.is-neg { color: #f08593; }

.acc-main-wrap {
    display: flex; min-height: 520px;
}
.acc-side-nav {
    flex: 0 0 220px; border-right: 1px solid var(--border-default, #dee2e6);
    background: rgba(0,0,0,.02); padding: 8px 0;
    display: flex; flex-direction: column;
}
[data-bs-theme="dark"] .acc-side-nav {
    background: rgba(255,255,255,.02);
    border-right-color: #2a2f37;
}
.acc-side-nav .acc-tab {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border: 0; background: transparent;
    color: inherit; text-align: left; cursor: pointer;
    border-left: 3px solid transparent;
    font-size: .92em; transition: background .15s;
}
.acc-side-nav .acc-tab:hover {
    background: rgba(67,183,122,.08);
}
.acc-side-nav .acc-tab:focus-visible {
    outline: 2px solid var(--brand-primary, #43b77a);
    outline-offset: -2px;
}
.acc-side-nav .acc-tab.is-active {
    background: rgba(67,183,122,.14);
    border-left-color: var(--brand-primary, #43b77a);
    font-weight: 600;
}
.acc-side-nav .acc-tab-num {
    display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center;
    border-radius: 50%; background: rgba(0,0,0,.08); color: inherit;
    font-size: .76em; font-weight: 600;
}
.acc-side-nav .acc-tab.is-active .acc-tab-num {
    background: var(--brand-primary, #43b77a); color: #fff;
}
.acc-side-nav .acc-tab-lbl { flex: 1 1 auto; }
.acc-side-nav .acc-tab-counter { font-size: .68em; }

.acc-content {
    flex: 1 1 auto; padding: 16px 20px;
    overflow-y: auto;
}
.acc-section[hidden] { display: none !important; }
.acc-section.is-active { display: block; }

.acc-card {
    background: var(--bg-elevated, #fff);
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 6px; padding: 14px 16px; margin-bottom: 14px;
}
[data-bs-theme="dark"] .acc-card {
    background: #1f242b; border-color: #2a2f37;
}
.acc-card-title {
    font-size: .92em; font-weight: 600; margin-bottom: 10px;
    color: var(--brand-primary, #43b77a);
}
.acc-card-title i { margin-right: 4px; }

/* build 1497: кнопка «Привязать абонента» — только иконка, фирменный градиент */
.acc-btn-add {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; color: #fff;
    background: linear-gradient(135deg, #43b77a 0%, #2d9a5f 100%);
    box-shadow: 0 1px 3px rgba(45,154,95,.35);
    transition: filter .15s, box-shadow .15s;
}
.acc-btn-add:hover { color: #fff; filter: brightness(1.07); box-shadow: 0 2px 6px rgba(45,154,95,.45); }
.acc-btn-add:active { filter: brightness(.95); }
.acc-btn-add:focus-visible { outline: 2px solid #43b77a; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .acc-btn-add { transition: none; } }

.acc-error-banner {
    padding: 10px 14px; margin-bottom: 12px;
    background: rgba(220,53,69,.12); color: #b3344a;
    border: 1px solid rgba(220,53,69,.35); border-radius: 6px;
    font-size: .92em;
}
[data-bs-theme="dark"] .acc-error-banner { color: #f08593; }

/* === вкладка Баланс === */
.acc-balance-hero {
    text-align: center; padding: 16px 12px 20px;
    background: linear-gradient(180deg, rgba(67,183,122,.08), transparent);
    border-radius: 8px; margin-bottom: 14px;
}
.acc-balance-big {
    font-size: 2.6rem; font-weight: 700; line-height: 1.1;
    margin-bottom: 6px;
}
.acc-balance-big.is-pos  { color: var(--status-success, #43b77a); }
.acc-balance-big.is-neg  { color: var(--status-danger, #dc3545); }
.acc-balance-big.is-zero { color: var(--text-muted, #6c757d); }
.acc-balance-formula {
    font-size: .82em; color: var(--text-muted, #6c757d);
    margin-bottom: 14px;
}
.acc-balance-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.acc-balance-actions .btn { min-width: 140px; min-height: 44px; }

.acc-balance-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.acc-balance-cell {
    text-align: center; padding: 10px 8px;
    background: rgba(0,0,0,.02); border-radius: 4px;
    display: flex; flex-direction: column; gap: 4px;
}
[data-bs-theme="dark"] .acc-balance-cell { background: rgba(255,255,255,.03); }
.acc-balance-cell .lbl { font-size: .76em; color: var(--text-muted, #6c757d); text-transform: none;   /* admin: без заглавных */ letter-spacing: .03em; }
.acc-balance-cell .val { font-size: 1.05em; font-weight: 600; }

.acc-balance-notes { margin-top: 12px; font-size: .88em; }
.acc-balance-notes > div { margin-bottom: 4px; }

/* === вкладка ФинОпы === */
.acc-fops-tbl tr.fop-in  td.fop-sum { color: var(--status-success, #43b77a); font-weight: 600; }
.acc-fops-tbl tr.fop-out td.fop-sum { color: var(--status-danger, #dc3545); font-weight: 600; }
.acc-fops-tbl tr.fop-storno td { text-decoration: line-through; opacity: .65; }
.acc-fops-tbl .fop-descr { max-width: 280px; }

/* === вкладка Абоненты === */
.acc-ab-tbl .acc-main-badge { font-size: .72em; }

/* === вкладка Уведомления === */
.acc-msg-list { list-style: none; padding: 0; margin: 0; }
.acc-msg-item {
    border-bottom: 1px solid var(--border-default, #dee2e6);
    padding: 8px 0; font-size: .88em;
}
.acc-msg-item:last-child { border-bottom: 0; }
.acc-msg-head { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.acc-msg-subject { font-weight: 600; }
.acc-msg-body { color: var(--text-muted, #6c757d); margin-top: 2px; }

/* === build 917+: расширенная шапка модалки (ФИО + договор + тариф + блокировки) === */
.acc-modal-abonent {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    flex-wrap: wrap;
    line-height: 1.2;
}
.acc-modal-abonent .acc-mab-link {
    color: var(--brand-primary, #43b77a);
    text-decoration: none;
    font-weight: 600;
}
.acc-modal-abonent .acc-mab-link:hover,
.acc-modal-abonent .acc-mab-link:focus-visible {
    text-decoration: underline;
}
.acc-modal-abonent .acc-mab-meta {
    font-size: 0.85em;
    color: var(--text-muted, #6c757d);
}
[data-bs-theme="dark"] .acc-modal-abonent .acc-mab-meta { color: #9ba1a8; }

.acc-modal-blocks { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.acc-modal-block-badge {
    font-size: 0.7em;
    vertical-align: middle;
    font-weight: 600;
    padding: 3px 7px;
}

/* === build 917+: финопеации с source-kind иконкой + чипы связей === */
.acc-fop-src {
    width: 36px;
    text-align: center;
    font-size: 1.05em;
}
.acc-fop-src.src-yookassa { color: #7b3fff; }
.acc-fop-src.src-w1       { color: #1976d2; }
.acc-fop-src.src-bank     { color: #2e7d32; }
.acc-fop-src.src-ebs      { color: #757575; }
.acc-fop-src.src-promise  { color: #e65100; }
.acc-fop-src.src-manual   { color: #00796b; }
.acc-fop-src.src-monthly  { color: #43b77a; }
.acc-fop-src.src-tarif    { color: #6a1b9a; }
.acc-fop-src.src-other    { color: #6c757d; }
[data-bs-theme="dark"] .acc-fop-src.src-ebs    { color: #9ba1a8; }
[data-bs-theme="dark"] .acc-fop-src.src-other  { color: #9ba1a8; }
[data-bs-theme="dark"] .acc-fop-src.src-monthly { color: #6fdb9c; }

.acc-fop-row { cursor: pointer; }
.acc-fop-row:hover { background-color: rgba(67, 183, 122, 0.05); }
[data-bs-theme="dark"] .acc-fop-row:hover { background-color: rgba(67, 183, 122, 0.10); }

.acc-fop-chip {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.05);
    font-size: 0.78em;
    text-decoration: none;
    line-height: 1.4;
}
.acc-fop-chip:hover { background: rgba(0,0,0,0.10); text-decoration: none; }
[data-bs-theme="dark"] .acc-fop-chip { background: rgba(255,255,255,0.06); }
[data-bs-theme="dark"] .acc-fop-chip:hover { background: rgba(255,255,255,0.12); }
.acc-fop-chip.chip-bank   { color: #2e7d32; background: rgba(46, 125, 50, 0.10); }
.acc-fop-chip.chip-usluga { color: #7b3fff; background: rgba(123, 63, 255, 0.10); }
.acc-fop-chip.chip-parent { color: #1976d2; background: rgba(25, 118, 210, 0.10); }
.acc-fop-chip.chip-storno { color: #6c757d; background: rgba(108, 117, 125, 0.15); }

.acc-fop-open {
    color: var(--brand-primary, #43b77a);
    padding: 0 6px;
}
.acc-fop-open:hover { color: var(--brand-primary-dark, #2d9a5f); }

/* Сторно строка — зачёркнутая */
.acc-fops-tbl tr.fop-storno { opacity: 0.6; text-decoration: line-through; }
.acc-fops-tbl tr.fop-storno .acc-fop-src,
.acc-fops-tbl tr.fop-storno .acc-fop-open { opacity: 0.7; }

/* === build 919+: вкладка «Банковские выписки» (Sprint 2) === */
.acc-bank-period .btn { font-size: 0.78em; padding: 2px 10px; }
.acc-bank-period .btn.active {
    background-color: var(--brand-primary, #43b77a);
    border-color: var(--brand-primary, #43b77a);
    color: #fff;
}

.acc-bank-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.acc-bank-sum-card {
    background: rgba(46, 125, 50, 0.06);
    border: 1px solid rgba(46, 125, 50, 0.18);
    border-radius: 6px;
    padding: 6px 12px;
    min-width: 140px;
}
.acc-bank-sum-card.acc-bank-sum-total {
    background: rgba(67, 183, 122, 0.10);
    border-color: var(--brand-primary, #43b77a);
}
.acc-bank-sum-name {
    font-size: 0.82em;
    color: var(--text-muted, #6c757d);
    margin-bottom: 2px;
}
.acc-bank-sum-stats { font-size: 0.95em; }
.acc-bank-sum-count { color: var(--text-muted, #6c757d); }
[data-bs-theme="dark"] .acc-bank-sum-card { background: rgba(46, 125, 50, 0.14); border-color: rgba(46, 125, 50, 0.32); }
[data-bs-theme="dark"] .acc-bank-sum-card.acc-bank-sum-total { background: rgba(67, 183, 122, 0.18); }
[data-bs-theme="dark"] .acc-bank-sum-name { color: #9ba1a8; }

.acc-bank-tbl { font-size: 0.92em; }
.acc-bank-tbl .fop-sum { font-variant-numeric: tabular-nums; }
.acc-bank-payer { max-width: 200px; }
.acc-bank-purpose {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted, #6c757d);
}
.acc-bank-row:hover { background-color: rgba(46, 125, 50, 0.04); }
[data-bs-theme="dark"] .acc-bank-row:hover { background-color: rgba(46, 125, 50, 0.10); }

.acc-bank-match-badge {
    font-size: 0.72em;
    padding: 2px 6px;
    font-weight: 600;
}

.acc-bank-empty {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    margin-top: 1rem;
}
[data-bs-theme="dark"] .acc-bank-empty { background: rgba(255, 255, 255, 0.03); }
.acc-bank-empty .acc-bank-empty-payments-link {
    color: var(--brand-primary, #43b77a);
    text-decoration: none;
}
.acc-bank-empty .acc-bank-empty-payments-link:hover { text-decoration: underline; }

/* === build 921+: вкладка «Услуги и тарифы» (Sprint 3) === */
.acc-srv-summary {
    padding: 8px 12px;
    border-radius: 6px;
}
.acc-srv-total { font-size: 1.05em; }
.acc-srv-ab-title {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-default, #dee2e6);
}
.acc-srv-ab-title a {
    color: var(--brand-primary, #43b77a);
    text-decoration: none;
}
.acc-srv-ab-title a:hover { text-decoration: underline; }
.acc-srv-tarif {
    padding: 6px 0;
    font-size: 0.95em;
}
.acc-srv-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.acc-srv-tbl {
    font-size: 0.88em;
    margin-bottom: 0;
}
.acc-srv-tbl .fop-sum { font-variant-numeric: tabular-nums; }
.acc-srv-bonuses summary {
    cursor: pointer;
    padding: 4px 0;
}
.acc-srv-bonuses summary:hover { color: var(--brand-primary, #43b77a); }
.acc-srv-abonent + .acc-srv-abonent {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-default, #dee2e6);
}
[data-bs-theme="dark"] .acc-srv-ab-title { border-bottom-color: #2a2f37; }
[data-bs-theme="dark"] .acc-srv-abonent + .acc-srv-abonent { border-top-color: #2a2f37; }

/* === build 922+: вкладка «Платёжные системы» (Sprint 4) === */
.acc-pay-channels { margin-bottom: 0.5rem; }
.acc-pay-channel {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.acc-pay-channel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
[data-bs-theme="dark"] .acc-pay-channel:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.32);
}
.acc-pay-ch-sum {
    font-size: 1.15em;
    font-variant-numeric: tabular-nums;
}
.acc-pay-integrations {
    background: rgba(0,0,0,0.02);
    padding: 8px 12px;
    border-radius: 6px;
}
[data-bs-theme="dark"] .acc-pay-integrations { background: rgba(255,255,255,0.03); }
.acc-pay-int-item { padding: 4px 0; font-size: 0.92em; }
.acc-pay-int-item + .acc-pay-int-item { border-top: 1px dashed var(--border-default, #dee2e6); }
[data-bs-theme="dark"] .acc-pay-int-item + .acc-pay-int-item { border-top-color: #2a2f37; }
.acc-pay-int-item a {
    color: var(--brand-primary, #43b77a);
    text-decoration: none;
}
.acc-pay-int-item a:hover { text-decoration: underline; }
.acc-card-subtitle {
    color: var(--text-muted, #6c757d);
    font-size: 0.95em;
    margin-bottom: 0.5rem;
}

/* === build 923+: P1-5 (свернуть нулевые) + P1-7 (KPI clickable) === */
.acc-balance-onlyost {
    margin-top: 4px;
    padding: 4px 8px;
}
.acc-bal-show-all {
    color: var(--brand-primary, #43b77a);
    text-decoration: none;
}
.acc-bal-show-all:hover { text-decoration: underline; }

.smit-stat.smit-stat-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.smit-stat.smit-stat-clickable:hover {
    background-color: rgba(67, 183, 122, 0.08);
}
.smit-stat.smit-stat-clickable:focus-visible {
    outline: 2px solid var(--brand-primary, #43b77a);
    outline-offset: 2px;
}
.smit-stat.smit-stat-clickable:active { transform: scale(0.98); }
[data-bs-theme="dark"] .smit-stat.smit-stat-clickable:hover {
    background-color: rgba(67, 183, 122, 0.14);
}

/* === a11y === */
.acc-modal-header :focus-visible,
.acc-content :focus-visible {
    outline: 2px solid var(--brand-primary, #43b77a);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    tr.acc-row-flash td { animation: none; background: rgba(67,183,122,.18); }
    .acc-side-nav .acc-tab { transition: none; }
}

/* === mobile (≤768px) === */
@media (max-width: 768px) {
    .acc-page .acc-bulk-toolbar { padding: 6px 8px; }
    .acc-page .acc-tbl { font-size: .84em; }

    .acc-main-wrap { flex-direction: column; min-height: 0; }
    .acc-side-nav {
        flex: 0 0 auto; flex-direction: row; overflow-x: auto;
        border-right: 0; border-bottom: 1px solid var(--border-default, #dee2e6);
        padding: 4px 6px;
    }
    .acc-side-nav .acc-tab {
        flex: 0 0 auto; border-left: 0; border-bottom: 3px solid transparent;
        padding: 8px 10px; white-space: nowrap;
    }
    .acc-side-nav .acc-tab.is-active {
        border-left: 0; border-bottom-color: var(--brand-primary, #43b77a);
    }
    .acc-side-nav .acc-tab-lbl { font-size: .9em; }

    .acc-content { padding: 12px; }
    .acc-balance-big { font-size: 2rem; }
    .acc-balance-grid { grid-template-columns: repeat(2, 1fr); }
    .acc-balance-actions .btn { flex: 1 1 auto; min-width: 0; }

    /* build 917+: шапка модалки на mobile — ФИО на отдельной строке */
    .acc-modal-header .modal-title { flex-wrap: wrap; }
    .acc-modal-abonent {
        display: flex;
        flex-basis: 100%;
        margin-left: 0;
        margin-top: 4px;
        font-size: 0.85em;
    }
    .acc-modal-abonent .acc-mab-name { margin-right: 0.25rem; }
    .acc-modal-block-badge { font-size: 0.65em; }

    /* финопеации на mobile: скрыть колонку № операции (полезна, но не критична) */
    .acc-fops-tbl thead th:nth-child(2),
    .acc-fops-tbl tbody td:nth-child(2) { display: none; }
    .acc-fops-tbl thead th:nth-child(3),
    .acc-fops-tbl tbody td:nth-child(3) { font-size: 0.82em; }
    .acc-fop-src { width: 28px; font-size: 0.95em; }
    .acc-fop-chip { font-size: 0.7em; padding: 1px 4px; }

    /* build 919+: банк. выписки на mobile — скрыть колонки «Сопоставление» и «Опер.» */
    .acc-bank-tbl thead th:nth-child(6),
    .acc-bank-tbl tbody td:nth-child(6) { display: none; }
    .acc-bank-purpose { max-width: 120px; }
    .acc-bank-sum-card { min-width: 120px; flex: 1 1 auto; }
}

@media (max-width: 480px) {
    .acc-balance-big { font-size: 1.7rem; }
    .acc-balance-actions { flex-direction: column; }
    .acc-balance-actions .btn { width: 100%; }
}

/* touch targets >=44px (a11y-touch-target-design) */
.acc-page .btn-sm { min-height: 32px; }
.acc-balance-actions .btn { min-height: 44px; }
.acc-side-nav .acc-tab { min-height: 44px; }

/* === payment_modal (Sprint 2) === */
.acc-pay-modal .acc-pay-header {
    background: linear-gradient(90deg, rgba(67,183,122,.10), transparent);
}
.acc-pay-modal .acc-pay-context {
    padding: 8px 12px; margin-bottom: 12px;
    background: rgba(0,0,0,.03); border-radius: 6px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
[data-bs-theme="dark"] .acc-pay-modal .acc-pay-context { background: rgba(255,255,255,.04); }
.acc-pay-modal .acc-pay-current-bal { margin-left: auto; font-size: .92em; }

.acc-pay-modal .acc-pay-advanced summary {
    cursor: pointer; padding: 4px 0;
    -webkit-user-select: none; -moz-user-select: none; user-select: none;
}
.acc-pay-modal .acc-pay-advanced[open] summary { color: var(--brand-primary, #43b77a); }

.acc-pay-modal .acc-pay-preview {
    margin-top: 14px; padding: 10px 14px;
    background: linear-gradient(180deg, rgba(67,183,122,.08), rgba(67,183,122,.02));
    border: 1px solid rgba(67,183,122,.30); border-radius: 6px;
}
.acc-pay-modal .acc-pay-preview-row {
    display: flex; justify-content: space-between; padding: 3px 0;
}
.acc-pay-modal .acc-pay-preview-result {
    border-top: 1px dashed rgba(67,183,122,.40);
    margin-top: 6px; padding-top: 8px; font-size: 1.05em;
}
[data-bs-theme="dark"] .acc-pay-modal .acc-pay-preview {
    background: linear-gradient(180deg, rgba(67,183,122,.16), rgba(67,183,122,.04));
    border-color: rgba(67,183,122,.40);
}

@media (max-width: 480px) {
    .acc-pay-modal .acc-pay-context { flex-direction: column; align-items: flex-start; gap: 4px; }
    .acc-pay-modal .acc-pay-current-bal { margin-left: 0; }
}

/* === abonent_link_modal (Sprint 3) === */
.acc-link-results {
    margin-top: 8px;
    max-height: 280px; overflow-y: auto;
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 6px;
}
.acc-link-results:empty { display: none; }
[data-bs-theme="dark"] .acc-link-results { border-color: #2a2f37; }

.acc-link-result-item {
    display: block; width: 100%; text-align: left;
    padding: 8px 12px; border: 0;
    background: transparent; color: inherit;
    border-bottom: 1px solid var(--border-default, #dee2e6);
    cursor: pointer; transition: background .12s;
    min-height: 44px;
}
.acc-link-result-item:last-child { border-bottom: 0; }
.acc-link-result-item:hover { background: rgba(67,183,122,.08); }
.acc-link-result-item:focus-visible {
    outline: 2px solid var(--brand-primary, #43b77a);
    outline-offset: -2px;
}
.acc-link-result-item.is-selected {
    background: rgba(67,183,122,.18); font-weight: 600;
}
[data-bs-theme="dark"] .acc-link-result-item:hover { background: rgba(67,183,122,.14); }
[data-bs-theme="dark"] .acc-link-result-item.is-selected { background: rgba(67,183,122,.24); }
[data-bs-theme="dark"] .acc-link-result-item { border-bottom-color: #2a2f37; }

/* ═══════════════════════════════════════════════════════════════════
   SMIT mobile filter sheet — переиспользуемый паттерн (build 646)
   Кнопка-триггер «🎚 Фильтры» в mg-toolbar (видна только d-md-none)
   открывает offcanvas-bottom со всеми фильтрами раздела.
   Применяется в /admin/debtors/, можно переиспользовать в любом списке.
   ═══════════════════════════════════════════════════════════════════ */

/* Триггер «Фильтры» в toolbar (mobile-only через d-md-none на элементе) */
.smit-mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
}
.smit-mobile-filter-trigger .smit-filter-count {
    background: var(--brand-primary, #43b77a);
    color: #fff;
    border-radius: 999px;
    padding: 0 8px;
    margin-left: 4px;
    font-size: 11px;
    line-height: 18px;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Offcanvas bottom-sheet с фильтрами.

   Высота:
   - height: auto = адаптируется под контент
   - max-height: 90vh = почти весь экран при много фильтрах
   - min-height: 50vh = минимум места при коротком контенте (sheet не схлопывается)
   - .offcanvas-body растягивается и скроллится — много фильтров не страшно
*/
.smit-mobile-filter-sheet {
    /* build 772: высота подстраивается под контент (height:auto), но не больше 80vh.
       Раньше было height:80vh — короткие фильтры (1-2 секции) висели в полупустой панели. */
    height: auto !important;
    max-height: 80vh !important;
    /* всегда непрозрачный фон — фильтр-лист над контентом/картой должен быть читаем */
    background: #fff !important;
    background-color: #fff !important;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -8px 24px rgba(0,0,0,.18);
    display: flex !important;
    flex-direction: column;
}
/* Decorative drag-handle (визуальная подсказка свайпа) */
.smit-mobile-filter-sheet::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border-default, #dee2e6);
    border-radius: 999px;
    margin: 8px auto 0;
    flex-shrink: 0;
}
.smit-mobile-filter-sheet .offcanvas-header {
    padding: 8px 18px 12px;
    border-bottom: 1px solid var(--border-subtle, #dee2e6);
    flex-shrink: 0;
}
.smit-mobile-filter-sheet .offcanvas-title {
    font-size: 1rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
}
.smit-mobile-filter-sheet .offcanvas-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* Секция внутри sheet (заголовок + чипы или поля) */
.smit-sheet-section {
    border-bottom: 1px solid var(--border-subtle, #dee2e6);
    padding-bottom: 14px;
    margin-bottom: 14px;
}
.smit-sheet-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 8px;
}
.smit-sheet-section h6 {
    font-size: .8rem;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .04em;
    color: var(--text-muted, #6c757d);
    margin-bottom: 10px;
    font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
}

/* Чипы внутри sheet — крупнее (touch ≥44px) */
.smit-sheet-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.smit-sheet-chips .btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: .85rem;
    border-radius: 999px;
}
/* Active state для чипов в sheet (как в mg-chips) */
.smit-sheet-chips .btn.active,
.smit-sheet-chips .btn[aria-pressed="true"] {
    background: #198754 !important;
    color: #fff !important;
    border-color: #198754 !important;
}
.smit-sheet-chips .btn[data-flag="promise_pay"].active,
.smit-sheet-chips .btn[data-flag="promise_pay"][aria-pressed="true"] {
    background: #0dcaf0 !important; border-color: #0dcaf0 !important; color: #000 !important;
}
.smit-sheet-chips .btn[data-period="mid"].active,
.smit-sheet-chips .btn[data-period="old"].active {
    background: #b58105 !important; border-color: #b58105 !important;
}
.smit-sheet-chips .btn[data-period="chronic"].active {
    background: #dc3545 !important; border-color: #dc3545 !important;
}

/* Range inputs внутри sheet */
.smit-sheet-range {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}
.smit-sheet-range label {
    font-size: .85rem;
    color: var(--text-muted, #6c757d);
    margin: 0;
}
.smit-sheet-range input {
    min-height: 40px;
    font-size: 16px;       /* ≥16 чтобы iOS не зумил */
}

/* Sticky действия снизу sheet (Применить/Сбросить) — build 720 fix */
.smit-sheet-actions {
    display: flex; gap: 10px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    margin: 8px -18px 0;   /* растягиваем во всю ширину offcanvas-body */
    padding-left: 18px;
    padding-right: 18px;
    position: sticky;
    bottom: -1px;          /* iOS Safari rounding hack — закрывает 1px щель снизу */
    background: #fff;
    border-top: 1px solid var(--border-subtle, #dee2e6);
    box-shadow: 0 -4px 12px rgba(0,0,0,.04);
    z-index: 5;
}
.smit-sheet-actions .btn {
    min-height: 44px;
    font-size: .95rem;
    font-weight: 600;
}
/* offcanvas-body: место под sticky-actions, чтобы не перекрывал последний sheet-section */
.smit-mobile-filter-sheet .offcanvas-body { padding-bottom: 0 !important; }

[data-bs-theme="dark"] .smit-sheet-actions { background: #1e2228; border-top-color: #2c3038; }
[data-bs-theme="dark"] .smit-mobile-filter-sheet { background: #1e2228; }

/* ═══ Dark theme для mobile filter sheet (build 723) ═══
   Применяется и через [data-bs-theme="dark"] и через body.dark-theme
   (на разных страницах используются разные механизмы установки тёмной темы) */

/* Триггер «Фильтры N» в toolbar (build 724: тёмный фон в dark) */
body.dark-theme .smit-mobile-filter-trigger,
[data-bs-theme="dark"] .smit-mobile-filter-trigger {
    background: #2a2f37 !important;
    color: #65d0a0 !important;
    border-color: #3a3f47 !important;
}
body.dark-theme .smit-mobile-filter-trigger:hover,
body.dark-theme .smit-mobile-filter-trigger:focus,
[data-bs-theme="dark"] .smit-mobile-filter-trigger:hover,
[data-bs-theme="dark"] .smit-mobile-filter-trigger:focus {
    background: #353b44 !important;
    color: #fff !important;
    border-color: var(--brand-primary, #43b77a) !important;
}
body.dark-theme .smit-mobile-filter-trigger .smit-filter-count,
[data-bs-theme="dark"] .smit-mobile-filter-trigger .smit-filter-count {
    background: var(--brand-primary, #43b77a);
    color: #fff;
}

/* Sheet — фон, текст, заголовок, drag-handle */
body.dark-theme .smit-mobile-filter-sheet { background: #1e2228; color: #e7eaf0; }
body.dark-theme .smit-mobile-filter-sheet::before,
[data-bs-theme="dark"] .smit-mobile-filter-sheet::before { background: #3a3f47; }
body.dark-theme .smit-mobile-filter-sheet .offcanvas-header,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .offcanvas-header { border-bottom-color: #2c3038; }
body.dark-theme .smit-mobile-filter-sheet .offcanvas-title,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .offcanvas-title { color: #e7eaf0; }
body.dark-theme .smit-mobile-filter-sheet .btn-close,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Section headers */
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-section,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-section { border-bottom-color: #2c3038; }
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-section h6,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-section h6 { color: #9aaab4; }

/* Chips: outline-стиль без active — фон #2a2f37, текст светлый */
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-chips .btn,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-chips .btn {
    background: #2a2f37;
    color: #c8d0d8;
    border-color: #3a3f47;
}
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-chips .btn:hover,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-chips .btn:hover {
    background: #353b44;
    color: #fff;
    border-color: #4a5260;
}
/* Active chip: brand-primary fill (поверх любых .btn-outline-*) */
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-chips .btn.active,
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-chips .btn[aria-pressed="true"],
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-chips .btn.active,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-chips .btn[aria-pressed="true"] {
    background: var(--brand-primary, #43b77a) !important;
    color: #fff !important;
    border-color: var(--brand-primary, #43b77a) !important;
}

/* Inputs / selects внутри sheet */
body.dark-theme .smit-mobile-filter-sheet .form-control,
body.dark-theme .smit-mobile-filter-sheet .form-select,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-control,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-select {
    background: #2a2f37;
    color: #e7eaf0;
    border-color: #3a3f47;
}
body.dark-theme .smit-mobile-filter-sheet .form-control::placeholder,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-control::placeholder {
    color: #6a7682;
}
body.dark-theme .smit-mobile-filter-sheet .form-control:focus,
body.dark-theme .smit-mobile-filter-sheet .form-select:focus,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-control:focus,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-select:focus {
    background: #2a2f37;
    color: #fff;
    border-color: var(--brand-primary, #43b77a);
    box-shadow: 0 0 0 .2rem rgba(67, 183, 122, .25);
}
/* Select option text (option сам не темнеет в native, но фон форсим) */
body.dark-theme .smit-mobile-filter-sheet .form-select option,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .form-select option {
    background: #2a2f37;
    color: #e7eaf0;
}

/* smit-sheet-range labels */
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-range label,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-range label {
    color: #9aaab4;
}

/* Toggle-list (ab-sheet-toggle-*) — переопределяет светлые стили */
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-list,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-list {
    background: #2a2f37;
    border-color: #3a3f47;
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row .ab-sheet-toggle-name,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row .ab-sheet-toggle-name {
    color: #e7eaf0;
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row .ab-sheet-toggle-count,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row .ab-sheet-toggle-count {
    background: rgba(255, 255, 255, .08);
    color: #9aaab4;
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row:hover,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row:hover {
    background: rgba(67, 183, 122, .12);
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row:not(:last-child),
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row:not(:last-child) {
    border-bottom-color: #353b44;
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row .form-check-input,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row .form-check-input {
    background-color: #3a3f47;
    border-color: #4a5260;
}
body.dark-theme .smit-mobile-filter-sheet .ab-sheet-toggle-row .form-check-input:checked,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .ab-sheet-toggle-row .form-check-input:checked {
    background-color: var(--brand-primary, #43b77a);
    border-color: var(--brand-primary, #43b77a);
}

/* Sticky-actions: фон + reset-кнопка */
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-actions,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-actions {
    background: #1e2228;
    border-top-color: #2c3038;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .4);
}
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-actions .btn-outline-secondary,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-actions .btn-outline-secondary {
    color: #c8d0d8;
    border-color: #3a3f47;
}
body.dark-theme .smit-mobile-filter-sheet .smit-sheet-actions .btn-outline-secondary:hover,
[data-bs-theme="dark"] .smit-mobile-filter-sheet .smit-sheet-actions .btn-outline-secondary:hover {
    background: #2a2f37;
    color: #fff;
    border-color: #4a5260;
}

/* ─── Toggle-switch list внутри sheet (build 720) ─── */
.ab-sheet-toggle-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle, #dee2e6);
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}
.ab-sheet-toggle-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 12px;
    min-height: 44px;       /* touch target */
    cursor: pointer;
    border-radius: 6px;
    transition: background .12s;
}
.ab-sheet-toggle-row:hover { background: rgba(67, 183, 122, .06); }
.ab-sheet-toggle-row:not(:last-child) { border-bottom: 1px solid #f1f3f5; border-radius: 0; }
.ab-sheet-toggle-row .form-check-input {
    flex-shrink: 0;
    width: 2.2em;
    height: 1.2em;
    margin: 0;
    cursor: pointer;
}
.ab-sheet-toggle-row .form-check-input:checked {
    background-color: var(--brand-primary, #43b77a);
    border-color: var(--brand-primary, #43b77a);
}
.ab-sheet-toggle-row .ab-sheet-toggle-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .92rem;
    color: var(--text-primary, #212529);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ab-sheet-toggle-row .ab-sheet-toggle-count {
    flex-shrink: 0;
    font-size: .8rem;
    color: var(--text-muted, #6c757d);
    background: rgba(0,0,0,.04);
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 32px;
    text-align: center;
}
[data-bs-theme="dark"] .ab-sheet-toggle-list { background: #2a2f37; border-color: #3a3f47; }
[data-bs-theme="dark"] .ab-sheet-toggle-row:hover { background: rgba(67, 183, 122, .12); }
[data-bs-theme="dark"] .ab-sheet-toggle-row:not(:last-child) { border-bottom-color: #3a3f47; }
[data-bs-theme="dark"] .ab-sheet-toggle-row .ab-sheet-toggle-count { background: rgba(255,255,255,.06); }

/* ═══════════════════════════════════════════════════════════════════════
   Mobile search bar (build 729) — slide-down popup из шапки
   ═══════════════════════════════════════════════════════════════════════ */

#mobile-search-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1090;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    transform: translateY(-100%);
    transition: transform .25s ease, opacity .2s ease;
    opacity: 0;
}
#mobile-search-bar:not(.d-none) {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
}
#mobile-search-bar form { width: 100%; }
#mobile-search-bar .form-control,
#mobile-search-bar .btn {
    height: 40px;
    min-height: 40px;
    font-size: 16px;            /* iOS: ≥16 чтобы не зумило */
    padding: 6px 12px;
}
#mobile-search-bar .btn { padding-left: 14px; padding-right: 14px; flex: 0 0 auto; }
#mobile-search-bar .btn i { font-size: 14px; }

/* Dark theme */
body.dark-theme #mobile-search-bar,
[data-bs-theme="dark"] #mobile-search-bar {
    background: #22262c;
    border-bottom-color: #3a3f47;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}
body.dark-theme #mobile-search-bar .form-control,
[data-bs-theme="dark"] #mobile-search-bar .form-control {
    background: #2a2f37;
    color: #e7eaf0;
    border-color: #3a3f47;
}
body.dark-theme #mobile-search-bar .form-control::placeholder,
[data-bs-theme="dark"] #mobile-search-bar .form-control::placeholder {
    color: #6a7682;
}
body.dark-theme #mobile-search-bar .form-control:focus,
[data-bs-theme="dark"] #mobile-search-bar .form-control:focus {
    background: #2a2f37;
    color: #fff;
    border-color: var(--brand-primary, #43b77a);
    box-shadow: 0 0 0 .2rem rgba(67, 183, 122, .25);
}
body.dark-theme #mobile-search-bar .btn-outline-secondary,
[data-bs-theme="dark"] #mobile-search-bar .btn-outline-secondary {
    color: #c8d0d8;
    border-color: #3a3f47;
    background: #2a2f37;
}
body.dark-theme #mobile-search-bar .btn-outline-secondary:hover,
[data-bs-theme="dark"] #mobile-search-bar .btn-outline-secondary:hover {
    background: #353b44;
    color: #fff;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #mobile-search-bar { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   abonent-title-bar mobile (build 802/804 — запрос Марии 2026-05-13)
   ═══════════════════════════════════════════════════════════════════════
   Структура на mobile через CSS Grid: 3 ряда × 2 колонки + 4-й full-width
   ┌──────────────────────────────────────────────────────────────┐
   │ ←                                                  2025_Супер │  row 1: back / tarif
   │ #6713 Абонент №6713                                   7,19 ₽ │  row 2: id+name / balance
   │ ✓ Активен                                          1199 ₽/мес │  row 3: badge / cost
   ├──────────────────────────────────────────────────────────────┤
   │ 💾 🖨 📄 ⏸ 🔌 🗑 ℹ                                              │  row 4: action-icons full width
   ├──────────────────────────────────────────────────────────────┤
   │ Информация · Операции · Аккаунты · Сессии · ...                │  вкладки на ВСЮ ширину окна
   └──────────────────────────────────────────────────────────────┘
   Все 3 ряда: левая часть align-left, правая align-right.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* build 896: новый mobile-layout шапки карточки абонента (target: 2.jpg)
         row 1: [← back] [#ID] ─────────────────────────────────── (пусто справа)
         row 2: [ФИО full-left] ────────────────────────── [баланс справа]
         row 3: [тариф-чип left] ───────────────────────── [цена ₽/мес справа]
         row 4: [💾 🖨 📄 ⏸ 🔌 🗑] ────────────────── [ℹ зелёный]
       H1 имеет display:contents — его дети (id/name/badge) распределяются
       как прямые потомки grid. */
    .abonent-title-bar {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        grid-auto-rows: auto;
        align-items: center !important;
        gap: 4px 8px !important;
        flex-wrap: unset !important;
    }

    /* Row 1 col 1 — Стрелка «Назад» */
    .abonent-title-bar .abonent-title-back {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
        align-self: center;
        display: inline-flex !important;
        align-items: center;
    }

    /* H1 — display:contents, дети раскладываются по grid напрямую */
    .abonent-title-bar h1.abonent-title-h1,
    .abonent-title-bar .abonent-title-h1 {
        display: contents !important;
        margin: 0 !important;
    }

    /* build 1398: аватарка абонента слева, на всю высоту #ID+ФИО (как на скрине).
       :has() — сдвигаем #ID и ФИО в колонку 2, только когда аватарка есть. */
    .abonent-title-bar > .ab-avatar-img {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
        justify-self: start;
        width: 54px !important;
        height: 54px !important;
        margin: 0 !important;
    }
    .abonent-title-bar:has(> .ab-avatar-img) .abonent-title-id { grid-column: 2 / -1 !important; }
    .abonent-title-bar:has(> .ab-avatar-img) .abonent-title-name { grid-column: 2 / -1 !important; }
    /* Row 1 col 2 — #ID, рядом с back-кнопкой (или после аватарки) */
    .abonent-title-bar .abonent-title-id {
        grid-row: 1;
        grid-column: 2 / -1;
        justify-self: start;
        align-self: center;
        font-size: .95rem !important;
        font-weight: 600 !important;
        color: #6c757d !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }

    /* Row 2 — ФИО (слева) */
    .abonent-title-bar .abonent-title-name {
        grid-row: 2;
        grid-column: 1 / 3;
        justify-self: start;
        align-self: center;
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        width: auto;
        word-break: break-word;
        display: flex !important;
        align-items: center !important;
    }

    /* Row 3 col 1-2 — тариф-чип (.abonent-title-badge внутри h1) показываем на mobile */
    .abonent-title-bar .abonent-title-badge {
        grid-row: 3;
        grid-column: 1 / 3;
        justify-self: start;
        align-self: center;
        margin: 0 !important;
        display: inline-flex !important;
        font-size: .8rem !important;
    }
    .abonent-title-bar .abonent-title-badge ~ .abonent-title-badge {
        margin-left: 4px !important;
    }

    /* Balance-wrap — display:contents чтобы дети попали прямо в grid */
    .abonent-title-bar .abonent-title-balance-wrap {
        display: contents !important;
    }
    /* Тариф над балансом (build 805 скрывал) — оставляем скрытым, тариф-чип в h1 уже на row 3 */
    .abonent-title-bar .abonent-title-tarif-mobile {
        display: none !important;
    }
    /* Row 2 col 3 — баланс справа от ФИО */
    .abonent-title-bar .abonent-title-balance,
    .abonent-title-bar .abonent-title-balance-positive,
    .abonent-title-bar .abonent-title-balance-low {
        grid-row: 2;
        grid-column: 3;
        justify-self: end;
        align-self: end;
        order: unset;
        font-size: 1.05rem !important;
        white-space: nowrap;
        padding: 6px 12px !important;
    }
    /* Row 3 col 3 — цена ₽/мес справа от тариф-чипа */
    .abonent-title-bar .abonent-title-cost-mobile {
        grid-row: 3;
        grid-column: 3;
        justify-self: end;
        align-self: center;
        order: unset;
        font-size: .8rem !important;
        line-height: 1.2;
    }

    /* Wrapper-div (родитель balance-wrap + #ab-title-actions + info-icon) — display:contents */
    .abonent-title-bar > div.d-flex.align-items-center.gap-1.ms-auto,
    .abonent-title-bar > div.ms-auto {
        display: contents !important;
    }

    /* Row 4 col 1-2 — Action-icons (save/print/csv/pause/power/del) */
    .abonent-title-bar #ab-title-actions {
        grid-row: 4;
        grid-column: 1 / 3;
        display: flex !important;
        width: 100% !important;
        gap: 4px !important;
        flex-wrap: nowrap;
        justify-content: flex-start !important;
        align-items: center !important;
        margin-top: 8px !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(0,0,0,.08);
    }
    /* Row 4 col 3 — ℹ без фона, иконка тёмно-серая с прозрачностью (видна на любом фоне) */
    .abonent-title-bar .abonent-title-info {
        display: inline-flex !important;
        grid-row: 4;
        grid-column: 3;
        justify-self: end;
        align-self: center;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important; height: auto !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: rgba(0, 0, 0, 0.55) !important;
        opacity: 0.85 !important;
        text-decoration: none !important;
        margin: 8px 0 0 0 !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(0,0,0,.08);
        box-sizing: border-box;
        font-size: 1.3rem !important;
    }
    .abonent-title-bar .abonent-title-info i {
        font-size: 1.3rem !important;
    }
    .abonent-title-bar .abonent-title-info:hover {
        background: transparent !important;
        color: #43b77a !important;
        opacity: 1 !important;
    }
    body.dark-theme .abonent-title-bar .abonent-title-info,
    [data-bs-theme="dark"] .abonent-title-bar .abonent-title-info {
        background: transparent !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }
    body.dark-theme .abonent-title-bar .abonent-title-info:hover,
    [data-bs-theme="dark"] .abonent-title-bar .abonent-title-info:hover {
        color: #65d0a5 !important;
    }
    .abonent-title-bar .abonent-title-info-stub-row4 {
        display: inline-flex !important;
        grid-row: 4;
        grid-column: 3;
        justify-self: end;
        margin-top: 8px;
    }

    /* Вкладки на ВСЮ ширину окна (от края до края, без отступов container'а).
       Container-fluid на mobile имеет padding-left: 0.5rem, padding-right: 0 —
       компенсируем negative margin. */
    .ab-navbar-tabs {
        margin-left: -0.5rem !important;
        margin-right: 0 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        width: calc(100% + 0.5rem) !important;
        max-width: none !important;
    }
    /* Контейнер табов внутри карточки (.ab-navbar) — тоже без padding */
    .abonent-title-bar + .ab-navbar,
    .ab-navbar {
        margin-left: -0.5rem !important;
        margin-right: 0 !important;
        width: calc(100% + 0.5rem) !important;
    }

    /* build 888: убираем пустое пространство под панелью вкладок на mobile
       (скрываем горизонтальный scrollbar — занимает ~4px высоты, заметен под активной вкладкой) */
    .ab-navbar-tabs {
        overflow-y: hidden !important;
        scrollbar-width: none !important;
    }
    .ab-navbar-tabs::-webkit-scrollbar {
        height: 0 !important;
        display: none !important;
    }
    .ab-navbar {
        min-height: 44px !important;
        border-bottom-width: 1px !important;
        margin-bottom: 0 !important;
    }

    /* build 888: активная вкладка — фирменный зелёный градиент (как у логотипа .smit-logo-icon)
       Высокая специфичность через двойной .ab-navbar-tabs.ab-navbar-tabs чтобы перебить
       inline-стиль `.ab-navbar-tabs .nav-link.active { background-color: var(--brand-primary) }`
       из abonents_edit_one.html. */
    .ab-navbar-tabs.ab-navbar-tabs .nav-link.active,
    .ab-navbar-tabs.ab-navbar-tabs.nav-tabs .nav-link.active {
        background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
        background-image: linear-gradient(135deg, #43b77a, #3cbfae) !important;
        color: #fff !important;
        box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
    }

    /* build 891: Mobile modern-mobile-menu — плавающая капсула снизу экрана.
       Скрываем старую горизонтальную полосу вкладок (.ab-navbar) на mobile
       ТОЛЬКО когда bottom-nav реально присутствует в DOM (build 893: настройка
       ABONENT_PROFILE_TABS_STYLE_MOBILE='bottom_nav'). Если bottom-nav не отрисован
       (режим 'classic') — показываем обычные вкладки. */
    body:has(#ab-mobile-bottom-nav) .ab-navbar { display: none !important; }

    /* build 905: компактный bottom-nav с эффектом матового стекла.
       Высота уменьшена с 48px до 36px. Лейбл скрыт под иконками
       (показываем только на активной вкладке, либо в sheet «Ещё»).
       Frosted-glass: усиленный blur 22px + saturate 200% + slabby gradient.
       Body-spacer build 891 (padding-bottom 84px) уменьшен до 56px. */
    .ab-mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 1040;
        display: flex;
        align-items: center;
        gap: 2px;
        padding: 3px 5px;
        background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.78));
        -webkit-backdrop-filter: saturate(200%) blur(22px);
        backdrop-filter: saturate(200%) blur(22px);
        border: 1px solid rgba(255, 255, 255, .55);
        border-radius: 999px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .14),
                    0 2px 6px rgba(15, 23, 42, .08),
                    inset 0 1px 0 rgba(255, 255, 255, .6);
    }
    .ab-mbn-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 0;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    /* build 907+908: все элементы — flex:0 0 auto (по содержимому).
       Активная вкладка тоже не растягивается — ширина равна
       иконка+лейбл+padding. Распределение свободного пространства
       идёт через .ab-mbn-list { justify-content: space-around }. */
    .ab-mbn-item {
        flex: 0 0 auto;
        min-width: 0;
    }
    .ab-mbn-item.is-active {
        flex: 0 0 auto;
        min-width: 0;
    }
    .ab-mbn-link {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 5px 8px;
        min-height: 32px;
        min-width: 32px;
        border-radius: 999px;
        text-decoration: none;
        color: #4a5b56;
        font-size: .68rem;
        font-weight: 600;
        line-height: 1.1;
        position: relative;
        transition: background-color .2s ease, color .2s ease, transform .15s ease, padding .2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .ab-mbn-link i.fas {
        font-size: .9rem;
        opacity: .8;
        transition: transform .2s ease;
    }
    /* По умолчанию label скрыт — иконка-only режим */
    .ab-mbn-link .ab-mbn-label {
        max-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        opacity: 0;
        transition: max-width .25s ease, opacity .2s ease;
    }
    .ab-mbn-link .ab-mbn-badge {
        position: absolute;
        top: 2px;
        right: 4px;
        background: #dc3545;
        color: #fff;
        font-size: .54rem;
        font-weight: 700;
        line-height: 1;
        padding: 2px 4px;
        border-radius: 999px;
        min-width: 14px;
        text-align: center;
    }
    /* Активная вкладка — pill с лейблом видимым.
       build 908: pill размером по контенту, без width:100% */
    .ab-mbn-item.is-active .ab-mbn-link {
        background: linear-gradient(135deg, #43b77a, #3cbfae);
        color: #fff;
        box-shadow: 0 3px 10px rgba(67, 183, 122, .35);
        padding-left: 10px;
        padding-right: 12px;
        flex: 0 0 auto;
        width: auto;
    }
    .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-label {
        max-width: 110px;
        opacity: 1;
    }
    .ab-mbn-item.is-active .ab-mbn-link i.fas {
        opacity: 1;
        transform: scale(1.05);
    }
    .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-badge {
        background: rgba(255, 255, 255, .25);
        color: #fff;
    }
    .ab-mbn-link:active {
        transform: scale(.95);
    }
    .ab-mbn-link:focus-visible {
        outline: 2px solid #43b77a;
        outline-offset: 2px;
    }

    /* Кнопка «Ещё» — компактная, только иконка */
    .ab-mbn-more {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 5px 8px;
        min-height: 34px;
        background: rgba(15, 23, 42, .05);
        border: 0;
        border-radius: 999px;
        color: #4a5b56;
        cursor: pointer;
        transition: background-color .15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .ab-mbn-more:hover { background: rgba(15, 23, 42, .1); }
    .ab-mbn-more:focus-visible {
        outline: 2px solid #43b77a;
        outline-offset: 2px;
    }
    .ab-mbn-more i.fas { font-size: .9rem; }
    /* «Ещё» — лейбл скрыт по умолчанию (только иконка) */
    .ab-mbn-more-label {
        display: none;
    }

    /* Sheet с полным списком вкладок */
    .ab-mbn-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .35);
        z-index: 1050;
        opacity: 0;
        transition: opacity .22s ease;
    }
    .ab-mbn-sheet-backdrop.is-open { opacity: 1; }
    .ab-mbn-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1055;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 28px rgba(15, 23, 42, .22);
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform .22s ease-out;
    }
    .ab-mbn-sheet.is-open { transform: translateY(0); }
    .ab-mbn-sheet-handle {
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(15, 23, 42, .18);
    }
    .ab-mbn-sheet-head {
        padding: 18px 16px 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(15, 23, 42, .08);
    }
    .ab-mbn-sheet-head strong {
        font-size: .95rem;
        color: #2c3e50;
    }
    .ab-mbn-sheet-close {
        background: none;
        border: 0;
        color: #6c757d;
        font-size: 1rem;
        padding: 4px 8px;
        cursor: pointer;
    }
    .ab-mbn-sheet-close:hover { color: #dc3545; }
    .ab-mbn-sheet-list {
        list-style: none;
        margin: 0;
        padding: 8px 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    }
    .ab-mbn-sheet-list .ab-mbn-item { flex: 0 0 auto; }
    .ab-mbn-sheet-list .ab-mbn-link {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 16px;
        min-height: 48px;
        border-radius: 0;
        font-size: .9rem;
        font-weight: 500;
    }
    .ab-mbn-sheet-list .ab-mbn-link i.fas {
        font-size: 1rem;
        width: 22px;
        text-align: center;
    }
    /* build 906: явно перебиваем bottom-nav правило max-width:0/opacity:0
       которое скрывало лейблы во ВСЕХ контекстах (включая sheet). */
    .ab-mbn-sheet-list .ab-mbn-link .ab-mbn-label {
        flex: 1 1 auto !important;
        max-width: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        white-space: normal !important;
    }
    .ab-mbn-sheet-list .ab-mbn-link .ab-mbn-badge {
        position: static;
        margin-left: auto;
        background: rgba(67, 183, 122, .15);
        color: #2f5d54;
    }
    .ab-mbn-sheet-list .ab-mbn-item.is-active .ab-mbn-link {
        background: rgba(67, 183, 122, .12);
        color: #2f5d54;
        box-shadow: inset 3px 0 0 #43b77a;
        transform: none;
    }
    .ab-mbn-sheet-list .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-badge {
        background: #43b77a;
        color: #fff;
    }

    /* Чтобы контент не залезал под плавающую панель — body-spacer.
       Build 905: уменьшен с 84px до 60px (panel 34+padding+gap+inset). */
    body.page-abonent-card,
    body:has(.ab-mobile-bottom-nav:not([hidden])) {
        padding-bottom: 60px !important;
    }

    /* ═══ build 1199: вариант EXPANDABLE — прикреплённая нижняя панель,
       иконки свёрнуты, активная «раскрывается» с подписью (expandable-tabs).
       Отличие от bottom_nav (плавающая капсула): панель во всю ширину снизу. ═══ */
    .ab-mobile-bottom-nav.ab-mbn-style-expandable {
        left: 0; right: 0; bottom: 0;
        border-radius: 14px 14px 0 0;
        border-left: 0; border-right: 0; border-bottom: 0;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.95));
        box-shadow: 0 -6px 20px rgba(15, 23, 42, .14);
    }
    body.dark-theme .ab-mobile-bottom-nav.ab-mbn-style-expandable {
        background: linear-gradient(180deg, rgba(30,34,40,.9), rgba(30,34,40,.98));
        border-top-color: #3a3f47;
    }
    .ab-mbn-style-expandable .ab-mbn-list { justify-content: space-evenly; }
    /* активная — раскрытая «пилюля» с лейблом (поведение уже в базе, усиливаем gap) */
    .ab-mbn-style-expandable .ab-mbn-item.is-active .ab-mbn-link { padding-left: 14px; padding-right: 14px; gap: 6px; }

    /* ═══ build 1199: вариант ICON-BAR — сегментированная панель ТОЛЬКО иконок,
       подписи не показываются даже у активной; активная = залитый сегмент. ═══ */
    .ab-mobile-bottom-nav.ab-mbn-style-icon_bar {
        gap: 0; padding: 4px;
        background: rgba(248, 249, 251, .96);
        border: 1px solid rgba(15, 23, 42, .08);
    }
    body.dark-theme .ab-mobile-bottom-nav.ab-mbn-style-icon_bar {
        background: rgba(30, 34, 40, .96); border-color: #3a3f47;
    }
    .ab-mbn-style-icon_bar .ab-mbn-list { justify-content: space-around; gap: 2px; }
    .ab-mbn-style-icon_bar .ab-mbn-link { padding: 8px 12px; }
    /* лейбл всегда скрыт (icon-only), даже у активной — переопределяем базовое раскрытие */
    .ab-mbn-style-icon_bar .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-label,
    .ab-mbn-style-icon_bar .ab-mbn-link .ab-mbn-label { max-width: 0 !important; opacity: 0 !important; margin: 0 !important; }
    .ab-mbn-style-icon_bar .ab-mbn-item.is-active .ab-mbn-link {
        background: var(--brand-primary, #43b77a);
        color: #fff; box-shadow: none;
    }
    .ab-mbn-style-icon_bar .ab-mbn-item.is-active .ab-mbn-link i.fas { color: #fff; opacity: 1; }
    .ab-mbn-style-icon_bar .ab-mbn-link i.fas { font-size: 1.05rem; }

    /* ═══ build 1201: вариант DOCK — macOS-подобный док: крупные иконки,
       активная увеличивается (scale) + поднимается, плавающая капсула. ═══ */
    .ab-mobile-bottom-nav.ab-mbn-style-dock {
        padding: 6px 10px;
        gap: 4px;
        border-radius: 22px;
    }
    .ab-mbn-style-dock .ab-mbn-list { justify-content: space-around; align-items: flex-end; }
    .ab-mbn-style-dock .ab-mbn-link {
        flex-direction: column; gap: 2px; padding: 6px 10px;
        transition: transform .2s cubic-bezier(.34,1.56,.64,1), background-color .2s;
        transform-origin: bottom center;
    }
    .ab-mbn-style-dock .ab-mbn-link i.fas { font-size: 1.25rem; opacity: .9; }
    .ab-mbn-style-dock .ab-mbn-link .ab-mbn-label { display: none; }
    .ab-mbn-style-dock .ab-mbn-item.is-active .ab-mbn-link {
        transform: translateY(-6px) scale(1.18);
        background: var(--brand-primary, #43b77a);
    }
    .ab-mbn-style-dock .ab-mbn-item.is-active .ab-mbn-link i.fas { color: #fff; opacity: 1; }
    /* подпись активной — маленькая под иконкой */
    .ab-mbn-style-dock .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-label {
        display: block; max-width: 80px; opacity: 1; font-size: .58rem; margin-top: 1px;
    }
    @media (prefers-reduced-motion: reduce) {
        .ab-mbn-style-dock .ab-mbn-item.is-active .ab-mbn-link { transform: none; }
        .ab-mbn-style-dock .ab-mbn-link { transition: none; }
    }

    /* ═══ build 1201: вариант COLORED — цветовая маркировка вкладок,
       каждая иконка своего цвета (nth-child); активная — залита своим цветом. ═══ */
    .ab-mobile-bottom-nav.ab-mbn-style_colored,
    .ab-mobile-bottom-nav.ab-mbn-style-colored { padding: 4px 6px; }
    .ab-mbn-style-colored .ab-mbn-list { justify-content: space-around; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+1) .ab-mbn-link { --tab-glow: #43b77a; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+2) .ab-mbn-link { --tab-glow: #0d6efd; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+3) .ab-mbn-link { --tab-glow: #7b2ff7; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+4) .ab-mbn-link { --tab-glow: #e6007e; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+5) .ab-mbn-link { --tab-glow: #fd7e14; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+6) .ab-mbn-link { --tab-glow: #00a8a8; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+7) .ab-mbn-link { --tab-glow: #dc3545; }
    .ab-mbn-style-colored .ab-mbn-item:nth-child(8n+8) .ab-mbn-link { --tab-glow: #6f42c1; }
    .ab-mbn-style-colored .ab-mbn-link i.fas { color: var(--tab-glow); opacity: 1; }
    .ab-mbn-style-colored .ab-mbn-link .ab-mbn-label { display: none; }
    .ab-mbn-style-colored .ab-mbn-item.is-active .ab-mbn-link {
        background: var(--tab-glow);
        box-shadow: 0 3px 12px color-mix(in srgb, var(--tab-glow) 50%, transparent);
    }
    .ab-mbn-style-colored .ab-mbn-item.is-active .ab-mbn-link i.fas { color: #fff; }
    .ab-mbn-style-colored .ab-mbn-item.is-active .ab-mbn-link .ab-mbn-label {
        display: block; max-width: 80px; opacity: 1; color: #fff; font-size: .58rem;
    }

    /* ═════════════════════════════════════════════════════════════════
       build 893: SIMPLIFIED mobile title-bar — ТОЛЬКО для ПАПОК абонентов
       (запрос admin 2026-05-18, скрин 1.jpg — пример папки SMIT)
       На страницах папки (body.page-abonent-folder) шапка показывает
       только: ← + название папки + ℹ. Action-icons, баланс, бейджи
       не нужны (у папки их и нет).
       На карточке отдельного абонента (body.page-abonent-card без
       .page-abonent-folder) сохраняется grid-layout build 802/804
       со всеми элементами (баланс, тариф, action-icons).
       ════════════════════════════════════════════════════════════════ */
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar {
        display: flex !important; grid-template-columns: unset !important;
        align-items: center !important; flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-back {
        display: inline-flex !important; flex: 0 0 auto !important;
        font-size: 1rem; grid-row: unset; grid-column: unset;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar h1.abonent-title-h1,
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-h1 {
        display: flex !important; flex: 1 1 auto !important; min-width: 0 !important;
        align-items: center !important; gap: 6px !important;
        font-size: 1.05rem !important; line-height: 1.25 !important; margin: 0 !important;
        overflow: hidden !important; text-overflow: ellipsis !important;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-id { display: none !important; }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-name {
        flex: 1 1 auto !important; grid-row: unset !important; grid-column: unset !important;
        font-weight: 700 !important; color: #212529 !important;
        white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
        font-size: 1.05rem !important; width: auto !important;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-badge { display: none !important; }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-balance-wrap { display: none !important; }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar #ab-title-actions { display: none !important; }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar > div.ms-auto,
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar > div.d-flex.align-items-center.gap-1.ms-auto {
        display: contents !important;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info {
        display: inline-flex !important; flex: 0 0 auto !important; margin-left: auto !important;
        grid-row: unset !important; grid-column: unset !important;
        width: auto !important; height: auto !important; border-radius: 0 !important;
        background: transparent !important; color: #6c757d !important;
        align-items: center !important; justify-content: center !important;
        text-decoration: none !important; margin-top: 0 !important;
        font-size: 1.2rem !important;
    }
    body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info:hover {
        color: #43b77a !important;
    }
    body.dark-theme.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info,
    [data-bs-theme="dark"] body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info {
        background: transparent !important; color: #adb5bd !important;
    }
    body.dark-theme.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info:hover,
    [data-bs-theme="dark"] body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info:hover {
        color: #65d0a5 !important;
    }
}

/* Dark theme — bottom-nav (build 905: frosted-glass) */
@media (max-width: 767.98px) {
    body.dark-theme .ab-mobile-bottom-nav,
    [data-bs-theme="dark"] .ab-mobile-bottom-nav {
        background: linear-gradient(180deg, rgba(30, 37, 48, .55), rgba(30, 37, 48, .75));
        border-color: rgba(255, 255, 255, .1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .55),
                    0 2px 6px rgba(0, 0, 0, .3),
                    inset 0 1px 0 rgba(255, 255, 255, .08);
    }
    body.dark-theme .ab-mbn-link,
    [data-bs-theme="dark"] .ab-mbn-link { color: #b3bcc7; }
    body.dark-theme .ab-mbn-more,
    [data-bs-theme="dark"] .ab-mbn-more {
        background: rgba(255, 255, 255, .06);
        color: #b3bcc7;
    }
    body.dark-theme .ab-mbn-sheet,
    [data-bs-theme="dark"] .ab-mbn-sheet {
        background: #1e2530;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, .65);
    }
    body.dark-theme .ab-mbn-sheet-head strong,
    [data-bs-theme="dark"] .ab-mbn-sheet-head strong { color: #e9ecef; }
    body.dark-theme .ab-mbn-sheet-head,
    [data-bs-theme="dark"] .ab-mbn-sheet-head { border-bottom-color: rgba(255, 255, 255, .08); }
    body.dark-theme .ab-mbn-sheet-handle,
    [data-bs-theme="dark"] .ab-mbn-sheet-handle { background: rgba(255, 255, 255, .22); }
    body.dark-theme .ab-mbn-sheet-list .ab-mbn-link,
    [data-bs-theme="dark"] .ab-mbn-sheet-list .ab-mbn-link { color: #d8e0e8; }
    body.dark-theme .ab-mbn-sheet-list .ab-mbn-item.is-active .ab-mbn-link,
    [data-bs-theme="dark"] .ab-mbn-sheet-list .ab-mbn-item.is-active .ab-mbn-link {
        background: rgba(67, 183, 122, .18);
        color: #b3e0d0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ab-mobile-bottom-nav,
    .ab-mbn-link,
    .ab-mbn-sheet,
    .ab-mbn-sheet-backdrop { transition: none !important; }
    .ab-mbn-item.is-active .ab-mbn-link { transform: none !important; }
}

[data-bs-theme="dark"] .abonent-title-balance-name,
body.dark-theme .abonent-title-balance-name { color: #9aaab4 !important; }
[data-bs-theme="dark"] .abonent-title-bar #ab-title-actions,
body.dark-theme .abonent-title-bar #ab-title-actions { border-top-color: rgba(255,255,255,.08); }
[data-bs-theme="dark"] .abonent-title-bar .abonent-title-id,
body.dark-theme .abonent-title-bar .abonent-title-id { color: #9aaab4 !important; }

/* ═══════════════════════════════════════════════════════════════════════
   Mobile search-row: input + filter trigger в одну строку (build 731)
   Универсальный класс для search.html, folder, и других mobile-страниц
   Кнопка «Фильтры» по высоте равна полю поиска (≈38px Bootstrap form-control)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .ab-mobile-search-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px;
        align-items: stretch;
        width: 100%;
    }
    .ab-mobile-search-row > form,
    .ab-mobile-search-row > .input-group,
    .ab-mobile-search-row > .search-wrap {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: stretch !important;
    }
    .ab-mobile-search-row .input-group { height: auto; flex: 1 1 auto; }
    .ab-mobile-search-row .form-control { min-height: 38px; }
    .ab-mobile-search-row .smit-mobile-filter-trigger {
        flex: 0 0 auto !important;
        white-space: nowrap;
        padding: 0 14px !important;
        font-size: .85rem !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-height: 38px !important;
        height: 38px !important;
        line-height: 1 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Navbar user avatar (build 733): defensive стиль — даже если кеш отдаст
   старый CSS, изображение никогда не вылезет за допустимый размер.
   Ставим max-width/max-height и !important на всё что определяет размер.
   ═══════════════════════════════════════════════════════════════════════ */
.navbar-user-avatar,
.navbar-user-avatar-mobile,
img.navbar-user-avatar,
img.navbar-user-avatar-mobile {
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255,255,255,.35);
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary, #43b77a);
    color: #fff !important;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    overflow: hidden !important;
    box-sizing: border-box !important;
    vertical-align: middle;
}
.navbar-user-avatar,
img.navbar-user-avatar {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    font-size: .72rem !important;
    line-height: 1 !important;
}
.navbar-user-avatar-mobile,
img.navbar-user-avatar-mobile {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: .76rem !important;
    line-height: 1 !important;
}
.navbar-user-avatar-fallback {
    background: linear-gradient(135deg, var(--brand-primary, #43b77a) 0%, #379963 100%) !important;
    letter-spacing: .5px;
}
.navbar-user-toggle { position: relative; }
.navbar-user-name { line-height: 1.1; }
body.dark-theme .navbar-user-avatar,
body.dark-theme .navbar-user-avatar-mobile,
[data-bs-theme="dark"] .navbar-user-avatar,
[data-bs-theme="dark"] .navbar-user-avatar-mobile {
    border-color: rgba(255,255,255,.18);
    box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}

/* ═══════════════════════════════════════════════════════════════════════
   Mobile filter sheet (build 734): защита от scroll-pass-through на iOS.
   Когда offcanvas-bottom открыт — touch-скролл через панель «утекал»
   на основную страницу под backdrop. overscroll-behavior:contain плюс
   фиксация body предотвращают это.
   ═══════════════════════════════════════════════════════════════════════ */
.smit-mobile-filter-sheet {
    overscroll-behavior: contain;
}
.smit-mobile-filter-sheet .offcanvas-body {
    overscroll-behavior: contain;
    overflow-y: auto;
}
@media (max-width: 767.98px) {
    body.offcanvas-open,
    body.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        touch-action: none;
    }
    /* Backdrop offcanvas — гарантированно перекрывает touch */
    .offcanvas-backdrop.show {
        touch-action: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Quick-add abonent modal mobile (build 740) — FULLSCREEN на ≤768px.
   На mobile модалка занимает весь экран (modal-fullscreen-md-down +
   собственные правила для footer/header sticky и safe-area iOS).
   На desktop (≥768px) — обычная centered modal-lg 780px.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .modal .qa-modal-dialog,
    .modal .modal-dialog.qa-modal-dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        align-items: stretch !important;
        display: flex !important;
    }
    .qa-modal-dialog .modal-content {
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .qa-modal-dialog .modal-header {
        border-radius: 0 !important;
        padding: .65rem .8rem !important;
        padding-top: max(.65rem, env(safe-area-inset-top, .65rem)) !important;
        flex-shrink: 0 !important;
    }
    .qa-modal-dialog .modal-body {
        padding: .9rem !important;
        overflow-y: auto !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }
    .qa-modal-dialog .modal-footer {
        border-radius: 0 !important;
        padding: .6rem .8rem !important;
        padding-bottom: max(.6rem, env(safe-area-inset-bottom, .6rem)) !important;
        flex-wrap: wrap;
        gap: .25rem;
        flex-shrink: 0 !important;
        background: var(--surface-default, #fff);
        border-top: 1px solid var(--border-default, #dee2e6);
    }
    body.dark-theme .qa-modal-dialog .modal-footer,
    [data-bs-theme="dark"] .qa-modal-dialog .modal-footer {
        background: #1f2227 !important;
        border-top-color: #2f343a !important;
    }
    /* Robot illustration отключаем на mobile — только на desktop */
    .qa-modal-dialog .qa-body-wrap::after { display: none !important; }
    /* Поля input должны быть 16px чтобы iOS Safari не зумил при фокусе */
    .qa-modal-dialog .form-control,
    .qa-modal-dialog .form-select,
    .qa-modal-dialog input[type="text"],
    .qa-modal-dialog input[type="email"],
    .qa-modal-dialog input[type="number"],
    .qa-modal-dialog textarea { font-size: 16px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Abonent title-bar mobile (build 731): тариф над балансом + стоимость снизу
   ═══════════════════════════════════════════════════════════════════════ */
.abonent-title-balance-name {
    font-size: .65rem;
    line-height: 1;
    margin-bottom: 1px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6c757d;
}
.abonent-title-tarif-mobile {
    margin-bottom: 2px !important;
    font-weight: 500;
}
.abonent-title-cost-mobile {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    font-weight: 500;
    color: #43b77a;
}
body.dark-theme .abonent-title-tarif-mobile,
[data-bs-theme="dark"] .abonent-title-tarif-mobile {
    color: #9aaab4 !important;
}
body.dark-theme .abonent-title-cost-mobile,
[data-bs-theme="dark"] .abonent-title-cost-mobile {
    color: #65d0a0 !important;
}
.abonent-title-balance-positive {
    font-size: .92rem;
    color: #2e7d32;
}
body.dark-theme .abonent-title-balance-positive,
[data-bs-theme="dark"] .abonent-title-balance-positive {
    color: #65d0a0 !important;
}

/* ════════════════════════════════════════════════════════════════
   Select2 — refined look (build 836)
   Единый аккуратный вид выпадающих списков по мотивам
   21st.dev timezone-select: мягкие скруглённые углы, многослойная
   тень, тонкий кастомный скроллбар, pill-подсветка строк.
   Применяется глобально ко всем Select2 (bootstrap-5 + default).
   Светлая + тёмная тема, фирменный зелёный #43b77a.
   ════════════════════════════════════════════════════════════════ */

/* --- Поле выбора (selection box) --- */
.select2-container--bootstrap-5 .select2-selection,
.select2-container--default .select2-selection {
    border-radius: 6px !important;
    border-color: var(--border-default, #ced4da) !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
}
.select2-container--bootstrap-5 .select2-selection:hover,
.select2-container--default .select2-selection:hover {
    border-color: #86cfaa !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection,
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .18) !important;
}

/* --- Выпадающий список (dropdown panel) --- */
.select2-container .select2-dropdown,
.select2-container--bootstrap-5 .select2-dropdown,
.select2-container--default .select2-dropdown {
    border-radius: 8px !important;
    border: 1px solid var(--border-default, #e2e6ea) !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16),
                0 2px 8px rgba(15, 23, 42, .08) !important;
    overflow: hidden !important;
    padding: 4px !important;
}
.select2-container--bootstrap-5 .select2-dropdown--above,
.select2-container--default .select2-dropdown--above {
    border-radius: 8px !important;
}

/* --- Поле поиска внутри dropdown --- */
.select2-container .select2-search--dropdown,
.select2-container--bootstrap-5 .select2-search--dropdown {
    padding: 4px 4px 6px !important;
}
.select2-container .select2-search--dropdown .select2-search__field,
.select2-container--bootstrap-5 .select2-search__field,
.select2-container--default .select2-search__field {
    border-radius: 6px !important;
    border: 1px solid var(--border-default, #ced4da) !important;
    padding: 6px 10px !important;
    font-size: .88rem !important;
    transition: border-color .15s ease, box-shadow .15s ease !important;
    outline: none !important;
}
.select2-container .select2-search--dropdown .select2-search__field:focus,
.select2-container--bootstrap-5 .select2-search__field:focus,
.select2-container--default .select2-search__field:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .15) !important;
}

/* --- Контейнер результатов: тонкий кастомный скроллбар --- */
.select2-container .select2-results__options {
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 183, 122, .45) transparent;
    scroll-behavior: smooth;
}
.select2-container .select2-results__options::-webkit-scrollbar {
    width: 8px;
}
.select2-container .select2-results__options::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}
.select2-container .select2-results__options::-webkit-scrollbar-thumb {
    background: rgba(67, 183, 122, .4);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.select2-container .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 183, 122, .65);
    background-clip: padding-box;
}

/* --- Строки результатов: pill-подсветка --- */
.select2-container .select2-results__option,
.select2-container--bootstrap-5 .select2-results__option,
.select2-container--default .select2-results__option {
    padding: 8px 12px !important;
    margin: 1px 0 !important;
    border-radius: 5px !important;
    font-size: .9rem !important;
    line-height: 1.35 !important;
    transition: background-color .12s ease, color .12s ease !important;
}
.select2-container .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
}
.select2-container .select2-results__option--selected,
.select2-container--bootstrap-5 .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #43b77a !important;
    color: #fff !important;
    font-weight: 600 !important;
}
.select2-container .select2-results__option--selected.select2-results__option--highlighted,
.select2-container--default .select2-results__option[aria-selected="true"].select2-results__option--highlighted {
    background-color: #379963 !important;
    color: #fff !important;
}
/* build 1277: пункт «+ Создать адрес» — контрастный во всех состояниях.
   Раньше зелёный текст попадал на зелёный hover/selected фон Select2 и пропадал.
   Принудительно: светлая плашка + тёмно-зелёный текст, в т.ч. при highlight/selected. */
.select2-results__option .ab-home-create-opt {
    display: block;
    font-weight: 600;
    color: #1b5e20 !important;
}
.select2-results__option--highlighted .ab-home-create-opt,
.select2-results__option--selected .ab-home-create-opt,
.select2-results__option[aria-selected="true"] .ab-home-create-opt {
    color: #0d3d12 !important;   /* ещё темнее на зелёной подсветке — гарантированный контраст */
}
.select2-results__option--highlighted:has(.ab-home-create-opt),
.select2-results__option--selected:has(.ab-home-create-opt),
.select2-results__option[aria-selected="true"]:has(.ab-home-create-opt) {
    background-color: #c8e6c9 !important;   /* светлая плашка вместо тёмно-зелёной заливки */
}
/* build 1278: «Создать через ФИАС» в сообщении «Адрес не найден» — был
   text-success (зелёный) на зелёной подсветке Select2 → нечитаемо.
   Тёмно-зелёный текст + светлая плашка во всех состояниях. */
.select2-results__message .ab-home-create-from-search,
.select2-results__message a.text-success {
    color: #1b5e20 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}
/* Универсальная страховка: любой .text-success внутри подсвеченного/выбранного
   пункта Select2 не должен совпадать с зелёным фоном — делаем текст тёмным. */
.select2-results__option--highlighted .text-success,
.select2-results__option--selected .text-success,
.select2-results__option[aria-selected="true"] .text-success {
    color: #0d3d12 !important;
}
.select2-container .select2-results__option--group > .select2-results__group {
    padding: 6px 10px 4px !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    text-transform: none !important;   /* admin: без заглавных */
    letter-spacing: .5px !important;
    color: #94a3b8 !important;
}
.select2-container .select2-results__message {
    padding: 10px 12px !important;
    color: #94a3b8 !important;
    font-size: .88rem !important;
}

/* ───────── Тёмная тема ───────── */
body.dark-theme .select2-container--bootstrap-5 .select2-selection,
body.dark-theme .select2-container--default .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    border-color: #454950 !important;
}
body.dark-theme .select2-container--bootstrap-5 .select2-selection:hover,
body.dark-theme .select2-container--default .select2-selection:hover {
    border-color: #43b77a !important;
}
body.dark-theme .select2-container--bootstrap-5.select2-container--focus .select2-selection,
body.dark-theme .select2-container--bootstrap-5.select2-container--open .select2-selection,
body.dark-theme .select2-container--default.select2-container--focus .select2-selection,
body.dark-theme .select2-container--default.select2-container--open .select2-selection {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .25) !important;
}
body.dark-theme .select2-container .select2-dropdown,
body.dark-theme .select2-container--bootstrap-5 .select2-dropdown,
body.dark-theme .select2-container--default .select2-dropdown {
    background-color: #22262e !important;
    border-color: #353940 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5),
                0 2px 8px rgba(0, 0, 0, .35) !important;
}
body.dark-theme .select2-container .select2-search--dropdown .select2-search__field,
body.dark-theme .select2-container--bootstrap-5 .select2-search__field,
body.dark-theme .select2-container--default .select2-search__field {
    background-color: #2a2e37 !important;
    border-color: #454950 !important;
    color: #dee2e6 !important;
}
body.dark-theme .select2-container .select2-search--dropdown .select2-search__field:focus,
body.dark-theme .select2-container--bootstrap-5 .select2-search__field:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .22) !important;
}
body.dark-theme .select2-container .select2-results__options {
    scrollbar-color: rgba(67, 183, 122, .55) transparent;
}
body.dark-theme .select2-container .select2-results__options::-webkit-scrollbar-thumb {
    background: rgba(67, 183, 122, .5);
    background-clip: padding-box;
}
body.dark-theme .select2-container .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 183, 122, .75);
    background-clip: padding-box;
}
body.dark-theme .select2-container .select2-results__option,
body.dark-theme .select2-container--bootstrap-5 .select2-results__option,
body.dark-theme .select2-container--default .select2-results__option {
    color: #d0d3d8 !important;
}
body.dark-theme .select2-container .select2-results__option--highlighted,
body.dark-theme .select2-container--bootstrap-5 .select2-results__option--highlighted,
body.dark-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(67, 183, 122, .18) !important;
    color: #8fdeb5 !important;
}
body.dark-theme .select2-container .select2-results__option--selected,
body.dark-theme .select2-container--bootstrap-5 .select2-results__option--selected,
body.dark-theme .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #43b77a !important;
    color: #fff !important;
}
body.dark-theme .select2-container .select2-results__option--selected.select2-results__option--highlighted {
    background-color: #379963 !important;
}
body.dark-theme .select2-container .select2-results__message,
body.dark-theme .select2-container .select2-results__option--group > .select2-results__group {
    color: #6c7480 !important;
}

@media (prefers-reduced-motion: reduce) {
    .select2-container--bootstrap-5 .select2-selection,
    .select2-container--default .select2-selection,
    .select2-container .select2-results__option,
    .select2-container .select2-search__field { transition: none !important; }
    .select2-container .select2-results__options { scroll-behavior: auto; }
}

/* ════════════════════════════════════════════════════════════════
   Карточка абонента — hero-блок (build 838)
   Вкладка «Информация»: тариф + цена + кнопка смены крупным блоком,
   ниже — компактные секции «Аккаунты / Скорость» и «Комментарии».
   Светлая + тёмная тема, фирменный зелёный #43b77a, адаптив ≤767px.
   Поле «Точка подключения» и ФИО-заголовок убраны (см. show_field*.html).
   ════════════════════════════════════════════════════════════════ */

/* ── Hero: строка тарифа ── */
.ab-hero-tarif {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 2px 0 10px;
    background: linear-gradient(135deg,
                rgba(67, 183, 122, .10) 0%,
                rgba(60, 191, 174, .08) 100%);
    border: 1px solid rgba(67, 183, 122, .28);
    border-radius: 10px;
}
.ab-hero-tarif-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #43b77a;
    color: #fff;
    font-size: 1rem;
}
.ab-hero-tarif-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ab-hero-tarif-name {
    font-size: 1.02rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ab-hero-tarif-price {
    font-size: .82rem;
    font-weight: 600;
    color: #379963;
}
.ab-hero-tarif-btn {
    flex-shrink: 0;
    border: 1px solid #43b77a;
    background: #fff;
    color: #379963;
    font-weight: 600;
    border-radius: 7px;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ab-hero-tarif-btn:hover {
    background: #43b77a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(67, 183, 122, .3);
}
.ab-hero-tarif-btn:focus-visible {
    outline: 2px solid #43b77a;
    outline-offset: 2px;
}

/* ── Hero: компактные секции (аккаунты, комментарии) ── */
.ab-hero-section {
    margin: 0 0 10px;
    padding: 10px 14px;
    background: var(--surface-card, #fff);
    border: 1px solid var(--border-subtle, #e9ecef);
    border-radius: 10px;
    border-left: 3px solid #43b77a;
}
.ab-hero-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ab-hero-section-icon {
    color: #43b77a;
    font-size: .92rem;
}
.ab-hero-section-title {
    font-size: .76rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .5px;
    color: var(--text-secondary, #6c757d);
}
.ab-hero-section-count {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(67, 183, 122, .14);
    color: #379963;
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}

/* ── Аккаунты / Скорость ── */
.ab-hero-acc-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ab-hero-acc-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    font-size: .85rem;
}
.ab-hero-acc-login {
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}
.ab-hero-acc-login:hover { color: #379963; text-decoration: underline; }
.ab-hero-acc-tpl {
    font-size: .68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: #6c757d;
    color: #fff;
    margin-right: 3px;
}
.ab-hero-acc-ip {
    font-size: .78rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(67, 183, 122, .12);
    color: #379963;
}
.ab-hero-acc-speed {
    font-size: .74rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(60, 191, 174, .15);
    color: #2a8a7e;
}
.ab-hero-acc-online {
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: #43b77a;
    color: #fff;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .3px;
}
.ab-hero-acc-more {
    font-size: .78rem;
    color: var(--text-secondary, #6c757d);
    text-decoration: none;
}
.ab-hero-acc-more:hover { color: #379963; }

/* ── Комментарии ── */
.ab-hero-cmt-list {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 183, 122, .4) transparent;
}
.ab-hero-cmt-list::-webkit-scrollbar { width: 6px; }
.ab-hero-cmt-list::-webkit-scrollbar-thumb {
    background: rgba(67, 183, 122, .4);
    border-radius: 6px;
}
.ab-hero-cmt-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: .83rem;
    line-height: 1.4;
    flex-wrap: wrap;
}
.ab-hero-cmt-row:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle, #eef0f2);
}
/* build 888: head — id/дата + автор в одной строке */
.ab-hero-cmt-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.ab-hero-cmt-meta {
    color: var(--text-muted, #94a3b8);
    font-size: .73rem;
    white-space: nowrap;
}
.ab-hero-cmt-author {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 600;
    color: #43b77a;
    background: rgba(67, 183, 122, .1);
    border: 1px solid rgba(67, 138, 122, .25);
    padding: 1px 7px;
    border-radius: 999px;
    white-space: nowrap;
}
.ab-hero-cmt-author i { font-size: .65rem; opacity: .85; }
.ab-hero-cmt-text {
    flex: 1 1 100%;
    word-break: break-word;
    color: var(--text-primary, #2c3e50);
}
/* Mobile: компактный layout (build 888) */
@media (max-width: 575.98px) {
    .ab-hero-cmt-row { padding: 8px 0; gap: 6px; font-size: .85rem; }
    .ab-hero-cmt-meta { font-size: .68rem; }
    .ab-hero-cmt-author { font-size: .68rem; padding: 1px 6px; }
    .ab-hero-cmt-del { padding: 4px 6px; font-size: .85rem; }
    .ab-hero-cmt-input textarea { font-size: 16px !important; }  /* iOS no-zoom on focus */
    .ab-hero-cmt-add { padding: 6px 10px !important; }
}
.ab-hero-cmt-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #cbd3da;
    font-size: .76rem;
    padding: 0 2px;
    cursor: pointer;
    transition: color .15s ease;
}
.ab-hero-cmt-del:hover { color: #dc3545; }
.ab-hero-cmt-del:focus-visible {
    outline: 2px solid #dc3545;
    outline-offset: 1px;
    border-radius: 3px;
}
.ab-hero-cmt-empty {
    font-size: .8rem;
    color: var(--text-muted, #94a3b8);
    padding: 4px 0 8px;
}
.ab-hero-cmt-input {
    display: flex;
    gap: 6px;
    align-items: center;
}
.ab-hero-cmt-input textarea {
    flex: 1;
    resize: none;
    font-size: .83rem;
    padding: 5px 9px !important;
    border-radius: 6px !important;
}
.ab-hero-cmt-add {
    flex-shrink: 0;
    background: #43b77a;
    border: 1px solid #43b77a;
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    transition: background .15s ease;
}
.ab-hero-cmt-add:hover { background: #379963; border-color: #379963; color: #fff; }
.ab-hero-cmt-add:focus-visible { outline: 2px solid #43b77a; outline-offset: 2px; }

/* ── Тёмная тема ── */
body.dark-theme .ab-hero-tarif,
[data-bs-theme="dark"] .ab-hero-tarif {
    background: linear-gradient(135deg,
                rgba(67, 183, 122, .16) 0%,
                rgba(60, 191, 174, .12) 100%);
    border-color: rgba(67, 183, 122, .35);
}
body.dark-theme .ab-hero-tarif-name,
[data-bs-theme="dark"] .ab-hero-tarif-name { color: #e4e6ea; }
body.dark-theme .ab-hero-tarif-price,
[data-bs-theme="dark"] .ab-hero-tarif-price { color: #65d0a0; }
body.dark-theme .ab-hero-tarif-btn,
[data-bs-theme="dark"] .ab-hero-tarif-btn {
    background: #2a2e37;
    color: #65d0a0;
    border-color: #43b77a;
}
body.dark-theme .ab-hero-tarif-btn:hover,
[data-bs-theme="dark"] .ab-hero-tarif-btn:hover {
    background: #43b77a;
    color: #fff;
}
body.dark-theme .ab-hero-section,
[data-bs-theme="dark"] .ab-hero-section {
    background: #22262e;
    border-color: #353940;
    border-left-color: #43b77a;
}
body.dark-theme .ab-hero-acc-login,
[data-bs-theme="dark"] .ab-hero-acc-login { color: #d8e0e8; }
body.dark-theme .ab-hero-acc-login:hover,
[data-bs-theme="dark"] .ab-hero-acc-login:hover { color: #65d0a0; }
body.dark-theme .ab-hero-acc-ip,
[data-bs-theme="dark"] .ab-hero-acc-ip {
    background: rgba(67, 183, 122, .18);
    color: #8fdeb5;
}
body.dark-theme .ab-hero-acc-speed,
[data-bs-theme="dark"] .ab-hero-acc-speed {
    background: rgba(60, 191, 174, .2);
    color: #6fd8c8;
}
body.dark-theme .ab-hero-cmt-text,
[data-bs-theme="dark"] .ab-hero-cmt-text { color: #d8e0e8; }
body.dark-theme .ab-hero-cmt-author,
[data-bs-theme="dark"] .ab-hero-cmt-author {
    background: rgba(67, 183, 122, .18);
    border-color: rgba(67, 183, 122, .45);
    color: #65d0a0;
}
body.dark-theme .ab-hero-cmt-row:not(:last-child),
[data-bs-theme="dark"] .ab-hero-cmt-row:not(:last-child) {
    border-bottom-color: #2f343c;
}
body.dark-theme .ab-hero-cmt-del,
[data-bs-theme="dark"] .ab-hero-cmt-del { color: #5a6671; }

/* ── Адаптив ≤767px ── */
@media (max-width: 767px) {
    .ab-hero-tarif {
        flex-wrap: wrap;
        gap: 8px 10px;
        padding: 10px 12px;
    }
    .ab-hero-tarif-info { flex-basis: calc(100% - 50px); }
    .ab-hero-tarif-btn {
        flex-basis: 100%;
        order: 3;
    }
    .ab-hero-tarif-name { font-size: .96rem; }
    .ab-hero-section { padding: 9px 11px; }
    .ab-hero-acc-row { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ab-hero-tarif-btn, .ab-hero-cmt-add, .ab-hero-cmt-del,
    .ab-hero-acc-login { transition: none; }
}

/* ════════════════════════════════════════════════════════════════
   Bootstrap 5 модалки — единый аккуратный стиль (build 841)
   По мотивам 21st.dev efferd/dialog/sticky-header-footer:
   sticky header + scrollable body + sticky footer (для
   .modal-dialog-scrollable), фирменный зелёный акцент-полоса
   слева на header, тени при скролле, тонкий зелёный скроллбар.
   Применяется глобально ко всем .modal через стандартные
   Bootstrap-классы. Светлая + тёмная тема.
   ════════════════════════════════════════════════════════════════ */

/* --- Контейнер (.modal-content) — мягкие скругления + многослойная тень --- */
.modal .modal-content {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 16px 48px rgba(15, 23, 42, .18),
                0 4px 12px rgba(15, 23, 42, .08);
    overflow: hidden;
}

/* --- Header --- */
.modal .modal-header {
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle, #e9ecef);
    /* фирменная зелёная полоса-акцент слева */
    border-left: 3px solid #43b77a;
    background: var(--surface-card, #fff);
    transition: box-shadow .2s ease;
}
.modal .modal-header .modal-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #2c3e50);
    letter-spacing: -0.005em;
}
.modal .modal-header .btn-close {
    padding: 6px;
    margin: 0 -4px 0 4px;
    border-radius: 6px;
    opacity: .55;
    transition: opacity .15s ease, background-color .15s ease;
}
.modal .modal-header .btn-close:hover {
    opacity: 1;
    background-color: rgba(220, 53, 69, .08);
}
.modal .modal-header .btn-close:focus-visible {
    outline: 2px solid #43b77a;
    outline-offset: 2px;
    opacity: 1;
}

/* --- Фирменная ЗЕЛЁНАЯ шапка модалок ---
   Многие модалки задают inline style="background:linear-gradient(...#43b77a...)".
   Правило .modal .modal-header выше сбрасывало фон в белый (а текст оставался
   белым → нечитаемо). Этот блок гарантирует зелёный фон + белый текст/иконки
   для ЛЮБОЙ модалки с зелёным inline-градиентом (атрибут-селектор) и для
   явного класса .smit-modal-head. !important — чтобы победить каскад AdminLTE. */
.modal .modal-header[style*="linear-gradient"],
.modal .modal-header.smit-modal-head {
    background: linear-gradient(90deg, #43b77a, #2d9a5f) !important;
    border-left: 0 !important;
    border-bottom: 0 !important;
}
.modal .modal-header[style*="linear-gradient"] .modal-title,
.modal .modal-header.smit-modal-head .modal-title,
.modal .modal-header[style*="linear-gradient"] .modal-title *,
.modal .modal-header.smit-modal-head .modal-title * {
    color: #fff !important;
}
.modal .modal-header[style*="linear-gradient"] .btn-close,
.modal .modal-header.smit-modal-head .btn-close {
    filter: brightness(0) invert(1);
    opacity: .85;
}
body.dark-theme .modal .modal-header[style*="linear-gradient"],
[data-bs-theme="dark"] .modal .modal-header[style*="linear-gradient"],
body.dark-theme .modal .modal-header.smit-modal-head,
[data-bs-theme="dark"] .modal .modal-header.smit-modal-head {
    background: linear-gradient(90deg, #43b77a, #2d9a5f) !important;
}

/* --- Body --- */
.modal .modal-body {
    padding: 16px 20px;
    color: var(--text-primary, #2c3e50);
    /* тонкий фирменный скроллбар (когда .modal-dialog-scrollable) */
    scrollbar-width: thin;
    scrollbar-color: rgba(67, 183, 122, .4) transparent;
    scroll-behavior: smooth;
}
.modal .modal-body::-webkit-scrollbar { width: 8px; }
.modal .modal-body::-webkit-scrollbar-track { background: transparent; margin: 4px 0; }
.modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(67, 183, 122, .4);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 183, 122, .65);
    background-clip: padding-box;
}

/* --- Footer --- */
.modal .modal-footer {
    gap: 6px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle, #e9ecef);
    background: var(--surface-card, #fff);
    transition: box-shadow .2s ease;
}
.modal .modal-footer > * { margin: 0; }
.modal .modal-footer .btn { font-weight: 500; }
.modal .modal-footer .btn:focus-visible {
    outline: 2px solid #43b77a;
    outline-offset: 2px;
}

/* --- Sticky-эффект для .modal-dialog-scrollable -------------------------
   Bootstrap уже делает .modal-content flex-column с прокручиваемым body —
   header и footer естественно остаются на месте. Добавляем тень-индикатор:
   когда body прокручен — header/footer получают мягкую тень-разделитель.
   Тень включается JS (см. abonents_edit_one.html и аналоги) добавлением
   класса .modal-scrolled-top / .modal-scrolled-bottom на .modal-content.
   Если JS не включит — fallback: чистая граница без тени, как сейчас. */
.modal-dialog-scrollable .modal-content.modal-scrolled-top .modal-header {
    box-shadow: 0 4px 8px -4px rgba(15, 23, 42, .12);
}
.modal-dialog-scrollable .modal-content.modal-scrolled-bottom .modal-footer {
    box-shadow: 0 -4px 8px -4px rgba(15, 23, 42, .12);
}

/* --- Тёмная тема ------------------------------------------------------- */
body.dark-theme .modal .modal-content,
[data-bs-theme="dark"] .modal .modal-content {
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .55),
                0 4px 12px rgba(0, 0, 0, .35);
}
body.dark-theme .modal .modal-header,
[data-bs-theme="dark"] .modal .modal-header {
    background: #1e2530;
    border-bottom-color: #353940;
    /* левая зелёная полоса сохраняется */
}
body.dark-theme .modal .modal-header .modal-title,
[data-bs-theme="dark"] .modal .modal-header .modal-title { color: #e7eaf0; }
body.dark-theme .modal .modal-header .btn-close,
[data-bs-theme="dark"] .modal .modal-header .btn-close { filter: invert(1); }
body.dark-theme .modal .modal-header .btn-close:hover,
[data-bs-theme="dark"] .modal .modal-header .btn-close:hover {
    background-color: rgba(248, 113, 113, .15);
}
body.dark-theme .modal .modal-body,
[data-bs-theme="dark"] .modal .modal-body { color: #d8e0e8; }
body.dark-theme .modal .modal-body::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(67, 183, 122, .5);
    background-clip: padding-box;
}
body.dark-theme .modal .modal-footer,
[data-bs-theme="dark"] .modal .modal-footer {
    background: #1e2530;
    border-top-color: #353940;
}
body.dark-theme .modal-dialog-scrollable .modal-content.modal-scrolled-top .modal-header,
[data-bs-theme="dark"] .modal-dialog-scrollable .modal-content.modal-scrolled-top .modal-header {
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .45);
}
body.dark-theme .modal-dialog-scrollable .modal-content.modal-scrolled-bottom .modal-footer,
[data-bs-theme="dark"] .modal-dialog-scrollable .modal-content.modal-scrolled-bottom .modal-footer {
    box-shadow: 0 -4px 12px -4px rgba(0, 0, 0, .45);
}

/* --- Адаптив ≤575px (mobile) ------------------------------------------ */
@media (max-width: 575.98px) {
    .modal .modal-content { border-radius: 10px; }
    .modal .modal-header { padding: 12px 14px; }
    .modal .modal-header .modal-title { font-size: .96rem; }
    .modal .modal-body { padding: 12px 14px; }
    .modal .modal-footer { padding: 10px 14px; }
    /* На очень узких экранах кнопки в footer переносятся, выравнивание по центру */
    .modal .modal-footer { justify-content: center; }
    .modal .modal-footer .btn { flex: 1 1 auto; min-width: 90px; }
}

/* --- Лёгкая анимация открытия модалки -------------------------------- */
/* Bootstrap по умолчанию даёт fade + translateY(-50px). Делаем заметнее:
   scale(0.96) + smooth ease-out. Уважает prefers-reduced-motion (ниже). */
.modal.fade .modal-dialog {
    transform: scale(0.96) translateY(-12px);
    opacity: 0;
    transition: transform .28s cubic-bezier(.34, 1.3, .64, 1),
                opacity .22s ease-out;
}
.modal.fade.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    /* Отключаем масштабирование при reduced-motion, оставляем чистый fade */
    .modal.fade .modal-dialog,
    .modal.fade.show .modal-dialog {
        transform: none;
        transition: opacity .15s ease-out;
    }
    .modal .modal-header,
    .modal .modal-footer,
    .modal .modal-header .btn-close { transition: none; }
    .modal .modal-body { scroll-behavior: auto; }
}

/* ════════════════════════════════════════════════════════════════
   Карточка абонента — Финансовая информация (build 843)
   Делает блок .sg-finance яркой hero-секцией с фирменным
   зелёным акцентом, читаемыми лейблами/значениями полей.
   Остальные subgroup'ы не трогаем — там общий стиль
   .form-subgroup в show_fields.html.
   ════════════════════════════════════════════════════════════════ */
.sg-finance.form-subgroup {
    border: 1px solid var(--border-subtle, #e9ecef);
    border-left: 4px solid #43b77a;
    border-radius: 10px;
    padding: 12px 14px 8px;
    background: linear-gradient(180deg,
                rgba(67, 183, 122, .04) 0%,
                transparent 60px);
}
.sg-finance.form-subgroup > legend {
    font-size: .76rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(67, 183, 122, .14) !important;
    color: #2e7d32 !important;
    border: none !important;
    margin-bottom: 10px;
    width: auto;
    display: inline-block;
}
.sg-finance.form-subgroup .form-row {
    margin-bottom: 6px;
}
.sg-finance.form-subgroup label {
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
}
.sg-finance.form-subgroup .form-control,
.sg-finance.form-subgroup .form-select {
    border-radius: 6px;
    border-color: var(--border-default, #ced4da);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sg-finance.form-subgroup .form-control:focus,
.sg-finance.form-subgroup .form-select:focus {
    border-color: #43b77a;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .18);
}
.sg-finance.form-subgroup .form-check-input:checked {
    background-color: #43b77a;
    border-color: #43b77a;
}
.sg-finance.form-subgroup .form-check-input:focus {
    border-color: #43b77a;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .18);
}
/* Тёмная тема Финансовой */
body.dark-theme .sg-finance.form-subgroup,
[data-bs-theme="dark"] .sg-finance.form-subgroup {
    background: linear-gradient(180deg,
                rgba(67, 183, 122, .08) 0%,
                transparent 60px);
    border-color: #353940;
    border-left-color: #43b77a;
}
body.dark-theme .sg-finance.form-subgroup > legend,
[data-bs-theme="dark"] .sg-finance.form-subgroup > legend {
    background: rgba(67, 183, 122, .22) !important;
    color: #8fdeb5 !important;
}
body.dark-theme .sg-finance.form-subgroup label,
[data-bs-theme="dark"] .sg-finance.form-subgroup label { color: #adb5bd; }
body.dark-theme .sg-finance.form-subgroup .form-control,
body.dark-theme .sg-finance.form-subgroup .form-select,
[data-bs-theme="dark"] .sg-finance.form-subgroup .form-control,
[data-bs-theme="dark"] .sg-finance.form-subgroup .form-select {
    background-color: #1e2530;
    border-color: #3a3f47;
    color: #e7eaf0;
}

/* ════════════════════════════════════════════════════════════════
   Карточка абонента — «Договор и контакты» (build 843)
   Subgroup 61 теперь содержит и контактные поля, и поля договора
   (вкл. юр-поля, скрытые/показываемые JS по чекбоксу COMPANY).
   Полоса слева бирюзовая (как было у контактного блока), без
   агрессивного градиента — блок и так длинный.
   ════════════════════════════════════════════════════════════════ */
.sg-contact.form-subgroup {
    border: 1px solid var(--border-subtle, #e9ecef);
    border-left: 4px solid #17a2b8;
    border-radius: 10px;
    padding: 12px 14px 8px;
}
.sg-contact.form-subgroup > legend {
    font-size: .76rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(23, 162, 184, .14) !important;
    color: #00695c !important;
    border: none !important;
    margin-bottom: 10px;
    width: auto;
    display: inline-block;
}
/* Юр-поля — мягкая фоновая подсветка чтобы было видно «это часть юр.лица» */
.sg-contact.form-subgroup .ab-legal-only {
    background: rgba(245, 158, 11, .06);
    border-radius: 6px;
    padding: 6px 8px;
    margin-left: -8px;
    margin-right: -8px;
}
body.dark-theme .sg-contact.form-subgroup,
[data-bs-theme="dark"] .sg-contact.form-subgroup {
    border-color: #353940;
    border-left-color: #17a2b8;
}
body.dark-theme .sg-contact.form-subgroup > legend,
[data-bs-theme="dark"] .sg-contact.form-subgroup > legend {
    background: rgba(23, 162, 184, .22) !important;
    color: #6ecfcf !important;
}
body.dark-theme .sg-contact.form-subgroup .ab-legal-only,
[data-bs-theme="dark"] .sg-contact.form-subgroup .ab-legal-only {
    background: rgba(245, 158, 11, .10);
}
@media (prefers-reduced-motion: reduce) {
    .sg-finance.form-subgroup .form-control,
    .sg-finance.form-subgroup .form-select { transition: none; }
}

/* ════════════════════════════════════════════════════════════════
   Buttons — refined look (build 845)
   По мотивам hextaui/button: мягкие скругления, читаемая
   типографика, focus-ring зелёный, hover-приподнимание +1px,
   active press-эффект, disabled приглушённый. Применяется
   глобально ко всем .btn через стандартные Bootstrap-классы.
   Существующие background/color правила выше в файле сохраняются —
   мы только дополняем поведение и геометрию.
   ════════════════════════════════════════════════════════════════ */

.btn {
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: background-color .15s ease,
                border-color .15s ease,
                color .15s ease,
                box-shadow .18s ease,
                transform .12s ease;
    position: relative;
    /* анти-jitter: фиксируем минимальную высоту через padding */
    line-height: 1.4;
}
.btn-sm { border-radius: 6px; padding: .32rem .7rem; font-size: .82rem; }
.btn-lg { border-radius: 10px; padding: .65rem 1.25rem; font-size: 1.02rem; }
/* icon-only кнопки не приподнимаются (часто toolbar — было бы дёрганно) */
.btn:not(.btn-ab-icon):not(.btn-close):not(.btn-link):hover:not(:disabled):not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .10);
}
.btn:active:not(:disabled):not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
    transition-duration: .08s;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .30);
}
.btn:disabled, .btn.disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Variants — фокус-ring подстраивается под цвет кнопки */
.btn-primary:focus-visible,
.btn-success:focus-visible,
.btn-outline-primary:focus-visible,
.btn-outline-success:focus-visible {
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .35);
}
.btn-danger:focus-visible,
.btn-outline-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .30);
}
.btn-warning:focus-visible,
.btn-outline-warning:focus-visible {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .32);
}
.btn-info:focus-visible,
.btn-outline-info:focus-visible {
    box-shadow: 0 0 0 3px rgba(23, 162, 184, .30);
}
.btn-secondary:focus-visible,
.btn-outline-secondary:focus-visible,
.btn-light:focus-visible,
.btn-dark:focus-visible {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, .25);
}

/* Hover-тень для основных вариантов чуть усиливается фирменным цветом */
.btn-primary:hover:not(:disabled),
.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(67, 183, 122, .28);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(220, 53, 69, .26);
}
.btn-warning:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(245, 158, 11, .28);
}
.btn-info:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(23, 162, 184, .26);
}

/* Btn-link — без приподнимания и без рамки на focus, только подчёркивание */
.btn-link {
    text-decoration: none;
    border-radius: 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .25);
    text-decoration: underline;
}

/* Btn-group — внутренние кнопки сохраняют border-radius снаружи группы */
.btn-group > .btn:not(:first-child):not(.dropdown-toggle-split),
.btn-group > .btn:nth-child(n+3) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.btn-group > .btn:not(:last-child):not(.dropdown-toggle) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.btn-group .btn { transform: none !important; box-shadow: none !important; }
.btn-group .btn:focus-visible {
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .25);
}

/* Иконки внутри кнопок — лёгкая анимация при hover */
.btn i.fas, .btn i.far, .btn i.fa {
    transition: transform .15s ease;
}
.btn:hover:not(:disabled) i.fas,
.btn:hover:not(:disabled) i.far,
.btn:hover:not(:disabled) i.fa {
    transform: scale(1.06);
}

/* ── Тёмная тема ── */
body.dark-theme .btn:focus-visible,
[data-bs-theme="dark"] .btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .40);
}
body.dark-theme .btn:not(.btn-ab-icon):not(.btn-close):not(.btn-link):hover:not(:disabled):not(.disabled),
[data-bs-theme="dark"] .btn:not(.btn-ab-icon):not(.btn-close):not(.btn-link):hover:not(:disabled):not(.disabled) {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
body.dark-theme .btn-primary:hover:not(:disabled),
body.dark-theme .btn-success:hover:not(:disabled),
[data-bs-theme="dark"] .btn-primary:hover:not(:disabled),
[data-bs-theme="dark"] .btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(67, 183, 122, .42);
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn i.fas, .btn i.far, .btn i.fa { transition: none !important; }
    .btn:hover:not(:disabled), .btn:active { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   Карточка абонента — блоки «Основные» и «Смена тарифа / Блокировки»
   (build 846). Hero-стиль аналогично .sg-finance/.sg-contact из 843.
   .sg-main — фирменный зелёный (главный блок: hero-тариф + комментарии).
   .sg-tarif — янтарный (внимание: смены/блокировки).
   Группировки внутри .sg-tarif добавляет JS в show_fields.html (3d).
   ════════════════════════════════════════════════════════════════ */

.sg-main.form-subgroup,
.sg-tarif.form-subgroup {
    border: 1px solid var(--border-subtle, #e9ecef);
    border-radius: 10px;
    padding: 12px 14px 8px;
}
.sg-main.form-subgroup { border-left: 4px solid #43b77a; }
.sg-tarif.form-subgroup { border-left: 4px solid #f0ad4e; }

.sg-main.form-subgroup > legend,
.sg-tarif.form-subgroup > legend {
    font-size: .76rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 6px;
    border: none !important;
    margin-bottom: 10px;
    width: auto;
    display: inline-block;
}
.sg-main.form-subgroup > legend {
    background: rgba(67, 183, 122, .14) !important;
    color: #2e7d32 !important;
}
.sg-tarif.form-subgroup > legend {
    background: rgba(240, 173, 78, .18) !important;
    color: #8a5b1d !important;
}

/* Подгруппы внутри «Смена тарифа / Блокировки» — JS-разделители (3d) */
.sg-tarif .ab-tarif-subhead {
    font-size: .72rem;
    font-weight: 700;
    text-transform: none;   /* admin: без заглавных */
    letter-spacing: .5px;
    color: var(--text-secondary, #6c757d);
    padding: 8px 0 4px;
    margin-top: 6px;
    border-top: 1px dashed var(--border-subtle, #e9ecef);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sg-tarif .ab-tarif-subhead:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 2px;
}
.sg-tarif .ab-tarif-subhead i {
    color: #f0ad4e;
    font-size: .85em;
}
.sg-tarif .ab-tarif-subhead.ab-th-block-own i { color: #17a2b8; }
.sg-tarif .ab-tarif-subhead.ab-th-block-admin i { color: #dc3545; }

/* ── Тёмная тема ── */
body.dark-theme .sg-main.form-subgroup,
body.dark-theme .sg-tarif.form-subgroup,
[data-bs-theme="dark"] .sg-main.form-subgroup,
[data-bs-theme="dark"] .sg-tarif.form-subgroup {
    border-color: #353940;
}
body.dark-theme .sg-main.form-subgroup,
[data-bs-theme="dark"] .sg-main.form-subgroup { border-left-color: #43b77a; }
body.dark-theme .sg-tarif.form-subgroup,
[data-bs-theme="dark"] .sg-tarif.form-subgroup { border-left-color: #f0ad4e; }

body.dark-theme .sg-main.form-subgroup > legend,
[data-bs-theme="dark"] .sg-main.form-subgroup > legend {
    background: rgba(67, 183, 122, .22) !important;
    color: #8fdeb5 !important;
}
body.dark-theme .sg-tarif.form-subgroup > legend,
[data-bs-theme="dark"] .sg-tarif.form-subgroup > legend {
    background: rgba(240, 173, 78, .22) !important;
    color: #f4c785 !important;
}

body.dark-theme .sg-tarif .ab-tarif-subhead,
[data-bs-theme="dark"] .sg-tarif .ab-tarif-subhead {
    color: #adb5bd;
    border-top-color: #353940;
}

/* ════════════════════════════════════════════════════════════════
   Кастомные кнопки — унификация под единый язык .btn (build 847)
   На скриншоте пользователя кнопки «Рассчитать платёж», «Подробнее»,
   «Изменить тариф», «+ Добавить», «🗑 удалить» были разные по форме —
   у каждой свой radius/font-weight/hover. Build 845 переопределил
   только стандартный .btn, а кастомные классы (.ab-hero-tarif-btn,
   .ab-hero-cmt-add, .ab-hero-cmt-del, .btn-ab-icon, .abd-acc-toggle,
   .toggle-mob-card) обходили .btn-стиль. Привожу их к одному
   рисунку: радиус 8px (мелкие 6px), focus-ring 3px зелёный glow,
   hover translateY(-1px), transitions .15s.
   ════════════════════════════════════════════════════════════════ */

/* Кастомные «полноразмерные» кнопки: hero, чат, accordion-toggle */
.ab-hero-tarif-btn,
.ab-hero-cmt-add,
.smit-action-btn,
.btn-ab-confirm:not(.btn-ab-icon) {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: background-color .15s ease,
                border-color .15s ease,
                color .15s ease,
                box-shadow .18s ease,
                transform .12s ease !important;
}
.ab-hero-tarif-btn:hover:not(:disabled),
.ab-hero-cmt-add:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 183, 122, .28) !important;
}
.ab-hero-tarif-btn:active:not(:disabled),
.ab-hero-cmt-add:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(67, 183, 122, .22) !important;
    transition-duration: .08s !important;
}
.ab-hero-tarif-btn:focus-visible,
.ab-hero-cmt-add:focus-visible,
.ab-hero-cmt-del:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .35) !important;
}

/* Иконочные кнопки (toolbar, удалить, accordion-каретка) — общий ring */
.btn-ab-icon,
.ab-hero-cmt-del,
.abd-acc-toggle,
.btn-close {
    border-radius: 6px !important;
    transition: background-color .15s ease,
                color .15s ease,
                box-shadow .18s ease,
                opacity .15s ease !important;
}
.btn-ab-icon:focus-visible,
.abd-acc-toggle:focus-visible,
.btn-close:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .30) !important;
}
.ab-hero-cmt-del:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .30) !important;
}

/* Все link-кнопки (внутри карточек hero, drawer'а, accordion'ов) —
   единый focus-ring без outline, чтобы не смешивался стиль */
.ab-hero-acc-login:focus-visible,
.ab-hero-acc-more:focus-visible,
.smit-action-btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .25) !important;
    border-radius: 4px;
}

/* Тёмная тема — focus-ring ярче */
body.dark-theme .ab-hero-tarif-btn:focus-visible,
body.dark-theme .ab-hero-cmt-add:focus-visible,
body.dark-theme .btn-ab-icon:focus-visible,
body.dark-theme .abd-acc-toggle:focus-visible,
body.dark-theme .btn-close:focus-visible,
[data-bs-theme="dark"] .ab-hero-tarif-btn:focus-visible,
[data-bs-theme="dark"] .ab-hero-cmt-add:focus-visible,
[data-bs-theme="dark"] .btn-ab-icon:focus-visible,
[data-bs-theme="dark"] .abd-acc-toggle:focus-visible,
[data-bs-theme="dark"] .btn-close:focus-visible {
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .45) !important;
}
body.dark-theme .ab-hero-tarif-btn:hover:not(:disabled),
body.dark-theme .ab-hero-cmt-add:hover:not(:disabled),
[data-bs-theme="dark"] .ab-hero-tarif-btn:hover:not(:disabled),
[data-bs-theme="dark"] .ab-hero-cmt-add:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(67, 183, 122, .42) !important;
}

@media (prefers-reduced-motion: reduce) {
    .ab-hero-tarif-btn,
    .ab-hero-cmt-add,
    .ab-hero-cmt-del,
    .btn-ab-icon,
    .abd-acc-toggle,
    .btn-close,
    .smit-action-btn { transition: none !important; }
    .ab-hero-tarif-btn:hover, .ab-hero-cmt-add:hover,
    .ab-hero-tarif-btn:active, .ab-hero-cmt-add:active { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   ЕДИНЫЙ СТИЛЬ КНОПОК — свод всех Bootstrap-вариантов (build 849)
   В проекте используются 14+ вариантов .btn-* в 80 шаблонах для
   по-смыслу одинаковых действий. Build 845/847 унифицировали
   геометрию, но цвета оставались разные (.btn-light vs
   .btn-secondary vs .btn-outline-secondary, .btn-info vs .btn-success).
   Свожу к 3 палитрам:
   - PRIMARY (зелёный fill): .btn-primary, .btn-success, .btn-info
   - SECONDARY (серый outline): .btn-light, .btn-secondary,
     .btn-outline-secondary, .btn-outline-light, .btn-outline-info
   - PRIMARY OUTLINE (зелёный outline → fill): .btn-outline-primary,
     .btn-outline-success
   - DESTRUCTIVE (красный/янтарный): .btn-danger/.btn-warning/outline
   Этот блок находится в самом конце файла и побеждает все
   предыдущие правила за счёт порядка каскада + !important.
   ════════════════════════════════════════════════════════════════ */

/* === PRIMARY palette (зелёный fill) === */
.btn-primary,
.btn-success,
.btn-info {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    color: #fff !important;
}
.btn-primary:hover:not(:disabled),
.btn-success:hover:not(:disabled),
.btn-info:hover:not(:disabled) {
    background-color: #379963 !important;
    border-color: #379963 !important;
    color: #fff !important;
}
.btn-primary:active:not(:disabled),
.btn-success:active:not(:disabled),
.btn-info:active:not(:disabled),
.btn-check:checked + .btn-primary,
.btn-check:checked + .btn-success,
.btn-check:checked + .btn-info {
    background-color: #2f8956 !important;
    border-color: #2f8956 !important;
    color: #fff !important;
}

/* === PRIMARY OUTLINE (зелёный outline → fill) === */
.btn-outline-primary,
.btn-outline-success {
    color: #379963 !important;
    border-color: #43b77a !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover:not(:disabled),
.btn-outline-success:hover:not(:disabled) {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    color: #fff !important;
}
.btn-outline-primary:active:not(:disabled),
.btn-outline-success:active:not(:disabled),
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-success {
    background-color: #379963 !important;
    border-color: #379963 !important;
    color: #fff !important;
}

/* === SECONDARY palette (серый outline) === */
.btn-secondary,
.btn-light,
.btn-outline-secondary,
.btn-outline-light,
.btn-outline-info {
    background-color: transparent !important;
    color: #495057 !important;
    border-color: #ced4da !important;
}
.btn-secondary:hover:not(:disabled),
.btn-light:hover:not(:disabled),
.btn-outline-secondary:hover:not(:disabled),
.btn-outline-light:hover:not(:disabled),
.btn-outline-info:hover:not(:disabled) {
    background-color: #f1f3f5 !important;
    color: #212529 !important;
    border-color: #adb5bd !important;
}
.btn-secondary:active:not(:disabled),
.btn-light:active:not(:disabled),
.btn-outline-secondary:active:not(:disabled),
.btn-outline-light:active:not(:disabled),
.btn-outline-info:active:not(:disabled),
.btn-check:checked + .btn-secondary,
.btn-check:checked + .btn-light,
.btn-check:checked + .btn-outline-secondary {
    background-color: #e9ecef !important;
    color: #212529 !important;
    border-color: #adb5bd !important;
}

/* === DESTRUCTIVE/WARNING palette === */
.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}
.btn-danger:hover:not(:disabled) {
    background-color: #b02a37 !important;
    border-color: #b02a37 !important;
}
.btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    background-color: transparent !important;
}
.btn-outline-danger:hover:not(:disabled) {
    background-color: #dc3545 !important;
    color: #fff !important;
}
.btn-warning {
    background-color: #f0ad4e !important;
    border-color: #f0ad4e !important;
    color: #fff !important;
}
.btn-warning:hover:not(:disabled) {
    background-color: #ec971f !important;
    border-color: #ec971f !important;
    color: #fff !important;
}
.btn-outline-warning {
    color: #b8860b !important;
    border-color: #f0ad4e !important;
    background-color: transparent !important;
}
.btn-outline-warning:hover:not(:disabled) {
    background-color: #f0ad4e !important;
    color: #fff !important;
}

/* === Кастомные кнопки в карточке абонента — сводим к тем же 3 палитрам === */
/* «Изменить тариф» (.ab-hero-tarif-btn) — используется как outline-primary */
.ab-hero-tarif-btn {
    background-color: transparent !important;
    color: #379963 !important;
    border-color: #43b77a !important;
}
.ab-hero-tarif-btn:hover:not(:disabled) {
    background-color: #43b77a !important;
    color: #fff !important;
    border-color: #43b77a !important;
}
/* «+ Добавить» комментарий (.ab-hero-cmt-add) — primary fill */
.ab-hero-cmt-add {
    background-color: #43b77a !important;
    color: #fff !important;
    border-color: #43b77a !important;
}
.ab-hero-cmt-add:hover:not(:disabled) {
    background-color: #379963 !important;
    border-color: #379963 !important;
    color: #fff !important;
}
/* Single-icon utility-кнопки в шапке абонента (.btn-ab-icon) — secondary outline */
.btn-ab-icon {
    border: 1px solid transparent !important;
    color: #6c757d !important;
    background: transparent !important;
}
.btn-ab-icon:hover:not(:disabled) {
    background: #f1f3f5 !important;
    color: #212529 !important;
    border-color: #ced4da !important;
}

/* === Кнопки внутри красных/коричневых banner'ов (.abon-banner) ===
   На красном фоне .btn-light и .btn-outline-secondary становятся
   серыми и теряются. Делаем им белый стиль с прозрачным фоном. */
.abon-banner .btn-light,
.abon-banner .btn-outline-secondary,
.abon-banner .btn-outline-light,
.abon-banner .btn-secondary,
.abon-banner-diag .btn-light,
.abon-banner-diag .btn-outline-secondary,
.abon-banner-diag .btn-outline-light,
.abon-banner-diag .btn-secondary {
    background-color: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .35) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.abon-banner .btn-light:hover:not(:disabled),
.abon-banner .btn-outline-secondary:hover:not(:disabled),
.abon-banner .btn-outline-light:hover:not(:disabled),
.abon-banner .btn-secondary:hover:not(:disabled),
.abon-banner-diag .btn-light:hover:not(:disabled),
.abon-banner-diag .btn-outline-secondary:hover:not(:disabled),
.abon-banner-diag .btn-outline-light:hover:not(:disabled),
.abon-banner-diag .btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, .26) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .55) !important;
}

/* === Disabled — единое приглушение для всех вариантов === */
.btn:disabled, .btn.disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

/* === Тёмная тема: secondary палитра адаптируется к тёмному фону === */
body.dark-theme .btn-secondary,
body.dark-theme .btn-light,
body.dark-theme .btn-outline-secondary,
body.dark-theme .btn-outline-light,
body.dark-theme .btn-outline-info,
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-light,
[data-bs-theme="dark"] .btn-outline-info {
    color: #adb5bd !important;
    border-color: #3a3f47 !important;
    background-color: transparent !important;
}
body.dark-theme .btn-secondary:hover:not(:disabled),
body.dark-theme .btn-light:hover:not(:disabled),
body.dark-theme .btn-outline-secondary:hover:not(:disabled),
body.dark-theme .btn-outline-light:hover:not(:disabled),
body.dark-theme .btn-outline-info:hover:not(:disabled),
[data-bs-theme="dark"] .btn-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .btn-light:hover:not(:disabled),
[data-bs-theme="dark"] .btn-outline-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .btn-outline-light:hover:not(:disabled),
[data-bs-theme="dark"] .btn-outline-info:hover:not(:disabled) {
    background-color: #2b2f33 !important;
    color: #e7eaf0 !important;
    border-color: #4a5057 !important;
}

/* ════════════════════════════════════════════════════════════════
   Подсветка незаполненных полей (build 857)
   На .sg-contact (и других hero-блоках) JS навешивает класс
   .smit-empty на input/select когда значение пустое — оператор
   сразу видит «что нужно дозаполнить».
   ════════════════════════════════════════════════════════════════ */
.smit-empty,
.smit-empty + .select2-container .select2-selection {
    border-color: #f1aeb5 !important;
    background-color: rgba(220, 53, 69, .04) !important;
    box-shadow: inset 0 0 0 1px rgba(220, 53, 69, .12) !important;
}
.smit-empty:focus,
.smit-empty + .select2-container--focus .select2-selection,
.smit-empty + .select2-container--open .select2-selection {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .18) !important;
}
body.dark-theme .smit-empty,
body.dark-theme .smit-empty + .select2-container .select2-selection,
[data-bs-theme="dark"] .smit-empty,
[data-bs-theme="dark"] .smit-empty + .select2-container .select2-selection {
    border-color: #6b3a40 !important;
    background-color: rgba(220, 53, 69, .08) !important;
}
body.dark-theme .smit-empty:focus,
[data-bs-theme="dark"] .smit-empty:focus {
    border-color: #ef6f7c !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .25) !important;
}

/* ════════════════════════════════════════════════════════════════
   ЕДИНЫЙ СТИЛЬ ЧЕКБОКСОВ + ТОГГЛОВ (build 857)
   По мотивам ShadcnStudio/checkbox-1 (чекбоксы) и reui/toggle-group-1
   (toggle-groups). Глобально для .form-check-input и нативных
   <input type=checkbox> через стандартные Bootstrap-классы.
   ════════════════════════════════════════════════════════════════ */

/* === Чекбоксы (.form-check-input[type=checkbox] без .form-switch) ===
   Build 859 fix: добавлен appearance:none — иначе старое правило
   2653 (appearance:auto + accent-color) рисовало нативную галочку
   поверх SVG-фона, и текст лейбла наезжал. */
.form-check-input[type="checkbox"]:not([role="switch"]) {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    border: 1.5px solid #ced4da !important;
    background-color: #fff !important;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease,
                box-shadow .15s ease;
    margin-top: .15em;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Bootstrap .form-check: padding-left под 18px чекбокс (1.25em вместо 1.5em
   слишком узко при новом размере). Лейбл получает gap через padding-left
   на самой метке — иначе при flex-row с gap соседние .form-check слипаются. */
.form-check:not(.form-switch) {
    padding-left: 1.65em;
    min-height: 1.5rem;
}
.form-check:not(.form-switch) .form-check-input {
    margin-left: -1.65em !important;
}
.form-check:not(.form-switch) .form-check-label {
    padding-left: .25em;
    line-height: 1.5;
}
.form-check-input[type="checkbox"]:not([role="switch"]):hover:not(:disabled) {
    border-color: #43b77a !important;
}
.form-check-input[type="checkbox"]:not([role="switch"]):focus:not(:disabled) {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .22) !important;
    outline: none !important;
}
.form-check-input[type="checkbox"]:not([role="switch"]):checked {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    /* белая галочка */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
    background-size: 70% 70% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.form-check-input[type="checkbox"]:not([role="switch"]):checked:hover:not(:disabled) {
    background-color: #379963 !important;
    border-color: #379963 !important;
}
.form-check-input[type="checkbox"]:not([role="switch"]):indeterminate {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='3' d='M5 10h10'/%3e%3c/svg%3e") !important;
}
.form-check-input[type="checkbox"]:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

/* === Радио (.form-check-input[type=radio]) === */
.form-check-input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    border: 1.5px solid #ced4da !important;
    background-color: #fff !important;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease,
                box-shadow .15s ease;
    margin-top: .15em;
    flex-shrink: 0;
    vertical-align: middle;
}
.form-check-input[type="radio"]:hover:not(:disabled) { border-color: #43b77a !important; }
.form-check-input[type="radio"]:focus:not(:disabled) {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .22) !important;
    outline: none !important;
}
.form-check-input[type="radio"]:checked {
    background-color: #fff !important;
    border-color: #43b77a !important;
    /* зелёная точка */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2.4' fill='%2343b77a'/%3e%3c/svg%3e") !important;
}

/* === Свитчи (.form-switch / role=switch) — pill-style toggle === */
.form-switch .form-check-input,
.form-check-input[role="switch"] {
    width: 38px !important;
    height: 22px !important;
    border-radius: 999px !important;
    border: 1.5px solid #ced4da !important;
    background-color: #e9ecef !important;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease,
                box-shadow .2s ease;
    /* белый «шарик» через background-image */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-position: left center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
}
.form-switch .form-check-input:focus,
.form-check-input[role="switch"]:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .22) !important;
    outline: none !important;
}
.form-switch .form-check-input:checked,
.form-check-input[role="switch"]:checked {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
    background-position: right center !important;
}
.form-switch .form-check-input:disabled,
.form-check-input[role="switch"]:disabled { opacity: .55 !important; cursor: not-allowed; }

/* Лейбл рядом с чекбоксом/свитчем */
.form-check-label {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    padding-left: 4px;
}
.form-check-input:disabled ~ .form-check-label { cursor: not-allowed; opacity: .65; }

/* === Toggle-group (.btn-check + .btn внутри .btn-group) ===
   По мотивам reui/toggle-group-1: pill-style контейнер,
   активная кнопка фирменная зелёная, единая высота. */
.btn-group:has(.btn-check) {
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    overflow: hidden;
}
.btn-check + .btn,
.btn-group .btn-check + .btn {
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
    color: #495057 !important;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease,
                box-shadow .15s ease, transform .12s ease;
}
.btn-check + .btn:hover:not(:disabled),
.btn-group .btn-check + .btn:hover:not(:disabled) {
    background: rgba(67, 183, 122, .10) !important;
    color: #379963 !important;
    transform: none;
    box-shadow: none !important;
}
.btn-check:checked + .btn,
.btn-check:active + .btn,
.btn-group .btn-check:checked + .btn {
    background: #43b77a !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(67, 183, 122, .35) !important;
    transform: none;
}
.btn-check:checked + .btn:hover:not(:disabled),
.btn-group .btn-check:checked + .btn:hover:not(:disabled) {
    background: #379963 !important;
    color: #fff !important;
}
.btn-check:focus-visible + .btn,
.btn-group .btn-check:focus-visible + .btn {
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .30) !important;
}
.btn-check:disabled + .btn { opacity: .55 !important; cursor: not-allowed; }

/* === Поля даты (input[type=date], input[type=datetime-local]) ===
   По мотивам ruixenui/chrono-select: скруглённый, фирменный
   focus-ring, стилизованная calendar-иконка. */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 6px 10px;
    font-size: .9rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    cursor: pointer;
    background-color: #fff;
}
input[type="date"]:hover:not(:disabled),
input[type="datetime-local"]:hover:not(:disabled),
input[type="time"]:hover:not(:disabled) {
    border-color: #43b77a;
}
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus {
    border-color: #43b77a !important;
    box-shadow: 0 0 0 3px rgba(67, 183, 122, .22) !important;
    outline: none;
}
/* Calendar-icon в WebKit */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .55;
    padding: 4px;
    border-radius: 4px;
    transition: opacity .15s ease, background-color .15s ease;
    filter: invert(40%) sepia(70%) saturate(380%) hue-rotate(100deg) brightness(.85);
}
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
    background-color: rgba(67, 183, 122, .12);
}
input[type="date"]:disabled,
input[type="datetime-local"]:disabled,
input[type="time"]:disabled {
    opacity: .55;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* === Тёмная тема для всех трёх компонентов === */
body.dark-theme .form-check-input[type="checkbox"]:not([role="switch"]),
body.dark-theme .form-check-input[type="radio"],
[data-bs-theme="dark"] .form-check-input[type="checkbox"]:not([role="switch"]),
[data-bs-theme="dark"] .form-check-input[type="radio"] {
    background-color: #2b2f33 !important;
    border-color: #4a5057 !important;
}
body.dark-theme .form-check-input[type="checkbox"]:not([role="switch"]):checked,
[data-bs-theme="dark"] .form-check-input[type="checkbox"]:not([role="switch"]):checked {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
}
body.dark-theme .form-check-input[type="radio"]:checked,
[data-bs-theme="dark"] .form-check-input[type="radio"]:checked {
    background-color: #2b2f33 !important;
    border-color: #43b77a !important;
}
body.dark-theme .form-switch .form-check-input,
body.dark-theme .form-check-input[role="switch"],
[data-bs-theme="dark"] .form-switch .form-check-input,
[data-bs-theme="dark"] .form-check-input[role="switch"] {
    background-color: #3a3f47 !important;
    border-color: #4a5057 !important;
}
body.dark-theme .form-switch .form-check-input:checked,
body.dark-theme .form-check-input[role="switch"]:checked,
[data-bs-theme="dark"] .form-switch .form-check-input:checked,
[data-bs-theme="dark"] .form-check-input[role="switch"]:checked {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
}
body.dark-theme .btn-group:has(.btn-check),
[data-bs-theme="dark"] .btn-group:has(.btn-check) {
    background-color: #22262e;
    border-color: #353940;
}
body.dark-theme .btn-check + .btn,
[data-bs-theme="dark"] .btn-check + .btn { color: #adb5bd !important; }
body.dark-theme .btn-check + .btn:hover:not(:disabled),
[data-bs-theme="dark"] .btn-check + .btn:hover:not(:disabled) {
    background: rgba(67, 183, 122, .18) !important;
    color: #65d0a0 !important;
}
body.dark-theme input[type="date"],
body.dark-theme input[type="datetime-local"],
body.dark-theme input[type="time"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] input[type="datetime-local"],
[data-bs-theme="dark"] input[type="time"] {
    background-color: #1e2530;
    border-color: #3a3f47;
    color: #e7eaf0;
    color-scheme: dark;
}
body.dark-theme input[type="date"]:disabled,
body.dark-theme input[type="datetime-local"]:disabled,
[data-bs-theme="dark"] input[type="date"]:disabled,
[data-bs-theme="dark"] input[type="datetime-local"]:disabled {
    background-color: #2b2f33;
}

@media (prefers-reduced-motion: reduce) {
    .form-check-input,
    .btn-check + .btn,
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"] { transition: none !important; }
    .btn-check + .btn { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   jQuery UI datepicker — фирменные цвета (build 858)
   На скриншоте пользователя build 857 не дал эффекта, потому что
   в проекте используется НЕ нативный <input type="date">, а
   jQuery UI datepicker (jquery-ui-1.13.3) — он рисует свой
   календарь .ui-datepicker. Существующий стиль в bs-compat.css
   использует #28a745 (старый Bootstrap success), переопределяем
   на фирменный #43b77a + добавляем dark-theme + скругления.
   ════════════════════════════════════════════════════════════════ */

/* Контейнер календаря */
.ui-datepicker {
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16),
                0 2px 8px rgba(15, 23, 42, .08) !important;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .08) !important;
}

/* build 888: mobile — datepicker как bottom-sheet (slide-up, full-width).
   jQuery UI выставляет inline `position:absolute; top:Xpx; left:Ypx;` —
   переопределяем через !important + большой z-index. */
@media (max-width: 767.98px) {
    .ui-datepicker {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: 0 !important;
        z-index: 10000 !important;
        padding: 16px 12px !important;
        animation: ui-datepicker-slideup .2s ease-out;
        max-height: 80vh;
        overflow-y: auto;
    }
    .ui-datepicker .ui-datepicker-header {
        border-radius: 8px !important;
        margin-bottom: 8px;
    }
    .ui-datepicker table {
        width: 100% !important;
        font-size: 1rem !important;
    }
    .ui-datepicker td a,
    .ui-datepicker td span {
        width: 38px !important;
        height: 38px !important;
        font-size: .95rem !important;
    }
    .ui-datepicker .ui-datepicker-buttonpane {
        padding-top: 12px !important;
        margin-top: 4px !important;
    }
}
@keyframes ui-datepicker-slideup {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .ui-datepicker { animation: none !important; }
}

/* build 888: универсальный bottom-sheet для Bootstrap-модалок на mobile.
   Класс .smit-mobile-sheet добавляется к .modal — на mobile модалка
   выезжает снизу слайд-панелью на всю ширину с оптимальной высотой.
   На desktop поведение стандартное (modal-dialog-centered). */
@media (max-width: 767.98px) {
    .smit-mobile-sheet .modal-dialog {
        margin: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 0 !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        transform: translateY(0) !important;
        pointer-events: none;
    }
    .smit-mobile-sheet .modal-content {
        border-radius: 16px 16px 0 0 !important;
        border-bottom: 0 !important;
        max-height: 88vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        animation: smit-sheet-slideup .22s ease-out;
        pointer-events: auto;
        box-shadow: 0 -8px 28px rgba(15, 23, 42, .22);
    }
    .smit-mobile-sheet .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 14px 16px !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important;
    }
    .smit-mobile-sheet .modal-header {
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(15, 23, 42, .08);
        flex-shrink: 0;
    }
    .smit-mobile-sheet .modal-header::before {
        /* «pull-handle» сверху как у iOS bottom-sheet */
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(15, 23, 42, .18);
    }
    .smit-mobile-sheet .modal-header {
        position: relative;
        padding-top: 18px !important;
    }
    .smit-mobile-sheet .modal-footer {
        padding: 10px 16px !important;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
        flex-shrink: 0;
        border-top: 1px solid rgba(15, 23, 42, .08);
        gap: 8px;
    }
    .smit-mobile-sheet .modal-footer .btn {
        flex: 1 1 0;
        padding-top: .55rem !important;
        padding-bottom: .55rem !important;
    }
    /* fade-анимация фона */
    .smit-mobile-sheet.fade .modal-dialog { transition: none; }
}
@keyframes smit-sheet-slideup {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .smit-mobile-sheet .modal-content { animation: none !important; }
}

/* build 888: dark-theme overrides для всех новых элементов */
body.dark-theme .smit-mobile-sheet .modal-content,
[data-bs-theme="dark"] .smit-mobile-sheet .modal-content {
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .55);
}
body.dark-theme .smit-mobile-sheet .modal-header,
body.dark-theme .smit-mobile-sheet .modal-footer,
[data-bs-theme="dark"] .smit-mobile-sheet .modal-header,
[data-bs-theme="dark"] .smit-mobile-sheet .modal-footer {
    border-color: rgba(255, 255, 255, .08);
}
body.dark-theme .smit-mobile-sheet .modal-header::before,
[data-bs-theme="dark"] .smit-mobile-sheet .modal-header::before {
    background: rgba(255, 255, 255, .25);
}
/* Comment + button label — dark не нуждается в override (используем bootstrap btn-success) */
/* .ab-flat-merged / .ab-entrance-merged — dark-цвета уже заданы выше через .ab-pair-sublabel */

/* Tarif-modal item на mobile — на dark уже отображается корректно (наследует bs5 theme),
   но проверим что иконка стрелки контрастна */
body.dark-theme .tarif-pick-item .fa-arrow-right,
[data-bs-theme="dark"] .tarif-pick-item .fa-arrow-right {
    color: #adb5bd;
}

/* Mobile tabs — активная вкладка на dark уже работает (наш градиент 135deg остаётся ярким),
   но добавим лёгкий glow для контраста */
body.dark-theme .ab-navbar-tabs.ab-navbar-tabs .nav-link.active,
[data-bs-theme="dark"] .ab-navbar-tabs.ab-navbar-tabs .nav-link.active {
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(67, 183, 122, .25);
}

/* Mobile header — abonent-title-bar в dark при отриц. балансе / низком балансе уже
   имеет свой gradient (см. блок «build 886: модификатор шапки» выше). Иконки и текст
   должны быть читаемы — проверим контраст */
body.dark-theme .abonent-title-bar-debt .abonent-title-id,
[data-bs-theme="dark"] .abonent-title-bar-debt .abonent-title-id {
    color: #ffb3b3 !important;
}
body.dark-theme .abonent-title-bar-low .abonent-title-id,
[data-bs-theme="dark"] .abonent-title-bar-low .abonent-title-id {
    color: #ffd479 !important;
}
body.dark-theme .abonent-title-bar-debt .abonent-title-name,
body.dark-theme .abonent-title-bar-low .abonent-title-name,
[data-bs-theme="dark"] .abonent-title-bar-debt .abonent-title-name,
[data-bs-theme="dark"] .abonent-title-bar-low .abonent-title-name {
    color: #f8f9fa !important;
}

/* abon-banner pattern overlay в dark остаётся ок (мы используем rgba(255,255,255,.x)
   который работает на любом фоне). Иконки внутри уже белые. */

/* Datepicker bottom-sheet в dark — переопределим фон */
@media (max-width: 767.98px) {
    body.dark-theme .ui-datepicker,
    [data-bs-theme="dark"] .ui-datepicker {
        background: #1e2530 !important;
        border-color: rgba(255, 255, 255, .12) !important;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, .55) !important;
    }
}

/* Header — фирменный зелёный */
.ui-datepicker .ui-datepicker-header {
    background: #43b77a !important;
}

/* build 888: ячейки td должны быть выровнены по центру (по линии) и одинакового размера */
.ui-datepicker td {
    padding: 1px !important;
    text-align: center !important;
}
/* build 888: круглый indicator для всех ячеек дат — круг 30×30 по центру (display flex),
   чтобы кружок сегодня/выбранной даты НЕ смещался относительно цифры. */
.ui-datepicker td a,
.ui-datepicker td span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    text-align: center !important;
    margin: 0 auto !important;
}

/* Today (сегодняшняя дата, не выбранная) — мягкий зелёный фон в круге */
.ui-datepicker .ui-datepicker-today a {
    background: #e8f5e9 !important;
    color: #379963 !important;
    border-radius: 50% !important;
}

/* Selected — фирменный fill, круглый */
.ui-datepicker .ui-datepicker-current-day a {
    background: #43b77a !important;
    color: #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(67, 183, 122, .35);
}

/* Hover на ячейке — круглая подложка */
.ui-datepicker td a:hover {
    background: rgba(67, 183, 122, .14) !important;
    color: #379963 !important;
    border-radius: 50% !important;
}

/* Кнопки «Сегодня / Закрыть» */
.ui-datepicker .ui-datepicker-buttonpane button {
    color: #379963 !important;
    border-radius: 6px !important;
}
.ui-datepicker .ui-datepicker-buttonpane button:hover {
    background: rgba(67, 183, 122, .12) !important;
}

/* === Тёмная тема === */
body.dark-theme .ui-datepicker,
[data-bs-theme="dark"] .ui-datepicker {
    background: #22262e !important;
    border-color: #353940 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55),
                0 2px 8px rgba(0, 0, 0, .35) !important;
}
body.dark-theme .ui-datepicker .ui-datepicker-header,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-header {
    background: #379963 !important;
}
body.dark-theme .ui-datepicker td a,
[data-bs-theme="dark"] .ui-datepicker td a { color: #d8e0e8 !important; }
body.dark-theme .ui-datepicker td span,
[data-bs-theme="dark"] .ui-datepicker td span { color: #6c757d !important; }
body.dark-theme .ui-datepicker td a:hover,
[data-bs-theme="dark"] .ui-datepicker td a:hover {
    background: rgba(67, 183, 122, .22) !important;
    color: #8fdeb5 !important;
}
body.dark-theme .ui-datepicker .ui-datepicker-today a,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-today a {
    background: rgba(67, 183, 122, .15) !important;
    color: #65d0a0 !important;
}
body.dark-theme .ui-datepicker .ui-datepicker-current-day a,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-current-day a {
    background: #43b77a !important;
    color: #fff !important;
}
body.dark-theme .ui-datepicker th,
[data-bs-theme="dark"] .ui-datepicker th { color: #adb5bd !important; }
body.dark-theme .ui-datepicker .ui-datepicker-buttonpane,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-buttonpane {
    background: #1e2530 !important;
    border-top-color: #353940 !important;
}
body.dark-theme .ui-datepicker .ui-datepicker-buttonpane button,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-buttonpane button {
    color: #65d0a0 !important;
}
body.dark-theme .ui-datepicker .ui-datepicker-buttonpane button:hover,
[data-bs-theme="dark"] .ui-datepicker .ui-datepicker-buttonpane button:hover {
    background: rgba(67, 183, 122, .22) !important;
}

/* === i-иконки документации на legend'ах hero-блоков (build 861) === */
.smit-doc-link {
    color: rgba(255, 255, 255, .75);
    margin-left: 4px;
    font-size: .8em;
    transition: color .15s ease, transform .12s ease;
    text-decoration: none !important;
    display: inline-block;
}
.smit-doc-link:hover { color: #fff; transform: scale(1.15); }
.smit-doc-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .6);
    outline-offset: 2px;
    border-radius: 3px;
}
/* На светлых legend'ах (.sg-finance / .sg-tarif с пастельной плашкой) — приглушённый зелёный */
.sg-finance > legend .smit-doc-link,
.sg-tarif > legend .smit-doc-link,
.sg-contact > legend .smit-doc-link,
.sg-main > legend .smit-doc-link {
    color: rgba(67, 183, 122, .65);
}
.sg-finance > legend .smit-doc-link:hover,
.sg-tarif > legend .smit-doc-link:hover,
.sg-contact > legend .smit-doc-link:hover,
.sg-main > legend .smit-doc-link:hover {
    color: #379963;
}
body.dark-theme .sg-finance > legend .smit-doc-link,
body.dark-theme .sg-tarif > legend .smit-doc-link,
body.dark-theme .sg-contact > legend .smit-doc-link,
body.dark-theme .sg-main > legend .smit-doc-link,
[data-bs-theme="dark"] .sg-finance > legend .smit-doc-link,
[data-bs-theme="dark"] .sg-tarif > legend .smit-doc-link,
[data-bs-theme="dark"] .sg-contact > legend .smit-doc-link,
[data-bs-theme="dark"] .sg-main > legend .smit-doc-link {
    color: rgba(67, 183, 122, .85);
}

/* ═══════════════════════════════════════════════════════════════════════
   build 886: визуальные правки шапки абонента, баннеров и чекбокса «Юр. лицо»
   ═══════════════════════════════════════════════════════════════════════ */

/* 1. Иконка кошелька — оранжевый бейдж для низкого баланса (между долгом и нормой) */
.abonent-title-balance-low {
    background: linear-gradient(135deg, #ff9a3d, #ff7a18);
    color: #fff !important;
    font-size: .85rem;
    padding: 6px 14px;
    border-radius: 0.375rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(255, 122, 24, .25);
}
.abonent-title-balance-low i.fa-wallet { color: #fff; }

/* 2. Шапка абонента — окрашивание по балансу */
.abonent-title-bar-debt {
    background: linear-gradient(90deg, #f8d3d3, #f3c0c0) !important;
    border: 1px solid #e05555 !important;
}
.abonent-title-bar-low {
    background: linear-gradient(90deg, #fff3e0, #ffe7c2) !important;
    border: 1px solid #ffb060 !important;
}
body.dark-theme .abonent-title-bar-debt,
[data-bs-theme="dark"] .abonent-title-bar-debt {
    background: linear-gradient(90deg, #4a2628, #3a1f22) !important;
    border-color: #7a3a3a !important;
}
body.dark-theme .abonent-title-bar-low,
[data-bs-theme="dark"] .abonent-title-bar-low {
    background: linear-gradient(90deg, #3a2c1d, #2f2618) !important;
    border-color: #8a6028 !important;
}

/* 3. .abon-banner — скруглённые углы 8px (запрос admin'а build 886) */
.abon-banner {
    border-radius: 8px !important;
}

/* 4. .abon-banner-body — выровнять по нижней линии, иконка — по верхней
      (запрос admin'а: чтобы заголовок и подзаголовок «прижимались» к низу карточки,
       а статусная иконка была на уровне верха карточки) */
.abon-banner {
    display: flex !important;
    align-items: stretch !important;
}
.abon-banner-icon {
    align-self: flex-start !important;
    margin-top: 2px;
}
.abon-banner-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;  /* прижать содержимое к низу */
    flex: 1 1 auto;
}

/* 5. Background pattern для .abon-banner-diag в зависимости от статуса
      Ненавязчивый SVG-pattern поверх существующего градиента — добавляет глубину
      и помогает мгновенно отличить статус, не нагружая визуально. */
.abon-banner-diag {
    position: relative;
    overflow: hidden;
}
.abon-banner-diag::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .12;
    background-repeat: repeat;
    background-size: 28px 28px;
}
/* Green — спокойные диагональные полосы */
.abon-banner-diag.abon-banner-diag-green::before {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, .35) 0,
        rgba(255, 255, 255, .35) 1px,
        transparent 1px,
        transparent 14px
    );
}
/* Yellow — точки (внимание, но не тревога) */
.abon-banner-diag.abon-banner-diag-yellow::before {
    background-image: radial-gradient(
        rgba(255, 255, 255, .45) 1.5px,
        transparent 2px
    );
    background-size: 14px 14px;
    opacity: .18;
}
/* Red — диагональные «штрихи опасности» (как разметка на дорожных знаках) */
.abon-banner-diag.abon-banner-diag-red::before {
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, .35) 0,
        rgba(255, 255, 255, .35) 2px,
        transparent 2px,
        transparent 12px
    );
    opacity: .18;
}
/* Gray (диагностика недоступна) — мелкие пунктиры */
.abon-banner-diag.abon-banner-diag-gray::before {
    background-image: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, .25) 0,
        rgba(255, 255, 255, .25) 1px,
        transparent 1px,
        transparent 8px
    );
}
/* Содержимое над паттерном */
.abon-banner-diag > .abon-banner-icon,
.abon-banner-diag > .abon-banner-body,
.abon-banner-diag > .abon-banner-actions {
    position: relative;
    z-index: 1;
}

/* 6. Чекбокс «Юр. лицо» — выделенный блок с акцентом (build 888 — упрощённая структура) */
/* build 888 — переоформлено build 889: компактный, ненавязчивый блок «Юр. лицо» */
.ab-company-row {
    background: rgba(67, 138, 122, .04);
    border: 1px solid rgba(67, 138, 122, .18);
    border-radius: 6px;
    padding: 6px 10px;
    margin: 6px 0;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out;
    display: block !important;
    flex-wrap: unset !important;
    width: 100%;
}
.ab-company-row.is-on {
    background: rgba(67, 138, 122, .09);
    border-color: rgba(67, 138, 122, .42);
}
/* Главная строка — label слева + toggle справа в одну линию */
.ab-company-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 28px;
}
/* build 892: тогл-переключатель ровно по вертикальному центру строки.
   Bootstrap form-check имеет min-height и default margin-top:.25em на input — это смещало кружок вниз. */
.ab-company-switch.form-check {
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}
.ab-company-switch .form-check-input {
    margin-top: 0 !important;
    align-self: center !important;
    vertical-align: middle !important;
}
.ab-company-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.ab-company-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem;
    font-weight: 500;
    color: #4a5b56;
    margin: 0;
    line-height: 1.2;
}
.ab-company-icon { color: #43b77a; font-size: .8rem; opacity: .85; }
.ab-company-switch {
    margin: 0 !important;
    padding-left: 2em !important;
    min-height: auto !important;
}
.ab-company-switch .form-check-input {
    width: 2em !important;
    height: 1.1em !important;
    cursor: pointer;
    margin-left: -2em !important;
    margin-top: 0 !important;
    float: none !important;
}
.ab-company-switch .form-check-input:checked {
    background-color: #43b77a !important;
    border-color: #43b77a !important;
}
.ab-company-badge {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 600;
    color: #2f5d54;
    background: rgba(67, 183, 122, .14);
    border: 1px solid rgba(67, 138, 122, .35);
    padding: 1px 7px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.3;
}
.ab-company-badge i { font-size: .58rem; }
/* Hint — мелкая приглушённая подсказка ПОД главной строкой */
.ab-company-hint {
    margin-top: 4px;
    font-size: .7rem;
    color: #7a8088;
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    padding: 0;
    background: none;
    border: none;
}
.ab-company-hint i {
    color: #adb5bd;
    font-size: .68rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.ab-company-hint span { flex: 1; }
/* Mobile — стек только если совсем не помещается */
@media (max-width: 380px) {
    .ab-company-main { flex-wrap: wrap; }
}
/* build 889: на mobile hint скрываем (admin запрос — занимает место) */
@media (max-width: 767.98px) {
    .ab-company-hint { display: none !important; }
}

/* Dark theme */
body.dark-theme .ab-company-row,
[data-bs-theme="dark"] .ab-company-row {
    background: rgba(67, 138, 122, .08);
    border-color: rgba(67, 183, 122, .22);
}
body.dark-theme .ab-company-row.is-on,
[data-bs-theme="dark"] .ab-company-row.is-on {
    background: rgba(67, 138, 122, .18);
    border-color: rgba(67, 183, 122, .5);
}
body.dark-theme .ab-company-label,
[data-bs-theme="dark"] .ab-company-label { color: #aab9b3; }
body.dark-theme .ab-company-badge,
[data-bs-theme="dark"] .ab-company-badge {
    color: #b3e0d0;
    background: rgba(67, 183, 122, .18);
    border-color: rgba(67, 183, 122, .42);
}
body.dark-theme .ab-company-hint,
[data-bs-theme="dark"] .ab-company-hint { color: #8a9097; }
body.dark-theme .ab-company-hint i,
[data-bs-theme="dark"] .ab-company-hint i { color: #6c757d; }

/* prefers-reduced-motion: отключить transitions */
@media (prefers-reduced-motion: reduce) {
    .ab-company-row { transition: none; }
}

/* build 888: «Подъезд / кв.» — два поля в одной строке.
   JS-merger ab_pair_init() ниже сольёт строку ab-entrance-row и ab-flat-row в одну,
   а CSS делает label «Кв.» компактным и оба input — узкими. */
.ab-pair-fields {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.ab-pair-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ab-pair-sublabel {
    font-size: .78rem;
    color: #6c757d;
    white-space: nowrap;
}
.ab-pair-field input {
    width: 80px !important;
    max-width: 80px;
}
.ab-flat-row.ab-flat-merged { display: none !important; }
.ab-entrance-row.ab-entrance-merged .ab-pair-field {
    flex: 0 0 auto;
}
body.dark-theme .ab-pair-sublabel,
[data-bs-theme="dark"] .ab-pair-sublabel { color: #adb5bd; }

/* build 892: Mobile — «Подъезд / кв.» в одну линию, не растягивая на 2 строки */
@media (max-width: 767.98px) {
    .ab-entrance-row.ab-entrance-merged {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        flex-direction: row !important;
    }
    .ab-entrance-row.ab-entrance-merged > .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 40% !important;
        padding-right: 0 !important;
    }
    .ab-entrance-row.ab-entrance-merged > .col-md-8 {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        padding-left: 0 !important;
    }
    .ab-entrance-row.ab-entrance-merged .ab-pair-fields {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    .ab-entrance-row.ab-entrance-merged .ab-pair-field {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }
    .ab-entrance-row.ab-entrance-merged .ab-pair-field input {
        width: 100% !important;
        max-width: none !important;
    }
    .ab-entrance-row.ab-entrance-merged .ab-pair-sublabel {
        font-size: .7rem;
    }
    .ab-entrance-row.ab-entrance-merged .ab-pair-label {
        font-size: .82rem;
    }
}

/* build 888: Mobile — diag-chip только иконки (Сессия/Разрывы/Трафик/Адрес).
   Текст внутри .diag-chip скрываем, оставляем только <i class="fas ..."></i>. */
@media (max-width: 767.98px) {
    .diag-chip {
        font-size: 0 !important;
        padding: .35rem .55rem !important;
    }
    .diag-chip i.fas,
    .diag-chip i.fa {
        font-size: 1rem !important;
        margin: 0 !important;
    }
    /* build 892: на mobile прячем большую иконку «галочка/предупреждение» слева от заголовка
       (она дублирует цветовой статус карточки). Оставляем только текст и чипы. */
    .abon-banner-diag > .abon-banner-icon {
        display: none !important;
    }
    /* Чипы — строго в один ряд, без переноса */
    .abon-banner-diag .diag-checks-row {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-top: 6px;
    }
    .abon-banner-diag .diag-chip {
        flex: 0 0 auto !important;
    }
    /* Лёгкое уменьшение паддинга в баннере — раз иконки нет, контент ближе к краю */
    .abon-banner-diag {
        padding-left: 12px !important;
    }
}

/* build 888: красивая стрелка-треугольник в Select2 (вместо CSS-border-triangle через <b>).
   Скрываем <b>, рисуем чёткий ▼ через ::after с использованием FA-character (\f0d7 = caret-down). */
/* build 1729: было position:relative без размеров — стрелка схлопывалась в
   0x0, а её ::after (позиционируется absolute от неё) уезжал под левый нижний
   угол поля. Выглядело как вторая стрелка у каждого селекта. Возвращаем
   стрелке нормальный бокс у правого края. */
.form-row .select2-container .select2-selection__arrow,
.form-subgroup .select2-container .select2-selection__arrow,
.select2-selection__arrow {
    position: absolute;
    top: 0;
    right: 0;
    width: 26px;
    height: 100%;
}
.form-row .select2-container .select2-selection__arrow b,
.form-subgroup .select2-container .select2-selection__arrow b,
.select2-selection__arrow b {
    display: none !important;
}
.form-row .select2-container .select2-selection__arrow::after,
.form-subgroup .select2-container .select2-selection__arrow::after,
.select2-selection__arrow::after {
    content: '\f0d7'; /* fa-caret-down */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6c757d;
    font-size: .8rem;
    line-height: 1;
    pointer-events: none;
    transition: color .15s ease, transform .15s ease;
}
.form-row .select2-container--open .select2-selection__arrow::after,
.select2-container--open .select2-selection__arrow::after {
    transform: translate(-50%, -50%) rotate(180deg);
    color: var(--brand-primary, #43b77a);
}
body.dark-theme .select2-selection__arrow::after,
[data-bs-theme="dark"] .select2-selection__arrow::after {
    color: #adb5bd;
}

/* build 888: модалка выбора нового тарифа на mobile —
   название/цена/стрелка в 1 линию (gap, без переноса пока влезает) */
@media (max-width: 767.98px) {
    .tarif-pick-item,
    .tariff-pick-item,
    .ab-tarif-pick-item {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        min-width: 0;
    }
    .tarif-pick-item > .tarif-pick-name,
    .tarif-pick-item > .tariff-name,
    .tarif-pick-item .ti-name {
        flex: 1 1 auto !important;
        min-width: 0;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .tarif-pick-item > .tarif-pick-price,
    .tarif-pick-item > .tariff-price,
    .tarif-pick-item .ti-price {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }
    .tarif-pick-item > .tarif-pick-arrow,
    .tarif-pick-item .ti-arrow,
    .tarif-pick-item .fa-arrow-right {
        flex: 0 0 auto !important;
    }
    /* Если очень узко и не влезает — разрешаем wrap */
    @media (max-width: 380px) {
        .tarif-pick-item { flex-wrap: wrap !important; }
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   build 894: mobile bottom-sheet для модалок смены тарифа (запрос admin 18.05)
   ═══════════════════════════════════════════════════════════════════════
   На mobile (≤767px) модалки .abtc-bottom-sheet (abtcSelectModal, abtcConfirmModal)
   позиционируются снизу экрана, имеют скруглённый верх + ручку-индикатор +
   slide-up анимацию. Открываются «выезжая снизу».
   На desktop (≥768px) — стандартное Bootstrap-поведение (modal-dialog-centered).
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .modal.abtc-bottom-sheet { padding: 0 !important; }
    .modal.abtc-bottom-sheet .modal-dialog {
        position: fixed !important;
        bottom: 0 !important; left: 0 !important; right: 0 !important;
        margin: 0 !important;
        max-width: 100% !important; width: 100% !important;
        min-height: auto !important;
        transform: translateY(100%); transition: transform .28s ease-out;
        align-items: flex-end !important;
    }
    .modal.abtc-bottom-sheet.show .modal-dialog {
        transform: translateY(0);
    }
    .modal.abtc-bottom-sheet .modal-content {
        border-radius: 18px 18px 0 0 !important;
        border-bottom: none !important;
        max-height: 92vh !important;
        box-shadow: 0 -10px 32px rgba(0, 0, 0, .25);
    }
    /* Ручка-индикатор (drag-handle) поверх header'а */
    .modal.abtc-bottom-sheet .modal-content::before {
        content: ""; display: block;
        width: 40px; height: 4px;
        background: #c5cbd0; border-radius: 2px;
        margin: 8px auto 0;
        flex-shrink: 0;
    }
    .modal.abtc-bottom-sheet .modal-header {
        border-bottom: 1px solid #e9ecef !important;
        padding: 8px 16px 10px !important;
        position: relative;
    }
    .modal.abtc-bottom-sheet .modal-header .modal-title {
        font-size: 1rem !important; font-weight: 600 !important;
    }
    .modal.abtc-bottom-sheet .modal-body {
        max-height: calc(92vh - 130px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px !important;
    }
    .modal.abtc-bottom-sheet .modal-footer {
        padding: 8px 16px !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        border-top: 1px solid #e9ecef !important;
    }
    /* prefers-reduced-motion — отключаем slide-up */
    @media (prefers-reduced-motion: reduce) {
        .modal.abtc-bottom-sheet .modal-dialog { transition: none; }
    }
    /* Dark theme */
    body.dark-theme .modal.abtc-bottom-sheet .modal-content::before,
    [data-bs-theme="dark"] .modal.abtc-bottom-sheet .modal-content::before {
        background: #5a6066;
    }
    body.dark-theme .modal.abtc-bottom-sheet .modal-header,
    body.dark-theme .modal.abtc-bottom-sheet .modal-footer,
    [data-bs-theme="dark"] .modal.abtc-bottom-sheet .modal-header,
    [data-bs-theme="dark"] .modal.abtc-bottom-sheet .modal-footer {
        border-color: #3a3f47 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   build 897: Select2 compact на mobile (запрос admin 18.05)
   ═══════════════════════════════════════════════════════════════════════
   Уменьшаем размер шрифта внутри Select2 dropdown'ов на узких экранах
   (поиск адреса, тарифа, абонента, NAS и пр.). Применяется ко всем
   Select2-виджетам, не только в карточке абонента.
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* Сам dropdown — список результатов поиска */
    .select2-container .select2-dropdown,
    .select2-container--bootstrap-5 .select2-dropdown {
        font-size: .85rem !important;
    }
    /* Каждая опция в списке */
    .select2-container .select2-results__option,
    .select2-container--bootstrap-5 .select2-results__option {
        padding: 6px 10px !important;
        font-size: .85rem !important;
        line-height: 1.3 !important;
    }
    /* Поле ввода поиска внутри dropdown */
    .select2-container .select2-search--dropdown .select2-search__field,
    .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
        font-size: .85rem !important;
        padding: 4px 8px !important;
    }
    /* Селекшн (то что в самом поле) — single */
    .select2-container .select2-selection--single,
    .select2-container--bootstrap-5 .select2-selection--single {
        min-height: 32px !important;
        height: auto !important;
    }
    .select2-container .select2-selection--single .select2-selection__rendered,
    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        font-size: .85rem !important;
        line-height: 1.4 !important;
        padding: 4px 24px 4px 8px !important;
    }
    /* Селекшн multi — чипы выбранных значений */
    .select2-container .select2-selection--multiple,
    .select2-container--bootstrap-5 .select2-selection--multiple {
        min-height: 32px !important;
        padding: 2px 4px !important;
    }
    .select2-container .select2-selection--multiple .select2-selection__choice,
    .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
        font-size: .8rem !important;
        padding: 2px 6px !important;
        margin: 2px 4px 2px 0 !important;
        line-height: 1.3 !important;
    }
    /* Сообщения «нет результатов / минимальная длина» */
    .select2-container .select2-results__option--load-more,
    .select2-container .select2-results__message,
    .select2-container .select2-results__option.loading-results {
        font-size: .8rem !important;
        padding: 4px 10px !important;
        line-height: 1.3 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   build 903: оптимизация dark theme для /admin/Abonents/<folder>/
   ═══════════════════════════════════════════════════════════════════════
   Запрос admin 18.05: на тёмной теме плохо читался текст в подсвеченных
   строках (баланс, иконка wi-fi сливались с фоном):
   - заблокированные (table-danger / row-negbal): белый текст на тёмно-розовом
   - низкий баланс (table-warning): жёлтый текст на жёлто-полупрозрачном
   - промис-pay row: розоватый, баланс «0.00» почти невидим
   - ℹ в шапке папки на mobile: серая, не видна
   - стрелка ← в шапке: серая, теряется на чёрном фоне
   ─────────────────────────────────────────────────────────────────────── */

/* Контрастный текст в подсвеченных строках */
body.dark-theme tr.row-negbal > td,
body.dark-theme tr.row-deep-debt.row-negbal > td,
[data-bs-theme="dark"] tr.row-negbal > td,
[data-bs-theme="dark"] tr.row-deep-debt.row-negbal > td {
    color: #f5f7fa !important;
}
body.dark-theme tr.row-negbal > td a,
body.dark-theme tr.row-deep-debt > td a,
body.dark-theme tr.row-negbal > td .ostatok,
body.dark-theme tr.row-deep-debt > td .ostatok,
[data-bs-theme="dark"] tr.row-negbal > td a,
[data-bs-theme="dark"] tr.row-deep-debt > td a,
[data-bs-theme="dark"] tr.row-negbal > td .ostatok,
[data-bs-theme="dark"] tr.row-deep-debt > td .ostatok {
    color: #ffb3b8 !important; /* мягкий пастельный красный — читаемо */
}

/* Низкий баланс (table-warning) — жёлтые тона ярче */
body.dark-theme tr.table-warning > td,
[data-bs-theme="dark"] tr.table-warning > td {
    color: #ffe9a8 !important;
}
body.dark-theme tr.table-warning > td a,
[data-bs-theme="dark"] tr.table-warning > td a {
    color: #ffd54a !important;
}

/* Иконки статуса wi-fi (online/offline/blocked) — обеспечиваем контраст
   в подсвеченных строках, исходные цвета (зелёный/красный) теряются. */
body.dark-theme tr.row-negbal > td .online-status-icon,
body.dark-theme tr.row-deep-debt > td .online-status-icon,
body.dark-theme tr.row-deep-debt.row-negbal > td .online-status-icon,
[data-bs-theme="dark"] tr.row-negbal > td .online-status-icon,
[data-bs-theme="dark"] tr.row-deep-debt > td .online-status-icon,
[data-bs-theme="dark"] tr.row-deep-debt.row-negbal > td .online-status-icon {
    color: #ff8b8b !important;
    opacity: .95;
}
body.dark-theme tr.table-warning > td .online-status-icon,
[data-bs-theme="dark"] tr.table-warning > td .online-status-icon {
    color: #ffd54a !important;
    opacity: .95;
}

/* Промис-pay строка — мягкий розовый, тёмный текст плохо читался.
   Если у строки есть бейдж 🤝 — обеспечиваем чтение баланса. */
body.dark-theme tr.row-promise-pay > td,
[data-bs-theme="dark"] tr.row-promise-pay > td {
    background-color: rgba(255, 175, 100, .12) !important;
    color: #ffe2d3 !important;
}

/* Папки (table-info) — синяя полоска. На тёмной теме слегка ярче ссылку */
body.dark-theme tr.table-info > td a,
[data-bs-theme="dark"] tr.table-info > td a {
    color: #8cc6ff !important;
    font-weight: 600;
}

/* Стрелка ← в title-bar папки на тёмной теме — была почти невидима */
body.dark-theme .abonent-title-back,
[data-bs-theme="dark"] .abonent-title-back {
    color: #d0d8e0 !important;
}
body.dark-theme .abonent-title-back:hover,
[data-bs-theme="dark"] .abonent-title-back:hover {
    color: #65d0a5 !important;
}

/* ℹ-иконка в шапке папки на mobile тёмная тема — ярче */
@media (max-width: 767.98px) {
    body.dark-theme.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info,
    [data-bs-theme="dark"] body.page-abonent-folder .abonent-title-bar.abonent-title-bar .abonent-title-info {
        color: rgba(255, 255, 255, 0.75) !important;
        opacity: 1 !important;
    }
}

/* Шапка title-bar папки в dark theme — добавляем границу снизу для отделения */
body.dark-theme.page-abonent-folder .abonent-title-bar,
[data-bs-theme="dark"] body.page-abonent-folder .abonent-title-bar {
    background: #21262d !important;
    border: 1px solid #2d333b !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* Поиск и кнопка «Фильтры» в dark theme — улучшаем контраст */
body.dark-theme .folder-search input,
body.dark-theme .folder-search .form-control,
[data-bs-theme="dark"] .folder-search input,
[data-bs-theme="dark"] .folder-search .form-control {
    background: #21262d !important;
    border-color: #2d333b !important;
    color: #e7eaf0 !important;
}
body.dark-theme .folder-search input::placeholder,
[data-bs-theme="dark"] .folder-search input::placeholder {
    color: #6c757d !important;
}

/* Папка-полоска (folder-row-pattern) — на dark theme была сине-полосатая,
   делаем менее контрастной чтобы не отвлекала. */
body.dark-theme tr.folder-row > td,
[data-bs-theme="dark"] tr.folder-row > td {
    background-image: none !important;
    background-color: rgba(60, 140, 180, .08) !important;
}
body.dark-theme tr.folder-row:hover > td,
[data-bs-theme="dark"] tr.folder-row:hover > td {
    background-color: rgba(60, 140, 180, .15) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   build 910: Эффект «матового стекла» (frosted glass) на mobile
   ═══════════════════════════════════════════════════════════════════════
   Активируется через body.smit-glass (если включена настройка
   BRANDING_GLASS_EFFECT_ENABLED). Применяется на mobile (≤767.98px) для:
   - Градиент фона страницы — от чуть тёмного к базовому фону
   - .abonent-title-bar и .smit-toolbar.mb-2 — полупрозрачные
   - .main-header — матовое стекло
   - aside.main-sidebar — матовое стекло (всегда самый верхний слой)
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    /* Градиент фона — light theme. Чуть темнее сверху → базовый цвет
       на 30% высоты страницы. Используем body::before чтобы не ломать
       существующий background body. */
    body.smit-glass.page-abonent-card,
    body.smit-glass.section-abonents {
        position: relative;
    }
    body.smit-glass.page-abonent-card::before,
    body.smit-glass.section-abonents::before {
        content: "";
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 30vh;
        background: linear-gradient(180deg,
            rgba(0, 0, 0, .08) 0%,
            rgba(0, 0, 0, 0) 100%);
        pointer-events: none;
        z-index: 0;
    }
    /* Dark theme — градиент чуть темнее (более чёрный сверху) */
    body.smit-glass.dark-theme.page-abonent-card::before,
    body.smit-glass.dark-theme.section-abonents::before,
    [data-bs-theme="dark"] body.smit-glass.page-abonent-card::before,
    [data-bs-theme="dark"] body.smit-glass.section-abonents::before {
        background: linear-gradient(180deg,
            rgba(0, 0, 0, .35) 0%,
            rgba(0, 0, 0, 0) 100%);
    }

    /* abonent-title-bar — полупрозрачный (frosted) */
    body.smit-glass .abonent-title-bar {
        background: rgba(255, 255, 255, .55) !important;
        -webkit-backdrop-filter: saturate(160%) blur(10px);
        backdrop-filter: saturate(160%) blur(10px);
        border: 1px solid rgba(255, 255, 255, .45) !important;
        box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    }
    /* Сохраняем модификаторы цвета баланса (debt/low) — но прозрачнее */
    body.smit-glass .abonent-title-bar.abonent-title-bar-debt {
        background: linear-gradient(135deg, rgba(255, 200, 200, .65), rgba(255, 220, 220, .55)) !important;
    }
    body.smit-glass .abonent-title-bar.abonent-title-bar-low {
        background: linear-gradient(135deg, rgba(255, 235, 200, .65), rgba(255, 245, 220, .55)) !important;
    }
    body.smit-glass.dark-theme .abonent-title-bar,
    [data-bs-theme="dark"] body.smit-glass .abonent-title-bar {
        background: rgba(30, 37, 48, .55) !important;
        border-color: rgba(255, 255, 255, .08) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    }
    body.smit-glass.dark-theme .abonent-title-bar.abonent-title-bar-debt,
    [data-bs-theme="dark"] body.smit-glass .abonent-title-bar.abonent-title-bar-debt {
        background: linear-gradient(135deg, rgba(80, 30, 40, .65), rgba(100, 40, 50, .55)) !important;
    }
    body.smit-glass.dark-theme .abonent-title-bar.abonent-title-bar-low,
    [data-bs-theme="dark"] body.smit-glass .abonent-title-bar.abonent-title-bar-low {
        background: linear-gradient(135deg, rgba(95, 70, 25, .65), rgba(115, 90, 35, .55)) !important;
    }

    /* .smit-toolbar.mb-2 — тулбар поиска/фильтра — полупрозрачный */
    body.smit-glass .smit-toolbar.mb-2,
    body.smit-glass .smit-toolbar {
        background: rgba(255, 255, 255, .55) !important;
        -webkit-backdrop-filter: saturate(160%) blur(10px);
        backdrop-filter: saturate(160%) blur(10px);
        border: 1px solid rgba(255, 255, 255, .45) !important;
    }
    body.smit-glass.dark-theme .smit-toolbar.mb-2,
    body.smit-glass.dark-theme .smit-toolbar,
    [data-bs-theme="dark"] body.smit-glass .smit-toolbar.mb-2,
    [data-bs-theme="dark"] body.smit-glass .smit-toolbar {
        background: rgba(30, 37, 48, .55) !important;
        border-color: rgba(255, 255, 255, .08) !important;
    }

    /* .main-header — матовое стекло */
    body.smit-glass .main-header {
        background: rgba(255, 255, 255, .55) !important;
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        backdrop-filter: saturate(180%) blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, .35) !important;
        box-shadow: 0 1px 8px rgba(15, 23, 42, .06);
    }
    body.smit-glass.dark-theme .main-header,
    [data-bs-theme="dark"] body.smit-glass .main-header {
        background: rgba(20, 25, 32, .65) !important;
        border-bottom-color: rgba(255, 255, 255, .08) !important;
        box-shadow: 0 1px 8px rgba(0, 0, 0, .35);
    }
}

/* Sidebar — матовое стекло (на всех breakpoint, всегда верхний z-index).
   На mobile sidebar открывается поверх контента → нужно особенно красиво. */
body.smit-glass aside.main-sidebar {
    background: rgba(40, 50, 65, .72) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 4px 0 24px rgba(15, 23, 42, .25);
    z-index: 2000 !important;  /* всегда поверх контента */
}
body.smit-glass.dark-theme aside.main-sidebar,
[data-bs-theme="dark"] body.smit-glass aside.main-sidebar {
    background: rgba(20, 25, 32, .78) !important;
    border-right-color: rgba(255, 255, 255, .06);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .55);
}
/* prefers-reduced-motion + старые браузеры без backdrop-filter:
   fallback — просто полупрозрачный фон без blur. */
@supports not (backdrop-filter: blur(1px)) {
    body.smit-glass aside.main-sidebar,
    body.smit-glass .main-header,
    body.smit-glass .abonent-title-bar,
    body.smit-glass .smit-toolbar {
        background: rgba(255, 255, 255, .92) !important;
    }
    body.smit-glass.dark-theme aside.main-sidebar,
    body.smit-glass.dark-theme .main-header,
    body.smit-glass.dark-theme .abonent-title-bar,
    body.smit-glass.dark-theme .smit-toolbar,
    [data-bs-theme="dark"] body.smit-glass aside.main-sidebar,
    [data-bs-theme="dark"] body.smit-glass .main-header,
    [data-bs-theme="dark"] body.smit-glass .abonent-title-bar,
    [data-bs-theme="dark"] body.smit-glass .smit-toolbar {
        background: rgba(25, 30, 38, .95) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FROSTED GLASS — модалки и offcanvas (если smit-glass включён)
   Полупрозрачный фон + backdrop-filter blur. Header/footer внутри
   модалки остаются плотными, чтобы текст оставался читаемым,
   но получают тонкую полупрозрачность для единства стиля.
   ═══════════════════════════════════════════════════════════════ */

/* --- Modal ---
   Bootstrap 5 рендерит .modal-content через CSS-переменные
   (--bs-modal-bg, --bs-modal-color, --bs-modal-border-color),
   поэтому простой background не перебивает Bootstrap-токен.
   Переопределяем переменные напрямую + дублируем background
   для старых тем без BS-токенов. */
body.smit-glass .modal {
    --bs-modal-bg: rgba(255, 255, 255, .72);
    --bs-modal-border-color: rgba(255, 255, 255, .35);
}
body.smit-glass .modal .modal-content {
    background: rgba(255, 255, 255, .72) !important;
    background-color: rgba(255, 255, 255, .72) !important;
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28),
                0 6px 18px rgba(15, 23, 42, .12);
    /* overflow:hidden из build 841 ломал backdrop-filter на child-элементах,
       но на самом .modal-content фильтр работает корректно. */
}
body.smit-glass .modal .modal-header,
body.smit-glass .modal .modal-footer {
    background: rgba(255, 255, 255, .35) !important;
    background-color: rgba(255, 255, 255, .35) !important;
    border-color: rgba(15, 23, 42, .08);
}
body.smit-glass .modal .modal-body {
    background: transparent !important;
    background-color: transparent !important;
}
/* Кастомные header'ы с собственным брендовым фоном (gradient/colored)
   защищаем от прозрачности родителя: isolate stacking-context + явный
   плотный background перебивает родительский blur. Без этого Chrome
   компонует child в pre-composited layer и применяет blur к содержимому.
   Работает и в светлой, и в тёмной теме одинаково (brand-gradient
   остаётся фирменно-зелёным независимо от темы). */
body.smit-glass .modal .fo-modal-header,
body.smit-glass .modal .acc-modal-header,
body.smit-glass .modal .modal-header-gradient,
body.smit-glass .modal .uu-modal-header,
body.smit-glass .modal .qa-modal-header,
body.smit-glass.dark-theme .modal .fo-modal-header,
body.smit-glass.dark-theme .modal .acc-modal-header,
body.smit-glass.dark-theme .modal .modal-header-gradient,
body.smit-glass.dark-theme .modal .uu-modal-header,
body.smit-glass.dark-theme .modal .qa-modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .fo-modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .acc-modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .modal-header-gradient,
[data-bs-theme="dark"] body.smit-glass .modal .uu-modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .qa-modal-header {
    position: relative;
    z-index: 2;
    isolation: isolate;
}
/* fo-modal-header — фирменный зелёный gradient одинаково в обеих темах */
body.smit-glass .modal .fo-modal-header,
body.smit-glass.dark-theme .modal .fo-modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .fo-modal-header {
    background: linear-gradient(135deg, #43b77a 0%, #2d9a5f 100%) !important;
    background-color: #43b77a !important;
}
/* Заголовки внутри них — чисто белый текст, тень для контраста */
body.smit-glass .modal .fo-modal-header .modal-title,
body.smit-glass .modal .fo-modal-header .modal-title *,
body.smit-glass.dark-theme .modal .fo-modal-header .modal-title,
body.smit-glass.dark-theme .modal .fo-modal-header .modal-title *,
[data-bs-theme="dark"] body.smit-glass .modal .fo-modal-header .modal-title,
[data-bs-theme="dark"] body.smit-glass .modal .fo-modal-header .modal-title * {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
/* btn-close внутри brand-header — белая иконка через invert */
body.smit-glass .modal .fo-modal-header .btn-close,
body.smit-glass.dark-theme .modal .fo-modal-header .btn-close,
[data-bs-theme="dark"] body.smit-glass .modal .fo-modal-header .btn-close {
    filter: invert(1) opacity(.85);
}
/* Backdrop под модалкой — мягче и сильнее размывает фон под ним */
body.smit-glass .modal-backdrop.show {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: rgba(15, 23, 42, .35);
    opacity: 1 !important;
}

/* Dark theme — modal */
body.smit-glass.dark-theme .modal,
[data-bs-theme="dark"] body.smit-glass .modal {
    --bs-modal-bg: rgba(30, 37, 48, .72);
    --bs-modal-border-color: rgba(255, 255, 255, .08);
}
body.smit-glass.dark-theme .modal .modal-content,
[data-bs-theme="dark"] body.smit-glass .modal .modal-content {
    background: rgba(30, 37, 48, .72) !important;
    background-color: rgba(30, 37, 48, .72) !important;
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .55),
                0 6px 18px rgba(0, 0, 0, .35);
}
body.smit-glass.dark-theme .modal .modal-header,
body.smit-glass.dark-theme .modal .modal-footer,
[data-bs-theme="dark"] body.smit-glass .modal .modal-header,
[data-bs-theme="dark"] body.smit-glass .modal .modal-footer {
    background: rgba(20, 25, 32, .55) !important;
    background-color: rgba(20, 25, 32, .55) !important;
    border-color: rgba(255, 255, 255, .06);
}
body.smit-glass.dark-theme .modal-backdrop.show,
[data-bs-theme="dark"] body.smit-glass .modal-backdrop.show {
    background: rgba(0, 0, 0, .55);
}

/* --- Offcanvas (drawer-панели: detail, filter-sheet, abonent drawer) --- */
body.smit-glass .offcanvas {
    --bs-offcanvas-bg: rgba(255, 255, 255, .72);
    --bs-offcanvas-border-color: rgba(15, 23, 42, .08);
    background: rgba(255, 255, 255, .72) !important;
    background-color: rgba(255, 255, 255, .72) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-color: rgba(15, 23, 42, .08) !important;
    box-shadow: -8px 0 32px rgba(15, 23, 42, .18);
}
body.smit-glass .offcanvas.offcanvas-bottom {
    box-shadow: 0 -8px 32px rgba(15, 23, 42, .18);
}
body.smit-glass .offcanvas.offcanvas-start {
    box-shadow: 8px 0 32px rgba(15, 23, 42, .18);
}
body.smit-glass .offcanvas .offcanvas-header {
    background: rgba(255, 255, 255, .35) !important;
    border-bottom: 1px solid rgba(15, 23, 42, .08);
}
body.smit-glass .offcanvas .offcanvas-body {
    background: transparent !important;
}
/* ⚠ Mobile filter-sheet ВСЕГДА непрозрачный (admin 2026-06-17).
   backdrop-filter (glass) не блюрит Leaflet-карту на мобильном Safari → стеклянный
   лист над картой нечитаем. Принудительно делаем фильтр-лист сплошным. */
body.smit-glass .smit-mobile-filter-sheet,
body.smit-glass .offcanvas.smit-mobile-filter-sheet {
    --bs-offcanvas-bg: #ffffff;
    background: #ffffff !important;
    background-color: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
body.smit-glass .smit-mobile-filter-sheet .offcanvas-header { background: #ffffff !important; }
body.smit-glass .smit-mobile-filter-sheet .offcanvas-body   { background: #ffffff !important; }
[data-bs-theme="dark"] body.smit-glass .smit-mobile-filter-sheet,
body.smit-glass.dark-theme .smit-mobile-filter-sheet {
    --bs-offcanvas-bg: #1e2530;
    background: #1e2530 !important;
    background-color: #1e2530 !important;
}
[data-bs-theme="dark"] body.smit-glass .smit-mobile-filter-sheet .offcanvas-header,
body.smit-glass.dark-theme .smit-mobile-filter-sheet .offcanvas-header,
[data-bs-theme="dark"] body.smit-glass .smit-mobile-filter-sheet .offcanvas-body,
body.smit-glass.dark-theme .smit-mobile-filter-sheet .offcanvas-body { background: #1e2530 !important; }

/* ⚠ build 1201: на МОБИЛЬНОМ отключаем стеклянный backdrop-filter у ВСЕХ offcanvas
   и делаем их фон сплошным. На узком экране лист почти на весь экран — blur
   позади бессмысленен, а на iOS Safari backdrop-filter на самом листе делает его
   «размытым вместе с фоном» (баг admin 2026-06-17). Светлая + тёмная тема. */
@media (max-width: 767.98px) {
    body.smit-glass .offcanvas,
    body.smit-glass .offcanvas.offcanvas-bottom,
    body.smit-glass .offcanvas.offcanvas-start,
    body.smit-glass .offcanvas.offcanvas-end {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        --bs-offcanvas-bg: #ffffff;
        background: #ffffff !important;
        background-color: #ffffff !important;
    }
    body.smit-glass .offcanvas .offcanvas-header,
    body.smit-glass .offcanvas .offcanvas-body { background: #ffffff !important; }
    [data-bs-theme="dark"] body.smit-glass .offcanvas,
    body.smit-glass.dark-theme .offcanvas,
    [data-bs-theme="dark"] body.smit-glass .offcanvas .offcanvas-header,
    body.smit-glass.dark-theme .offcanvas .offcanvas-header,
    [data-bs-theme="dark"] body.smit-glass .offcanvas .offcanvas-body,
    body.smit-glass.dark-theme .offcanvas .offcanvas-body {
        --bs-offcanvas-bg: #1e2530;
        background: #1e2530 !important;
        background-color: #1e2530 !important;
    }
}
/* Backdrop offcanvas — такой же мягкий блюр как у модалки */
body.smit-glass .offcanvas-backdrop.show {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: rgba(15, 23, 42, .35);
    opacity: 1 !important;
}

/* Dark theme — offcanvas */
body.smit-glass.dark-theme .offcanvas,
[data-bs-theme="dark"] body.smit-glass .offcanvas {
    --bs-offcanvas-bg: rgba(30, 37, 48, .72);
    --bs-offcanvas-border-color: rgba(255, 255, 255, .08);
    background: rgba(30, 37, 48, .72) !important;
    background-color: rgba(30, 37, 48, .72) !important;
    border-color: rgba(255, 255, 255, .08) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .55);
}
body.smit-glass.dark-theme .offcanvas.offcanvas-bottom,
[data-bs-theme="dark"] body.smit-glass .offcanvas.offcanvas-bottom {
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .55);
}
body.smit-glass.dark-theme .offcanvas.offcanvas-start,
[data-bs-theme="dark"] body.smit-glass .offcanvas.offcanvas-start {
    box-shadow: 8px 0 32px rgba(0, 0, 0, .55);
}
body.smit-glass.dark-theme .offcanvas .offcanvas-header,
[data-bs-theme="dark"] body.smit-glass .offcanvas .offcanvas-header {
    background: rgba(20, 25, 32, .55) !important;
    border-bottom-color: rgba(255, 255, 255, .06);
}
body.smit-glass.dark-theme .offcanvas-backdrop.show,
[data-bs-theme="dark"] body.smit-glass .offcanvas-backdrop.show {
    background: rgba(0, 0, 0, .55);
}

/* prefers-reduced-motion + старые браузеры — fallback без blur */
@supports not (backdrop-filter: blur(1px)) {
    body.smit-glass .modal .modal-content,
    body.smit-glass .offcanvas {
        background: rgba(255, 255, 255, .96) !important;
    }
    body.smit-glass.dark-theme .modal .modal-content,
    body.smit-glass.dark-theme .offcanvas,
    [data-bs-theme="dark"] body.smit-glass .modal .modal-content,
    [data-bs-theme="dark"] body.smit-glass .offcanvas {
        background: rgba(25, 30, 38, .97) !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.smit-glass .modal-backdrop.show,
    body.smit-glass .offcanvas-backdrop.show {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* build 1625: glassmorphism на мобильном НЕ нужен. Полупрозрачные offcanvas/modal
   (--bs-offcanvas-bg rgba .72) + backdrop blur делали панели фильтров «размытыми»
   и мешали работе (контент сливался с фоном). На мобильном — сплошные фоны, без blur. */
@media (max-width: 767.98px) {
    body.smit-glass .offcanvas,
    body.smit-glass .offcanvas-backdrop.show,
    body.smit-glass .modal .modal-content,
    body.smit-glass .modal-backdrop.show,
    body.smit-glass .dropdown-menu {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    body.smit-glass .offcanvas {
        background: #fff !important; --bs-offcanvas-bg: #fff !important;
    }
    body.smit-glass .modal .modal-content { background: #fff !important; }
    body.smit-glass .dropdown-menu { background: #fff !important; }
    body.smit-glass .offcanvas-backdrop.show,
    body.smit-glass .modal-backdrop.show {
        background: rgba(0, 0, 0, .5) !important; opacity: 1 !important;
    }
    body.smit-glass.dark-theme .offcanvas,
    [data-bs-theme="dark"] body.smit-glass .offcanvas {
        background: #1e2530 !important; --bs-offcanvas-bg: #1e2530 !important;
    }
    body.smit-glass.dark-theme .modal .modal-content,
    [data-bs-theme="dark"] body.smit-glass .modal .modal-content,
    body.smit-glass.dark-theme .dropdown-menu,
    [data-bs-theme="dark"] body.smit-glass .dropdown-menu {
        background: #1e2530 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   build 936: mobile-кнопка «Новый абонент» в самом верху sidebar
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .sidebar-mobile-cta {
        padding: 10px 14px 8px;
        margin: 0;
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }
    .sidebar-mobile-cta .sidebar-mobile-cta-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
        background: var(--brand-primary, #43b77a);
        border-color: var(--brand-primary, #43b77a);
        color: #fff;
        font-weight: 600;
        font-size: .9rem;
        padding: 10px 14px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(67, 183, 122, .3);
    }
    .sidebar-mobile-cta .sidebar-mobile-cta-btn:hover,
    .sidebar-mobile-cta .sidebar-mobile-cta-btn:focus {
        background: #3aa86b;
        border-color: #3aa86b;
        color: #fff;
        box-shadow: 0 3px 10px rgba(67, 183, 122, .4);
    }
    .sidebar-mobile-cta .sidebar-mobile-cta-btn:active { transform: scale(.97); }
    /* На mobile старая sticky-кнопка в sidebar-abonents-nav дублирует — скрываем её */
    .sidebar-abonents-nav .sidebar-cta-row { display: none !important; }

    /* ───── build 936: модалка «Новый абонент» как bottom-sheet на mobile ───── */
    .modal.qa-mobile-sheet .modal-dialog {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        margin: 0;
        width: 100%; max-width: 100%;
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.32,.72,0,1);
        pointer-events: none;
    }
    .modal.qa-mobile-sheet.show .modal-dialog {
        transform: translateY(0);
        pointer-events: auto;
    }
    .modal.qa-mobile-sheet .modal-content {
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
        border: 0;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, .25);
    }
    /* Drag-handle сверху над header'ом */
    .modal.qa-mobile-sheet .modal-content::before {
        content: '';
        display: block;
        width: 44px; height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 8px auto 0;
    }
    .modal.qa-mobile-sheet .modal-header {
        padding: 8px 16px 10px;
        border-bottom: 1px solid #e9ecef;
    }
    .modal.qa-mobile-sheet .modal-body {
        padding: 12px 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal.qa-mobile-sheet .modal-footer {
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
    }
    /* На mobile робот не нужен — занимает место */
    body:not(.dark-mode) .qa-mobile-sheet .qa-body-wrap::after { display: none !important; }
    body:not(.dark-mode) .qa-mobile-sheet .qa-body-wrap {
        margin-right: 0 !important;
        display: block !important;
    }
    /* Поля компактнее: на mobile увеличиваем поля до 16px чтобы iOS не зумил */
    .qa-mobile-sheet .form-control,
    .qa-mobile-sheet .form-select { font-size: 16px !important; }
    /* Если включена smit-glass, размытие у bottom-sheet header — отключаем
       (handle и заголовок должны быть плотными) */
    body.smit-glass .modal.qa-mobile-sheet .modal-content::before { background: #ccc; }

    @media (prefers-reduced-motion: reduce) {
        .modal.qa-mobile-sheet .modal-dialog { transition: none; }
    }
    body.dark-theme .modal.qa-mobile-sheet .modal-content,
    [data-bs-theme="dark"] .modal.qa-mobile-sheet .modal-content {
        background: #1e2530;
        border-color: #3a3f47;
    }
    body.dark-theme .modal.qa-mobile-sheet .modal-content::before,
    [data-bs-theme="dark"] .modal.qa-mobile-sheet .modal-content::before { background: #5a6066; }
    body.dark-theme .modal.qa-mobile-sheet .modal-header,
    [data-bs-theme="dark"] .modal.qa-mobile-sheet .modal-header { border-bottom-color: #3a3f47; }
    body.dark-theme .modal.qa-mobile-sheet .modal-footer,
    [data-bs-theme="dark"] .modal.qa-mobile-sheet .modal-footer { background: #1e2530; }
}

/* ── Системные/служебные папки дерева абонентов (Операторы связи, Корзина,
      Служебная группа). Класс sys-folder ставится в get_childrens. Серая
      приглушённая подача, чтобы визуально отделить от клиентских папок. ── */
.filetree span.folder.sys-folder > a,
.filetree li span.sys-folder > a {
    color: #8a939b !important;
    font-style: italic;
}
.filetree span.folder.sys-folder {
    opacity: .72;
}
.filetree span.folder.sys-folder:hover { opacity: 1; }
body.dark-theme .filetree span.folder.sys-folder > a,
[data-bs-theme="dark"] .filetree span.folder.sys-folder > a { color: #6b727a !important; }

/* ──────────────────────────────────────────────────────────────
   Toast-уведомления отключены по запросу admin (2026-06-08).
   Глушит все всплывашки разом: общий smitToast, IntegrationTester
   и локальные bootstrap.Toast из отдельных шаблонов.
   ────────────────────────────────────────────────────────────── */
.toast-container,
#smitToastHost,
.toast.show,
.toast {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   Модуль IPTV — dark-тема, контраст, мобильная адаптация, touch
   (UX-аудит 2026-06-11: dashboard/accounts/log/settings/abonents_form/iptv)
   Единая секция вместо инлайн-дублей в 5 шаблонах.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Dark: бейджи / pill (светлые «островки» на тёмной странице) ── */
[data-bs-theme="dark"] .iv-badge-on, .dark-theme .iv-badge-on{background:#1e3a28;color:#5bbd8f}
[data-bs-theme="dark"] .iv-badge-off, .dark-theme .iv-badge-off{background:#2a2f37;color:#9aa4b0}
[data-bs-theme="dark"] .iv-prov-pill, .dark-theme .iv-prov-pill,
[data-bs-theme="dark"] .iptv-pill, .dark-theme .iptv-pill{background:#2a2f37;color:#c4cdd9}
[data-bs-theme="dark"] .iptv-badge, .dark-theme .iptv-badge{background:#2a2f37;color:#c4cdd9}
[data-bs-theme="dark"] .iptv-badge.ok, .dark-theme .iptv-badge.ok{background:#1e3a28;color:#5bbd8f}
[data-bs-theme="dark"] .iptv-badge.off, .dark-theme .iptv-badge.off{background:#2a2f37;color:#9aa4b0}
[data-bs-theme="dark"] .iptv-badge.err, .dark-theme .iptv-badge.err{background:#3a1f1d;color:#f08a82}

/* ── Dark: таблицы вкладки абонента + форма подключения ── */
[data-bs-theme="dark"] .iptv-tbl th, .dark-theme .iptv-tbl th{color:#9fb0c4;border-color:#2a2f37}
[data-bs-theme="dark"] .iptv-tbl td, .dark-theme .iptv-tbl td{border-color:#2a2f37}
[data-bs-theme="dark"] #iptvSubForm, .dark-theme #iptvSubForm{background:#23272d !important;border-color:#2a2f37 !important}
[data-bs-theme="dark"] .iv-err th, .dark-theme .iv-err th{color:#9fb0c4;border-color:#2a2f37}
[data-bs-theme="dark"] .iv-err td, .dark-theme .iv-err td{border-color:#2a2f37}

/* ── Dark: контраст приглушённого/цветного текста (WCAG AA на тёмном) ── */
[data-bs-theme="dark"] .iv-lbl, .dark-theme .iv-lbl,
[data-bs-theme="dark"] .iset-sub, .dark-theme .iset-sub,
[data-bs-theme="dark"] .iset-mapcnt, .dark-theme .iset-mapcnt{color:#9aa7b8}
[data-bs-theme="dark"] .iv-empty, .dark-theme .iv-empty,
[data-bs-theme="dark"] .iptv-empty, .dark-theme .iptv-empty{color:#a8b6c8}
[data-bs-theme="dark"] .iv-url, .dark-theme .iv-url{color:#8fa3bb}
[data-bs-theme="dark"] .iv-err-txt, .dark-theme .iv-err-txt,
[data-bs-theme="dark"] .iptv-err, .dark-theme .iptv-err{color:#f08a82}
[data-bs-theme="dark"] .iv-ok, .dark-theme .iv-ok,
[data-bs-theme="dark"] .iptv-log-ok, .dark-theme .iptv-log-ok{color:#5bbd8f}
[data-bs-theme="dark"] .iv-fail, .dark-theme .iv-fail,
[data-bs-theme="dark"] .iptv-log-fail, .dark-theme .iptv-log-fail{color:#f08a82}
[data-bs-theme="dark"] .iset-row label, .dark-theme .iset-row label{color:#d0d3d8}

/* ── Light: фикс уже-проваленного контраста бейджа «выключен» (#868e96 на #f1f3f5 < AA) ── */
.iv-badge-off{color:#5c636a}

/* ── Touch: иконочные кнопки действий в таблицах ≥32px hit-area ── */
.iv-resync, .iptv-unsub, .iptv-create{min-width:32px;min-height:32px}

/* ── Mobile: горизонтальный скролл широких таблиц вместо overflow/раздавливания ── */
.iv-tbl, .iv-err, .iptv-tbl{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
.iv-err-txt{word-break:break-word}
@media (max-width:768px){
  .iv-tbl td, .iptv-tbl td{white-space:nowrap}
  /* toolbar: контролы на всю ширину, аккуратный столбик */
  .iv-toolbar > input, .iv-toolbar > select{max-width:none !important;width:100%}
  .iv-toolbar > button{width:100%}
  /* форма подключения IPTV в карточке абонента — поля на всю ширину */
  #iptvSubForm .d-flex > div, #iptvSubForm select, #iptvSubForm input{width:100% !important;min-width:0 !important}
  #iptvSubForm button{flex:1}
  /* имя провайдера на дашборде не съедает строку */
  .iv-prov-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
}

/* IPTV settings: поля формы витрины ЛК в тёмной теме (если режим [data-bs-theme] без body.dark-theme) */
[data-bs-theme="dark"] .iset-card .form-control,
[data-bs-theme="dark"] .iset-card textarea,
.dark-theme .iset-card .form-control,
.dark-theme .iset-card textarea{background:#23272d;border-color:#2a2f37;color:#e4e6ea}

/* <code> в тёмной теме: дефолтный Bootstrap-розовый #d63384/#e83e8c даёт контраст
   ~3.6:1 на тёмном фоне (ниже WCAG AA 4.5:1). Особенно заметно где <code> несёт
   полезный текст (email-адреса в Почтовом сервере, логины, коды). Светлее розовый. */
body.dark-theme code,
[data-bs-theme="dark"] code{color:#ff8fc4}
/* code внутри ссылки (кликабельные email/коды) — не перебивать цвет ссылки */
body.dark-theme a code,
[data-bs-theme="dark"] a code{color:inherit}

/* build 1180: адаптивная шапка — пункты top-меню не сжимаются (flex-shrink:0),
   чтобы при нехватке ширины навбар реально переполнялся и JS-overflow-менеджер
   мог это детектировать. Класс навешивается JS на .main-header.navbar. */
@media (min-width: 768px) {
  .navbar.nav-overflow-managed > .navbar-nav > .nav-item,
  .navbar.nav-overflow-managed #nav-main > .nav-item { flex-shrink: 0; }
  .navbar.nav-overflow-managed #nav-main .nav-link { white-space: nowrap; }
  .navbar.nav-overflow-managed .navbar-user-name { white-space: nowrap; }
}

/* ════════════════════════════════════════════════════════════════
   SmIT Tooltip — кастомный тултип вместо нативного title (build 1200)
   JS: billing/static/js/smit-tooltip.js (перехват [title]/[data-tip]).
   ════════════════════════════════════════════════════════════════ */
.smit-tip {
  position: absolute;
  z-index: 20000;
  max-width: 280px;
  padding: 7px 11px;
  background: #1f2733;
  color: #f1f5f9;
  font-size: .78rem;
  line-height: 1.4;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .28), 0 1px 3px rgba(0, 0, 0, .2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px) scale(.97);
  transition: opacity .14s ease, transform .14s ease;
  word-wrap: break-word;
  white-space: normal;
}
.smit-tip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.smit-tip-body { display: block; }
/* стрелка — указывает вниз (тултип сверху элемента) */
.smit-tip-arrow {
  position: absolute;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #1f2733;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 2px 0;
}
/* тултип снизу элемента — стрелка вверх */
.smit-tip.smit-tip--bottom .smit-tip-arrow {
  bottom: auto;
  top: -5px;
  border-radius: 2px 0 0 0;
}
/* тёмная тема UI — чуть светлее карточка для контраста с тёмным фоном */
body.dark-theme .smit-tip,
[data-bs-theme="dark"] .smit-tip {
  background: #2c3645;
  color: #eef2f7;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
}
body.dark-theme .smit-tip-arrow,
[data-bs-theme="dark"] .smit-tip-arrow { background: #2c3645; }
/* бренд-акцент: тонкая полоска-обводка слева (фирменный зелёный) */
.smit-tip { border-left: 3px solid var(--brand-primary, #43b77a); }
@media (prefers-reduced-motion: reduce) {
  .smit-tip { transition: opacity .01s linear; transform: none; }
  .smit-tip.is-visible { transform: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   ЕДИНАЯ ПАГИНАЦИЯ (HeroUI-style) — build 1230
   Глобально на .pagination: скруглённые ghost-кнопки, активная — заливка
   brand, шевроны, «…». Перекрывает Bootstrap .page-link во всей админке
   (shared-include paginator*.html + JS-списки finops/homes/debtors/…).
   ════════════════════════════════════════════════════════════════════════ */
.pagination {
  --smit-pg-size: 30px;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.pagination .page-item { margin: 0 !important; }
.pagination .page-item .page-link {
  min-width: var(--smit-pg-size);
  height: var(--smit-pg-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #5b6470;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none !important;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.pagination .page-item .page-link:hover {
  background: color-mix(in srgb, var(--brand-primary, #5BA89D) 14%, transparent) !important;
  color: color-mix(in srgb, var(--brand-primary, #5BA89D) 80%, #000) !important;
}
.pagination .page-item .page-link:active { transform: scale(.94); }
.pagination .page-item .page-link:focus-visible {
  outline: 2px solid var(--brand-primary, #43b77a);
  outline-offset: 2px;
}
.pagination .page-item.active .page-link,
.pagination .page-item .page-link.active {
  background: var(--brand-primary, #5BA89D) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand-primary, #5BA89D) 40%, transparent) !important;
}
.pagination .page-item.active .page-link:hover {
  background: color-mix(in srgb, var(--brand-primary, #5BA89D) 88%, #000) !important;
  color: #fff !important;
}
.pagination .page-item.disabled .page-link,
.pagination .page-item .page-link[disabled] {
  opacity: .4;
  pointer-events: none;
  background: transparent !important;
}
/* «…» — неактивный разделитель */
.pagination .page-item.smit-ellipsis .page-link,
.pagination .page-item.disabled.smit-ellipsis .page-link {
  background: transparent !important;
  color: #9aa0a6 !important;
  pointer-events: none;
  opacity: 1;
  letter-spacing: 1px;
}
/* единый вид селекта «строк на странице» */
.paginator-per-page-select { border-radius: 8px !important; }

/* тёмная тема */
body.dark-theme .pagination .page-item .page-link,
[data-bs-theme="dark"] .pagination .page-item .page-link {
  color: #9aa0a6;
  background: transparent !important;
}
body.dark-theme .pagination .page-item .page-link:hover,
[data-bs-theme="dark"] .pagination .page-item .page-link:hover {
  background: color-mix(in srgb, var(--brand-primary, #5BA89D) 24%, transparent) !important;
  color: #fff !important;
}
body.dark-theme .pagination .page-item.active .page-link,
[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background: var(--brand-primary, #43b77a) !important;
  color: #fff !important;
}
body.dark-theme .pagination .page-item.smit-ellipsis .page-link,
[data-bs-theme="dark"] .pagination .page-item.smit-ellipsis .page-link { color: #6c757d !important; }

/* мобильный — компактнее */
@media (max-width: 575.98px) {
  .pagination { --smit-pg-size: 28px; gap: 3px; }
  .pagination .page-item .page-link { font-size: 11.5px; padding: 0 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pagination .page-item .page-link { transition: none; }
  .pagination .page-item .page-link:active { transform: none; }
}

/* ============================================================
   build 1240: Дерево папок абонентов в стиле file-tree explorer
   (вдохновлено VS Code explorer). Шеврон слева, направляющие
   линии вложенности, плотные строки, аккуратные hover/active.
   Применяется ТОЛЬКО к .sidebar-filetree (дерево «Папки»).
   ============================================================ */
.main-sidebar .sidebar-filetree .ft-link {
  display: flex; align-items: center; gap: 4px;
  padding: 0.18rem 0.5rem 0.18rem 0.35rem !important;
  font-size: 0.8rem; line-height: 1.3;
  border-radius: 5px; position: relative;
}
/* шеврон раскрытия слева */
.main-sidebar .sidebar-filetree .ft-caret {
  flex: 0 0 12px; width: 12px; font-size: 0.6rem;
  color: #6b8a6b; text-align: center;
  transition: transform .12s ease;
}
.main-sidebar .sidebar-filetree .ft-caret-empty { visibility: hidden; }
/* иконка папки/листа — !important перебивает AdminLTE .nav-treeview .nav-icon */
.main-sidebar .sidebar-filetree .ft-ico {
  flex: 0 0 auto; width: 15px !important; font-size: 0.82rem !important;
  text-align: center; color: #e0b057 !important;  /* папка — янтарный, как в explorer */
}
.main-sidebar .sidebar-filetree .ft-link .fa-folder-open { color: #f0c468 !important; }
.main-sidebar .sidebar-filetree .ft-leaf .ft-ico { color: #7fb0e0 !important; font-size: 0.5rem !important; }
/* подпись вложенных папок — контрастнее серо-зелёного AdminLTE */
.main-sidebar .sidebar-filetree .nav-treeview > .nav-item > .ft-link .ft-label { color: #c4d4c4 !important; }
.main-sidebar .sidebar-filetree .ft-link:hover .ft-label { color: #fff !important; }
.main-sidebar .sidebar-filetree .ft-caret { color: #7c9b7c !important; }
/* служебные папки (Корзина/Служебная/Операторы) — приглушены, не отвлекают */
.main-sidebar .sidebar-filetree .ft-service > .ft-link .ft-ico { color: #8a8f8a !important; }
.main-sidebar .sidebar-filetree .ft-service > .ft-link .ft-label { opacity: .72; }
/* подпись + счётчик */
.main-sidebar .sidebar-filetree .ft-label {
  margin: 0; flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.main-sidebar .sidebar-filetree .ft-count {
  flex: 0 0 auto; font-size: 0.68rem; font-weight: 600;
  color: #8aa98a; background: rgba(255,255,255,.06);
  border-radius: 8px; padding: 0 6px; min-width: 18px; text-align: center;
}
/* hover / active */
.main-sidebar .sidebar-filetree .ft-link:hover {
  background: rgba(67,183,122,.14) !important;
}
.main-sidebar .sidebar-filetree .ft-link.active {
  background: rgba(67,183,122,.22) !important;
}
.main-sidebar .sidebar-filetree .ft-link.active .ft-label,
.main-sidebar .sidebar-filetree .ft-link.active .ft-ico { color: #eafff2; }
.main-sidebar .sidebar-filetree .ft-link.active .ft-count { color: #cdebd9; background: rgba(255,255,255,.12); }

/* направляющие линии вложенности — вертикальная полоска у поддерева */
.main-sidebar .sidebar-filetree .nav-treeview {
  position: relative; padding-left: 0.6rem; background: transparent;
}
.main-sidebar .sidebar-filetree .nav-treeview::before {
  content: ''; position: absolute; left: 0.78rem; top: 0; bottom: 0;
  width: 1px; background: rgba(255,255,255,.1);
}
.main-sidebar .menu-open.sidebar-filetree .nav-treeview,
.main-sidebar .sidebar-filetree .menu-open > .nav-treeview { background: transparent; }

/* Светлая тема */
body:not(.dark-theme) .main-sidebar .sidebar-filetree .ft-count { color: #5b8c5b; background: rgba(0,0,0,.05); }
body:not(.dark-theme) .main-sidebar .sidebar-filetree .nav-treeview::before { background: rgba(0,0,0,.1); }

@media (prefers-reduced-motion: reduce) {
  .main-sidebar .sidebar-filetree .ft-caret { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   build 1292 — Единое оформление блоков по всему админу (эталон /admin/welcome/)
   Глобальный слой: одинаковое скругление/рамка/тень для всех .card и кастомных
   *-card; заголовки блоков — sentence-case (не CAPS); единый стиль кнопок.
   ═══════════════════════════════════════════════════════════════════════════ */

/* — Скругление и рамка карточек: единый радиус 5px — */
/* Специфичность .content-wrapper .card нужна, чтобы перебить bs-compat.css
   (`.content-wrapper .card { border-radius: .25rem }`). */
.content-wrapper .card,
.content-wrapper .mso-card, .content-wrapper .srv-card, .content-wrapper .dash-tile,
.content-wrapper .tg-card, .content-wrapper .vc-card, .content-wrapper .aih-card,
.content-wrapper .style-card, .content-wrapper .lic-card, .content-wrapper .id-card,
.content-wrapper .brand-card, .content-wrapper .anal-card, .content-wrapper .profile-card,
.content-wrapper .kb-card, .content-wrapper .gpt-card, .content-wrapper .int-card,
.content-wrapper .acc-card, .content-wrapper .fo-card, .content-wrapper .bs-card {
    border-radius: 5px;
}
.content-wrapper .card > .card-header:first-child { border-radius: 5px 5px 0 0; }
.content-wrapper .card > .card-footer:last-child  { border-radius: 0 0 5px 5px; }
.content-wrapper .card > .card-img-top { border-radius: 5px 5px 0 0; }
/* единая мягкая тень для всех блоков (как на дашборде) */
.content-wrapper .card,
.content-wrapper .mso-card, .content-wrapper .srv-card, .content-wrapper .dash-tile,
.content-wrapper .tg-card, .content-wrapper .vc-card, .content-wrapper .aih-card,
.content-wrapper .style-card, .content-wrapper .lic-card, .content-wrapper .id-card,
.content-wrapper .brand-card, .content-wrapper .anal-card, .content-wrapper .profile-card,
.content-wrapper .kb-card, .content-wrapper .gpt-card, .content-wrapper .int-card,
.content-wrapper .acc-card, .content-wrapper .fo-card, .content-wrapper .bs-card {
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
body:not(.dark-theme) .content-wrapper .card { border: 1px solid rgba(0,0,0,.07); }

/* — Те же радиус+тень для всех панелей/полос/плиток/KPI/виджетов —
   (msg-status-strip, mso-kpi, *-kpi, *-strip, *-tile, *-metric, *-widget, *-panel,
   stat-card, dash-tile, info-box). Покрывает кастомные блоки без перечисления. */
.content-wrapper [class*="-kpi"],
.content-wrapper [class*="-strip"],
.content-wrapper [class*="-tile"],
.content-wrapper [class*="-metric"],
.content-wrapper [class*="-widget"],
.content-wrapper [class*="-panel"],
.content-wrapper .stat-card,
.content-wrapper .info-box {
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
/* — Плавный «подъём» KPI/плиток/виджетов при наведении — */
.content-wrapper [class*="-kpi"],
.content-wrapper [class*="-tile"],
.content-wrapper [class*="-widget"],
.content-wrapper .stat-card {
    transition: transform .16s ease, box-shadow .16s ease;
    will-change: transform;
}
.content-wrapper [class*="-kpi"]:hover,
.content-wrapper [class*="-tile"]:hover,
.content-wrapper [class*="-widget"]:hover,
.content-wrapper .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
@media (prefers-reduced-motion: reduce) {
    .content-wrapper [class*="-kpi"],
    .content-wrapper [class*="-tile"],
    .content-wrapper [class*="-widget"],
    .content-wrapper .stat-card { transition: none; }
    .content-wrapper [class*="-kpi"]:hover,
    .content-wrapper [class*="-tile"]:hover,
    .content-wrapper [class*="-widget"]:hover,
    .content-wrapper .stat-card:hover { transform: none; }
}

/* — Заголовки блоков: с большой буквы, не КАПСОМ — */
.card-header .card-title,
.card-header > h5, .card-header > h6,
.card-header > div > h5, .card-header > div > h6,
.mso-card > .hd, .srv-card .card-header h5 {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* ─── build 1397: ЕДИНЫЙ стиль заголовка блока по всему админу ───
   Эталон — светло-серая полоса .card-header с иконкой и h5/h6 (как на
   /admin/settings/system/ вкладка «Логи»). Приводим ВСЕ .card-header к
   этому виду независимо от того, какие классы навесил конкретный шаблон
   (bg-primary, градиенты и т.п. перебиваются). Цветные «статусные» шапки,
   которым намеренно нужен цвет, помечают себя классом .card-header-keep. */
.content-wrapper .card > .card-header:not(.card-header-keep) {
    background: #f4f6f9 !important;
    border-bottom: 1px solid rgba(0,0,0,.07) !important;
    padding: .55rem .9rem !important;
    display: flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
}
/* заголовок внутри — единый размер/начертание, не капсом */
.content-wrapper .card > .card-header:not(.card-header-keep) > h5,
.content-wrapper .card > .card-header:not(.card-header-keep) > h6,
.content-wrapper .card > .card-header:not(.card-header-keep) > .card-title,
.content-wrapper .card > .card-header:not(.card-header-keep) > div > h5,
.content-wrapper .card > .card-header:not(.card-header-keep) > div > h6 {
    margin: 0 !important;
    font-size: .98rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #2f3a4a !important;
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-grow: 1;
}
/* ведущая иконка заголовка — приглушённый серо-фирменный тон */
.content-wrapper .card > .card-header:not(.card-header-keep) > h5 > i:first-child,
.content-wrapper .card > .card-header:not(.card-header-keep) > h6 > i:first-child,
.content-wrapper .card > .card-header:not(.card-header-keep) > .card-title > i:first-child,
.content-wrapper .card > .card-header:not(.card-header-keep) > i:first-child {
    color: #6c757d !important;
    font-size: .95em;
}
/* убираем цветной текст у Bootstrap-цветных шапок (bg-primary text-white и пр.) */
.content-wrapper .card > .card-header.bg-primary:not(.card-header-keep),
.content-wrapper .card > .card-header.bg-success:not(.card-header-keep),
.content-wrapper .card > .card-header.bg-info:not(.card-header-keep),
.content-wrapper .card > .card-header.bg-secondary:not(.card-header-keep),
.content-wrapper .card > .card-header.bg-dark:not(.card-header-keep),
.content-wrapper .card > .card-header.bg-gradient-primary:not(.card-header-keep) {
    background: #f4f6f9 !important;
    color: #2f3a4a !important;
}
/* тёмная тема — та же полоса, тёмный фон */
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep),
[data-bs-theme="dark"] .content-wrapper .card > .card-header:not(.card-header-keep) {
    background: #262d38 !important;
    border-bottom-color: rgba(255,255,255,.08) !important;
}
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep) > h5,
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep) > h6,
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep) > .card-title,
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep) > div > h5,
body.dark-theme .content-wrapper .card > .card-header:not(.card-header-keep) > div > h6,
[data-bs-theme="dark"] .content-wrapper .card > .card-header:not(.card-header-keep) > h5,
[data-bs-theme="dark"] .content-wrapper .card > .card-header:not(.card-header-keep) > h6,
[data-bs-theme="dark"] .content-wrapper .card > .card-header:not(.card-header-keep) > .card-title {
    color: #e2e8f0 !important;
}

/* ─── build 1397b: ЕДИНЫЙ вид кастомных блоков-«карточек» без .card-header ───
   Многие страницы настроек рисуют блок как кастомный *-card / *-section / *-box
   с ЗАГОЛОВКОМ (h5/h6) прямо в теле, без светло-серой полосы-шапки. Приводим их
   к общему виду: (1) радиус 5px + единая тень (перебиваем локальные 10px через
   !important); (2) первый h5/h6 внутри блока превращаем в полосу-шапку на всю
   ширину блока (как эталон вкладки «Логи»).
   Escape hatch: класс .no-headbar на блоке отключает полосу для конкретного случая.
   Отступ блока задаётся переменной --blk-pad (дефолт 16px) — выставлен для
   основных классов ниже, чтобы полоса легла ровно по краям. */

/* (1) радиус + тень для произвольных блоков-карточек/секций */
.content-wrapper [class$="-card"],
.content-wrapper [class*="-card "],
.content-wrapper [class$="-section"],
.content-wrapper [class*="-section "],
.content-wrapper [class$="-box"]:not(.info-box),
.content-wrapper [class*="-box "]:not(.info-box) {
    border-radius: 5px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* дефолтный внутренний отступ блока (для расчёта полосы-шапки) */
.content-wrapper [class$="-card"],
.content-wrapper [class*="-card "],
.content-wrapper [class$="-section"],
.content-wrapper [class*="-section "] { --blk-pad: 16px; }
/* точные значения для блоков с нестандартным padding */
.content-wrapper .cs-card, .content-wrapper .ss-card,
.content-wrapper .lic-card { --blk-pad: 18px; }
.content-wrapper .sorm-card, .content-wrapper .sorm-section { --blk-pad: 16px; }
.content-wrapper .tg-card, .content-wrapper .gpt-card { --blk-pad: 14px; }

/* (2) первый заголовок внутри блока → полоса-шапка на всю ширину.
   :first-child гарантирует, что это заголовок блока, а не подзаголовок в теле. */
.content-wrapper [class$="-card"]:not(.no-headbar):not(.card-header-keep) > h5:first-child,
.content-wrapper [class*="-card "]:not(.no-headbar):not(.card-header-keep) > h5:first-child,
.content-wrapper [class$="-card"]:not(.no-headbar):not(.card-header-keep) > h6:first-child,
.content-wrapper [class*="-card "]:not(.no-headbar):not(.card-header-keep) > h6:first-child,
.content-wrapper [class$="-section"]:not(.no-headbar):not(.card-header-keep) > h5:first-child,
.content-wrapper [class*="-section "]:not(.no-headbar):not(.card-header-keep) > h5:first-child,
.content-wrapper [class$="-section"]:not(.no-headbar):not(.card-header-keep) > h6:first-child,
.content-wrapper [class*="-section "]:not(.no-headbar):not(.card-header-keep) > h6:first-child {
    display: flex !important;
    align-items: center;
    gap: .45rem;
    margin: calc(-1 * var(--blk-pad, 16px)) calc(-1 * var(--blk-pad, 16px)) var(--blk-pad, 16px) !important;
    padding: .55rem .9rem !important;
    min-height: 44px;
    background: #f4f6f9 !important;
    border-bottom: 1px solid rgba(0,0,0,.07);
    border-radius: 5px 5px 0 0 !important;
    font-size: .98rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #2f3a4a !important;
}
/* ведущая иконка в полосе-шапке — приглушённый тон */
.content-wrapper [class$="-card"]:not(.no-headbar) > h5:first-child > i:first-child,
.content-wrapper [class*="-card "]:not(.no-headbar) > h5:first-child > i:first-child,
.content-wrapper [class$="-card"]:not(.no-headbar) > h6:first-child > i:first-child,
.content-wrapper [class*="-card "]:not(.no-headbar) > h6:first-child > i:first-child,
.content-wrapper [class$="-section"]:not(.no-headbar) > h5:first-child > i:first-child,
.content-wrapper [class*="-section "]:not(.no-headbar) > h5:first-child > i:first-child,
.content-wrapper [class$="-section"]:not(.no-headbar) > h6:first-child > i:first-child,
.content-wrapper [class*="-section "]:not(.no-headbar) > h6:first-child > i:first-child {
    color: #6c757d !important;
    font-size: .95em;
}
/* бейджи/подписи справа в полосе-шапке прижимаем вправо */
.content-wrapper [class$="-card"]:not(.no-headbar) > h5:first-child > span,
.content-wrapper [class*="-card "]:not(.no-headbar) > h5:first-child > span,
.content-wrapper [class$="-section"]:not(.no-headbar) > h5:first-child > span {
    margin-left: auto;
}
/* тёмная тема — тёмная полоса-шапка */
body.dark-theme .content-wrapper [class$="-card"]:not(.no-headbar) > h5:first-child,
body.dark-theme .content-wrapper [class*="-card "]:not(.no-headbar) > h5:first-child,
body.dark-theme .content-wrapper [class$="-card"]:not(.no-headbar) > h6:first-child,
body.dark-theme .content-wrapper [class*="-card "]:not(.no-headbar) > h6:first-child,
body.dark-theme .content-wrapper [class$="-section"]:not(.no-headbar) > h5:first-child,
body.dark-theme .content-wrapper [class*="-section "]:not(.no-headbar) > h5:first-child,
/* build 1733: h6-варианты для -section (были только h5 — шапки складских
   карточек в тёмной теме оставались светлыми) + симметрия data-bs-theme */
body.dark-theme .content-wrapper [class$="-section"]:not(.no-headbar) > h6:first-child,
body.dark-theme .content-wrapper [class*="-section "]:not(.no-headbar) > h6:first-child,
[data-bs-theme="dark"] .content-wrapper [class$="-card"]:not(.no-headbar) > h5:first-child,
[data-bs-theme="dark"] .content-wrapper [class*="-card "]:not(.no-headbar) > h5:first-child,
[data-bs-theme="dark"] .content-wrapper [class$="-card"]:not(.no-headbar) > h6:first-child,
[data-bs-theme="dark"] .content-wrapper [class*="-card "]:not(.no-headbar) > h6:first-child,
[data-bs-theme="dark"] .content-wrapper [class$="-section"]:not(.no-headbar) > h5:first-child,
[data-bs-theme="dark"] .content-wrapper [class*="-section "]:not(.no-headbar) > h5:first-child,
[data-bs-theme="dark"] .content-wrapper [class$="-section"]:not(.no-headbar) > h6:first-child,
[data-bs-theme="dark"] .content-wrapper [class*="-section "]:not(.no-headbar) > h6:first-child {
    background: #262d38 !important;
    border-bottom-color: rgba(255,255,255,.08);
    color: #e2e8f0 !important;
}

/* — Глобально: единый радиус 5px для кнопок, полей и прочих скруглённых
   элементов. Круглые элементы (.rounded-circle, аватары, пилюли-бейджи,
   спиннеры, switch) ИСКЛЮЧЕНЫ — им радиус оставляем как есть. — */
.content-wrapper .btn,
.content-wrapper .form-control,
.content-wrapper .form-select,
.content-wrapper .input-group-text,
.content-wrapper .dropdown-menu,
.content-wrapper .dropdown-item,
.content-wrapper .alert,
.content-wrapper .list-group,
.content-wrapper .nav-tabs .nav-link,
.content-wrapper .nav-pills .nav-link,
.content-wrapper .modal-content,
.content-wrapper .toast,
.content-wrapper .table-responsive,
.content-wrapper .progress,
.content-wrapper .form-check-input:not([type="checkbox"]):not([type="radio"]) {
    border-radius: 5px !important;
}
/* радиусы крайних элементов в группах (btn-group / input-group) */
.content-wrapper .btn-group > .btn:not(:first-child):not(:last-child),
.content-wrapper .input-group > :not(:first-child):not(:last-child) { border-radius: 0 !important; }
.content-wrapper .btn-group > .btn:first-child,
.content-wrapper .input-group > :first-child { border-radius: 5px 0 0 5px !important; }
.content-wrapper .btn-group > .btn:last-child,
.content-wrapper .input-group > :last-child { border-radius: 0 5px 5px 0 !important; }
.content-wrapper .btn-group > .btn:only-child,
.content-wrapper .input-group > :only-child { border-radius: 5px !important; }

/* ═══ Sidebar: активный пункт — фирменный градиент + выделение ═══ */
/* Активный пункт верхнего уровня — фон-градиент, белый текст/иконка */
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active,
.main-sidebar .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
    color: #fff !important;
    border-radius: 5px !important;
    box-shadow: 0 2px 6px rgba(60,191,174,.3);
}
.main-sidebar .nav-link.active .nav-icon,
.main-sidebar .nav-link.active p { color: #fff !important; }
/* Раскрытый родитель с активным вложенным — подсветка + градиент-иконка */
.main-sidebar .nav-item.menu-open > .nav-link {
    background: rgba(67,183,122,.12) !important;
    color: #d6f3e3 !important;
    border-radius: 5px !important;
}
.main-sidebar .nav-item.menu-open > .nav-link .nav-icon {
    background: linear-gradient(135deg, #43b77a, #3cbfae);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #43b77a;
}
/* Активный вложенный пункт — заметная подсветка слева + текст */
.main-sidebar .nav-treeview > .nav-item > .nav-link.active {
    background: rgba(67,183,122,.22) !important;
    color: #fff !important;
    border-left: 3px solid #3cbfae;
    border-radius: 0 5px 5px 0 !important;
}

/* — Ссылки-кнопки (links, оформленные как кнопки): единый радиус 5px — */
.content-wrapper .mso-quick a,
.content-wrapper .gpt-btn,
.content-wrapper .hero-cta,
.content-wrapper a.btn,
.content-wrapper [class$="-btn"],
.content-wrapper [class*="-btn "] {
    border-radius: 5px !important;
}

/* — Глобальный отступ контента от футера: 10px — */
.content-wrapper { padding-bottom: 10px; }
.main-footer { margin-top: 10px; }

/* — Левое меню настроек (panel_left): радиус + компактность — */
.panel-left-menu { border-radius: 5px; }
.panel-left-item { margin: 1px 0 !important; }
.panel-left-link { padding: 5px 7px !important; border-radius: 5px !important; }
.panel-left-sublink { border-radius: 5px !important; padding: 4px 6px !important; }

/* — Шапки блоков (.hd) — светло-серый градиент-фон — */
.content-wrapper .hd,
.content-wrapper .mso-card > .hd {
    background: linear-gradient(180deg, #fafbfc 0%, #f1f3f5 100%);
}
body.dark-theme .content-wrapper .hd,
.dark-mode .content-wrapper .hd,
body.dark-theme .content-wrapper .mso-card > .hd {
    background: linear-gradient(180deg, #262b32 0%, #1f242b 100%);
}

/* ═══ Глобально: все синие цвета → фирменный зелёный ═══
   primary/links/nav уже зелёные выше. Здесь: info (cyan/blue), text-info,
   bg-info, btn-info, badge bg-info, и контекстные синие иконки/акценты. */
.text-info { color: var(--brand-primary) !important; }
.bg-info, .badge.bg-info, .badge.badge-info { background-color: var(--brand-primary) !important; color: #fff !important; }
.btn-info { background-color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; color: #fff !important; }
.btn-info:hover, .btn-info:focus { background-color: #379963 !important; border-color: #2f8956 !important; color: #fff !important; }
.btn-outline-info { color: var(--brand-primary) !important; border-color: var(--brand-primary) !important; }
.btn-outline-info:hover, .btn-outline-info:focus { background-color: var(--brand-primary) !important; color: #fff !important; }
.alert-info { background-color: #eafaf1 !important; border-color: #b6e8cd !important; color: #1e7e44 !important; }
body.dark-theme .alert-info, .dark-mode .alert-info { background-color: rgba(67,183,122,.12) !important; border-color: rgba(67,183,122,.3) !important; color: #8fe0b3 !important; }
.progress-bar.bg-info { background-color: var(--brand-primary) !important; }
.border-info { border-color: var(--brand-primary) !important; }
.spinner-border.text-info, .spinner-grow.text-info { color: var(--brand-primary) !important; }
.list-group-item-info { background-color: #eafaf1 !important; color: #1e7e44 !important; }
/* контекстные синие иконки в наших блоках */
.content-wrapper .text-primary, .content-wrapper .fa-info-circle.text-info,
.content-wrapper i.text-info { color: var(--brand-primary) !important; }

/* кнопка «прочитать всё» в чат-сайдбаре — фирменный градиент */
.scw-readall-btn {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
    border-radius: 5px !important;
    border-color: #3aa86e !important;
}
.scw-readall-btn:hover {
    background: linear-gradient(135deg, #3aa86e, #34ab9c) !important;
}

/* ═══ Фирменный градиент для зелёных кнопок и бейджей ═══ */
.btn-primary, .btn-success, .btn-info,
.badge.bg-primary, .badge.bg-success, .badge.bg-info,
.bg-primary, .bg-success {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
    border-color: #3aa86e !important;
}
.btn-primary:hover, .btn-success:hover, .btn-info:hover,
.btn-primary:focus, .btn-success:focus, .btn-info:focus,
.btn-primary:active, .btn-success:active, .btn-info:active {
    background: linear-gradient(135deg, #3aa86e, #34ab9c) !important;
    border-color: #2f8956 !important;
}
.btn-primary:disabled, .btn-success:disabled, .btn-info:disabled,
.btn-primary.disabled, .btn-success.disabled {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
    opacity: .55;
}

/* — Глобальный фикс вёрстки Select2: высота как у Bootstrap-поля,
   вертикальное центрирование текста, ширина 100%, радиус 5px, стрелка по центру. — */
.content-wrapper .select2-container { width: 100% !important; max-width: 100%; }
/* одиночный select — высота calc(2.25rem) как .form-control, центрирование текста */
.content-wrapper .select2-container--bootstrap-5 .select2-selection--single,
.content-wrapper .select2-container .select2-selection--single {
    height: calc(1.5em + .75rem + 2px) !important;
    min-height: calc(1.5em + .75rem + 2px);
    display: flex; align-items: center;
    border-radius: 5px !important;
    padding: 0 .75rem;
}
.content-wrapper .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding-left: 0 !important; padding-right: 1.4rem !important;
    display: block; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.content-wrapper .select2-selection--single .select2-selection__arrow {
    height: 100% !important; top: 0 !important; right: 6px !important;
    display: flex; align-items: center;
}
/* мелкий select (рядом с .form-control-sm / в тулбарах) — высота как form-control-sm */
.content-wrapper .form-select-sm + .select2-container .select2-selection--single,
.content-wrapper .select2-sm .select2-selection--single,
.content-wrapper .input-group-sm .select2-selection--single {
    height: calc(1.5em + .5rem + 2px) !important;
    min-height: calc(1.5em + .5rem + 2px);
    font-size: .875rem; padding: 0 .5rem;
}
/* множественный select — авто-высота, перенос чипов, радиус 5px */
.content-wrapper .select2-container--bootstrap-5 .select2-selection--multiple,
.content-wrapper .select2-selection--multiple {
    min-height: calc(1.5em + .75rem + 2px) !important;
    border-radius: 5px !important;
    padding: 2px 4px; align-items: center;
}
/* select2 внутри input-group — корректные крайние радиусы */
.content-wrapper .input-group > .select2-container:not(:first-child) .select2-selection { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.content-wrapper .input-group > .select2-container:not(:last-child) .select2-selection { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
/* в фокусе/открыт — единый focus-ring */
.content-wrapper .select2-container--focus .select2-selection,
.content-wrapper .select2-container--open .select2-selection { border-radius: 5px !important; }
/* убрать вторую (нативную) стрелку: оставляем одну select2-стрелку, прячем дубль */
.content-wrapper select.form-select + .select2-container { background-image: none; }
.content-wrapper .select2-selection__arrow b { border-color: #6c757d transparent transparent transparent !important; }
.content-wrapper .select2-selection--single .select2-selection__arrow:not(:last-child) { display: none !important; }
/* небольшой отступ текста слева в выбранном значении */
.content-wrapper .select2-selection--single .select2-selection__rendered { padding-left: 4px !important; }
.content-wrapper .select2-results__option { padding-left: 12px; }
/* активный/подсвеченный пункт открытого списка — фирменный градиент */
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-results__option--highlighted[aria-selected],
.select2-container .select2-results__option--highlighted {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important;
    color: #fff !important;
}
.select2-container--bootstrap-5 .select2-results__option--selected,
.select2-results__option[aria-selected="true"] {
    background: linear-gradient(135deg, #3aa86e, #34ab9c) !important;
    color: #fff !important;
}

/* ═══ Селектор организации в шапке (#org-selector / -mobile) ═══ */
/* — Десктоп: пилюля с бренд-акцентом — */
#org-selector > .nav-link {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid rgba(67,183,122,.4);
    background: rgba(67,183,122,.08);
    transition: background .15s, border-color .15s;
}
#org-selector > .nav-link:hover,
#org-selector.show > .nav-link {
    background: rgba(67,183,122,.16);
    border-color: #43b77a;
}
#org-selector > .nav-link > i { color: #43b77a !important; font-size: .95rem; }
#org-selector .org-sel-name {
    font-weight: 600; font-size: .85rem; max-width: 160px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#org-selector .nav-dropdown-toggle::after { margin-left: .15rem; opacity: .6; }
/* — Дропдаун: бренд-акценты для пунктов — */
#org-selector .dropdown-menu, #org-selector-mobile .dropdown-menu {
    border-radius: 8px; border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: .35rem; min-width: 230px;
}
#org-selector .dropdown-item, #org-selector-mobile .dropdown-item {
    border-radius: 5px; padding: .45rem .6rem; display: flex; align-items: center; gap: .55rem;
}
#org-selector .dropdown-item:hover, #org-selector-mobile .dropdown-item:hover {
    background: rgba(67,183,122,.1);
}
#org-selector .dropdown-item.active, #org-selector-mobile .dropdown-item.active {
    background: linear-gradient(135deg, #43b77a, #3cbfae) !important; color: #fff !important;
}
#org-selector .dropdown-item.active .text-muted,
#org-selector-mobile .dropdown-item.active .text-muted { color: rgba(255,255,255,.8) !important; }
#org-selector .dropdown-item i, #org-selector-mobile .dropdown-item i { width: 18px; text-align: center; color: #43b77a; }
#org-selector .dropdown-item.active i, #org-selector-mobile .dropdown-item.active i { color: #fff; }
/* — Тёмная тема — */
body.dark-theme #org-selector > .nav-link, .dark-mode #org-selector > .nav-link {
    background: rgba(67,183,122,.14); border-color: rgba(67,183,122,.45);
}
body.dark-theme #org-selector > .nav-link:hover, .dark-mode #org-selector.show > .nav-link {
    background: rgba(67,183,122,.24);
}
body.dark-theme #org-selector .dropdown-menu,
body.dark-theme #org-selector-mobile .dropdown-menu,
.dark-mode #org-selector .dropdown-menu {
    background: #22262e; border-color: rgba(255,255,255,.1);
    box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
body.dark-theme #org-selector .dropdown-item:hover,
.dark-mode #org-selector .dropdown-item:hover { background: rgba(67,183,122,.18); }
/* — Мобильный чип — */
#org-selector-mobile .org-mobile-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .35rem .6rem; border-radius: 999px;
    background: rgba(67,183,122,.14); border: 1px solid rgba(67,183,122,.4);
    min-height: 36px;
}
#org-selector-mobile .org-mobile-chip > i { color: #43b77a; }
#org-selector-mobile .org-mobile-name { font-weight: 600; font-size: .82rem; }
@media (max-width: 575.98px){
    #org-selector-mobile .dropdown-menu { min-width: 220px; }
    #org-selector-mobile .dropdown-item { padding: .55rem .6rem; }  /* крупнее тач-таргет */
}

/* — Masonry-хелпер: 2 независимые колонки по высоте на десктопе — */
.smit-masonry { column-gap: 1rem; }
@media (min-width: 992px) { .smit-masonry { column-count: 2; } }
.smit-masonry > .card,
.smit-masonry > .mso-card,
.smit-masonry > [class*="-card"] {
    break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
    display: inline-block; width: 100%; margin: 0 0 1rem;
}

/* ── Режим drawer (?drawer=1): страница внутри выезжающей панели без хрома ── */
/* Используется для сайдбар-панели тикета в разделе Поддержка (build 1390). */
body.sp-drawer-mode .main-header,
body.sp-drawer-mode .main-sidebar,
body.sp-drawer-mode .main-footer,
body.sp-drawer-mode .app-sidebar { display: none !important; }
body.sp-drawer-mode .content-wrapper { margin-left: 0 !important; min-height: 100vh; }
body.sp-drawer-mode .content-header { display: none !important; }
body.sp-drawer-mode { background: var(--surface-default, #fff); }

/* ═══ build 1398: аватарки абонентов + иконки соц-сетей (VK/TG/MAX) ═══ */
/* Иконка-ссылка на соц-профиль абонента — без круга, цветная брендовая иконка (build 1399) */
.ab-social-ico{display:inline-flex;align-items:center;justify-content:center;
  background:transparent !important;width:auto !important;height:auto !important;border-radius:0 !important;
  font-size:1.25rem;text-decoration:none;line-height:1;transition:transform .12s,filter .12s}
.ab-social-ico:hover{transform:translateY(-2px);filter:brightness(1.1)}
.ab-social-vk{color:#0077ff}
.ab-social-tg{color:#2aabee}
.ab-social-max{color:#7c3aed}
/* Аватарка абонента (в шапке профиля/тикета/сайдбара/тултипа) */
.ab-avatar-img{border-radius:50%;object-fit:cover;background:#eef2f7;border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,.18);flex:0 0 auto}
[data-bs-theme="dark"] .ab-avatar-img,.dark-theme .ab-avatar-img{border-color:#2a2f37}

/* ═══ build 1401: единый стиль вкладок для ВСЕХ разделов (профиль/поддержка/…) ═══
   Класс .ab-navbar-tabs.ab-tabs-style-{classic|pills|underline|compact|tubelight|glow}
   применяется к любому tab-навбару. Стиль выбирается в Настройки → Профиль →
   «Вкладки карточки абонента» (ABONENT_PROFILE_TABS_STYLE) и распространяется
   на все разделы через SMIT_PROFILE_PREFS.tabs_style. Ранее было inline в
   abonents_edit_one.html (только профиль). */
    /* build 882: альтернативные стили навигации табов карточки абонента
       (SMIT_PROFILE_PREFS.tabs_style — classic/pills/underline/compact) */
    /* PILLS — скруглённые таблетки */
    .ab-navbar-tabs.ab-tabs-style-pills { gap: 4px; padding: 6px 0; }
    .ab-navbar-tabs.ab-tabs-style-pills .nav-link {
        border-radius: 999px !important;
        padding: .55rem 1rem !important;
    }
    /* UNDERLINE — Material-style подчёркивание */
    .ab-navbar-tabs.ab-tabs-style-underline .nav-link {
        background: transparent !important;
        padding: .85rem 1.25rem !important;
        border-bottom: 3px solid transparent !important;
    }
    .ab-navbar-tabs.ab-tabs-style-underline .nav-link.active {
        color: var(--brand-primary, #43b77a) !important;
        background: transparent !important;
        border-bottom-color: var(--brand-primary, #43b77a) !important;
    }
    .ab-navbar-tabs.ab-tabs-style-underline .nav-link.active i.fas { color: var(--brand-primary, #43b77a); }
    .ab-navbar-tabs.ab-tabs-style-underline .nav-link:hover {
        background: transparent !important;
        border-bottom-color: rgba(67, 183, 122, .35) !important;
    }
    /* COMPACT — узкие табы, только иконки на mobile */
    .ab-navbar-tabs.ab-tabs-style-compact .nav-link {
        padding: .55rem .7rem !important;
        font-size: .78rem !important;
    }
    .ab-navbar-tabs.ab-tabs-style-compact .nav-link i.fas {
        font-size: .95em !important;
        opacity: 1;
    }
    @media (max-width: 991px) {
        .ab-navbar-tabs.ab-tabs-style-compact .nav-link {
            padding: .55rem .5rem !important;
        }
        .ab-navbar-tabs.ab-tabs-style-compact .nav-link .ab-tab-label-text {
            display: none;
        }
    }
    body.dark-theme .ab-navbar-tabs.ab-tabs-style-underline .nav-link.active {
        color: #65d0a0 !important;
        border-bottom-color: #65d0a0 !important;
    }
    /* TUBELIGHT — пилюля с акцентной подсветкой (tubelight-navbar). build 1199 */
    .ab-navbar-tabs.ab-tabs-style-tubelight { gap: 6px; padding: 6px 0; }
    .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link {
        border-radius: 999px !important;
        padding: .55rem 1.1rem !important;
        position: relative;
        background: transparent !important;
        border: 0 !important;
        transition: background .2s, color .2s;
    }
    .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link:hover {
        background: color-mix(in srgb, var(--brand-primary, #43b77a) 10%, transparent) !important;
    }
    .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active {
        background: color-mix(in srgb, var(--brand-primary, #43b77a) 16%, transparent) !important;
        color: var(--brand-primary, #43b77a) !important;
        font-weight: 600;
    }
    .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active i.fas { color: var(--brand-primary, #43b77a); }
    /* акцентная «лампа» сверху активной вкладки + glow */
    .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active::before {
        content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
        width: 55%; height: 3px; border-radius: 3px;
        background: var(--brand-primary, #43b77a);
        box-shadow: 0 0 10px 1px var(--brand-primary, #43b77a), 0 0 22px 3px color-mix(in srgb, var(--brand-primary, #43b77a) 55%, transparent);
        transition: width .2s, left .2s;
    }
    body.dark-theme .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active {
        color: #65d0a0 !important;
        background: rgba(101, 208, 160, .16) !important;
    }
    body.dark-theme .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active::before {
        background: #65d0a0;
        box-shadow: 0 0 10px 1px #65d0a0, 0 0 22px 3px rgba(101, 208, 160, .5);
    }
    @media (prefers-reduced-motion: reduce) {
        .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link,
        .ab-navbar-tabs.ab-tabs-style-tubelight .nav-link.active::before { transition: none; }
    }

    /* GLOW-MENU — цветовая маркировка вкладок + неоновое свечение активной.
       build 1201. Каждая вкладка получает свой цвет (nth-child палитра);
       активная — залита своим цветом со свечением (glow-menu стиль). */
    .ab-navbar-tabs.ab-tabs-style-glow { gap: 4px; padding: 6px 0; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-link {
        border-radius: 999px !important;
        padding: .5rem 1rem !important;
        background: transparent !important;
        border: 0 !important;
        --tab-glow: #43b77a;
        transition: background .2s, color .2s, box-shadow .25s;
    }
    /* цветовая палитра по позиции вкладки */
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+1) .nav-link { --tab-glow: #43b77a; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+2) .nav-link { --tab-glow: #0d6efd; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+3) .nav-link { --tab-glow: #7b2ff7; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+4) .nav-link { --tab-glow: #e6007e; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+5) .nav-link { --tab-glow: #fd7e14; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+6) .nav-link { --tab-glow: #00a8a8; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+7) .nav-link { --tab-glow: #dc3545; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-item:nth-child(8n+8) .nav-link { --tab-glow: #6f42c1; }
    /* неактивная — иконка в цвете вкладки (маркировка) */
    .ab-navbar-tabs.ab-tabs-style-glow .nav-link i.fas { color: var(--tab-glow); opacity: .9; }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-link:hover {
        background: color-mix(in srgb, var(--tab-glow) 12%, transparent) !important;
    }
    /* активная — залита своим цветом + свечение (glow) */
    .ab-navbar-tabs.ab-tabs-style-glow .nav-link.active {
        background: var(--tab-glow) !important;
        color: #fff !important;
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--tab-glow) 60%, transparent),
                    0 4px 14px color-mix(in srgb, var(--tab-glow) 55%, transparent),
                    0 0 18px 2px color-mix(in srgb, var(--tab-glow) 45%, transparent);
    }
    .ab-navbar-tabs.ab-tabs-style-glow .nav-link.active i.fas { color: #fff; opacity: 1; }
    @media (prefers-reduced-motion: reduce) {
        .ab-navbar-tabs.ab-tabs-style-glow .nav-link { transition: none; }
    }

/* ═══ build 1401: единый стиль вкладок для ОСТАЛЬНЫХ разделов ═══
   body[data-tabs-style=X] распространяет выбранный стиль на любые .nav-tabs/.nav-pills
   внутри .content-wrapper (кроме .ab-navbar-tabs — у них свои правила выше).
   Активная вкладка Bootstrap = .nav-link.active / .active > .nav-link. */
.content-wrapper .nav-tabs:not(.ab-navbar-tabs),
.content-wrapper .nav-pills:not(.ab-navbar-tabs){border-bottom:0}
/* базовый вид ссылок (общий для стилей) */
body[data-tabs-style] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link,
body[data-tabs-style] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link{
  color:#6c757d;border:0;transition:background .15s,color .15s}
/* PILLS */
body[data-tabs-style="pills"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link,
body[data-tabs-style="pills"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link{border-radius:999px !important;padding:.5rem 1rem !important}
body[data-tabs-style="pills"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link.active,
body[data-tabs-style="pills"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link.active,
body[data-tabs-style="pills"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .active>.nav-link{
  background:var(--brand-primary,#43b77a) !important;color:#fff !important;border-radius:999px !important}
/* UNDERLINE */
body[data-tabs-style="underline"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link{
  background:transparent !important;border-bottom:3px solid transparent !important;border-radius:0 !important}
body[data-tabs-style="underline"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link.active,
body[data-tabs-style="underline"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .active>.nav-link{
  color:var(--brand-primary,#43b77a) !important;background:transparent !important;border-bottom-color:var(--brand-primary,#43b77a) !important}
/* COMPACT */
body[data-tabs-style="compact"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link,
body[data-tabs-style="compact"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link{padding:.5rem .7rem !important;font-size:.82rem !important}
/* TUBELIGHT */
body[data-tabs-style="tubelight"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link,
body[data-tabs-style="tubelight"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link{border-radius:999px !important;background:transparent !important;position:relative}
body[data-tabs-style="tubelight"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link.active,
body[data-tabs-style="tubelight"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link.active{
  background:color-mix(in srgb,var(--brand-primary,#43b77a) 16%,transparent) !important;color:var(--brand-primary,#43b77a) !important;font-weight:600}
/* GLOW (упрощённо — заливка бренд-цветом активной, как pills со свечением) */
body[data-tabs-style="glow"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link,
body[data-tabs-style="glow"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link{border-radius:8px !important}
body[data-tabs-style="glow"] .content-wrapper .nav-tabs:not(.ab-navbar-tabs) .nav-link.active,
body[data-tabs-style="glow"] .content-wrapper .nav-pills:not(.ab-navbar-tabs) .nav-link.active{
  background:var(--brand-primary,#43b77a) !important;color:#fff !important;box-shadow:0 0 12px color-mix(in srgb,var(--brand-primary,#43b77a) 60%,transparent)}

/* ─────────────────────────────────────────────────────────────────────
   Fix: восстановление Bootstrap 5 responsive display-утилит.
   AdminLTE (adminlte.min.css, грузится ПОСЛЕ bootstrap) повторно объявляет
   `.d-none{display:none!important}` уже ПОСЛЕ responsive-правил `d-{bp}-*`,
   из-за чего `d-none d-lg-block` (десктоп-таблица) и `d-block d-lg-none`
   (мобильные карточки) переставали работать — блок с `d-none` оставался
   скрытым на всех ширинах (баг вкладки «Сессии» абонента). theme-smit.css
   грузится последним в base_adminlte.html, поэтому дублируем адаптивные
   утилиты здесь — они перебивают adminlte по порядку каскада.
   ───────────────────────────────────────────────────────────────────── */
@media (min-width:576px){
  .d-sm-none{display:none!important}
  .d-sm-inline{display:inline!important}
  .d-sm-inline-block{display:inline-block!important}
  .d-sm-block{display:block!important}
  .d-sm-flex{display:flex!important}
  .d-sm-inline-flex{display:inline-flex!important}
  .d-sm-table{display:table!important}
  .d-sm-table-row{display:table-row!important}
  .d-sm-table-cell{display:table-cell!important}
}
@media (min-width:768px){
  .d-md-none{display:none!important}
  .d-md-inline{display:inline!important}
  .d-md-inline-block{display:inline-block!important}
  .d-md-block{display:block!important}
  .d-md-flex{display:flex!important}
  .d-md-inline-flex{display:inline-flex!important}
  .d-md-table{display:table!important}
  .d-md-table-row{display:table-row!important}
  .d-md-table-cell{display:table-cell!important}
}
@media (min-width:992px){
  .d-lg-none{display:none!important}
  .d-lg-inline{display:inline!important}
  .d-lg-inline-block{display:inline-block!important}
  .d-lg-block{display:block!important}
  .d-lg-flex{display:flex!important}
  .d-lg-inline-flex{display:inline-flex!important}
  .d-lg-table{display:table!important}
  .d-lg-table-row{display:table-row!important}
  .d-lg-table-cell{display:table-cell!important}
}
@media (min-width:1200px){
  .d-xl-none{display:none!important}
  .d-xl-inline{display:inline!important}
  .d-xl-inline-block{display:inline-block!important}
  .d-xl-block{display:block!important}
  .d-xl-flex{display:flex!important}
  .d-xl-inline-flex{display:inline-flex!important}
}
@media (min-width:1400px){
  .d-xxl-none{display:none!important}
  .d-xxl-block{display:block!important}
  .d-xxl-flex{display:flex!important}
}

/* ── build 1736: выбор организации в шапке модалки «Новый абонент» ──────────
   При «Все организации» в шапке стояло имя папки («Все») — оно не отвечало
   на вопрос, чьим станет абонент. Селект оформлен под шапку: без рамки, одна
   стрелка (нативную гасим appearance:none — иначе рисуются две). */
.qa-org-select {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin-left: .5rem;
    padding: .12rem 1.35rem .12rem .5rem;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.4;
    color: #495057;
    background-color: rgba(0, 0, 0, .04);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .4rem center;
    background-size: 9px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    max-width: 190px;
    transition: background-color .15s ease, border-color .15s ease;
}
.qa-org-select:hover {
    background-color: rgba(0, 0, 0, .07);
}
.qa-org-select:focus-visible {
    outline: 2px solid #43b77a;
    outline-offset: 1px;
}
body.dark-theme .qa-org-select,
body[data-theme="dark"] .qa-org-select {
    color: #cfd8e3;
    background-color: rgba(255, 255, 255, .07);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a8b8cc' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
body.dark-theme .qa-org-select:hover,
body[data-theme="dark"] .qa-org-select:hover {
    background-color: rgba(255, 255, 255, .12);
}
body.dark-theme .qa-org-select option,
body[data-theme="dark"] .qa-org-select option {
    background-color: #2b3543;
    color: #cfd8e3;
}

/* ═══════════════════════════════════════════════════════════════════════
   build 1775: Модалки на мобильном = полноэкранные слайд-панели (выезд справа)
   ЕДИНОЕ правило для ВСЕХ Bootstrap-модалок (реестр PDF, редакторы, формы,
   подтверждения и т.д.). Заменяет per-page .mg-slide-modal / .doc-slide-modal.
   Opt-out: класс .modal-nofull на .modal — оставить обычную центр-модалку.
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  .modal:not(.modal-nofull) .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100dvh;
    min-height: 100dvh;      /* перебивает min-height у .modal-dialog-centered */
    display: block;          /* убирает flex-центрирование centered-модалок */
  }
  .modal:not(.modal-nofull) .modal-content {
    height: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  /* выезд справа вместо стандартного fade-вниз */
  .modal.fade:not(.modal-nofull) .modal-dialog {
    transform: translateX(100%);
    transition: transform .28s ease-out;
  }
  .modal.show:not(.modal-nofull) .modal-dialog {
    transform: translateX(0);
  }
  /* шапка/футер прилипают — заголовок, close и кнопки действий всегда видны.
     background:inherit = непрозрачный фон модалки (в т.ч. тёмная тема); цветные
     .bg-*-шапки сохраняют свой цвет (utility !important сильнее inherit). */
  .modal:not(.modal-nofull) .modal-header {
    position: sticky; top: 0; z-index: 3; background: inherit;
  }
  .modal:not(.modal-nofull) .modal-body {
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .modal:not(.modal-nofull) .modal-footer {
    position: sticky; bottom: 0; z-index: 3; background: inherit;
  }
  /* PDF-вьюер (iframe) должен занять всю высоту панели */
  .modal.smit-pdfview:not(.modal-nofull) .modal-body,
  .modal.smit-pdfview:not(.modal-nofull) .pv-iframe { height: 100%; min-height: 0; }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .modal.fade:not(.modal-nofull) .modal-dialog { transition: none; }
}
