/* ===================================================== */
/* 🎨 ТЕМА: базовые переменные под фирменные цвета        */
/* Переопределяем --bs-body-* Bootstrap, чтобы при        */
/* загрузке страницы не было белого/чёрного мелькания     */
/* ===================================================== */
:root {
    color-scheme: light;
    --bs-body-bg: #ffffff;
    --bs-body-color: #0C4A5E;
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: #16191d;
    --bs-body-color: #e6e8ea;
}


/* ===================================================== */
/* 🚀 ФИРМЕННЫЕ СТИЛИ (Высший приоритет через !important) */
/* ===================================================== */

/* 1. Основные кнопки бренда */
.btn-brand {
    background: var(--brand-gradient) !important;
    border: none !important;
    color: #fff !important;
    transition: all .25s ease;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(27, 168, 181, .3);
    color: #fff !important;
    filter: brightness(1.1);
}

/* 2. Контурные кнопки бренда */
.btn-outline-brand {
    color: var(--brand-primary) !important;
    border: 2px solid var(--brand-primary) !important;
    background-color: transparent !important;
    transition: all .25s ease;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--text-on-primary) !important;
}

/* 3. Градиентные фоны и тексты */
.bg-brand-gradient {
    background: var(--brand-gradient) !important;
    color: var(--text-on-gradient) !important;
}

.text-brand {
    color: var(--brand-primary) !important;
}

a.text-brand:hover {
    color: var(--brand-accent) !important;
}

/* 4. Переопределение Bootstrap primary */
.bg-primary {
    background-color: var(--brand-primary) !important;
}

.text-primary {
    color: var(--brand-primary) !important;
}

.btn-primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--text-on-primary) !important;
}

.btn-primary:hover {
    background-color: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    color: var(--text-on-accent) !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: var(--text-on-primary) !important;
}

.border-primary {
    border-color: var(--brand-primary) !important;
}

/* 5. Иконки в кружочках */
.icon-circle.bg-primary,
.icon-circle.bg-success,
.icon-circle.bg-info {
    background: var(--brand-gradient) !important;
}

.icon-circle.bg-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #a71d2a 100%) !important;
}

.icon-circle.bg-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, #d39e00 100%) !important;
}

/* ===================================================== */
/* 🌗 DARK THEME АДАПТАЦИЯ                                  */
/* ===================================================== */
[data-bs-theme="dark"] {
    --brand-gradient: linear-gradient(135deg, var(--brand-start) 0%, var(--brand-end) 100%);
}

[data-bs-theme="dark"] .btn-brand:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .text-brand {
    color: var(--brand-accent) !important;
}

/* ===================================================== */
/* 📐 БАЗОВАЯ РАСКЛАДКА (Sticky Footer)                    */
/* ===================================================== */
html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-bg);
    transition: background-color .3s ease, color .3s ease;
}

.navbar {
    flex-shrink: 0;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

footer {
    flex-shrink: 0;
    margin-top: auto;
}

.navbar-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* ===================================================== */
/* 🌓 Переключатель темы                                   */
/* ===================================================== */
.theme-switcher {
    display: inline-flex;
    background: var(--bs-tertiary-bg);
    border-radius: 50px;
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--bs-border-color);
}

.theme-switcher button {
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: .875rem;
    transition: all .2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.theme-switcher button:hover {
    background: var(--bs-secondary-bg);
}

.theme-switcher button.active {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(27, 168, 181, .3);
}

/* ===================================================== */
/* 🎯 Иконки в кружочках                                    */
/* ===================================================== */
.icon-circle {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.75rem !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .icon-circle {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

/* ===================================================== */
/* 📝 Контент статей (Typography)                           */
/* ===================================================== */
.content-body {
    line-height: 1.7;
    font-size: 1.05rem;
}

.content-body h2,
.content-body h3,
.content-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--brand-secondary);
    font-weight: 700;
}

[data-bs-theme="dark"] .content-body h2,
[data-bs-theme="dark"] .content-body h3,
[data-bs-theme="dark"] .content-body h4 {
    color: var(--brand-accent);
}

.content-body p {
    margin-bottom: 1.25rem;
}

.content-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-body video,
.content-body iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 1.5rem auto;
    display: block;
    border-radius: 0.75rem;
}

.content-body table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

.content-body blockquote {
    border-left: 4px solid var(--brand-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bs-tertiary-bg);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
}

.content-body code {
    background: var(--bs-tertiary-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    color: var(--brand-primary);
    font-size: 0.9em;
    font-weight: 500;
}

.content-body pre {
    background: var(--bs-tertiary-bg);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.content-body figure {
    max-width: 100%;
    margin: 1.5rem auto;
    text-align: center;
}

.content-body figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    font-style: italic;
}

.content-body ul,
.content-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content-body li {
    margin-bottom: 0.5rem;
}

.content-body a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-decoration-color: rgba(27, 168, 181, 0.3);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.content-body a:hover {
    color: var(--brand-accent);
    text-decoration-color: var(--brand-accent);
}

/* ===================================================== */
/* 🎴 Карточки статей                                       */
/* ===================================================== */
.article-card {
    transition: all .3s ease;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, .12) !important;
}

[data-bs-theme="dark"] .article-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, .4) !important;
}

.article-card .card-img-top {
    height: 180px;
    object-fit: cover;
    transition: transform .4s ease;
}

.article-card:hover .card-img-top {
    transform: scale(1.05);
}

