:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #6c757d;
    --border: #dee2e6;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --change-up: #27ae60;
    --change-down: #e74c3c;
    --change-neutral: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-size: 16px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
    color: var(--text-dark);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: var(--primary);
    color: white;
    padding: 20px;
    position: relative;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.2;
    color: white;
}

.header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 15px;
    line-height: 1.3;
    color: rgba(255,255,255,0.9);
}

.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.target-card {
    background: rgba(255,255,255,0.15);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.target-value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 3px;
    color: white;
}

.target-label {
    font-size: 0.8rem;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

.content {
    padding: 20px;
    background: var(--bg-white);
}

.stats-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid var(--secondary);
    transition: transform 0.3s ease;
    color: var(--text-dark);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.stat-card.critical {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.stat-card.warning {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, #fffaf0 0%, #feebc8 100%);
}

.stat-card.good {
    border-left-color: var(--success);
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.teachers { background: var(--secondary); }
.stat-icon.students { background: var(--success); }
.stat-icon.parents { background: var(--warning); }
.stat-icon.problems { background: var(--danger); }

.stat-title {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.2;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.2;
}

/* Стили для индикаторов изменения */
.change-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.change-up {
    color: var(--change-up);
    background: rgba(39, 174, 96, 0.1);
}

.change-down {
    color: var(--change-down);
    background: rgba(231, 76, 60, 0.1);
}

.change-neutral {
    color: var(--change-neutral);
    background: rgba(243, 156, 18, 0.1);
}

.change-icon {
    font-size: 0.8rem;
}

/* Индикаторы для таблицы */
.table-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.table-change-up {
    color: var(--change-up);
    background: rgba(39, 174, 96, 0.1);
}

.table-change-down {
    color: var(--change-down);
    background: rgba(231, 76, 60, 0.1);
}

.table-change-neutral {
    color: var(--change-neutral);
    background: rgba(243, 156, 18, 0.1);
}

.charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
}

.chart-container {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 350px;
    border: 1px solid var(--border);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.chart-update-info {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 250px;
}

.chart-canvas {
    width: 100% !important;
    height: 100% !important;
}

.filters-section {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.filter-btn {
    padding: 10px 12px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-dark);
}

.filter-btn:hover {
    border-color: var(--secondary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.filter-btn.critical.active {
    background: var(--danger);
    border-color: var(--danger);
}

.filter-btn.warning.active {
    background: var(--warning);
    border-color: var(--warning);
}

.filter-btn.success.active {
    background: var(--success);
    border-color: var(--success);
}

.table-section {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-top: 20px;
    border: 1px solid var(--border);
}

.table-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.table-header-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .table-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .table-header-right {
        flex-direction: column;
        align-items: flex-end;
    }
}

.table-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

@media (min-width: 768px) {
    .table-title {
        text-align: left;
    }
}

.update-info {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.3;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    color: white;
}

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

.btn-success:hover {
    background: #219955;
    transform: translateY(-2px);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-white);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    background: var(--bg-white);
}

th {
    background: var(--primary);
    color: white;
    padding: 14px 10px;
    text-align: left;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    position: relative;
    font-size: 0.85rem;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

th:hover {
    background: #34495e;
}

th.sortable::after {
    content: '↕';
    margin-left: 5px;
    opacity: 0.6;
    font-size: 10px;
    color: white;
}

th.sort-asc::after {
    content: '↑';
    opacity: 1;
}

th.sort-desc::after {
    content: '↓';
    opacity: 1;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--text-dark);
    background: var(--bg-white);
}

tr:nth-child(even) {
    background: var(--bg-light);
}

tr:hover {
    background: #e3f2fd;
}

.critical-row {
    background: #fff5f5 !important;
    border-left: 4px solid var(--danger);
}

.critical-row:hover {
    background: #ffeaea !important;
}

.warning-row {
    background: #fffaf0 !important;
    border-left: 4px solid var(--warning);
}

.warning-row:hover {
    background: #fff3cd !important;
}

.good-row {
    background: #f0fff4 !important;
    border-left: 4px solid var(--success);
}

.good-row:hover {
    background: #e8f6f3 !important;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    color: white;
}

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

.status-warning {
    background: var(--warning);
    color: white;
}

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

.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 8px;
    overflow: hidden;
    min-width: 60px;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-good { background: var(--success); }
.progress-warning { background: var(--warning); }
.progress-critical { background: var(--danger); }

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 45px;
    text-align: right;
}

.institution-number {
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    font-size: 1rem;
}

.institution-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.2;
}

.actions-cell {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.3;
    min-width: 150px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    color: var(--text-light);
    background: var(--bg-white);
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger);
    background: #fff5f5;
    border-radius: 12px;
    margin: 15px;
    font-size: 1rem;
    border: 1px solid #fed7d7;
}

