/* Основные переменные цветов */
:root {
    --accent-1: #cc33aa;  /* Приглушённый розовый */
    --accent-2: #cc5533;  /* Приглушённый оранжевый для коммерции */
    --accent-3: #8822aa;  /* Приглушённый фиолетовый */
    --accent-4: #770055;  /* Тёмно-бордовый */
    --header-bg: #442244;  /* Тёмно-фиолетовый для шапки */
    --text-dark: #222222;  /* Тёмный текст */
    --text-muted: #555555; /* Приглушённый текст */
    --dark-blue: #224466;  /* Тёмно-синий для кнопок */

    --bg-light: #f5f0f8;
    --card-bg: #ffffff;
    --border-light: #e8e0f0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Общий фон */
body {
    background-color: var(--bg-light);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(136, 34, 170, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(204, 51, 170, 0.02) 0%, transparent 30%);
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Шапка (меню) — тёмно-фиолетовая */
.navbar {
    background: var(--header-bg) !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    border-bottom: 2px solid var(--accent-1);
}

.navbar-brand, .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-1) !important;
    transform: translateY(-1px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: white !important;
    background: none;
    -webkit-text-fill-color: white;
}

/* Карточки */
.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, rgba(136, 34, 170, 0.03) 0%, rgba(204, 51, 170, 0.02) 100%);
    border-bottom: 2px solid var(--accent-1);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Заголовок боковой панели */
.card-header.bg-primary {
    background: var(--dark-blue) !important;
    border-bottom: 2px solid var(--accent-1) !important;
}

.card-header.bg-primary h5 {
    color: white;
    font-weight: 500;
}

/* Кнопки */
.btn-primary {
    background: var(--dark-blue);
    border: none;
    border-radius: 40px;
    padding: 10px 24px;
    font-weight: 500;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(34, 68, 102, 0.15);
}

.btn-primary:hover {
    background: #2a5580;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 68, 102, 0.2);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--dark-blue);
    border-radius: 40px;
    color: var(--dark-blue);
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline-primary:hover {
    background: var(--dark-blue);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid #ddd0e8;
    border-radius: 40px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-outline-secondary:hover {
    background: #ddd0e8;
    border-color: #ccb8e0;
    transform: translateY(-1px);
}

/* Бейджи */
.badge {
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.75rem;
    margin-right: 6px;
    margin-bottom: 6px;
    display: inline-block;
}

.badge.bg-success {
    background: var(--dark-blue) !important;
    color: white !important;
}

.badge.bg-warning {
    background: var(--accent-2) !important;
    color: white !important;
}

.badge.bg-info {
    background: var(--accent-3) !important;
    color: white !important;
}

/* Пагинация */
.pagination .page-link {
    color: var(--dark-blue);
    border: 1px solid #e0d6e8;
    border-radius: 40px;
    margin: 0 3px;
    transition: all 0.2s;
    background: white;
}

.pagination .page-link:hover {
    background: var(--accent-3);
    border-color: var(--accent-3);
    color: white;
}

.pagination .active .page-link {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    color: white;
}

/* Подвал */
/* Подвал */
footer {
    background: var(--header-bg) !important;
    color: rgba(255, 255, 255, 0.8);
    border-top: 2px solid var(--accent-1);
    margin-top: 60px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
    pointer-events: none;
}

footer p {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* Ссылки */
a {
    color: var(--dark-blue);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--accent-1);
}

/* Заголовки — без градиента */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
}

h1.display-4 {
    color: var(--text-dark);
    font-weight: 800;
    background: none;
    -webkit-text-fill-color: var(--text-dark);
}

/* Alert */
.alert-info {
    background: rgba(34, 68, 102, 0.05);
    border: 1px solid rgba(34, 68, 102, 0.15);
    border-radius: 20px;
    color: var(--text-dark);
}

.alert-info h4 {
    color: var(--dark-blue);
}

/* Боковое меню */
.list-group-item {
    border: 1px solid #e8e0f0;
    border-radius: 12px !important;
    margin-bottom: 8px;
    transition: all 0.2s;
    background-color: white;
    border-left: 3px solid transparent;
}

.list-group-item:hover {
    border-left-color: var(--accent-1);
    transform: translateX(4px);
    background: #faf5ff;
}

/* Акцентные элементы */
hr {
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
    height: 1px;
    border: none;
    opacity: 0.3;
}

/* Цифры в карточках на главной */
.card .display-4 {
    color: var(--accent-1);
    font-weight: 700;
}

/* Адаптация */
@media (max-width: 767.98px) {
    .col-md-4 {
        display: none;
    }

    .btn {
        white-space: normal;
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* Сворачиваемые блоки */
.collapse-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    position: relative;
}

.collapse-content.expanded {
    max-height: 2000px;
}

.collapse-content.has-gradient::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.collapse-content.expanded.has-gradient::after {
    display: none;
}

.collapse-trigger {
    cursor: pointer;
    color: var(--accent-1);
    font-weight: 500;
    display: inline-block;
    margin-top: 10px;
    user-select: none;
}

.collapse-trigger:hover {
    text-decoration: underline;
}

/* Принудительное переопределение цвета подвала */
footer,
footer .container,
footer .row,
footer .col-12,
footer p {
    background: var(--header-bg) !important;
}

footer .container,
footer .row,
footer .col-12 {
    background: transparent !important;
}

.clickable-card {
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.clickable-card .card {
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.clickable-card:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.clickable-card:active .card {
    transform: scale(0.98);
}