/* Базовые стили */
* { box-sizing: border-box; margin: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: #222; }

/* Шапка */
.topbar { display: flex; align-items: center; gap: 24px; background: #1e3a5f; color: #fff; padding: 10px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; }
#nav a { color: #cfe0f5; text-decoration: none; margin-right: 14px; padding: 6px 10px; border-radius: 6px; }
#nav a.active, #nav a:hover { background: #2f5486; color: #fff; }
.userinfo { margin-left: auto; font-size: 14px; }
.logout { color: #ffb3b3; margin-left: 10px; }

/* Основной контент */
main { 
padding: 20px; 
/*max-width: 1400px;*/ 
margin: 0 auto; 
}
h2 { margin: 10px 0 14px; }
h3 { margin: 14px 0 8px; }

/* Таблицы */
.tbl { border-collapse: collapse; width: 100%; background: #fff; margin: 8px 0 20px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.tbl th, .tbl td { border: 1px solid #dde3ea; padding: 6px 10px; font-size: 14px; text-align: left; vertical-align: top; }
.tbl th { background: #eef3f9; }

/* Формы */
.row-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: #fff; padding: 12px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); margin-bottom: 12px; }
.row-form label { display: flex; flex-direction: column; font-size: 13px; gap: 3px; }
input, select { padding: 6px 8px; border: 1px solid #bbb; border-radius: 5px; font-size: 14px; }

/* Кнопки */
button { padding: 7px 14px; border: none; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; font-size: 14px; }
button:hover { background: #1d4ed8; }
button.danger { background: #dc2626; }
button.gray { background: #64748b; }
button.small { padding: 2px 7px; font-size: 12px; }

/* Вкладки */
.subtabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.subtabs button { background: #cbd5e1; color: #222; }
.subtabs button.active { background: #2563eb; color: #fff; }

/* Сетка расписания */
.grid { border-collapse: collapse; width: 100%; background: #fff; }
.grid th, .grid td { border: 1px solid #ccd4dd; padding: 4px; font-size: 12px; vertical-align: top; min-height: 60px; }
.grid th { background: #1e3a5f; color: #fff; padding: 6px; }
.grid .pairnum { background: #eef3f9; font-weight: bold; text-align: center; min-width: 70px; }

.parity-block { min-height: 50px; padding: 3px; border-radius: 4px; margin: 2px 0; display: flex; flex-direction: column; gap: 2px; }

/* Элементы занятий в сетке */
.lesson-item { background: #fff; border: 1px solid #c9d4e0; border-radius: 4px; padding: 3px 5px; margin: 2px 0; font-size: 12px; border-left: 3px solid #94a3b8; }
.lesson-item .meta { color: #555; font-size: 11px; }
.lesson-item .meta-small { color: #888; font-size: 10px; }
.lesson-item.conflict-allowed { border-left-color: #f59e0b !important; background: #fffbeb; }

/* Типы недель */
.lesson-item.week-every { border-left-color: #2563eb; }
.lesson-item.week-odd { border-left-color: #16a34a; }
.lesson-item.week-even { border-left-color: #f59e0b; }
.lesson-item.week-custom { border-left-color: #8b5cf6; }
.lesson-item.week-multiple { border-left-color: #ec4899; }

.week-label {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}
.week-every .week-label { background: #dbeafe; color: #1e40af; }
.week-odd .week-label { background: #dcfce7; color: #166534; }
.week-even .week-label { background: #fef3c7; color: #92400e; }
.week-custom .week-label { background: #ede9fe; color: #5b21b6; }
.week-multiple .week-label { background: #fce7f3; color: #9d174d; }

.flag { color: #b45309; font-weight: bold; }

/* Кнопка добавления */
.add-btn { background: #22c55e !important; color: #fff !important; padding: 2px 8px !important; font-size: 11px !important; border-radius: 4px !important; margin: 2px 0 !important; }
.add-btn:hover { background: #16a34a !important; }

/* Периоды */
.period-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    padding: 6px;
    background: #f8fafc;
    border-radius: 4px;
    flex-wrap: wrap;
}
.period-row .week-type-select { min-width: 150px; padding: 4px 8px; }
.period-row .custom-range { display: flex; gap: 8px; align-items: center; }
.period-row .custom-range label { flex-direction: row; align-items: center; gap: 4px; font-size: 12px; }
.period-row .custom-range input[type="number"] { width: 50px; padding: 3px 5px; }
.period-row .remove-period { margin-left: auto; }

.periods-section { margin: 12px 0; padding: 10px; background: #f8f9fa; border-radius: 6px; }

/* Модальные окна */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; padding: 20px; max-height: 100vh; overflow: auto; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.modal h3 { margin-top: 0; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal label { display: flex; flex-direction: column; font-size: 13px; gap: 3px; }
.modal .btns { margin-top: 14px; display: flex; gap: 10px; justify-content: flex-end; }

/* Сообщения */
.err { background: #fee2e2; color: #991b1b; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.ok-msg { background: #dcfce7; color: #166534; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.report-error { color: #b91c1c; }
.report-info { color: #92400e; }
.moved-mark { color: #b91c1c; font-weight: bold; font-size: 12px; }
.diff-bad { color: #b91c1c; font-weight: bold; }
.diff-ok { color: #166534; font-weight: bold; }
.hint { color: #64748b; font-size: 13px; margin-top: 6px; }

/* Страница входа */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1e3a5f; }
.login-box { background: #fff; padding: 32px; border-radius: 12px; width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 20px; text-align: center; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* ==================== БЛОК НАГРУЗКИ ==================== */
.workload-controls { margin-bottom: 20px; }
.workload-controls .row-form { margin-bottom: 8px; flex-wrap: wrap; }

#lmW { max-width: 400px; }

/* Спойлеры */
.spoiler {
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}
.spoiler summary {
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #1e293b;
    user-select: none;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.spoiler summary:hover { background: #e2e8f0; }
.spoiler summary::-webkit-details-marker { color: #2563eb; }
.spoiler[open] summary { border-bottom: 1px solid #e2e8f0; background: #e2e8f0; }

.spoiler .csv-import-section { padding: 12px 16px; }
.spoiler .row-form { padding: 12px 16px; margin: 0; flex-wrap: wrap; gap: 8px; }
.spoiler .row-form label { min-width: 120px; font-size: 14px; }
.spoiler .row-form input,
.spoiler .row-form select { padding: 6px 10px; font-size: 14px; }
.spoiler .row-form button { margin: 0; padding: 6px 14px; font-size: 14px; }

/* Импорт CSV */
.csv-import-section { padding: 4px 0; }
.csv-format-hint {
    margin: 6px 16px 12px 16px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #475569;
    font-size: 13px;
}
.csv-format-hint code { background: #e2e8f0; padding: 2px 6px; border-radius: 3px; font-size: 12px; }

#csvPreview { margin: 8px 16px 12px 16px; max-height: 300px; overflow-y: auto; }
.csv-preview h4 { margin: 0 0 8px 0; font-size: 14px; color: #1e293b; }

/* Таблица нагрузки */
#wlTableContainer { margin-top: 12px; }
#wlTable { margin-top: 4px; overflow-x: auto; }

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 12px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}
.table-header h3 { margin: 0; font-size: 16px; color: #1e293b; }
.table-header .record-count { font-size: 13px; color: #64748b; background: #f1f5f9; padding: 4px 12px; border-radius: 12px; }

#wlTable .tbl { width: 100%; }
#wlTable .tbl th { background: #f1f5f9; padding: 8px 12px; text-align: left; font-weight: 600; font-size: 13px; color: #475569; border-bottom: 2px solid #e2e8f0; }
#wlTable .tbl td { padding: 6px 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
#wlTable .tbl tr:hover td { background: #f8fafc; }
#wlTable .tbl .small { padding: 2px 8px; font-size: 13px; }

/* Импорт - прогресс и ошибки */
.progress-bar { margin: 16px 0; background: #e2e8f0; border-radius: 10px; overflow: hidden; height: 24px; }
#importProgress { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); transition: width 0.3s ease; border-radius: 10px; }
#importStatus { text-align: center; font-size: 14px; color: #475569; margin: 8px 0; }
#importDetail { text-align: center; font-size: 13px; color: #64748b; }

.import-summary { background: #f0fdf4; border: 1px solid #86efac; border-radius: 6px; padding: 12px; margin: 12px 0; }

.import-items-check { margin: 12px 0; padding: 12px; border-radius: 6px; background: #f1f5f9; }
.import-items-check.missing { background: #fef3c7; border: 1px solid #fcd34d; }
.import-items-check.ok { background: #d1fae5; border: 1px solid #6ee7b7; }
.import-items-check.warning { background: #fef3c7; border: 1px solid #fbbf24; }
.import-items-check h4 { margin: 0 0 8px 0; font-size: 14px; }
.import-items-check ul { margin: 4px 0; padding-left: 20px; list-style-type: disc; }
.import-items-check li { margin: 4px 0; font-size: 14px; }

.error-list { color: #dc2626; list-style-type: none; padding: 0; }
.error-list li { padding: 4px 8px; margin: 4px 0; background: #fef2f2; border-radius: 4px; }

.import-result { margin: 16px 0; padding: 16px; background: #f8fafc; border-radius: 6px; }

.error-summary { margin: 12px 0; }
.error-summary details { margin: 8px 0; padding: 8px; background: #fef2f2; border-radius: 4px; }
.error-summary summary { cursor: pointer; font-weight: 500; color: #dc2626; }
.error-summary .error-list { margin: 8px 0 0 0; padding-left: 20px; }
.error-summary .error-list li { padding: 4px 0; font-size: 13px; }

/* ==================== РАСПИСАНИЕ ГРУПП ==================== */
.group-info { margin: 12px 0 16px 0; }
.group-info-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    border-left: 4px solid #2563eb;
}
.group-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.group-info-header h3 { margin: 0; font-size: 18px; color: #1e293b; }

.group-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.group-badge.бакалавриат { background: #dbeafe; color: #1e40af; }
.group-badge.СПО { background: #fce7f3; color: #9d174d; }
.group-badge.form { background: #f1f5f9; color: #475569; }

.group-info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #475569;
}
.group-info-details span { display: flex; align-items: center; gap: 4px; }
.group-info-details strong { color: #1e293b; }

/* Таблица расписания групп */
.grid.full-schedule {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.grid.full-schedule th,
.grid.full-schedule td {
    border: 1px solid #dde3ea;
    padding: 6px 8px;
    font-size: 13px;
    vertical-align: top;
    min-height: 50px;
}
.grid.full-schedule th {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    font-weight: 600;
    text-align: center;
}
.grid.full-schedule .pairnum {
    background: #eef3f9;
    font-weight: bold;
    text-align: center;
    min-width: 70px;
    font-size: 13px;
}
.grid.full-schedule .pairnum small { font-weight: normal; font-size: 10px; color: #666; }
.grid.full-schedule .empty-cell { min-height: 50px; }
.grid.full-schedule .lesson-item { margin: 2px 0; padding: 4px 6px; font-size: 12px; border-left-width: 3px; }
.grid.full-schedule .lesson-item .meta { font-size: 11px; }
.grid.full-schedule .lesson-item .meta-small { font-size: 10px; }

.grid.full-schedule .lesson-item.week-every { border-left-color: #2563eb; }
.grid.full-schedule .lesson-item.week-odd { border-left-color: #16a34a; }
.grid.full-schedule .lesson-item.week-even { border-left-color: #f59e0b; }
.grid.full-schedule .lesson-item.week-custom { border-left-color: #8b5cf6; }

.grid.full-schedule .week-label {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
}
.grid.full-schedule .week-every .week-label { background: #dbeafe; color: #1e40af; }
.grid.full-schedule .week-odd .week-label { background: #dcfce7; color: #166534; }
.grid.full-schedule .week-even .week-label { background: #fef3c7; color: #92400e; }
.grid.full-schedule .week-custom .week-label { background: #ede9fe; color: #5b21b6; }

/* ==================== РАСПИСАНИЕ ВСЕХ ГРУПП ==================== */
.table-wrapper { overflow-x: auto; margin: 12px 0; }

.grid.all-groups {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
    min-width: 800px;
}
.grid.all-groups th,
.grid.all-groups td {
    border: 1px solid #dde3ea;
    padding: 4px 6px;
    vertical-align: top;
    text-align: left;
}
.grid.all-groups th {
    background: #1e3a5f;
    color: #fff;
    padding: 6px 8px;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
}
.grid.all-groups .group-header {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    font-size: 13px;
    min-width: 100px;
}
.grid.all-groups .group-header.бакалавриат { background: #1a4a7a; }
.grid.all-groups .group-header.СПО { background: #2d4a6a; }
.grid.all-groups .group-subheader {
    background: #eef3f9;
    text-align: center;
    font-size: 10px;
    color: #475569;
    padding: 2px 4px;
}
.grid.all-groups .day-cell {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    min-width: 80px;
    font-size: 13px;
}
.grid.all-groups .pair-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    min-width: 40px;
}
.grid.all-groups .time-cell {
    background: #f8fafc;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    min-width: 65px;
}
.grid.all-groups .empty-cell { background: #fafbfc; min-height: 40px; }
.grid.all-groups .empty-day {
    text-align: center;
    color: #94a3b8;
    padding: 12px 6px;
    background: #fafbfc;
    font-style: italic;
    font-size: 13px;
}
.grid.all-groups .group-count {
    text-align: center;
    font-size: 11px;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 4px;
}
.grid.all-groups .lesson-cell { padding: 3px 4px; min-height: 40px; }
.grid.all-groups .lesson-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 5px;
    margin: 2px 0;
    font-size: 11px;
    border-left: 3px solid #2563eb;
}
.grid.all-groups .lesson-item.week-every { border-left-color: #2563eb; }
.grid.all-groups .lesson-item.week-odd { border-left-color: #16a34a; }
.grid.all-groups .lesson-item.week-even { border-left-color: #f59e0b; }
.grid.all-groups .lesson-item.week-custom { border-left-color: #8b5cf6; }
.grid.all-groups .lesson-item.conflict-allowed { border-left-color: #f59e0b; background: #fffbeb; }

.grid.all-groups .lesson-discipline { font-weight: 600; font-size: 12px; color: #333; }
.grid.all-groups .lesson-teacher { font-size: 10px; color: #333; }
.grid.all-groups .lesson-room { font-size: 10px; color: #333; }
.grid.all-groups .lesson-periods { font-size: 9px; color: #94a3b8; margin-top: 1px; }

/* Легенда */
.legend {
    margin: 12px 0;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
}
.legend-color {
    display: inline-block;
    width: 20px;
    height: 4px;
    border-radius: 2px;
}
.legend-color.week-every { background: #2563eb; }
.legend-color.week-odd { background: #16a34a; }
.legend-color.week-even { background: #f59e0b; }
.legend-color.week-custom { background: #8b5cf6; }

/* ==================== НАВИГАЦИЯ ПО НЕДЕЛЯМ ==================== */
.week-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 8px;
    margin: 8px 0 12px 0;
    border: 1px solid #e2e8f0;
}
.week-navigation button {
    padding: 4px 12px;
    font-size: 16px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 4px;
    min-width: 36px;
}
.week-navigation button:hover { background: #cbd5e1; }
.week-navigation #weekDisplay {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    min-width: 150px;
    text-align: center;
}
.week-navigation select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* ==================== КОНТРОЛЬ ЧАСОВ ==================== */
.control-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 6px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 12px;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}
.summary-item:last-child { border-bottom: none; }
.summary-item.total {
    font-weight: 600;
    border-bottom: 2px solid #2563eb;
    background: #eff6ff;
    border-radius: 4px;
}
.summary-item .summary-label { color: #475569; }
.summary-item .summary-value { color: #1e293b; font-weight: 500; }
.summary-item .summary-value.diff-ok { color: #16a34a; }
.summary-item .summary-value.diff-bad { color: #dc2626; }
.summary-item.total .summary-value.diff-ok { color: #16a34a; }
.summary-item.total .summary-value.diff-bad { color: #dc2626; }

/* ==================== ОЧИСТКА ==================== */
#clearBtn { background: #dc2626 !important; }
#clearBtn:hover { background: #b91c1c !important; }

#clearWorkloadBtn { background: #dc2626 !important; }
#clearWorkloadBtn:hover { background: #b91c1c !important; }

.clear-warning { padding: 10px 0; }
.clear-warning .warning-text {
    color: #dc2626;
    font-size: 14px;
    padding: 10px;
    background: #fef2f2;
    border-radius: 6px;
    margin-top: 10px;
}
.clear-details {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}
.clear-details p { margin: 4px 0; font-size: 14px; }
.clear-details strong { color: #1e293b; }

#clearConfirmBtn {
    background: #dc2626 !important;
    font-size: 16px !important;
    padding: 10px 20px !important;
}
#clearConfirmBtn:hover { background: #b91c1c !important; }

#clearProgress { background: #dc2626 !important; }
#clearStatus { text-align: center; font-size: 14px; color: #475569; margin-top: 8px; }

#clearWorkloadProgress { background: #dc2626 !important; }
#clearWorkloadStatus { text-align: center; font-size: 14px; color: #475569; margin-top: 8px; }
#clearWorkloadDetail { text-align: center; font-size: 13px; color: #64748b; }

/* ==================== INLINE РЕДАКТИРОВАНИЕ ==================== */
.editable-row td { padding: 4px 6px; vertical-align: middle; }
.editable-cell { padding: 2px 4px !important; }

.inline-input {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #f8fafc;
}
.inline-input:hover { background: #fff; border-color: #94a3b8; }
.inline-input:focus {
    border-color: #2563eb;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.inline-input.changed { border-color: #f59e0b; background: #fffbeb; }
.inline-input.saved { border-color: #22c55e; background: #f0fdf4; transition: all 0.3s ease; }
.inline-input.error { border-color: #dc2626 !important; background: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important; animation: shake 0.3s ease; }

.inline-select {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: #f8fafc;
    transition: all 0.2s ease;
}
.inline-select:hover { background: #fff; border-color: #94a3b8; }
.inline-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.inline-select.changed { border-color: #f59e0b; background: #fffbeb; }
.inline-select.saved { border-color: #22c55e; background: #f0fdf4; transition: all 0.3s ease; }
.inline-select.error { border-color: #dc2626 !important; background: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important; animation: shake 0.3s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.save-row {
    background: #22c55e !important;
    color: #fff !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    transition: all 0.2s !important;
}
.save-row:hover { background: #16a34a !important; transform: scale(1.05); }
.save-row:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.save-row.saving { opacity: 0.6; pointer-events: none; }

.delete-row {
    background: #dc2626 !important;
    color: #fff !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    transition: all 0.2s !important;
}
.delete-row:hover { background: #b91c1c !important; transform: scale(1.05); }

#saveStatus {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.editable-row[data-saving="true"] td { opacity: 0.6; }
.editable-row[data-saving="true"] .inline-input,
.editable-row[data-saving="true"] .inline-select {
    background: #f1f5f9;
    pointer-events: none;
}
.editable-row:hover td { background: #f8fafc; }
.editable-row.saving-row td { background: #fef3c7 !important; }
.editable-row.saved-row td { background: #f0fdf4 !important; transition: background 0.5s ease; }

.editable-row .small { padding: 2px 8px; font-size: 12px; }

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

/* ==================== АДАПТИВ ==================== */
@media (max-width: 768px) {
    .modal { min-width: unset; width: 95%; padding: 15px; }
    .modal .form-grid { grid-template-columns: 1fr; }
    
    .spoiler .row-form { flex-direction: column; gap: 6px; }
    .spoiler .row-form label { min-width: 100%; }
    
    #wlTable .tbl { font-size: 13px; }
    #wlTable .tbl th,
    #wlTable .tbl td { padding: 4px 6px; }
    
    .table-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .csv-format-hint { font-size: 12px; }
    
    .topbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .userinfo { margin-left: 0; }
    #nav { display: flex; flex-wrap: wrap; }
    
    .group-info-header { flex-direction: column; align-items: flex-start; }
    .group-info-details { flex-direction: column; gap: 4px; }
    
    .grid.full-schedule { font-size: 11px; }
    .grid.full-schedule th,
    .grid.full-schedule td { padding: 3px 4px; font-size: 11px; }
    .grid.full-schedule .lesson-item { font-size: 10px; padding: 2px 4px; }
    .grid.full-schedule .lesson-item .meta { font-size: 9px; }
    .grid.full-schedule .pairnum { font-size: 11px; min-width: 50px; }
    
    .grid.all-groups { font-size: 10px; min-width: 600px; }
    .grid.all-groups th,
    .grid.all-groups td { padding: 2px 3px; }
    .grid.all-groups .group-header { font-size: 11px; padding: 4px 3px; }
    .grid.all-groups .day-cell { font-size: 11px; min-width: 60px; }
    .grid.all-groups .lesson-item { font-size: 9px; padding: 2px 3px; }
    .grid.all-groups .lesson-discipline { font-size: 10px; }
    .grid.all-groups .lesson-teacher { font-size: 8px; }
    
    .inline-input,
    .inline-select { font-size: 12px; padding: 4px 6px; }
    .editable-row td { padding: 2px 4px; font-size: 12px; }
    .save-row,
    .delete-row { padding: 2px 6px !important; font-size: 10px !important; }
}
.legend-color.week-multiple { background: #ec4899; }

/* Стили для праздничных дней */
.holiday-notice {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    border: 2px solid #f59e0b;
    margin: 10px 0;
}

.holiday-icon {
    font-size: 48px;
    animation: holidayBounce 2s infinite;
}

.holiday-content h3 {
    margin: 0;
    color: #92400e;
    font-size: 20px;
}

.holiday-content p {
    margin: 5px 0;
    color: #78350f;
}

.holiday-content .hint {
    color: #92400e;
    font-style: italic;
}

@keyframes holidayBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Статистика праздников */
.holiday-stats {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    margin: 12px 0;
}

.holiday-stats h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
}

.stats-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 120px;
    padding: 10px 0;
}

.stat-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-bar {
    width: 100%;
    max-width: 30px;
    min-height: 10px;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.stat-label {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}

.stat-count {
    font-size: 10px;
    font-weight: bold;
    color: #1e293b;
}
/* Стили для сетки преподавателей */
.teacher-grid .teacher-header {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    font-size: 13px;
    min-width: 120px;
}

.teacher-grid .teacher-subheader {
    background: #eef3f9;
    text-align: center;
    font-size: 10px;
    color: #475569;
    padding: 2px 4px;
}

.teacher-grid .day-cell {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    min-width: 80px;
    font-size: 13px;
}

.teacher-grid .pair-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    min-width: 40px;
}

.teacher-grid .time-cell {
    background: #f8fafc;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    min-width: 65px;
}

.teacher-grid .empty-cell {
    background: #fafbfc;
    min-height: 40px;
}

.teacher-grid .lesson-cell {
    padding: 3px 4px;
    min-height: 40px;
}

.teacher-grid .lesson-group {
    font-size: 10px;
    color: #475569;
}

.teacher-grid .lesson-room {
    font-size: 9px;
    color: #64748b;
}

.teacher-grid .lesson-periods {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 1px;
}

.teacher-grid .empty-day {
    text-align: center;
    color: #94a3b8;
    padding: 12px 6px;
    background: #fafbfc;
    font-style: italic;
    font-size: 13px;
}
/* Стили для статистики преподавателя */
.stats-summary {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border-left: 4px solid #2563eb;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a5f;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.stats-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* График занятости - горизонтальный */
.week-stats {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.week-stats h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #1e293b;
}

.week-chart {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: flex-end;
    height: 150px;
    padding: 10px 8px;
    background: #fff;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

.week-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 36px;
    position: relative;
    flex-shrink: 0;
}

.week-bar-item .bar-tooltip {
    display: none;
    position: absolute;
    top: -24px;
    background: #1e293b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}

.week-bar-item:hover .bar-tooltip {
    display: block;
}

.bar-container {
    width: 20px;
    height: 100px;
    background: #f1f5f9;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.week-label {
    font-size: 9px;
    color: #475569;
    margin-top: 6px;
    font-weight: 600;
    text-align: center;
}

.week-type {
    font-size: 7px;
    color: #94a3b8;
    margin-top: 1px;
    text-align: center;
}

/* Топ списки */
.top-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.top-stats {
    background: #f8fafc;
    border-radius: 6px;
    padding: 12px;
}

.top-stats h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #1e293b;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
}

.top-name {
    color: #1e293b;
    font-weight: 500;
}

.top-value {
    color: #64748b;
    font-size: 12px;
}

/* Информация о преподавателе */
.teacher-info {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #2563eb;
}

.teacher-info h4 {
    margin: 0 0 4px 0;
    color: #1e3a5f;
    font-size: 16px;
}

.teacher-info p {
    margin: 2px 0;
    color: #475569;
    font-size: 14px;
}

.teacher-info .hint {
    color: #64748b;
    font-size: 13px;
    font-style: italic;
}

/* Адаптив */
@media (max-width: 768px) {
    .top-columns {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .week-chart {
        height: 120px;
        gap: 4px;
        padding: 8px 4px;
    }
    
    .bar-container {
        height: 80px;
        width: 16px;
    }
    
    .week-bar-item {
        min-width: 28px;
    }
    
    .week-label {
        font-size: 8px;
    }
}

/* Стили для расписания кабинетов */
.room-info {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #8b5cf6;
}

.room-info h4 {
    margin: 0 0 4px 0;
    color: #1e3a5f;
    font-size: 16px;
}

.room-info p {
    margin: 2px 0;
    color: #475569;
    font-size: 14px;
}

.room-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 12px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.room-grid-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.grid.room-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.grid.room-grid th,
.grid.room-grid td {
    border: 1px solid #dde3ea;
    padding: 6px 8px;
    vertical-align: top;
    text-align: left;
}

.grid.room-grid th {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    font-weight: 600;
    text-align: center;
}

.grid.room-grid .day-cell {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.grid.room-grid .pair-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
}

.grid.room-grid .time-cell {
    background: #f8fafc;
    text-align: center;
    font-size: 11px;
    color: #64748b;
}

.grid.room-grid .empty-cell {
    background: #fafbfc;
    min-height: 40px;
}

.grid.room-grid .lesson-cell {
    padding: 4px 6px;
}

.grid.room-grid .lesson-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 6px;
    margin: 2px 0;
    font-size: 12px;
    border-left: 3px solid #94a3b8;
}

.grid.room-grid .lesson-item.week-every { border-left-color: #2563eb; }
.grid.room-grid .lesson-item.week-odd { border-left-color: #16a34a; }
.grid.room-grid .lesson-item.week-even { border-left-color: #f59e0b; }
.grid.room-grid .lesson-item.week-custom { border-left-color: #8b5cf6; }
.grid.room-grid .lesson-item.conflict-allowed { border-left-color: #f59e0b; background: #fffbeb; }

.grid.room-grid .lesson-discipline {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.grid.room-grid .lesson-group {
    font-size: 11px;
    color: #475569;
}

.grid.room-grid .lesson-teacher {
    font-size: 11px;
    color: #475569;
}

.grid.room-grid .lesson-periods {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.grid.room-grid .flag {
    color: #b45309;
    font-weight: bold;
    font-size: 11px;
}

.grid.room-grid .empty-day {
    text-align: center;
    color: #94a3b8;
    padding: 12px 6px;
    background: #fafbfc;
    font-style: italic;
    font-size: 13px;
}

/* Адаптив */
@media (max-width: 768px) {
    .grid.room-grid {
        font-size: 11px;
    }
    
    .grid.room-grid th,
    .grid.room-grid td {
        padding: 4px 6px;
    }
    
    .grid.room-grid .lesson-item {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .grid.room-grid .lesson-discipline {
        font-size: 11px;
    }
}
/* Стили для расписания всех кабинетов */
.grid.all-rooms-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
    min-width: 800px;
}

.grid.all-rooms-grid th,
.grid.all-rooms-grid td {
    border: 1px solid #dde3ea;
    padding: 4px 6px;
    vertical-align: top;
    text-align: left;
}

.grid.all-rooms-grid th {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
}

.grid.all-rooms-grid .room-header {
    background: #1e3a5f;
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    font-size: 12px;
    min-width: 120px;
}

.grid.all-rooms-grid .room-count {
    background: #eef3f9;
    text-align: center;
    font-size: 10px;
    color: #475569;
    padding: 2px 4px;
}

.grid.all-rooms-grid .day-cell {
    background: #f8fafc;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    min-width: 80px;
    font-size: 13px;
}

.grid.all-rooms-grid .pair-cell {
    background: #f8fafc;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    min-width: 40px;
}

.grid.all-rooms-grid .time-cell {
    background: #f8fafc;
    text-align: center;
    font-size: 10px;
    color: #64748b;
    min-width: 65px;
}

.grid.all-rooms-grid .empty-cell {
    background: #fafbfc;
    min-height: 40px;
}

.grid.all-rooms-grid .lesson-cell {
    padding: 3px 4px;
    min-height: 40px;
}

.grid.all-rooms-grid .lesson-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 5px;
    margin: 2px 0;
    font-size: 11px;
    border-left: 3px solid #94a3b8;
}

.grid.all-rooms-grid .lesson-item.week-every { border-left-color: #2563eb; }
.grid.all-rooms-grid .lesson-item.week-odd { border-left-color: #16a34a; }
.grid.all-rooms-grid .lesson-item.week-even { border-left-color: #f59e0b; }
.grid.all-rooms-grid .lesson-item.week-custom { border-left-color: #8b5cf6; }
.grid.all-rooms-grid .lesson-item.conflict-allowed { border-left-color: #f59e0b; background: #fffbeb; }

.grid.all-rooms-grid .lesson-discipline {
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
}

.grid.all-rooms-grid .lesson-group {
    font-size: 10px;
    color: #475569;
}

.grid.all-rooms-grid .lesson-teacher {
    font-size: 10px;
    color: #475569;
}

.grid.all-rooms-grid .lesson-periods {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 1px;
}

.grid.all-rooms-grid .empty-day {
    text-align: center;
    color: #94a3b8;
    padding: 12px 6px;
    background: #fafbfc;
    font-style: italic;
    font-size: 13px;
}

/* Адаптив */
@media (max-width: 768px) {
    .grid.all-rooms-grid {
        font-size: 10px;
        min-width: 600px;
    }
    
    .grid.all-rooms-grid th,
    .grid.all-rooms-grid td {
        padding: 2px 3px;
    }
    
    .grid.all-rooms-grid .room-header {
        font-size: 10px;
        padding: 4px 3px;
        min-width: 80px;
    }
    
    .grid.all-rooms-grid .day-cell {
        font-size: 11px;
        min-width: 60px;
    }
    
    .grid.all-rooms-grid .lesson-item {
        font-size: 9px;
        padding: 2px 3px;
    }
    
    .grid.all-rooms-grid .lesson-discipline {
        font-size: 10px;
    }
}

/* ============ ТОПБАР И МЕНЮ ============ */
.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #1a365d, #2d4a7a);
    color: #fff;
    padding: 0 24px;
    height: 64px;
    flex-wrap: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    text-decoration: none;
    user-select: none;
}

.brand-svg {
    color: #60a5fa;
    flex-shrink: 0;
}

.brand-text {
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Меню навигации */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.nav-menu::-webkit-scrollbar {
    height: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #60a5fa;
    border-radius: 2px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
}

.nav-icon svg {
    fill: currentColor;
}

.nav-label {
    font-size: 13px;
}

/* Кнопка мобильного меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Пользовательская информация */
.userinfo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}

.avatar-letter {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

/* ============ АДАПТИВ ============ */
@media (max-width: 992px) {
    .topbar {
        padding: 0 16px;
        height: 56px;
    }
    
    .brand-text {
        font-size: 15px;
    }
    
    .nav-label {
        font-size: 12px;
    }
    
    .nav-link {
        padding: 6px 10px;
    }
    
    .user-name {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .topbar-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px 0;
        overflow-x: visible;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-link {
        padding: 10px 14px;
        border-radius: 6px;
        justify-content: flex-start;
    }
    
    .nav-link.active::after {
        left: 0;
        transform: none;
        width: 3px;
        height: 24px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .userinfo {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        justify-content: flex-end;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .user-details {
        display: none;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .avatar-letter {
        font-size: 14px;
    }
}
/* Стили для фильтра в модальном окне */
.control-filters {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.control-filters label {
    font-weight: 500;
    color: #1e293b;
}

.control-filters select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    min-width: 150px;
}

.control-filters select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* Стили для строк с расхождениями */
.diff-row {
    background: #fef2f2 !important;
    border-left: 3px solid #dc2626;
}

.diff-row:hover td {
    background: #fee2e2 !important;
}

.diff-ok {
    color: #16a34a;
    font-weight: 600;
}

.diff-bad {
    color: #dc2626;
    font-weight: 700;
}

/* Стили для кнопки переключения */
#toggleDiffBtn {
    transition: all 0.2s ease;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #1e293b;
    cursor: pointer;
}

#toggleDiffBtn:hover {
    background: #e2e8f0;
}

#toggleDiffBtn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

#toggleDiffBtn.active:hover {
    background: #1d4ed8;
}
/* Стили для бейджей уровней */
.level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.level-vo {
    background: #dbeafe;
    color: #1e40af;
}

.level-spo {
    background: #fce7f3;
    color: #9d174d;
}

/* Стили для фильтров в модальном окне */
.control-filters select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    background: #fff;
    min-width: 120px;
}

.control-filters select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#toggleDiffBtn {
    transition: all 0.2s ease;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #1e293b;
    cursor: pointer;
}

#toggleDiffBtn:hover {
    background: #e2e8f0;
}

#toggleDiffBtn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

#toggleDiffBtn.active:hover {
    background: #1d4ed8;
}
.subgroup-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}