.sort-info {
    text-align: center;
    padding: 12px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
}

/* Стили для кликабельных карточек */
.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.clickable:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-click-hint {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 8px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    line-height: 1.2;
}

.clickable:hover .stat-click-hint {
    opacity: 1;
}

/* Стили для модальных окон */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.modal-content {
    background-color: var(--bg-white);
    margin: 0 auto;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    position: relative;
    color: var(--text-dark);
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: var(--secondary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header.critical {
    background: var(--danger);
}

.modal-header.warning {
    background: var(--warning);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    flex: 1;
    color: white;
}

.close {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
    padding: 5px;
    margin-left: 10px;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 0;
    max-height: calc(95vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-white);
}

.modal-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .modal-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.modal-stat {
    text-align: center;
    padding: 15px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}

.modal-stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.modal-change {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.modal-change-up {
    color: var(--change-up);
    background: rgba(39, 174, 96, 0.1);
}

.modal-change-down {
    color: var(--change-down);
    background: rgba(231, 76, 60, 0.1);
}

.modal-change-neutral {
    color: var(--change-neutral);
    background: rgba(243, 156, 18, 0.1);
}

.modal-stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.2;
}

.progress-breakdown {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
}

.progress-breakdown h3 {
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.2;
}

.progress-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 768px) {
    .progress-categories {
        grid-template-columns: repeat(3, 1fr);
    }
}

.progress-category {
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.progress-category.good {
    background: #f0fff4;
    color: var(--success);
    border-color: #c6f6d5;
}

.progress-category.warning {
    background: #fffaf0;
    color: var(--warning);
    border-color: #feebc8;
}

.progress-category.critical {
    background: #fff5f5;
    color: var(--danger);
    border-color: #fed7d7;
}

.category-count-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.category-count {
    font-size: 1.1rem;
    font-weight: 700;
}

.category-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.category-change-up {
    color: var(--change-up);
    background: rgba(39, 174, 96, 0.1);
}

.category-change-down {
    color: var(--change-down);
    background: rgba(231, 76, 60, 0.1);
}

.category-change-neutral {
    color: var(--change-neutral);
    background: rgba(243, 156, 18, 0.1);
}

.modal-table-container {
    padding: 20px;
    background: var(--bg-white);
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
    background: var(--bg-white);
}

.modal-table th {
    background: var(--primary);
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 500;
    position: sticky;
    top: 0;
    font-size: 0.8rem;
    border-bottom: 2px solid var(--border);
}

.modal-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--text-dark);
    background: var(--bg-white);
}

.modal-table tr:nth-child(even) {
    background: var(--bg-light);
}

.modal-table tr:hover {
    background: #e3f2fd;
}

