/**
 * Стили для портала "Бюджет для граждан"
 * г. Черемхово, Иркутская область
 */

/* === Основные переменные === */
:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #ca8a04;
    --secondary-light: #fbbf24;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* === Базовые стили === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    /* Убираем возможное затемнение */
    filter: none !important;
    opacity: 1 !important;
}

/* === Типографика === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    margin: 0 0 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* === Контейнер === */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Шапка === */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255,255,255,0.15);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* === Hero секция === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--gray-900) 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* === Переключатель годов === */
.year-switcher {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.year-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.year-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

.year-btn.active {
    background: white;
    color: var(--primary);
    border-color: white;
}

/* === KPI карточки === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem 1rem;
    max-width: 1280px;
    margin: -3rem auto 0;
    position: relative;
    z-index: 10;
}

.kpi-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.kpi-icon.income { background: #dcfce7; color: var(--success); }
.kpi-icon.expense { background: #fee2e2; color: var(--danger); }
.kpi-icon.surplus { background: #dbeafe; color: var(--primary); }
.kpi-icon.execution { background: #fef3c7; color: var(--secondary); }

.kpi-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.kpi-change.positive { background: #dcfce7; color: var(--success); }
.kpi-change.negative { background: #fee2e2; color: var(--danger); }

/* === Секции === */
.section {
    padding: 4rem 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--gray-500);
    font-size: 1.125rem;
}

/* === Сетка графиков (программы, документы) === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

.chart-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.chart-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* === Табы графиков на главной === */
.chart-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: 1rem 1rem 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chart-tabs::-webkit-scrollbar {
    display: none;
}

.chart-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    font-family: var(--font-sans);
}

.chart-tab i {
    font-size: 1rem;
    transition: color 0.25s;
}

.chart-tab:hover {
    color: var(--primary);
    background: rgba(30, 64, 175, 0.06);
}

.chart-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.chart-tab.active i {
    color: var(--primary-light);
}

/* Панели графиков */
.chart-panels {
    position: relative;
}

.chart-panel {
    display: none;
    animation: chartFadeIn 0.35s ease;
}

.chart-panel.active {
    display: block;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-panel-card {
    background: white;
    border-radius: 0 0 1rem 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.chart-panel-header {
    padding: 1.5rem 2rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.chart-panel-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800);
}

.chart-panel-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin: 0;
    padding-bottom: 0.75rem;
}

.chart-panel-body {
    position: relative;
    height: 550px;
    padding: 1.5rem 2rem 2rem;
}

/* Адаптивность табов графиков */
@media (max-width: 1024px) {
    .chart-panel-body {
        height: 480px;
        padding: 1rem 1.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .chart-tabs {
        border-radius: 0.75rem 0.75rem 0 0;
        padding: 0.375rem;
        gap: 0.25rem;
    }
    
    .chart-tab {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .chart-tab span {
        display: none;
    }
    
    .chart-tab i {
        font-size: 1.125rem;
    }
    
    .chart-panel-body {
        height: 380px;
        padding: 1rem;
    }
    
    .chart-panel-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .chart-panel-header h3 {
        font-size: 1.0625rem;
    }
}

@media (max-width: 480px) {
    .chart-panel-body {
        height: 300px;
        padding: 0.75rem;
    }
    
    .chart-tab {
        padding: 0.5rem 0.75rem;
    }
}

/* === Таблицы === */
.table-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    background: var(--gray-100);
}

.data-table th .sort-icon {
    margin-left: 0.25rem;
    opacity: 0.5;
}

.data-table th.sorted .sort-icon {
    opacity: 1;
    color: var(--primary);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Прогресс-бар в таблице */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s;
}

.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.blue { background: var(--primary); }

.progress-value {
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* === Бейджи === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-info { background: #dbeafe; color: var(--primary); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* === Кнопки === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* === Карточки новостей === */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

.news-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-card-body {
    padding: 1.5rem;
}

.news-date {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.news-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Программы === */
.program-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.program-card.status-completed {
    border-left-color: var(--success);
}

.program-card.status-planned {
    border-left-color: var(--gray-400);
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.program-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.program-meta {
    display: flex;
    gap: 1rem;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.program-progress {
    margin-top: 1rem;
}

.program-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* === Футер === */
.footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 1rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--gray-400);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-700);
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* === Модальные окна === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* === Уведомления (Toast) === */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--primary); }

/* === Загрузка === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === Кнопка "Наверх" === */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 100;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
}

/* === Пагинация === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-100);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .nav.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .kpi-grid {
        margin-top: -2rem;
        padding: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-filters {
        flex-direction: column;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .year-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* === Интерактивный тур === */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.tour-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.tour-highlight-box {
    position: fixed;
    z-index: 10001;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.6),
        0 0 0 9999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.tour-highlight-box::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 16px;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    animation: tourPulse 2s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.01); }
}

.tour-tooltip {
    position: fixed;
    z-index: 10002;
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 90vw;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.tour-tooltip-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-tooltip-header h4 {
    margin: 0;
    font-size: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tour-step-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tour-tooltip-body {
    padding: 1.25rem;
}

.tour-tooltip-body p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.tour-tooltip-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-dots {
    display: flex;
    gap: 6px;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: all 0.3s;
}

.tour-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.tour-tooltip-btns {
    display: flex;
    gap: 0.5rem;
}

.tour-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tour-btn-skip {
    background: var(--gray-100);
    color: var(--gray-600);
}

.tour-btn-skip:hover {
    background: var(--gray-200);
}

.tour-btn-prev {
    background: var(--gray-100);
    color: var(--gray-700);
}

.tour-btn-prev:hover {
    background: var(--gray-200);
}

.tour-btn-next {
    background: var(--primary);
    color: white;
}

.tour-btn-next:hover {
    background: var(--primary-dark);
}

.tour-btn-finish {
    background: var(--success);
    color: white;
}

.tour-btn-finish:hover {
    background: #15803d;
}

/* Помощь-кнопка с иконкой тура */
.help-tour-btn {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-tour-btn:hover {
    background: var(--secondary-light);
    color: var(--gray-900);
    transform: translateY(-4px);
}

/* === Админ-панель === */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--gray-900);
    color: white;
    flex-shrink: 0;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-700);
}

.admin-sidebar-nav {
    padding: 1rem 0;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-400);
    transition: all 0.2s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--gray-800);
    color: white;
}

.admin-main {
    flex: 1;
    background: var(--gray-100);
    overflow-y: auto;
}

.admin-header {
    background: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.admin-content {
    padding: 1.5rem;
}

/* === Табы === */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--gray-500);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--gray-700);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