.article-placeholder {
    height: 180px;
    background: var(--brand-gradient);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.article-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, .1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.article-placeholder i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.article-placeholder span {
    font-size: 0.8rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ===================================================== */
/* 📑 ПРЕМИАЛЬНАЯ ПАГИНАЦИЯ В ФИРМЕННЫХ ЦВЕТАХ             */
/* ===================================================== */
.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.5rem;
    --bs-pagination-font-size: 0.9rem;
    --bs-pagination-color: var(--brand-primary);
    --bs-pagination-bg: var(--bs-body-bg);
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: var(--bs-border-color);
    --bs-pagination-border-radius: 0.5rem;
    --bs-pagination-hover-color: #fff;
    --bs-pagination-hover-bg: var(--brand-primary);
    --bs-pagination-hover-border-color: var(--brand-primary);
    --bs-pagination-focus-color: #fff;
    --bs-pagination-focus-bg: var(--brand-primary);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(27, 168, 181, 0.25);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--brand-primary);
    --bs-pagination-active-border-color: var(--brand-primary);
    --bs-pagination-disabled-color: var(--bs-secondary-color);
    --bs-pagination-disabled-bg: var(--bs-body-bg);
    --bs-pagination-disabled-border-color: var(--bs-border-color);
    gap: 4px;
}

.pagination .page-link {
    border-radius: 0.5rem !important;
    margin: 0 2px;
    transition: all 0.25s ease;
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}

.pagination .page-link:hover {
    transform: translateY(-2px);
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(27, 168, 181, 0.3);
    z-index: 2;
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(27, 168, 181, 0.25);
    z-index: 3;
}

.pagination .page-item.active .page-link {
    background: var(--brand-gradient) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(27, 168, 181, 0.45);
    font-weight: 700;
    transform: translateY(-2px);
    z-index: 3;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    border-color: var(--bs-border-color);
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

.pagination .page-link i {
    font-size: 1rem;
    line-height: 1;
}

/* Dark theme пагинация */
[data-bs-theme="dark"] .pagination .page-link:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.pagination-info strong {
    color: var(--brand-primary);
    font-weight: 600;
}

@media (max-width: 576px) {
    .pagination .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
        padding: 0.35rem 0.55rem;
    }
}

/* ===================================================== */
/* 🔧 FIX: bg-opacity-10 + text-primary (слияние цветов)  */
/* ===================================================== */
.badge.bg-primary.bg-opacity-10,
.badge[class*="bg-"][class*="bg-opacity-10"].text-primary {
    color: var(--brand-secondary) !important;
    font-weight: 600;
    border: 1px solid rgba(27, 168, 181, 0.2);
}

[data-bs-theme="dark"] .badge.bg-primary.bg-opacity-10,
[data-bs-theme="dark"] .badge[class*="bg-"][class*="bg-opacity-10"].text-primary {
    color: var(--brand-accent) !important;
    border-color: rgba(43, 196, 209, 0.3);
}

.bg-opacity-10.text-primary {
    color: var(--brand-secondary) !important;
}

.bg-opacity-10.text-success {
    color: #0f5132 !important;
}

.bg-opacity-10.text-danger {
    color: #842029 !important;
}

.bg-opacity-10.text-warning {
    color: #664d03 !important;
}

.bg-opacity-10.text-info {
    color: #055160 !important;
}

[data-bs-theme="dark"] .bg-opacity-10.text-primary {
    color: var(--brand-accent) !important;
}

[data-bs-theme="dark"] .bg-opacity-10.text-success {
    color: #75d9a1 !important;
}

[data-bs-theme="dark"] .bg-opacity-10.text-danger {
    color: #f28a93 !important;
}

[data-bs-theme="dark"] .bg-opacity-10.text-warning {
    color: #ffe066 !important;
}

[data-bs-theme="dark"] .bg-opacity-10.text-info {
    color: #6edff6 !important;
}

.bg-opacity-25.text-primary {
    color: var(--brand-secondary) !important;
    font-weight: 600;
}

[data-bs-theme="dark"] .bg-opacity-25.text-primary {
    color: var(--brand-accent) !important;
}

/* ===================================================== */
/* 🏷️ CATEGORY CHIPS (фильтры в фирменных цветах)          */
/* ===================================================== */
.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--bs-border-color);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.category-chip:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.25);
}

.category-chip.active {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(27, 168, 181, 0.35);
}

.category-chip i {
    margin-right: 0.35rem;
}

[data-bs-theme="dark"] .category-chip:hover,
[data-bs-theme="dark"] .category-chip.active {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ===================================================== */
/* 🎯 ПРЕМИАЛЬНЫЙ NAVBAR                                  */
/* ===================================================== */
.navbar-premium {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bs-border-color);
    transition: all 0.3s ease;
    z-index: 1030;
    padding: 0.5rem 0;
}

[data-bs-theme="dark"] .navbar-premium {
    background: rgba(15, 20, 25, 0.85);
}

.navbar-premium.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .navbar-premium.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Логотип */
.navbar-brand {
    color: var(--brand-secondary) !important;
    font-weight: 700;
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

[data-bs-theme="dark"] .navbar-brand {
    color: var(--brand-accent) !important;
}

.navbar-brand:hover {
    transform: scale(1.03);
}

/* === ЛОГОТИП В NAVBAR === */
.logo-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    padding: 2px;
    box-shadow: 0 4px 15px rgba(27, 168, 181, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
}

/* Внутренний круглый контейнер для лого */
.logo-wrapper::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    z-index: 0;
}

