/* Минималистичная деловая дизайн-система */

:root {
    /* Светлая тема - нейтральная палитра */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-accent: #f1f3f5;
    
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.04);
    --card-hover-shadow: rgba(0, 0, 0, 0.08);
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --hover-bg: #f8f9fa;
    
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    --primary: #495057;
    --primary-hover: #343a40;
    --primary-light: rgba(73, 80, 87, 0.08);
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
}

[data-theme="dark"] {
    /* Тёмная тема - нейтральная палитра с улучшенной контрастностью */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-accent: #1c2128;
    
    --card-bg: #161b22;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --card-hover-shadow: rgba(0, 0, 0, 0.6);
    
    --text-primary: #ffffff;
    --text-secondary: #e6edf3;
    --text-muted: #9198a1;
    
    --border-color: #30363d;
    --border-light: #21262d;
    --hover-bg: #1c2128;
    
    --success: #3fb950;
    --success-bg: rgba(63, 185, 80, 0.15);
    --error: #f85149;
    --error-bg: rgba(248, 81, 73, 0.15);
    --warning: #d29922;
    --warning-bg: rgba(210, 153, 34, 0.15);
    --info: #58a6ff;
    --info-bg: rgba(88, 166, 255, 0.15);
    
    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --primary-light: rgba(88, 166, 255, 0.1);
    
    --accent: #a371f7;
    --accent-hover: #b392f0;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Контейнеры */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container,
    .container-narrow {
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    .container,
    .container-narrow {
        padding: 12px 8px;
    }
}

/* Единая навигация */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--card-shadow);
    min-height: 44px;
    touch-action: manipulation;
}

.btn-back:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(-2px);
    box-shadow: 0 3px 8px var(--card-hover-shadow);
}

@media (max-width: 768px) {
    .page-nav {
        padding: 12px 0;
        margin-bottom: 16px;
    }
    
    .btn-back {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* Навигация */
.nav {
    display: flex;
    gap: 4px;
    padding: 0;
    margin: 0;
    list-style: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Хлебные крошки */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* Хедер */
.header {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--card-shadow);
    text-align: center;
}

.header h1 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

p, span, div, label {
    color: var(--text-primary);
}

.header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 20px;
    height: 44px;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: none;
    letter-spacing: 0;
}

.btn:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
    font-weight: 600;
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-small {
    padding: 0 14px;
    height: 36px;
    font-size: 13px;
}

.btn-large {
    padding: 0 28px;
    height: 52px;
    font-size: 15px;
}

/* Переключатель темы */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0 16px;
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    transform: none;
}

/* Заголовки страниц */
.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

/* Универсальные стили для кнопок просмотра/действий */
.btn-view {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Строки таблиц */
.task-row,
tr[onclick] {
    cursor: pointer;
    transition: background 0.2s ease;
}

.task-row:hover,
tr[onclick]:hover {
    background: var(--hover-bg);
}

/* Сетки для фильтров */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Карточки */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: all 0.15s ease;
}

.card:hover {
    transform: none;
    box-shadow: 0 2px 4px var(--card-hover-shadow);
    border-color: var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 400;
}

/* Сетки */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

/* Статистические карточки */
.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.stat-card:hover {
    transform: none;
    box-shadow: 0 2px 4px var(--card-hover-shadow);
    border-color: var(--border-color);
}

.stat-card a,
.card a,
.grid a {
    text-decoration: none;
    color: inherit;
}

.stat-card a:hover,
.card a:hover,
.grid a:hover {
    text-decoration: none;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-change {
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* Таблицы */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 1px 2px var(--card-shadow);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-color);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: none;
    font-size: 13px;
    letter-spacing: 0;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
}

td strong,
td b {
    font-weight: 600;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.1s ease;
}

tbody tr:hover {
    background: var(--hover-bg);
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0 12px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
    font-weight: 500;
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
    min-height: 100px;
    resize: vertical;
    font-weight: 500;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Бейджи */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.badge-success {
    background: var(--success);
    color: #ffffff;
}

.badge-error {
    background: var(--error);
    color: #ffffff;
}

.badge-warning {
    background: var(--warning);
    color: #ffffff;
}

.badge-info {
    background: var(--info);
    color: #ffffff;
}

.badge-primary {
    background: var(--primary);
    color: #ffffff;
}

/* Статусы */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.status-open {
    background: var(--info-bg);
    color: var(--info);
}

.status-in_progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-closed {
    background: var(--success-bg);
    color: var(--success);
}

.status-postponed {
    background: var(--error-bg);
    color: var(--error);
}

/* Загрузка */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
}