/* Адаптивность для планшетов */
@media (min-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header {
        padding: 25px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .content {
        padding: 25px;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .table-header-right {
        align-items: flex-end;
    }
    
    .btn {
        width: auto;
        min-width: 160px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 900px;
        margin: 2% auto;
    }
    
    .filters-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Адаптивность для десктопов */
@media (min-width: 1024px) {
    .stats-overview {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .charts-section {
        grid-template-columns: 1fr 1fr;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .modal-content {
        max-width: 1100px;
    }
    
    .targets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Адаптивность для больших экранов */
@media (min-width: 1200px) {
    .stats-overview {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .modal-content {
        max-width: 1300px;
    }
}

/* Особые стили для очень маленьких экранов */
@media (max-width: 360px) {
    body {
        padding: 5px;
        font-size: 14px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .content {
        padding: 15px;
    }
    
    .targets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .target-value {
        font-size: 1.2rem;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .chart-container {
        padding: 15px;
        height: 300px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .close {
        font-size: 1.5rem;
    }
}

/* Улучшения для касаний */
@media (hover: none) and (pointer: coarse) {
    .clickable:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .filter-btn:hover {
        transform: none;
        border-color: var(--border);
    }
    
    .clickable:active,
    .stat-card:active,
    .btn:active,
    .filter-btn:active {
        transform: scale(0.98);
    }
    
    .stat-click-hint {
        opacity: 1;
    }
    
    .filter-btn.active:hover {
        transform: none;
    }
}

/* Улучшения читаемости для светлой темы */
@media (prefers-color-scheme: light) {
    .container {
        background: white;
    }
    
    .stat-card {
        background: white;
    }
    
    .chart-container {
        background: white;
    }
    
    .table-section {
        background: white;
    }
    
    .modal-content {
        background: white;
    }
}

/* Гарантия читаемости текста */
.actions-cell,
.stat-subtitle,
.sort-info,
.progress-text {
    color: var(--text-light) !important;
}

.institution-number,
.institution-name,
.stat-title,
.stat-value,
.chart-title,
.table-title,
.modal-stat-value,
.progress-breakdown h3 {
    color: var(--text-dark) !important;
}

/* Гарантия контраста для статусных строк */
.critical-row,
.warning-row,
.good-row {
    color: var(--text-dark) !important;
}

.critical-row .actions-cell,
.warning-row .actions-cell,
.good-row .actions-cell {
    color: var(--text-light) !important;
}
/* Добавляем в конец файла */

/* Стили для блокировки прокрутки body */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Улучшения для модальных окон на мобильных */
.modal.mobile-modal .modal-content {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
}

.modal.mobile-modal .modal-body {
    max-height: calc(100vh - 80px);
}

/* Предотвращение закрытия при прокрутке */
.modal-content {
    touch-action: pan-y;
}

/* Индикатор для мобильных что можно прокручивать */
.modal-body::after {
    content: '';
    display: block;
    height: 1px;
    width: 100%;
}
/* Добавляем в конец файла */

/* Стили для фиксированных заголовков таблиц */
.table-fixed-header {
    position: relative;
    max-height: 600px;
    overflow: auto;
}

.table-fixed-header table {
    border-collapse: separate;
    border-spacing: 0;
}

.table-fixed-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary);
    color: white;
    border-bottom: 2px solid var(--border);
}

.table-fixed-header thead th::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--border);
}

/* Для модальных окон */
.modal-table-fixed-header {
    position: relative;
    max-height: 400px;
    overflow: auto;
}

.modal-table-fixed-header table {
    border-collapse: separate;
    border-spacing: 0;
}

.modal-table-fixed-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary);
    color: white;
    border-bottom: 2px solid var(--border);
}

.modal-table-fixed-header thead th::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--border);
}

/* Улучшения для тени под фиксированными заголовками */
.table-fixed-header thead th,
.modal-table-fixed-header thead th {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .table-fixed-header {
        max-height: 500px;
    }
    
    .modal-table-fixed-header {
        max-height: 300px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .table-fixed-header {
        max-height: 400px;
    }
    
    .modal-table-fixed-header {
        max-height: 250px;
    }
}