.navbar-brand:hover .logo-wrapper {
    transform: rotate(-8deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(27, 168, 181, 0.45);
}

.navbar-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
}

.navbar-brand:hover .navbar-brand-logo {
    transform: scale(1.08);
}

/* Мобильная версия */
@media (max-width: 575.98px) {
    .logo-wrapper {
        width: 42px;
        height: 42px;
    }
}
/* Добавить в .logo-wrapper блок */
.logo-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 10%,
        transparent 20%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: logoShine 3s linear infinite;
    z-index: 2;
    pointer-events: none;
}

.navbar-brand:hover .logo-wrapper::after {
    opacity: 1;
}

@keyframes logoShine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.brand-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Ссылки навигации */
.nav-link-premium {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem !important;
    border-radius: 12px;
    font-weight: 500;
    color: var(--bs-body-color) !important;
    transition: all 0.25s ease;
    position: relative;
    font-size: 0.95rem;
}

.nav-link-premium:hover {
    background: rgba(27, 168, 181, 0.08);
    color: var(--brand-primary) !important;
    transform: translateY(-1px);
}

.nav-link-premium.active {
    background: var(--brand-gradient);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.3);
}

.nav-link-premium i {
    font-size: 1.05em;
}

/* Иконочные кнопки */
.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-body-color);
    transition: all 0.25s ease;
    padding: 0;
    font-size: 1.15rem;
}

.btn-icon:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.3);
}

/* Поиск */
.search-input-wrapper {
    background: var(--bs-tertiary-bg);
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 220px;
}

.search-input-wrapper:focus-within {
    background: var(--bs-body-bg);
    box-shadow: 0 0 0 3px rgba(27, 168, 181, 0.15);
}

.search-input {
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: var(--bs-secondary-color);
}

/* Компактный переключатель темы */
.theme-switcher-compact {
    display: inline-flex;
    background: var(--bs-tertiary-bg);
    border-radius: 50px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--bs-border-color);
}

.theme-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.theme-btn:hover {
    background: var(--bs-secondary-bg);
}

.theme-btn.active {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(27, 168, 181, 0.3);
}

/* Dropdown пользователя */
.btn-user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    border: 1px solid var(--bs-border-color);
    background: transparent;
    transition: all 0.25s ease;
    color: var(--bs-body-color);
}

.btn-user-dropdown:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* ✅ ИСПРАВЛЕНО: badge теперь идеально центрирован */
.user-badge {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    color: #fff !important;
    flex-shrink: 0;
}

.user-badge i {
    font-size: 0.75rem !important;
    line-height: 1 !important;
    display: block;
    margin: 0;
    padding: 0;
}

.dropdown-menu-premium {
    border: none;
    border-radius: 16px;
    min-width: 280px;
    padding: 0.5rem;
    animation: dropdownFadeIn 0.2s ease;
    background: var(--bs-body-bg);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header-custom {
    padding: 0.75rem 0.75rem 0.5rem;
}

.dropdown-item-premium {
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item-premium:hover {
    background: rgba(27, 168, 181, 0.1);
    color: var(--brand-primary);
    transform: translateX(3px);
}

/* ===================================================== */
/* 📱 МОБИЛЬНЫЙ ПОИСК (OVERLAY) — ИСПРАВЛЕНО              */
/* ===================================================== */
.mobile-search-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--bs-body-bg);
    z-index: 10000 !important;
    /* ✅ Очень высокий z-index */
    padding: 2rem 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.mobile-search-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0);
}

/* ✅ Явные цвета для всех элементов поиска */
.mobile-search-overlay .container {
    width: 100%;
    max-width: 600px;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.mobile-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--bs-body-color);
}

.mobile-search-header h5 {
    color: var(--bs-body-color) !important;
    margin: 0;
    font-size: 1.25rem;
}

/* ✅ Форма поиска с гарантированной видимостью */
.mobile-search-form .input-group {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bs-body-bg) !important;
    border: 2px solid var(--brand-primary, #1BA8B5) !important;
    display: flex !important;
}

[data-bs-theme="dark"] .mobile-search-form .input-group {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: var(--bs-body-bg) !important;
}

.mobile-search-form .form-control {
    border-radius: 0 !important;
    font-size: 1.1rem !important;
    padding: 1rem 1.25rem !important;
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border: none !important;
    min-height: 60px !important;
    flex: 1 1 auto !important;
    width: 1% !important;
    display: block !important;
}

.mobile-search-form .form-control:focus {
    background: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    box-shadow: none !important;
    outline: none !important;
}

.mobile-search-form .form-control::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.7;
}

.mobile-search-form .btn {
    border-radius: 0 !important;
    padding: 0 1.5rem !important;
    min-width: 70px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ✅ Chips популярных запросов */
.search-suggestions {
    animation: fadeInUp 0.5s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-suggestion-chip {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.875rem;
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
}

.search-suggestion-chip:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-1px);
}

