/* box-sizing: border-box везде, чтобы padding/border у элемента (например, у
   input с width:100%) считались внутрь заданной ширины, а не поверх неё —
   без этого width:100% + padding в content-box вылезает за родителя. */
*, *::before, *::after {
    box-sizing: border-box;
}

.sidebar-nav {
    margin-top: 20px;
    padding: 0;
    list-style: none;
}
/* Общие стили */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

.container-fluid {
    display: flex;
    min-height: 100vh;
    padding: 0; /* Убираем padding, добавленный Bootstrap */
    margin: 0; /* Убираем margin, если есть */
}

/* Контент */
.content {
    margin-left: 260px;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in;
    padding-top: 1rem; /* Дополнительный отступ для топ-панели */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Боковая панель */
.sidebar-nav {
    width: 260px;
    background-color: #1F2937;
    color: #fff;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease;
    margin: 0; /* Убираем margin */
    z-index: 1000; /* Обеспечиваем, что sidebar выше топ-панели */
}



.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 1rem;
}

.sidebar-nav li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.sidebar-nav li a:hover {
    color: #60A5FA;
}

.line {
    border-top: 1px solid #4B5563;
    margin: 1rem 0;
}

.sidebar-section-label {
    color: #60A5FA;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

/* Кнопка переключения */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    background-color: #1E40AF;
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1000;
}

/* Карточки */
.card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    max-width: 100%; /* Растягиваем карточки на всю ширину */
}



/* Вложенные карточки на странице профиля */
.profile-page .card {
    max-width: 50%; /* Уменьшаем ширину вложенных карточек только на странице профиля */
}

.card h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.card p {
    color: #6B7280;
    line-height: 1.6;
}

/* Кнопки */
.btn-primary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    text-decoration: none;
}

.btn-primary:hover,
.btn-danger:hover {
    color: #fff;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(90deg, #1E40AF, #3B82F6);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-danger {
    background: linear-gradient(90deg, #B91C1C, #EF4444);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #111827;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Отступ между полем ввода и кнопкой */
.form-group button.btn-primary {
    margin-top: 0.75rem; /* Отступ сверху для кнопки */
}

/* Списки */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 1rem 0; /* Базовые отступы */
    background-color: #F9FAFB;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background-color 0.2s ease;
}

/* Добавляем отступ для содержимого внутри .list-item */
.list-item > div {
    padding-left: 1rem; /* Отступ слева для текста внутри .list-item */
}

/* Убираем отступы для вложенных списков внутри .list-item */
.list-item ul {
    padding-left: 0;
    margin-left: 0;
    list-style-type: none;
}

.list-item:hover {
    background-color: #F3F4F6;
}

.list-item .font-medium {
    color: #111827;
    font-weight: 500;
}

.list-item .text-gray {
    color: #6B7280;
}

.list-item .text-green {
    color: #10B981;
}

.list-item .text-red {
    color: #EF4444;
}

/* Стили для списков на главной странице */
.main-page-list {
    list-style-type: disc;
    padding-left: 1.5rem;
}

/* Стили для страницы команды */
.team-members-card {
    padding-left: 1.5rem; /* Стандартный отступ от левого края блока до фона .list-item */
}

.team-members-card h3 {
    padding-left: 0; /* Убираем дополнительный отступ, так как .team-members-card уже имеет padding-left: 1.5rem */
}

.team-members-card ul {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}

.team-members-card .list-item {
    padding-left: 1.5rem; /* Дополнительный отступ для фона .list-item от края блока */
}

.team-members-card .list-item > div {
    padding-left: 1.5rem; /* Стандартный отступ от начала фона до текста */
}

/* Сообщения */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message.success {
    background-color: #D1FAE5;
    color: #065F46;
}

.message.error {
    background-color: #FEE2E2;
    color: #991B1B;
}

.message.warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.message.info,
.message.debug {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* Пагинация */
.pagination {
    margin-top: 2rem;
    text-align: center;
}

.page-links a {
    margin: 0 0.5rem;
    text-decoration: none;
    color: #1E40AF;
    font-weight: 500;
    transition: color 0.2s ease;
}

.page-links a:hover {
    color: #3B82F6;
}

.page-current {
    font-weight: bold;
    color: #111827;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar-nav {
        transform: translateX(-100%);
        width: 220px;
    }

    .sidebar-nav.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    /* На мобильных устройствах вложенные карточки на странице профиля занимают всю ширину */
    .profile-page .card {
        max-width: 100%;
    }
}

/* Hero-блок главной страницы */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 45%, #3B82F6 100%);
    color: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.25);
}

.hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.75rem;
    font-weight: 700;
    color: #BFDBFE;
    margin-bottom: 0.75rem;
}

.hero-text h1 {
    font-size: 2.25rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #fff;
}

.hero-subhead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #DBEAFE;
    margin: 0 0 1.75rem 0;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.hero-actions .btn-primary.hero-btn {
    background: #fff;
    background-image: none;
    color: #1E40AF;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hero-actions .btn-primary.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.hero-btn-secondary {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.hero-feature {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.1rem;
    backdrop-filter: blur(4px);
}