.page-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    transform: none;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-info {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 0 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .header {
        padding: 16px 12px;
        text-align: center;
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-actions > * {
        min-height: 44px;
        flex: 1;
        min-width: 120px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-value {
        font-size: 26px;
    }
    
    /* Адаптивные таблицы */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
        border-radius: 0;
    }
    
    table {
        font-size: 14px;
        min-width: 600px;
        width: 100%;
    }
    
    th, td {
        padding: 12px 8px;
        white-space: nowrap;
    }
    
    th {
        font-size: 13px;
        position: sticky;
        top: 0;
        background: var(--card-bg);
        z-index: 10;
    }
    
    /* Адаптивные кнопки */
    .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 15px;
        padding: 14px 20px;
    }
    
    /* Модальные окна */
    .modal {
        padding: 12px;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: calc(100vw - 24px) !important;
        margin: 0;
        padding: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    /* Формы */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    input, select, textarea {
        font-size: 16px !important;
        min-height: 48px;
        padding: 12px 16px !important;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    /* Календарь */
    .calendar-table {
        width: 100%;
        table-layout: fixed;
        font-size: 12px;
    }
    
    .calendar-table th {
        padding: 8px 2px;
        font-size: 11px;
    }
    
    .calendar-table td {
        padding: 4px 2px;
        min-height: 60px;
        vertical-align: top;
    }
    
    .calendar-day {
        min-height: 55px;
        font-size: 11px;
        padding: 4px 2px;
    }
    
    .day-number {
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 4px;
    }
    
    .shift-item {
        font-size: 10px;
        padding: 4px;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .shift-time {
        font-size: 9px;
    }
    
    /* Карточки */
    .card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .card h2, .card h3 {
        font-size: 18px;
    }
    
    /* Flex элементы */
    .flex-row {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Навигационные вкладки */
    .nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .nav-item a {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Тема переключатель */
    .theme-toggle {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .header h1,
    .page-title {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .card {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .card h2, .card h3 {
        font-size: 16px;
    }
    
    /* Календарь компактный */
    .calendar-wrapper {
        padding: 12px;
        border-radius: 12px;
    }
    
    .month-navigation {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .month-title {
        font-size: 18px;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-btn {
        flex: 1;
        min-height: 44px;
        font-size: 13px;
    }
    
    .calendar-table {
        font-size: 11px;
    }
    
    .calendar-table th {
        padding: 6px 1px;
        font-size: 10px;
        font-weight: 700;
    }
    
    .calendar-table td {
        padding: 3px 1px;
        min-height: 50px;
    }
    
    .day-number {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .shift-item {
        font-size: 9px;
        padding: 3px 2px;
        margin-bottom: 2px;
        border-radius: 4px;
    }
    
    .shift-mod-name {
        display: block;
        font-size: 9px;
    }
    
    .shift-time {
        font-size: 8px;
    }
    
    .shift-more {
        font-size: 8px;
    }
    
    /* Кнопки */
    .btn {
        font-size: 14px;
        padding: 13px 18px;
        min-height: 46px;
        border-radius: 10px;
    }
    
    .btn-back {
        padding: 11px 16px;
        font-size: 14px;
    }
    
    /* Модальные окна */
    .modal {
        padding: 8px;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: calc(100vw - 16px) !important;
        padding: 16px;
        border-radius: 12px;
    }
    
    .modal h2 {
        font-size: 18px;
    }
    
    /* Таблицы */
    table {
        font-size: 12px;
        min-width: 550px;
    }
    
    th, td {
        padding: 10px 6px;
    }
    
    /* Формы */
    input, select, textarea {
        font-size: 16px !important;
        min-height: 46px;
        border-radius: 8px;
    }
    
    textarea {
        min-height: 100px;
    }
    
    /* Навигация */
    .page-nav {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .nav-item a {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Тема и выход */
    .theme-toggle {
        min-height: 44px;
        padding: 8px 14px;
        font-size: 13px;
        gap: 6px;
    }
    
    .btn-logout {
        min-height: 44px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}

/* Утилиты */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

.shadow { box-shadow: 0 4px 12px var(--card-shadow); }
.shadow-lg { box-shadow: 0 8px 32px var(--card-shadow); }

.transition { transition: all 0.3s; }

/* Анимации появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-in-delay-1 { animation-delay: 0.1s; animation-fill-mode: both; }
.fade-in-delay-2 { animation-delay: 0.2s; animation-fill-mode: both; }
.fade-in-delay-3 { animation-delay: 0.3s; animation-fill-mode: both; }

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 12px;
    }
    
    .form-control {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Улучшенная адаптивность для графиков */
canvas {
    max-width: 100%;
    height: auto !important;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 350px;
}

@media (max-width: 768px) {
    .chart-container {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 220px;
    }
}

/* Специальные стили для фильтров - выравнивание элементов */
.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
    height: 18px;
    line-height: 18px;
}

.filter-group .form-control,
.filter-group select,
.filter-group input {
    height: 44px;
}

.filter-group .btn {
    height: 44px;
    margin-top: 24px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal .close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal .close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