/* Кнопка закрытия */
.btn-close-search {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.btn-close-search:hover {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
    transform: rotate(90deg);
}

/* ===================================================== */
/* 📱 МОБИЛЬНОЕ МЕНЮ (OFFCANVAS)                          */
/* ===================================================== */
.mobile-menu-offcanvas {
    width: 320px !important;
    max-width: 85vw;
    background: var(--brand-gradient) !important;
    color: #fff;
    border: none;
}

.mobile-menu-offcanvas .offcanvas-header {
    padding: 1rem 1.25rem;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.offcanvas-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
}

.mobile-menu-offcanvas .offcanvas-title {
    color: #fff;
}

.mobile-nav {
    padding: 0.5rem 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #fff;
    padding-left: 1.5rem;
}

.mobile-nav-link i:first-child {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.mobile-nav-link .bi-chevron-right {
    opacity: 0.5;
    transition: transform 0.25s ease;
    font-size: 0.9rem;
}

.mobile-nav-link:hover .bi-chevron-right,
.mobile-nav-link.active .bi-chevron-right {
    transform: translateX(4px);
    opacity: 1;
}

.mobile-nav-divider {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.mobile-user-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.mobile-auth-block {
    padding: 1.5rem 1.25rem;
}

.mobile-auth-block .btn {
    padding: 0.65rem 1rem;
    font-weight: 500;
}

.mobile-auth-block .btn-outline-brand {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
}

.mobile-auth-block .btn-outline-brand:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #fff !important;
}

.mobile-auth-block .btn-brand {
    background: #fff !important;
    color: var(--brand-primary) !important;
    border-color: #fff !important;
}

/* ===================================================== */
/* 📱 АДАПТИВНОСТЬ                                        */
/* ===================================================== */
@media (max-width: 991.98px) {
    .navbar-premium {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .brand-text {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .theme-switcher-compact {
        padding: 2px;
    }

    .theme-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }

    .logo-wrapper {
        width: 36px;
        height: 36px;
    }

    .brand-text {
        display: none;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================================== */
/* 📱 SIDEBAR NAVIGATION (Desktop + Mobile unified)      */
/* ===================================================== */

/* === Общие стили для навигации в sidebar (desktop) === */
.sidebar .nav {
    gap: 2px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    margin: 2px 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.925rem;
    font-weight: 500;
    position: relative;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
    border-left-color: rgba(255, 255, 255, 0.6);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
    border-left-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Заголовки секций */
.sidebar .nav-section-title {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 1rem 1rem 0.4rem;
    margin-top: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

.sidebar .nav-section-title:first-child {
    margin-top: 0;
    padding-top: 0.5rem;
}

/* === Badge-счётчики с pulse-анимацией === */
.sidebar .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.35em 0.6em;
    font-weight: 600;
    margin-left: auto;
    border-radius: 50px;
    min-width: 22px;
    text-align: center;
}

.sidebar .nav-link .badge.bg-danger,
.sidebar .nav-link .badge.bg-warning {
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 2px 12px rgba(220, 53, 69, 0.4);
    }
}

/* === Кнопка выхода === */
.sidebar .nav-link button[type="submit"] {
    color: inherit !important;
    font: inherit;
}

.sidebar .nav-link:has(button[type="submit"]):hover {
    background: rgba(220, 53, 69, 0.25);
    color: #fff;
    border-left-color: #DC3545;
}

/* === Мобильный offcanvas (использует .mobile-nav-link из navbar) === */
/* Для совместимости: если offcanvas содержит старый .nav-link — применяем стили mobile-nav-link */
.offcanvas .nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 0;
    margin: 0;
}

.offcanvas .nav .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.offcanvas .nav .nav-link:hover,
.offcanvas .nav .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #fff;
    transform: none;
}

.offcanvas .nav .nav-link.active::before {
    display: none;
    /* Убираем точку в offcanvas */
}

.offcanvas .nav-section-title {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.offcanvas .nav-section-title::before {
    display: none;
}

.offcanvas .nav .badge {
    font-size: 0.7rem;
    padding: 0.35em 0.6em;
    margin-left: auto;
}

/* === Адаптивность для мобильных === */
@media (max-width: 767.98px) {
    .offcanvas .nav .nav-link {
        padding: 0.85rem 1.25rem;
        font-size: 0.975rem;
    }
}

/* ===================================================== */
/* 🔘 ПРЕМИАЛЬНАЯ СИСТЕМА КНОПОК (УНИВЕРСАЛЬНАЯ)         */
/* ===================================================== */

/* === 1. БАЗОВЫЕ СВОЙСТВА === */
.btn {
    position: relative;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 10px;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s ease,
                background 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    will-change: transform;
}

/* ✅ Эффект нажатия — лёгкое уменьшение */
.btn:active:not(:disabled) {
    transform: scale(0.96);
}

/* Отключаем для disabled и loading */
.btn:disabled,
.btn.btn-loading {
    transform: none !important;
}

/* === 2. РАЗМЕРЫ === */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
    border-radius: 14px;
}

.btn-xl {
    padding: 1rem 2.25rem;
    font-size: 1.15rem;
    border-radius: 16px;
    font-weight: 600;
}

/* === 3. BRAND КНОПКИ (ГРАДИЕНТНЫЕ) === */
.btn-brand {
    background: var(--brand-gradient) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.2);
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 168, 181, 0.35);
    filter: brightness(1.08);
    color: #fff !important;
}

.btn-brand:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(27, 168, 181, 0.3);
}

.btn-brand:focus-visible {
    box-shadow: 0 0 0 3px rgba(27, 168, 181, 0.3);
}

.btn-outline-brand {
    color: var(--brand-primary) !important;
    border: 2px solid var(--brand-primary) !important;
    background: transparent !important;
}

.btn-outline-brand:hover,
.btn-outline-brand:focus {
    background: var(--brand-primary) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 168, 181, 0.25);
}

.btn-soft-brand {
    background: rgba(27, 168, 181, 0.1) !important;
    color: var(--brand-primary) !important;
    border: 1px solid rgba(27, 168, 181, 0.2) !important;
}