.hero-feature i {
    font-size: 1.25rem;
    color: #93C5FD;
    margin-top: 0.15rem;
}

.hero-feature h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.25rem 0;
}

.hero-feature p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #DBEAFE;
    margin: 0;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-features {
        grid-template-columns: 1fr;
    }
}

/* Компактная "шапка" для внутренних страниц (профиль, команда, медиа и т.п.) —
   переиспользует язык главного hero (градиент/скругление), но короче,
   без сетки из двух колонок. Два варианта на выбор: .page-hero-gradient
   (полноценный градиент, как на главной) и .page-hero-flat (лёгкий вариант
   с цветной рамкой слева, без градиентного фона). */
.page-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}

.page-hero-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.page-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    line-height: 1.25;
}

.page-hero p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Вариант А — градиент, как на главной странице */
.page-hero-gradient {
    background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 45%, #3B82F6 100%);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.2);
}

.page-hero-gradient .page-hero-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.page-hero-gradient h1 {
    color: #fff;
}

.page-hero-gradient p {
    color: #DBEAFE;
}

/* Вариант Б — лёгкий, без градиента */
.page-hero-flat {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-left: 4px solid #1E40AF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.page-hero-flat .page-hero-icon {
    background: #EFF6FF;
    color: #1E40AF;
}

.page-hero-flat h1 {
    color: #111827;
}

.page-hero-flat p {
    color: #6B7280;
}

@media (max-width: 560px) {
    .page-hero {
        flex-direction: column;
        text-align: center;
    }
}

/* Плитки платформ (раздел "Медиа и маркет") */
.platform-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.platform-tile {
    width: 140px;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #111827;
    font-weight: 500;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.platform-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #BFDBFE;
    color: #111827;
    text-decoration: none;
}

.platform-tile-icon {
    font-size: 2rem;
}

.platform-tile-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.telegram-icon { color: #0088cc; }
.vkontakte-icon { color: #4C75A3; }
.whatsapp-icon { color: #25D366; }
.instagram-icon { color: #E1306C; }

/* Статус подключённого аккаунта (медиа/маркет) */
.status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
}

.status-badge.active { color: #059669; background: rgba(5, 150, 105, 0.1); }
.status-badge.load { color: #D97706; background: rgba(217, 119, 6, 0.1); }
.status-badge.error { color: #DC2626; background: rgba(220, 38, 38, 0.1); }
.status-badge.inactive,
.status-badge.suspended { color: #6B7280; background: rgba(107, 114, 128, 0.1); }

/* Кнопка-контур — второстепенное действие рядом с btn-primary */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: 1px solid #D1D5DB;
    color: #374151;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
    border-color: #1E40AF;
    color: #1E40AF;
    text-decoration: none;
}

/* Карточка уведомления (ограниченный доступ и т.п.) */
.notice-card {
    border: 1px solid #FCA5A5;
    background-color: #FEF2F2;
}

.notice-card h3 {
    color: #B91C1C;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.notice-card ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.notice-cta {
    margin-top: 1rem;
    background: linear-gradient(90deg, #B91C1C, #DC2626);
}

.notice-cta:hover {
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.25);
}

/* Стили для полосы статей базы знаний */
.kb-articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.kb-view-all-btn {
    background: linear-gradient(90deg, #10B981, #34D399);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.kb-view-all-btn:hover {
    background: linear-gradient(90deg, #059669, #10B981);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    color: #fff;
    text-decoration: none;
}

.kb-articles-container {
    width: 100%;
    overflow: hidden;
}

.kb-articles-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
}

/* Настройка скроллбара для статей */
.kb-articles-scroll::-webkit-scrollbar {
    height: 6px;
}

.kb-articles-scroll::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.kb-articles-scroll::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.kb-articles-scroll::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.kb-article-card {
    display: block;
    flex: 0 0 320px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kb-article-card:hover {
    text-decoration: none;
    color: inherit;
}

.kb-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3B82F6;
}

.kb-article-thumbnail {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.kb-article-thumbnail i {
    font-size: 3rem;
}

.kb-article-duration {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.kb-article-content {
    padding: 1rem;
}

.kb-article-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-article-excerpt {
    font-size: 0.875rem;
    color: #6B7280;
    line-height: 1.5;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9CA3AF;
}

.kb-article-category {
    font-weight: 500;
    color: #3B82F6;
}

.kb-no-articles {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}

.kb-empty-icon {
    font-size: 3rem;
    color: #D1D5DB;
    margin-bottom: 1rem;
}

.kb-visits-counter {
    font-size: 0.875rem;
    color: #9CA3AF;
    margin-top: 1rem;
}

/* Адаптивность для полосы статей */
@media (max-width: 768px) {
    .kb-articles-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kb-article-card {
        flex: 0 0 280px;
    }
    
    .kb-articles-scroll {
        gap: 1rem;
    }
}