.btn-soft-brand:hover {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border-color: var(--brand-primary) !important;
    transform: translateY(-1px);
}

/* === 4. СИСТЕМНЫЕ КНОПКИ (success, danger, warning, info) === */

/* SUCCESS */
.btn-success {
    background: linear-gradient(135deg, #4ADE80, #10B981) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    filter: brightness(1.08);
}

.btn-outline-success {
    color: #10B981 !important;
    border: 2px solid #10B981 !important;
    background: transparent !important;
}

.btn-outline-success:hover {
    background: #10B981 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-soft-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #0f766e !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.btn-soft-success:hover {
    background: #10B981 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-soft-success {
    color: #4ADE80 !important;
}

/* DANGER */
.btn-danger {
    background: linear-gradient(135deg, #F87171, #DC2626) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
    filter: brightness(1.08);
}

.btn-outline-danger {
    color: #DC2626 !important;
    border: 2px solid #DC2626 !important;
    background: transparent !important;
}

.btn-outline-danger:hover {
    background: #DC2626 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-soft-danger {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
}

.btn-soft-danger:hover {
    background: #DC2626 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-soft-danger {
    color: #F87171 !important;
}

/* WARNING */
.btn-warning {
    background: linear-gradient(135deg, #FBBF24, #D97706) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
    filter: brightness(1.08);
}

.btn-outline-warning {
    color: #D97706 !important;
    border: 2px solid #D97706 !important;
    background: transparent !important;
}

.btn-outline-warning:hover {
    background: #D97706 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-soft-warning {
    background: rgba(217, 119, 6, 0.1) !important;
    color: #92400e !important;
    border: 1px solid rgba(217, 119, 6, 0.2) !important;
}

.btn-soft-warning:hover {
    background: #D97706 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-soft-warning {
    color: #FBBF24 !important;
}

/* INFO */
.btn-info {
    background: linear-gradient(135deg, #60A5FA, #2563EB) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    filter: brightness(1.08);
}

.btn-outline-info {
    color: #2563EB !important;
    border: 2px solid #2563EB !important;
    background: transparent !important;
}

.btn-outline-info:hover {
    background: #2563EB !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-soft-info {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #1e40af !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
}

.btn-soft-info:hover {
    background: #2563EB !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-soft-info {
    color: #60A5FA !important;
}

/* SECONDARY */
.btn-secondary {
    background: linear-gradient(135deg, #94A3B8, #64748B) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.3);
    filter: brightness(1.08);
}

.btn-outline-secondary {
    color: #64748B !important;
    border: 2px solid #64748B !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background: #64748B !important;
    color: #fff !important;
    transform: translateY(-2px);
}

.btn-soft-secondary {
    background: rgba(100, 116, 139, 0.1) !important;
    color: #475569 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
}

.btn-soft-secondary:hover {
    background: #64748B !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-soft-secondary {
    color: #94A3B8 !important;
}

/* LIGHT */
.btn-light {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #212529 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    background: #f8f9fa !important;
}

/* === 5. PRIMARY КНОПКИ (уже были, дополним) === */
.btn-primary {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.2);
}

.btn-primary:hover {
    background: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 168, 181, 0.35);
}

/* === 6. СОСТОЯНИЯ === */

/* Disabled */
.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === 7. ФОРМЫ КНОПОК === */
.btn-pill {
    border-radius: 50px !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.btn-square {
    border-radius: 0 !important;
}

.btn-rounded {
    border-radius: 12px !important;
}

/* === 8. ИКОНОЧНЫЕ КНОПКИ === */
.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only.btn-sm {
    width: 36px;
    height: 36px;
}

.btn-icon-only.btn-lg {
    width: 52px;
    height: 52px;
}

/* === 9. ГРУППЫ КНОПОК === */
.btn-group>.btn {
    border-radius: 0 !important;
}

.btn-group>.btn:first-child {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

.btn-group>.btn:last-child {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.btn-group>.btn:not(:first-child) {
    margin-left: -1px;
}

/* === 10. КНОПКИ ДЕЙСТВИЙ В ТАБЛИЦАХ === */
.btn-action {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action-view:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.btn-action-edit:hover {
    background: #FBBF24;
    color: #fff;
    border-color: #FBBF24;
}

.btn-action-delete:hover {
    background: #DC2626;
    color: #fff;
    border-color: #DC2626;
}

/* === 11. SHIMMER ЭФФЕКТ (блеск при hover) === */
.btn-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn-shimmer:hover::before {
    left: 100%;
}

/* === 12. КНОПКА "ВВЕРХ" (scroll to top) === */
.btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(27, 168, 181, 0.35);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
}

.btn-scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(27, 168, 181, 0.45);
}

/* === 13. DARK THEME === */
[data-bs-theme="dark"] .btn-light {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background: #334155 !important;
}

[data-bs-theme="dark"] .btn-brand:hover,
[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-success:hover,
[data-bs-theme="dark"] .btn-danger:hover,
[data-bs-theme="dark"] .btn-warning:hover,
[data-bs-theme="dark"] .btn-info:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* === 14. МОБИЛЬНАЯ АДАПТАЦИЯ === */
@media (max-width: 575.98px) {
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-xl {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .btn-scroll-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* ===================================================== */
/* 🔔 ПРЕМИАЛЬНЫЕ TOAST-УВЕДОМЛЕНИЯ                       */
/* ===================================================== */

/* Контейнер уведомлений (правый верхний угол) */
.toast-container-wrapper {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

/* === Базовый toast === */
.premium-toast {
    background: var(--bs-body-bg);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
    pointer-events: auto;
    border: 1px solid var(--bs-border-color);
    transform: translateX(420px);
    opacity: 0;
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 420px;
}

.premium-toast.hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.premium-toast:hover {
    animation-play-state: paused;
}

.premium-toast:hover .toast-progress-bar {
    animation-play-state: paused;
}

@keyframes toastSlideIn {
    0% {
        transform: translateX(420px);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
        max-height: 200px;
        margin-bottom: 12px;
    }

    100% {
        transform: translateX(420px);
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
    }
}

/* === Акцентная полоса слева === */
.toast-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-color, var(--brand-primary));
}

/* === Тело toast === */
.toast-body-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    position: relative;
}

/* === Иконка === */
.toast-icon-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--toast-color-rgb, 27, 168, 181), 0.12);
    color: var(--toast-color, var(--brand-primary));
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-icon {
    line-height: 1;
}

/* === Контент === */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 2px;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-message:empty {
    display: none;
}

.toast-message a {
    color: var(--toast-color, var(--brand-primary));
    text-decoration: underline;
    font-weight: 500;
}

/* === Кнопка закрытия === */
.toast-close {
    background: transparent;
    border: none;
    color: var(--bs-secondary-color);
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: 0.6;
}

.toast-close:hover {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    opacity: 1;
    transform: rotate(90deg);
}

.toast-close i {
    font-size: 0.85rem;
}

/* === Прогресс-бар === */
.toast-progress {
    height: 3px;
    background: var(--bs-tertiary-bg);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: var(--toast-color, var(--brand-primary));
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* === ТИПЫ TOAST === */
.premium-toast[data-type="success"] {
    --toast-color: #10B981;
    --toast-color-rgb: 16, 185, 129;
}

.premium-toast[data-type="error"] {
    --toast-color: #DC2626;
    --toast-color-rgb: 220, 38, 38;
}

.premium-toast[data-type="warning"] {
    --toast-color: #D97706;
    --toast-color-rgb: 217, 119, 6;
}

.premium-toast[data-type="info"] {
    --toast-color: #2563EB;
    --toast-color-rgb: 37, 99, 235;
}

.premium-toast[data-type="brand"] {
    --toast-color: var(--brand-primary, #1BA8B5);
    --toast-color-rgb: 27, 168, 181;
}

/* === Анимация иконки === */
.premium-toast .toast-icon-wrapper {
    animation: toastIconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastIconPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }

    60% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* === Мобильная адаптация === */
@media (max-width: 575.98px) {
    .toast-container-wrapper {
        top: 80px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .premium-toast {
        max-width: none;
    }

    @keyframes toastSlideIn {
        0% {
            transform: translateY(-30px);
            opacity: 0;
        }

        100% {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes toastSlideOut {
        0% {
            transform: translateY(0);
            opacity: 1;
        }

        100% {
            transform: translateY(-30px);
            opacity: 0;
        }
    }
}

/* === Dark theme === */
[data-bs-theme="dark"] .premium-toast {
    background: rgba(25, 30, 38, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .toast-icon-wrapper {
    background: rgba(var(--toast-color-rgb, 27, 168, 181), 0.18);
}

/* ===================================================== */
/* 📚 PREMIUM LIBRARY                                     */
/* ===================================================== */

/* === HERO СЕКЦИЯ БИБЛИОТЕКИ === */
.library-hero {
    background: linear-gradient(135deg, var(--brand-start, #2BC4D1) 0%, var(--brand-end, #0C4A5E) 100%);
    color: #fff;
    padding: 4rem 0 5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.library-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBg 8s ease-in-out infinite;
}

.library-hero::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatBg 10s ease-in-out infinite reverse;
}

@keyframes floatBg {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

.library-hero-content {
    position: relative;
    z-index: 2;
}

.library-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.6s ease;
}

.library-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease 0.1s backwards;
}

.library-hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero search */
.library-hero-search {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 0.5rem;
    max-width: 600px;
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

.library-hero-search .form-control {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.1rem;
    font-size: 0.95rem;
    color: #212529;
}

.library-hero-search .form-control::placeholder {
    color: #6c757d;
}

.library-hero-search .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.library-hero-search .btn-light {
    background: #fff;
    color: var(--brand-primary);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.25s;
}

.library-hero-search .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* === ХЛЕБНЫЕ КРОШКИ === */
.breadcrumb-premium {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.breadcrumb-premium .breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: var(--bs-secondary-color);
    padding: 0 0.5rem;
}

.breadcrumb-premium .breadcrumb-item a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-premium .breadcrumb-item a:hover {
    color: var(--brand-accent);
    text-decoration: underline;
}

.breadcrumb-premium .breadcrumb-item.active {
    color: var(--bs-secondary-color);
}

/* === СЕКЦИЯ "ПОПУЛЯРНОЕ" === */
.featured-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--bs-body-color);
}

.featured-section-title i {
    color: #FBBF24;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }
}

/* === ЗАГОЛОВОК СПИСКА МАТЕРИАЛОВ === */
.materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.materials-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--bs-body-color);
}

.materials-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--brand-gradient);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(27, 168, 181, 0.25);
}

/* === FILTER CHIPS (улучшенные) === */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bs-body-bg);
    border-radius: 20px;
    border: 2px dashed var(--bs-border-color);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 24px;
    background: var(--bs-tertiary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--bs-secondary-color);
}

.empty-state h4 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--bs-secondary-color);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================================== */
/* 📱 SIDEBAR PREMIUM                                     */
/* ===================================================== */
.library-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
}

.library-sidebar::-webkit-scrollbar {
    width: 4px;
}

.library-sidebar::-webkit-scrollbar-thumb {
    background: var(--brand-gradient);
    border-radius: 10px;
}

.sidebar-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
    background: var(--bs-body-bg);
}

.sidebar-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.sidebar-card-header {
    background: var(--brand-gradient);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-card-header i {
    font-size: 1.1rem;
}

/* Список категорий */
.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-category-item {
    border-bottom: 1px solid var(--bs-border-color);
}

.sidebar-category-item:last-child {
    border-bottom: none;
}

.sidebar-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.25s;
    font-size: 0.9rem;
}

.sidebar-category-link:hover {
    background: rgba(27, 168, 181, 0.06);
    color: var(--brand-primary);
    padding-left: 1.5rem;
}

.sidebar-category-link .cat-icon {
    width: 24px;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.sidebar-category-link .cat-name {
    flex: 1;
    font-weight: 500;
}

.sidebar-category-link .cat-count {
    background: var(--brand-gradient);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

/* Облако тегов */
.sidebar-tags {
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sidebar-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border-radius: 50px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--bs-border-color);
}

.sidebar-tag:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(27, 168, 181, 0.2);
}

.sidebar-tag small {
    opacity: 0.7;
    font-size: 0.7rem;
}

/* Социальные карточки */
.social-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    color: #fff;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s, box-shadow 0.3s;
}

.social-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.social-card-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #005f8c 100%);
}

.social-card-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-card-body {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.social-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.social-card:hover .social-card-icon {
    transform: rotate(-10deg) scale(1.1);
}

.social-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.social-card-desc {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.social-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.95);
    color: #212529;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s;
}

.social-card-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Карточка пользователя / призыв к регистрации */
.user-progress-card,
.cta-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    background: var(--bs-body-bg);
}

.user-progress-card-header {
    background: linear-gradient(135deg, #4ADE80, #10B981);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
}

.user-progress-body {
    padding: 1.25rem;
}

.user-progress-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #10B981;
    flex-shrink: 0;
}

.user-progress-info h6 {
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.user-progress-info small {
    color: var(--bs-secondary-color);
}

/* CTA для гостей */
.cta-card-header {
    background: var(--brand-gradient);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
}

.cta-card-body {
    padding: 1.25rem;
}

.cta-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.cta-features li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-features li i {
    color: #10B981;
    flex-shrink: 0;
}

/* Рекомендуемые */
.recommended-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommended-item {
    border-bottom: 1px solid var(--bs-border-color);
}

.recommended-item:last-child {
    border-bottom: none;
}

.recommended-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.25s;
}

.recommended-link:hover {
    background: rgba(27, 168, 181, 0.06);
    padding-left: 1.5rem;
}

.recommended-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.recommended-thumb-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--brand-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.recommended-info h6 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommended-info small {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

/* Форматы обучения */
.formats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.format-item {
    border-bottom: 1px solid var(--bs-border-color);
}

.format-item:last-child {
    border-bottom: none;
}

.format-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.25s;
    font-size: 0.9rem;
}

.format-link:hover {
    background: rgba(27, 168, 181, 0.06);
    padding-left: 1.5rem;
    color: var(--brand-primary);
}

.format-link i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ===================================================== */
/* 📖 ARTICLE PAGE PREMIUM                                */
/* ===================================================== */

/* Reading progress bar */
.reading-progress-bar {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bs-tertiary-bg);
    z-index: 1020;
    display: none;
}

.reading-progress-bar-inner {
    height: 100%;
    background: var(--brand-gradient);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 8px rgba(27, 168, 181, 0.5);
}

body.article-page .reading-progress-bar {
    display: block;
}

/* Article hero header */
.article-hero {
    padding: 2rem 0 3rem;
}

.article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.article-badge-type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}

.article-badge-featured {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    color: #fff;
}

.article-badge-category {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

.article-badge-category:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.article-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: var(--bs-body-color);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-meta-item i {
    color: var(--brand-primary);
}

/* Article cover */
.article-cover {
    margin: 2rem 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    position: relative;
}

.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.article-cover figcaption {
    background: var(--bs-tertiary-bg);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    text-align: center;
    font-style: italic;
}

/* Video/Audio/PDF containers */
.article-video-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    margin: 2rem 0;
}

.article-video-container iframe,
.article-video-container video {
    width: 100%;
    border: 0;
    display: block;
}

.article-audio-card {
    background: var(--brand-gradient);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    color: #fff;
    text-align: center;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(27, 168, 181, 0.3);
}

.article-audio-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: audioPulse 4s ease-in-out infinite;
}

@keyframes audioPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.article-audio-card>* {
    position: relative;
    z-index: 2;
}

.article-audio-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: audioFloat 3s ease-in-out infinite;
}

@keyframes audioFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.article-audio-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.article-audio-player {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.article-audio-tip {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 1rem;
}

.article-pdf-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.article-pdf-header {
    background: var(--brand-gradient);
    color: #fff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-pdf-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-pdf-actions {
    display: flex;
    gap: 0.5rem;
}

.article-pdf-actions .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.article-pdf-frame {
    width: 100%;
    height: 85vh;
    min-height: 600px;
    border: 0;
}

.article-pdf-footer {
    background: var(--bs-tertiary-bg);
    padding: 0.85rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* Article excerpt */
.article-excerpt {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--bs-body-color);
    padding: 1.25rem 1.5rem;
    background: var(--bs-tertiary-bg);
    border-left: 4px solid var(--brand-primary);
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
    font-style: italic;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.article-tag:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(27, 168, 181, 0.25);
}

/* Share buttons */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    transition: all 0.25s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.share-btn-telegram:hover {
    background: #0088cc;
    color: #fff;
    border-color: #0088cc;
}

.share-btn-whatsapp:hover {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}

.share-btn-copy:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* Comments */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bs-border-color);
}

.comment-item {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 1rem;
    transition: box-shadow 0.3s;
}

.comment-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
    flex-shrink: 0;
}

.comment-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.comment-author {
    font-weight: 700;
    color: var(--bs-body-color);
    margin-bottom: 0.2rem;
}

.comment-time {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

/* Floating TOC for article */
.article-toc {
    position: sticky;
    top: 90px;
    background: var(--bs-body-bg);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--bs-border-color);
    margin-bottom: 1.5rem;
}

.article-toc-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bs-secondary-color);
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.article-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc-list li {
    padding: 0.35rem 0;
}

.article-toc-list a {
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.article-toc-list a:hover {
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
}

/* ===================================================== */
/* 📱 МОБИЛЬНАЯ АДАПТАЦИЯ                                 */
/* ===================================================== */
@media (max-width: 991.98px) {
    .library-hero {
        padding: 2.5rem 0 3rem;
    }

    .library-hero h1 {
        font-size: 1.85rem;
    }

    .library-hero-subtitle {
        font-size: 0.95rem;
    }

    .library-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-audio-card {
        padding: 1.75rem 1.25rem;
    }

    .article-pdf-frame {
        height: 70vh;
        min-height: 500px;
    }
}

@media (max-width: 575.98px) {
    .library-hero {
        padding: 2rem 0 2.5rem;
    }

    .library-hero h1 {
        font-size: 1.6rem;
    }

    .library-hero-search {
        padding: 0.4rem;
    }

    .library-hero-search .form-control {
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }

    .library-hero-search .btn-light {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .featured-section-title {
        font-size: 1.2rem;
    }

    .materials-header h2 {
        font-size: 1.25rem;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .article-meta {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .article-audio-icon {
        font-size: 2.5rem;
    }

    .share-btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: center;
    }
}

/* === TABS для sidebar на мобильных === */
@media (max-width: 991.98px) {
    .sidebar-mobile-tabs {
        display: flex;
        background: var(--bs-tertiary-bg);
        border-radius: 12px;
        padding: 4px;
        margin-bottom: 1rem;
        gap: 2px;
    }

    .sidebar-mobile-tab {
        flex: 1;
        padding: 0.6rem;
        border: none;
        background: transparent;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--bs-body-color);
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
    }

    .sidebar-mobile-tab.active {
        background: var(--brand-gradient);
        color: #fff;
        box-shadow: 0 2px 8px rgba(27, 168, 181, 0.3);
    }

    .sidebar-mobile-panel {
        display: none;
    }

    .sidebar-mobile-panel.active {
        display: block;
        animation: fadeIn 0.3s;
    }
}

@media (min-width: 992px) {
    .sidebar-mobile-tabs {
        display: none;
    }

    .sidebar-mobile-panel {
        display: block !important;
    }

/* ===================================================== */
/* 📊 ЕДИНЫЕ PREMIUM-КАРТОЧКИ СО СЧЁТЧИКАМИ             */
/* ===================================================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-primary);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 15%, transparent);
}
.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}
.stat-card-icon.teal { background: var(--brand-gradient); }
.stat-card-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-card-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-card-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card-icon.pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.stat-card-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card-icon.purple { background: linear-gradient(135deg, #a855f7, #9333ea); }
.stat-card-icon.slate { background: linear-gradient(135deg, #64748b, #475569); }

/* Ссылка-обёртка для карточки-счётчика (фильтр по клику) */
.stat-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.stat-card-link:hover { color: inherit; }
.stat-card-body { min-width: 0; }
.stat-card-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--bs-body-color);
}
.stat-card-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

/* ===================================================== */
/* 🔔 ЕДИНЫЕ БЛОКИ УВЕДОМЛЕНИЙ / ПРЕДУПРЕЖДЕНИЙ           */
/* ===================================================== */
.app-alert {
    --app-alert-color: var(--brand-primary);
    --app-alert-color-rgb: 27, 168, 181;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--app-alert-color);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 1rem;
}

.app-alert-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--app-alert-color);
    background: rgba(var(--app-alert-color-rgb), 0.12);
}

.app-alert-body {
    flex: 1;
    min-width: 0;
}

.app-alert-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bs-body-color);
    margin-bottom: 0.15rem;
}

.app-alert-message {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    line-height: 1.5;
}
.app-alert-message ul { margin-top: 0.25rem; }

.app-alert-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.app-alert-close:hover { opacity: 1; }

/* Типы */
.app-alert-success { --app-alert-color: #16a34a; --app-alert-color-rgb: 22, 163, 74; }
.app-alert-error { --app-alert-color: #dc2626; --app-alert-color-rgb: 220, 38, 38; }
.app-alert-warning { --app-alert-color: #d97706; --app-alert-color-rgb: 217, 119, 6; }
.app-alert-info { --app-alert-color: #2563eb; --app-alert-color-rgb: 37, 99, 235; }

/* Тёмная тема */
[data-bs-theme="dark"] .app-alert {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .app-alert, .app-alert-close { transition: none; }
}

}