/* ===== Variables ===== */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --transition: all 0.2s ease;
    --success-light: #d4edda;
    --danger-light: #f8d7da;
    --white: #ffffff;
    --radius: 12px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--light);
    overflow: hidden;
    position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    color: var(--gray-800);
}

.logo-text span {
    color: var(--primary);
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 5px;
}

.nav-menu {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.85);
    font-weight: 600;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg,
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.08),
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.03));
    border: 1px solid hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.1);
    border-radius: var(--border-radius-sm);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nav-section-title::after {
    content: '';
    display: inline-flex;
    width: 16px;
    height: 16px;
    background: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.5);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.2s ease, opacity 0.2s;
}
.nav-section-title:hover {
    background: linear-gradient(135deg,
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.14),
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.08));
    border-color: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.2);
    color: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 1);
}
.nav-section-title:hover::after {
    background: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.8);
}

.nav-section .nav-btn {
    transition: all 0.2s ease;
}
.nav-section.collapsed .nav-btn {
    display: none;
}
.nav-section.collapsed .nav-section-title::after {
    transform: rotate(-90deg);
}

/* цвета секций меню */
.nav-section[data-group="main"]       { --nav-h: 221; --nav-s: 83%; --nav-l: 55%; }
.nav-section[data-group="references"] { --nav-h: 199; --nav-s: 89%; --nav-l: 48%; }
.nav-section[data-group="assignments"] { --nav-h: 38;  --nav-s: 92%; --nav-l: 50%; }
.nav-section[data-group="tools"]     { --nav-h: 173; --nav-s: 80%; --nav-l: 40%; }
.nav-section[data-group="study"]     { --nav-h: 239; --nav-s: 84%; --nav-l: 67%; }
.nav-section[data-group="reports"]   { --nav-h: 142; --nav-s: 76%; --nav-l: 36%; }
.nav-section[data-group="staff"]    { --nav-h: 350; --nav-s: 70%; --nav-l: 55%; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.15);
    background: linear-gradient(135deg,
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.1),
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.04));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-btn .nav-icon {
    font-size: 1.25rem;
    min-width: 24px;
}

.nav-btn:hover {
    background: linear-gradient(135deg,
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.2),
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.12));
    border-color: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.25);
    color: var(--gray-800);
}

.nav-btn.active {
    background: linear-gradient(135deg,
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.65),
        hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.45));
    border-color: hsla(var(--nav-h, 142), var(--nav-s, 76%), var(--nav-l, 36%), 0.5);
    color: white;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* API Status */
.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: 20px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.status-ok .status-indicator {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-error .status-indicator {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
    overflow: hidden;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    height: var(--header-height);
    background: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.readonly-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    color: #92400e;
    padding: 10px 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid #fcd34d;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-danger {
    background: white;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: #0ea5e9;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-only:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-icon-only.btn-delete:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-icon-only.btn-edit:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-outline.btn-delete:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

th {
    text-align: left;
    padding: 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--gray-50);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.form-info {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.teacher-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    max-width: 200px;
}

.vacant-checkbox,
.vacant-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--warning);
}

/* ===== Common Component Styles ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard {
    padding: 1rem 0;
}

.action-buttons {
    white-space: nowrap;
    text-align: center;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--border-radius-sm);
    background: var(--warning);
    color: white;
}

.curriculums-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.workload-content {
    margin-top: 1rem;
}

.workload-view {
    margin-top: 1rem;
}

.analysis-results {
    margin-top: 1rem;
}

.level-class-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.level-tbody {
    display: table-row-group;
}

.parallel-matrices {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.load-subgroup {
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.subject-summary {
    padding: 1rem 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 1rem;
}

.subject-teachers {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.teacher-row {
    cursor: pointer;
    transition: var(--transition);
}

.teacher-row:hover {
    background: var(--gray-50);
}

.lr-restore-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.mass-teacher-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
}

.max-hours-info {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.pos-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.pos-link:hover {
    text-decoration: underline;
}

.snapshot-tab-pages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.staffing-assign-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.staffing-assign-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.staffing-toggle-text {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.subject-area-details {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.transition-toggle {
    cursor: pointer;
    user-select: none;
}

.select-level-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    background: white;
    color: var(--gray-600);
    transition: var(--transition);
    font-family: inherit;
}

.select-level-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.select-level-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.assign-stake-input {
    width: 70px;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
}

.compare-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.entry-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.exclude-position-cb,
.exclude-subject-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 0.4rem;
}

.filter-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.vanga-page {
    padding: 1rem 0;
}

.vanga-input-col {
    width: 80px;
}

.vanga-input-col input {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    text-align: center;
}

.vanga-extra-input {
    width: 60px;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    text-align: center;
}

.vanga-toggle {
    cursor: pointer;
    user-select: none;
}

.mass-assign-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    background: white;
    color: var(--gray-600);
    transition: var(--transition);
    font-family: inherit;
}

.mass-assign-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.mass-assign-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.stat-card .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    display: block;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: block;
    margin-top: 0.25rem;
}

.workload-subject-hours {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.show {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1001;
    animation: modalSlideIn 0.3s ease;
}

.modal-sm {
    max-width: 400px;
}

.modal-md {
    max-width: 450px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    width: 85%;
    max-width: 85%;
}

.mass-level-group {
    margin-bottom: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1rem;
}
.mass-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.mass-level-header strong {
    font-size: 1rem;
    color: var(--gray-700);
}
.mass-class-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.mass-class-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-family: inherit;
}
.mass-class-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.mass-class-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}
.subject-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(67, 97, 238, 0.2);
}
.subject-tag .remove-subject {
    cursor: pointer;
    opacity: 0.6;
    font-weight: 700;
    font-size: 1rem;
}
.subject-tag .remove-subject:hover {
    opacity: 1;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--gray-50);
}

/* ===== Loading State ===== */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.5rem;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease;
    border-left: 4px solid;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.4;
}

.toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--gray-700);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Centered Toast ===== */
.toast-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    background: white;
    padding: 20px 32px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastFadeIn 0.3s ease;
    border: none;
    min-width: 300px;
    justify-content: center;
}
.toast-center.toast-success { border-left: 4px solid var(--success); }
.toast-center.toast-error { border-left: 4px solid var(--danger); }
.toast-center.toast-warning { border-left: 4px solid var(--warning); }
.toast-center.toast-info { border-left: 4px solid var(--primary); }

@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ===== Filter Bar Compact ===== */
.filter-bar-compact {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.filter-bar-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-bar-btn.filter-btn {
    background: white;
    color: var(--gray-600);
}

.filter-bar-btn.filter-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.filter-bar-btn.filter-btn.active {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

.filter-bar-btn.filter-btn.active:hover {
    background: #ea580c;
}

.filter-bar-btn.reset-btn {
    background: white;
    color: var(--danger);
    border-color: var(--danger);
}

.filter-bar-btn.filter-group-btn {
    background: white;
    color: var(--gray-600);
}

.filter-bar-btn.filter-group-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.filter-bar-btn.filter-group-btn.active {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

.filter-bar-btn.filter-group-btn.active:hover {
    background: #ea580c;
}

.filter-bar-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    max-width: 150px;
}

.filter-bar-select:hover {
    border-color: var(--gray-400);
}

.filter-bar-btn.reset-btn:hover {
    background: var(--danger);
    color: white;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
    flex: 1 1 auto;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.filter-group input[type="text"],
.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    color: var(--gray-700);
    transition: var(--transition);
}

.filter-group input[type="text"]:hover,
.filter-group select:hover {
    border-color: var(--gray-400);
}

.filter-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.25rem;
    cursor: pointer;
}

.filter-group.d-flex {
    flex-direction: row;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

/* ===== Filter Modal ===== */
.filter-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.75rem;
}

.filter-section {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
}

.filter-section:nth-child(even) {
    background: white;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
}

.filter-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.filter-option-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--gray-700);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.filter-option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.filter-option-btn.selected {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.filter-option-btn.selected:hover {
    background: #059669;
    border-color: #059669;
}

.filter-option-btn.hidden-option {
    display: none;
}

.filter-class-group-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    width: 100%;
    margin: 0.35rem 0 0.25rem 0;
    padding: 0.2rem 0;
}

.filter-class-group-header:first-child {
    margin-top: 0;
}

.filter-toggle {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.toggle-btn {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    background: white;
    color: var(--gray-600);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.toggle-btn:hover:not(.active) {
    background: var(--gray-100);
}

.area-group-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0 0 0.35rem 0;
    width: 100%;
}

.modal-subject {
    max-width: 1200px;
    width: 95%;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .app-container {
        margin: 10px;
    }
    
    .content-body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
        position: static;
        height: auto;
        z-index: auto;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        padding: 1rem;
    }
    
    .nav-menu.show {
        display: block;
    }
    
    .main-content {
        height: calc(100vh - var(--header-height));
        margin-left: 0;
    }
    
    .content-header {
        padding: 0 1rem;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px auto;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }

/* ===== Table summary ===== */
.table-summary {
    margin-top: 1rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    text-align: right;
    color: var(--gray-600);
}

/* ===== Vacant badge ===== */
.vacant-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 1px 6px;
    border-radius: 8px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    margin-left: 4px;
    white-space: nowrap;
    font-weight: 500;
}
.class-info-badge {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.4;
}
.cabinet-line {
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}
.cabinet-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}
.cabinet-type-label {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gray-800);
}
.cabinet-building-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}
.cabinet-location {
    font-size: 0.85rem;
    color: var(--gray-500);
}
.card-vacant {
    border-left: 3px solid #ffc107;
}
.vacant-row {
    color: #856404;
    font-style: italic;
}
.vacant-separator {
    margin: 0.25rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    border-top: 1px dashed var(--danger);
    padding-top: 3px;
}

/* ===== Class Summary (статистика по классам) ===== */
.class-summary {
    display: flex;
    flex-flow: row wrap;
    gap: 1rem;
    margin: 1rem 0;
}
.summary-building {
    flex: 1 1 350px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1rem 1.25rem;
}
.summary-building h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.building-shifts {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.shift-group {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
}
.shift-group strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    min-width: 140px;
}
.shift-levels {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}
.shift-levels span {
    white-space: nowrap;
}
.summary-no-data {
    font-size: 0.875rem;
    color: var(--gray-400);
    font-style: italic;
}

/* ===== Extended Utilities ===== */
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }
.align-baseline { align-items: baseline; }
.gap-0 { gap: 0; }
.gap-05 { gap: 0.25rem; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }
.text-nowrap { white-space: nowrap; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-small { font-size: 0.85rem; }
.fs-smaller { font-size: 0.75rem; }
.cursor-pointer { cursor: pointer; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.m-0 { margin: 0; }
.ml-1 { margin-left: 0.5rem; }
.ml-2 { margin-left: 1rem; }
.ml-3 { margin-left: 1.5rem; }
.mr-1 { margin-right: 0.5rem; }
.mr-2 { margin-right: 1rem; }
.m-0-auto { margin: 0 auto; }
.my-1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2 { margin-top: 1rem; margin-bottom: 1rem; }
.my-3 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mx-1 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-2 { margin-left: 1rem; margin-right: 1rem; }

/* ===== Curriculum Cards (Original - kept for compatibility) ===== */
.curriculums-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.curriculum-level-header {
    grid-column: 1 / -1;
    width: 100%;
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-700);
    padding: 0.5rem 0;
    margin: 0.5rem 0 0;
    border-bottom: 2px solid var(--primary-light);
}

.shift-header {
    padding: 0.3rem 0.75rem;
    margin: 0.25rem 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.homeroom-shift-block {
    grid-column: 1 / -1;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.homeroom-shift-block:last-child {
    margin-bottom: 0;
}

.homeroom-shift-block h3 {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin: 0 0 0 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary-light);
}

.homeroom-teacher-group {
    display: contents;
}

.homeroom-teacher-group h4 {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0.25rem 0 0 0;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.homeroom-teacher-group h4 .count-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.homeroom-floor-group {
    display: contents;
}

.homeroom-floor-group h4 {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0.15rem 0 0 0;
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.homeroom-floor-group h4 .count-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.homeroom-block-group {
    display: contents;
}

.homeroom-block-group h5 {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin: 0.1rem 0 0 0;
    padding: 0.15rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.homeroom-block-group h5 .count-badge {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.curriculum-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
  margin-bottom: 1rem;
}

.curriculum-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.curriculum-card-header {
  padding: 1.25rem 1.75rem;
  background: #dce3f2;
  border-bottom: 2px solid #b8c5e0;
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: background 0.2s;
}

.curriculum-card-header:hover {
  background: #d0d8eb;
}

.curriculum-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 300px;
}

.curriculum-icon {
  display: inline-flex;
  align-items: center;
  color: var(--gray-400);
}

.curriculum-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-900);
  word-break: break-word;
  line-height: 1.3;
}

.curriculum-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  flex: 1;
  justify-items: center;
  align-items: center;
}

.stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 130px;
  min-height: 62px;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.stat-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.4;
  margin-bottom: 0.1rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.expand-icon {
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  color: var(--gray-400);
}
.expand-icon.open {
  transform: rotate(90deg);
}

.curriculum-card-body {
  padding: 1.5rem 1.75rem;
  background: white;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.curriculum-legend {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  justify-content: center;
}
.curriculum-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.empty-subjects {
  text-align: center;
  padding: 2rem;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  color: var(--gray-500);
}

/* ===== Button Sizes ===== */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-icon {
  margin-right: 0.375rem;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--gray-500);
  padding: 0.25rem 0.35rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-ghost-danger:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* Дополнительные стили для форм */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Стили для поля названия класса */
#class-name {
  background-color: var(--gray-50);
  transition: background-color 0.3s ease;
}

#class-name:focus {
  background-color: white;
}

/* Анимация для полей формы */
.form-group {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Стили для выпадающих списков */
select {
  cursor: pointer;
}

select option {
  padding: 0.5rem;
}

/* Индикатор ручного редактирования */
.form-group small {
  color: var(--gray-400);
  transition: color 0.3s ease;
}

.form-group input:focus + small {
  color: var(--primary);
}

/* Стили для поля ученика */
#student-name-group {
  transition: all 0.3s ease;
  overflow: hidden;
}

#student-name-group[style*="display: block"] {
  animation: slideDown 0.3s ease;
}

/* Стили для сообщения о дубликате */
.duplicate-error {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  animation: shake 0.3s ease;
}
.form-static-value {
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.duplicate-error.error {
  background-color: #fee2e2;
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.duplicate-error.warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 3px solid var(--warning);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Стили для заблокированной кнопки */
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary:disabled:hover {
  background: var(--primary);
  transform: none;
}

/* Подсветка полей с ошибкой */
.form-group input.duplicate-input {
  border-color: var(--danger);
  background-color: #fff5f5;
}

.form-group input.duplicate-input:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Дополнительные стили для учебных планов */
.split-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1rem;
  color: var(--warning);
  cursor: help;
}

.split-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.split-yes {
  color: var(--success);
}

.split-no {
  color: var(--gray-400);
}

.total-hours-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 80px;
  justify-content: center;
}

.total-hours-badge small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-500);
}

.hours-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  min-width: 65px;
  justify-content: center;
}

.subjects-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0.3px;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--gray-200);
}
.subjects-table td {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  vertical-align: middle;
}
.subjects-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
}
.subjects-table tbody tr:nth-child(even) td {
  background: var(--gray-50);
}
.subjects-table tbody tr:hover td {
  background: #f1f5ff;
}

.curriculum-summary {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--gray-50);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Grand total across all curriculums */
.curriculum-grand-total {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: white;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.curriculum-grand-total table tr:hover td { background: var(--gray-50) !important; }
.curriculum-grand-total table {
  background: transparent;
  width: 100%;
}
.curriculum-grand-total th,
.curriculum-grand-total td {
  color: var(--gray-700);
  border-color: var(--gray-200);
  padding: 0.75rem 1rem;
}
.curriculum-grand-total thead th {
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--gray-200);
}
.grand-total-footer td {
  background: var(--primary-light) !important;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1rem;
  border-top: 3px solid var(--primary);
  padding: 0.85rem 1rem;
}
.grand-toggle { cursor: pointer; }
.grand-toggle:hover td { background: var(--gray-50) !important; }
.grand-toggle td { padding: 0.7rem 1rem; }
.grand-toggle .toggle-icon { transition: transform 0.2s; display: inline-flex; align-items: center; margin-right: 0.4rem; color: var(--gray-500); }
.grand-toggle .toggle-icon.open { transform: rotate(90deg); }
.grand-detail-row { display: none; }
.grand-detail-row.open { display: table-row; }
.grand-detail-row td { padding: 0 !important; }
.grand-detail-table { width: 100%; border-collapse: collapse; }
.grand-detail-table th, .grand-detail-table td { padding: 0.4rem 1rem; font-size: 0.85rem; color: var(--gray-700); }
.grand-detail-table th { background: var(--gray-100); font-weight: 600; }
.grand-detail-table td { border-bottom: 1px solid var(--gray-200); }
.grand-detail-table tbody tr:hover td { background: var(--gray-50) !important; }

/* Vanga styles */
.vanga-class-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.vanga-class-header {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.vanga-class-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.vanga-subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.vanga-tag-continued {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.vanga-tag-dropped {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe69c;
}
.vanga-tag-unassigned {
  background: #e9ecef;
  color: #6c757d;
  border: 1px solid #ced4da;
}
.vanga-cp-summary {
  display: flex;
  border-left: 1px solid var(--gray-200);
  flex: 1;
}
.vanga-cp-col {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-left: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--gray-600);
  white-space: nowrap;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.vanga-cp-col strong {
  font-size: 1.2rem;
  color: #7c3aed;
}
.vanga-arrow {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin: 0 0.25rem;
}
.vanga-cur {
  font-size: 1.1rem;
  color: #000;
  font-weight: 700;
}
.vanga-cur strong {
  font-size: 1.1rem;
  color: #000;
  font-weight: 700;
}

.vanga-extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.vanga-extra-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}
.vanga-extra-item label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}
.vanga-extra-item input {
  width: 100%;
  padding: 0.25rem 0.375rem;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
}

.summary-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.summary-value.highlight {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 1rem;
  border-radius: 20px;
}

/* ===== Классное руководство ===== */
.homeroom-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.homeroom-stats .stat-card {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 150px;
    text-align: center;
    font-size: 1rem;
}
.homeroom-stats .stat-card strong {
    font-size: 1.5rem;
    display: block;
    color: var(--primary);
}
.homeroom-student-stats {
    margin-top: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.75rem;
}
.homeroom-student-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    font-family: inherit;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s;
}
.homeroom-student-toggle:hover {
    background: var(--gray-50);
}
.homeroom-student-toggle .load-chevron {
    transition: transform 0.2s;
}
.homeroom-student-stats.collapsed .homeroom-student-toggle .load-chevron {
    transform: rotate(-90deg);
}
.homeroom-student-stats.collapsed .homeroom-student-table {
    display: none;
}
.homeroom-student-table {
    margin-top: 0.75rem;
}
.homeroom-student-table .load-th,
.homeroom-student-table .load-group-btn,
.homeroom-student-table .load-edu-btn,
.homeroom-student-table .load-subgroup-btn,
.homeroom-student-table .load-row,
.homeroom-student-table .load-total {
    grid-template-columns: 1fr repeat(3, 75px);
}
.homeroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.homeroom-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}
.homeroom-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    filter: brightness(0.98);
}
.homeroom-card--none {
    background: #f8f9fa;
    border-style: dashed;
    border-color: var(--gray-400);
}
.homeroom-card--1 {
    background: #d4edda;
}
.homeroom-card--2 {
    background: #fff3cd;
}
.homeroom-card--3plus {
    background: #f8d7da;
}

.homeroom-card .teacher {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    min-height: 2.4em;
}
.homeroom-card .student-count {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}
.homeroom-card .class-count {
    font-size: 0.8rem;
    color: var(--gray-600);
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(2px);
}
.homeroom-card-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.homeroom-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.homeroom-card-students {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}
.homeroom-legend {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    justify-content: center;
}
.homeroom-legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}
.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 5px;
    border: 1px solid rgba(0,0,0,0.1);
}
.legend-color.gray { background-color: #f8f9fa; border: 1px solid #6c757d; }
.legend-color.green { background-color: #d4edda; border: 1px solid #28a745; }
.legend-color.blue { background-color: #cce5ff; border: 1px solid #007bff; }
.legend-color.orange { background-color: #ffe5b4; border: 1px solid #fd7e14; }
.legend-color-none { background: var(--gray-400); border-color: var(--gray-500); }
.legend-color-green { background: var(--success); border-color: #059669; }
.legend-color-orange { background: var(--warning); border-color: #d97706; }
.legend-color-red { background: var(--danger); border-color: #dc2626; }
.subject-group {
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.subject-group--kelective {
    border-left-color: #f59e0b;
}
.subject-group--elective {
    border-left-color: #10b981;
}
.subject-group--extracurricular {
    border-left-color: #8b5cf6;
}
.subject-group-title {
    padding: 0.75rem 1.25rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.group-footer td {
    background: var(--gray-50);
    font-weight: 600;
    border-top: 2px solid var(--gray-300);
    padding: 0.75rem 1rem;
}
.total-footer td {
    background: var(--primary-light);
    font-weight: 700;
    color: var(--primary-dark);
    border-top: 3px solid var(--primary);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
}
.total-table {
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.08);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.total-summary {
    margin-top: 2rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}
/* subject assignments */
.subject-section {
    margin-bottom: 2.5rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.subject-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.75rem;
}

.subject-header h3 {
    font-size: 1.3rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-group {
    margin-bottom: 1.5rem;
}

.level-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.class-card {
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
    text-align: center;
}

.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.class-card.status-none {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.class-card.status-partial {
    background: #fff3cd;
    border-color: #ffc107;
}

.class-card.status-full {
    background: #d4edda;
    border-color: #28a745;
}

.class-card.status-split-2 {
    background: #cce5ff;
    border-color: #007bff;
}

.class-card.status-split-3plus {
    background: #f8d7da;
    border-color: #dc3545;
}

.class-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.class-hours {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.class-homeroom {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.class-status {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* модальное окно для subject-assignment */
#subject-assignment-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-subject-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-subject-header h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.hours-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    margin: 0.5rem 0;
    overflow: hidden;
}

.hours-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.hours-progress-fill.over {
    background: var(--danger);
}

.hours-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.split-groups {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    justify-content: center;
}

.group-btn {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.group-btn.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.assignment-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    transition: all 0.15s;
}

.assignment-item.vacant {
    opacity: 0.65;
}

.assignment-row-top {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.assignment-row-top select {
    flex: 1;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: white;
}

.assignment-row-bottom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hours-control {
    display: inline-flex;
    align-items: center;
}

.hours-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
    user-select: none;
}

.hours-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.hours-input {
    width: 64px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-left: none;
    border-right: none;
    border-radius: 0;
    height: 28px;
    font-size: 0.85rem;
    padding: 0;
    outline: none;
}

.hours-input::-webkit-inner-spin-button,
.hours-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vacant-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--gray-500);
    user-select: none;
}

.vacant-toggle-label input {
    display: none;
}

.vacant-slider {
    position: relative;
    width: 32px;
    height: 18px;
    background: var(--gray-300);
    border-radius: 9px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.vacant-slider::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.vacant-toggle-label input:checked + .vacant-slider {
    background: var(--warning);
}

.vacant-toggle-label input:checked + .vacant-slider::after {
    left: 16px;
}

.teacher-shift-load {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-left: auto;
}

.btn-delete-text {
    font-size: 0.8rem;
    color: var(--danger);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-delete-text:hover {
    background: #fee2e2;
}

.empty-assignments {
    text-align: center;
    color: var(--gray-400);
    font-style: italic;
    padding: 2rem 0;
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.subject-stats {
    display: flex;
    gap: 1rem;
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stat-item {
    color: var(--gray-700);
}

.analysis-filters {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.analysis-card {
  background: white;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.analysis-card-header {
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.1rem;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
}

.analysis-table th {
  text-align: left;
  padding: 0.75rem 1.5rem;
  background: var(--gray-100);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--gray-600);
}

.analysis-table td {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.analysis-level {
  background: white;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  padding: 1.5rem;
}

.analysis-class-sub {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--primary-light);
}
/* ===== classAssignments.js ===== */
    .class-assign-level {
        margin-bottom: 2.5rem;
    }
    
    .level-header {
        font-size: 1.3rem;
        color: var(--gray-700);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--primary-light);
    }
    
    .class-assign-card {
        background: white;
        border-radius: var(--border-radius);
        margin-bottom: 1.5rem;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        border: 1px solid var(--gray-200);
        width: 100%;
    }
    
    .class-assign-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-light);
    }
    
    .class-assign-header {
        padding: 1rem 1.5rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .class-assign-header h4 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 600;
    }
    
    .class-assign-total {
        background: rgba(255, 255, 255, 0.2);
        padding: 0.25rem 0.75rem;
        border-radius: 20px;
        font-size: 0.8rem;
        backdrop-filter: blur(4px);
    }
    
    .class-assign-subjects {
        padding: 1.5rem;
    }
    
    .subject-group {
        margin-bottom: 2rem;
    }
    
    .subject-group:last-child {
        margin-bottom: 0;
    }
    
    .subject-group-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--gray-600);
        margin-bottom: 1rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-left: 4px solid var(--primary);
        padding-left: 0.75rem;
    }
    
    .subject-group-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .class-assign-subject-card {
        background: var(--gray-100);
        border-radius: var(--border-radius-sm);
        padding: 1rem;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid var(--gray-200);
        position: relative;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 80px;
    }
    
    .class-assign-subject-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .class-assign-subject-card.status-unassigned {
        background: #fee2e2;
        border-color: #fecaca;
    }
    
    .class-assign-subject-card.status-partial {
        background: #fff3cd;
        border-color: #ffe69c;
    }
    
    .class-assign-subject-card.status-assigned {
        background: #d4edda;
        border-color: #c3e6cb;
    }
    
    .class-assign-subject-card .subject-name {
        font-weight: 600;
        font-size: 1rem;
        color: var(--gray-800);
        margin-bottom: 0.25rem;
    }
    
    .class-assign-subject-card .split-badge {
        position: absolute;
        top: 0.25rem;
        right: 0.25rem;
        font-size: 1rem;
        opacity: 0.7;
    }
    
    .class-assign-filters {
        margin-bottom: 2rem;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        align-items: flex-end;
    }
    
    .assigned-info {
        font-weight: 600;
        margin-top: 0.5rem;
    }
    
    .assignment-item.existing {
        justify-content: space-between;
    }
    
    .assignment-teacher-info {
        flex: 1;
        font-weight: 500;
        color: var(--gray-800);
    }
    
    .assignment-item.empty-slot select {
        flex: 1;
        padding: 0.5rem;
        border: 1px solid var(--gray-300);
        border-radius: var(--border-radius-sm);
        width: 100%;
    }
    
    .hours-note {
        margin-top: 1rem;
        padding: 0.75rem;
        background: var(--primary-light);
        border-radius: var(--border-radius-sm);
        color: var(--primary-dark);
        font-size: 0.9rem;
        text-align: center;
    }
    
    @media (max-width: 768px) {
        .subject-group-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        }
        
        .class-assign-filters {
            flex-direction: column;
        }
        
        .filter-group {
            width: 100%;
            flex: none;
        }
        
        .assignment-item {
            flex-direction: column;
        }
        
        .assignment-item.empty-slot select {
            width: 100%;
        }
    }
/* ===== subjectAreas.js ===== */
    .subject-areas-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
    }

    .subject-areas-list {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .subject-area-card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
        border: 1px solid var(--gray-200);
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .subject-area-card:hover {
        box-shadow: 0 8px 30px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

    .subject-area-card-header {
        padding: 1.25rem 1.75rem;
        background: #dce3f2;
        border-bottom: 2px solid #b8c5e0;
        color: var(--gray-800);
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 1.25rem;
        transition: background 0.2s;
    }

    .subject-area-card-header:hover {
        background: #d0d8eb;
    }

    .subject-area-title {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 0;
        width: 300px;
    }

    .subject-area-icon {
        display: inline-flex;
        align-items: center;
        color: var(--gray-400);
    }

    .subject-area-title h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin: 0;
        color: var(--gray-900);
        word-break: break-word;
        line-height: 1.3;
    }

    .subject-area-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        flex: 1;
        justify-items: center;
        align-items: center;
    }

    .subject-area-card-body {
        padding: 1.5rem 1.75rem;
        background: white;
        animation: slideDown 0.3s ease;
    }

    .subject-area-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--gray-200);
    }

    .area-description {
        background: var(--gray-50);
        padding: 1rem 1.25rem;
        border-radius: var(--border-radius-sm);
        margin-bottom: 1.75rem;
        color: var(--gray-700);
        border-left: 4px solid var(--gray-400);
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .detail-section {
        margin-bottom: 2.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px dashed var(--gray-200);
    }

    .detail-section:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .detail-section h4 {
        margin-bottom: 1rem;
        color: var(--gray-700);
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-left: 4px solid var(--primary);
        padding-left: 0.75rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .detail-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .detail-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        background: var(--gray-50);
        border-radius: var(--border-radius-sm);
        margin-bottom: 0.35rem;
        border: 1px solid var(--gray-200);
        transition: border-color 0.15s;
    }
    .detail-list li:hover {
        border-color: var(--gray-300);
    }

    .detail-list li:last-child {
        margin-bottom: 0;
    }

    .detail-name {
        font-weight: 500;
        color: var(--gray-800);
    }

    .empty-detail {
        color: var(--gray-500);
        font-style: italic;
        padding: 1.25rem;
        background: var(--gray-50);
        border-radius: var(--border-radius-sm);
        text-align: center;
        border: 1px dashed var(--gray-200);
    }

    .area-tile-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.85rem;
    }

    .area-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 1.15rem 0.75rem;
        background: var(--gray-50);
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        text-align: center;
        min-height: 100px;
        position: relative;
        transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    }
    .area-tile:hover {
        border-color: var(--primary);
        box-shadow: 0 3px 12px rgba(67, 97, 238, 0.12);
        background: white;
    }

    .area-tile-name {
        font-weight: 600;
        font-size: 0.875rem;
        color: var(--gray-800);
        line-height: 1.4;
        word-break: break-word;
        max-width: 100%;
    }

    .area-tile-meta {
        font-size: 0.75rem;
        color: var(--gray-500);
        margin-top: 0.2rem;
    }

    .area-tile-delete {
        position: absolute;
        top: 0.35rem;
        right: 0.35rem;
        opacity: 0;
        transition: opacity 0.15s;
        padding: 0.2rem;
        border-radius: 4px;
    }
    .area-tile:hover .area-tile-delete {
        opacity: 1;
    }

    .building-teacher-group {
        margin-bottom: 1.5rem;
    }
    .building-teacher-group:last-child {
        margin-bottom: 0;
    }
    .building-group-title {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--gray-600);
        margin-bottom: 0.75rem;
        padding: 0.4rem 0.75rem;
        background: var(--gray-100);
        border-radius: var(--border-radius-sm);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    @media (max-width: 768px) {
        .subject-area-card-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
            padding: 1rem;
        }
        .subject-area-stats {
            width: 100%;
            grid-template-columns: repeat(3, 1fr);
        }
        .subject-area-title h3 {
            font-size: 1rem;
        }
        .subject-area-actions {
            flex-direction: column;
            align-items: stretch;
        }
        .card-actions {
            justify-content: flex-end;
        }
    }
/* ===== subjectAreas.js ===== */
/* ===== subjects.js ===== */
  .subject-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
  }
  
  .subject-name {
    font-weight: 500;
    color: var(--gray-800);
  }
  
  .split-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
  }
  
  .split-yes {
    background: #d1fae5;
    color: #065f46;
  }
  
  .split-no {
    background: var(--gray-200);
    color: var(--gray-600);
  }
  
  .actions-cell {
    display: flex;
    gap: 0.5rem;
  }
  
/* ===== subjects.js ===== */
/* ===== workload.js ===== */
    .workload-header {
        margin-bottom: 2rem;
    }

    .workload-summary {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .summary-card {
        background: white;
        padding: 1.5rem;
        border-radius: var(--border-radius);
        text-align: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }

    .summary-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .summary-value {
        display: block;
        font-size: 2rem;
        font-weight: 700;
        color: var(--primary);
        line-height: 1.2;
    }

    .summary-label {
        display: block;
        font-size: 0.875rem;
        color: var(--gray-600);
        margin-top: 0.25rem;
    }

    .workload-filters {
        background: white;
        padding: 1.5rem;
        border-radius: var(--border-radius);
        margin-bottom: 2rem;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .workload-view-select {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid var(--gray-300);
        border-radius: var(--border-radius-sm);
        font-size: 1rem;
        cursor: pointer;
    }

    .workload-teacher-card,
    .workload-class-card,
    .workload-subject-card {
        background: white;
        border-radius: var(--border-radius);
        margin-bottom: 1.5rem;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }

    .workload-teacher-card:hover,
    .workload-class-card:hover,
    .workload-subject-card:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .workload-teacher-header,
    .workload-class-header,
    .workload-subject-header {
        padding: 1.25rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .workload-teacher-header h3,
    .workload-class-header h3,
    .workload-subject-header h3 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 600;
    }

    .workload-total-hours {
        background: rgba(255, 255, 255, 0.2);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.9rem;
        font-weight: 500;
        backdrop-filter: blur(4px);
    }

    .workload-subjects-list,
    .workload-teachers-list {
        padding: 1.25rem;
    }

    .workload-subject-item {
        background: var(--gray-50);
        border-radius: var(--border-radius-sm);
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid var(--gray-200);
    }

    .workload-subject-item:last-child {
        margin-bottom: 0;
    }

    .workload-subject-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
    }

    .workload-subject-name {
        font-weight: 600;
        color: var(--gray-800);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .workload-subject-type {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        background: var(--gray-200);
        border-radius: 4px;
        color: var(--gray-600);
        font-weight: normal;
    }

    .workload-subject-total {
        font-weight: 600;
        color: var(--primary);
    }

    .workload-classes-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .workload-class-item {
        background: white;
        padding: 0.5rem;
        border-radius: 4px;
        border: 1px solid var(--gray-200);
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 0.2s ease;
    }

    .workload-class-item:hover {
        background: var(--primary-light);
        border-color: var(--primary);
    }

    .workload-class-name {
        font-weight: 500;
        color: var(--gray-700);
    }

    .workload-class-hours {
        font-weight: 600;
        color: var(--primary);
    }

    .workload-teacher-in-class,
    .workload-teacher-in-subject {
        background: var(--gray-50);
        border-radius: var(--border-radius-sm);
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        border: 1px solid var(--gray-200);
    }

    .workload-teacher-in-class:last-child,
    .workload-teacher-in-subject:last-child {
        margin-bottom: 0;
    }

    .workload-teacher-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        background: none;
        color: inherit;
        padding: 0;
    }

    .workload-teacher-name {
        font-weight: 600;
        color: var(--gray-800);
    }

    .workload-teacher-total {
        font-weight: 600;
        color: var(--primary);
    }

    .workload-subjects-in-class {
        margin-left: 1.5rem;
    }

    .workload-subject-in-class {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
        font-size: 0.9rem;
        border-bottom: 1px dashed var(--gray-200);
    }

    .workload-subject-in-class:last-child {
        border-bottom: none;
    }

    .workload-empty {
        text-align: center;
        padding: 3rem;
        background: white;
        border-radius: var(--border-radius);
        color: var(--gray-500);
        font-size: 1rem;
    }

    @media (max-width: 768px) {
        .workload-filters {
            grid-template-columns: 1fr;
        }

        .workload-classes-grid {
            grid-template-columns: 1fr;
        }

        .workload-teacher-header,
        .workload-class-header,
        .workload-subject-header {
            flex-direction: column;
            gap: 0.5rem;
            text-align: center;
        }

        .workload-subject-header {
            flex-direction: column;
            gap: 0.5rem;
            align-items: flex-start;
        }
    }
/* ===== workload.js ===== */
/* ===== remainingReport.js ===== */
    .report-container { overflow-x: auto; margin: 1rem 0; }
    .report-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    .report-table th { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 0.75rem; font-weight: 600; text-align: center; white-space: nowrap; }
    .report-table td { border: 1px solid var(--gray-300); padding: 0; vertical-align: middle; }
    .group-header td { background: var(--gray-200); font-weight: 700; padding: 0.5rem 1rem; border: none; border-bottom: 2px solid var(--gray-400); }
    .remaining-cell { position: relative; width: 100px; height: 60px; background: linear-gradient(135deg, #ffe6e6 50%, #e6ffe6 50%); border: 1px solid #aaa; }
    .remaining-cell.cell-full { background: #e6ffe6; }
    .remaining-cell.cell-gray { background: #e0e0e0; }
    .remaining-cell.cell-gray .cell-remaining,
    .remaining-cell.cell-gray .cell-total { color: #666; }
    .cell-remaining { position: absolute; top: 4px; left: 4px; font-size: 0.9rem; font-weight: 600; color: rgb(0, 0, 0); background: rgba(255,255,255,0.6); padding: 2px 4px; border-radius: 1px; }
    .cell-total { position: absolute; bottom: 4px; right: 4px; font-size: 0.9rem; font-weight: 600; color: rgb(0, 0, 0); background: rgba(255,255,255,0.6); padding: 2px 4px; border-radius: 1px; }
    .percent-cell { padding: 0.5rem; text-align: center; font-weight: 600; background: var(--gray-50); color: var(--primary); white-space: nowrap; }
    .subject-total, .level-total, .grand-total, .group-level-total, .group-total-sum { padding: 0.5rem; text-align: center; font-weight: 600; background: var(--gray-50); white-space: nowrap; }
    .total-remaining { color: #a00; }
    .total-max { color: #0a0; }
    .level-remaining { color: #a00; }
    .level-max { color: #0a0; }
    .grand-remaining { color: #a00; font-size: 1.1rem; }
    .grand-max { color: #0a0; font-size: 1.1rem; }
    .grand-percent { padding: 0.5rem; text-align: center; font-weight: 700; background: var(--gray-200); color: var(--primary-dark); }
    .group-total { background: #e6f7ff; font-weight: 600; }
    .group-total td { border-top: 2px solid var(--primary-light); border-bottom: 2px solid var(--primary-light); }
    .group-percent { padding: 0.5rem; text-align: center; font-weight: 600; background: #e6f7ff; }
    .total-row { background: var(--gray-200); font-weight: 700; }

    @media (max-width: 768px) {
      .remaining-cell { width: 70px; height: 50px; }
      .cell-remaining, .cell-total { font-size: 0.9rem; }
    }
/* ===== remainingReport.js ===== */
/* ===== Кнопки предметных областей в форме учителя ===== */
.areas-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.area-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.area-btn:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
}

.area-btn.selected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.area-btn.selected:hover {
    background: #0f9e6a;
}

/* ===== НОВЫЕ СТИЛИ ДЛЯ МАССОВОГО НАЗНАЧЕНИЯ В subjectAssignments ===== */
#mass-class-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.mass-class-btn {
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 32px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray-700);
}

.mass-class-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.mass-class-btn.selected {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

#mass-select-all-btn {
    margin-bottom: 0.5rem;
}

#mass-selected-count {
    font-weight: 700;
    color: var(--primary);
}

/* Teacher grid */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.teacher-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-align: center;
    border-left: 5px solid;
}
.teacher-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.teacher-card.gray { border-left-color: #6c757d; background-color: #f8f9fa; }
.teacher-card.green { border-left-color: #28a745; background-color: #d4edda; }
.teacher-card.blue { border-left-color: #007bff; background-color: #cce5ff; }
.teacher-card.orange { border-left-color: #fd7e14; background-color: #ffe5b4; }

.teacher-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.teacher-badge {
    font-size: 0.8rem;
    color: var(--gray-700);
    background: rgba(0,0,0,0.05);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Модалка для выбора областей */
.areas-checkbox-list {
    max-height: 400px;
    overflow-y: auto;
}
.area-checkbox-item {
    margin-bottom: 0.75rem;
}
.area-checkbox-item label {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    cursor: pointer;
}
.area-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
}
.matrix-header {
    margin-bottom: 1rem;
}
.matrix-legend {
    display: flex;
    gap: 1.5rem;
    margin: 0.5rem 0;
    align-items: center;
    flex-wrap: wrap;
}
.matrix-note {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}
.matrix-scroll-wrapper {
    overflow-x: auto;
    max-width: 100%;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.teacher-areas-table.vertical-headers {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
    background: white;
}
.teacher-areas-table.vertical-headers th,
.teacher-areas-table.vertical-headers td {
    border: 1px solid var(--gray-300);
    padding: 8px 6px;
    vertical-align: middle;
    text-align: center;
}
.teacher-areas-table.vertical-headers .teacher-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    width: 20%;
    white-space: nowrap;
    text-align: left;
    padding: 6px 12px;
}
.teacher-areas-table.vertical-headers .area-col {
    vertical-align: top;
    padding: 0;
    width: 50px;
}
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    padding: 8px 0;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: help;
}
.vertical-text-inner {
    display: inline-block;
    max-height: 200px;
    overflow: visible;
}
.teacher-cell {
    cursor: pointer;
    transition: background 0.1s;
    word-break: break-word;
    white-space: normal;
    font-size: 0.8rem;
}
.teacher-cell:hover { background: var(--gray-100); }
.teacher-cell.gray { border-left: 4px solid #6c757d; background-color: #f8f9fa; }
.teacher-cell.green { border-left: 4px solid #28a745; background-color: #d4edda; }
.teacher-cell.blue { border-left: 4px solid #007bff; background-color: #cce5ff; }
.teacher-cell.orange { border-left: 4px solid #fd7e14; background-color: #ffe5b4; }
.teacher-cell .teacher-name { font-weight: bold; margin-bottom: 2px; line-height: 1.2; }
.teacher-cell .teacher-badge { font-size: 0.65rem; color: var(--gray-600); }
.matrix-cell { font-size: 1.1rem; cursor: pointer; transition: filter 0.1s; }
.matrix-cell.member { color: #28a745; font-weight: bold; background-color: #e8f5e9; }
.matrix-cell.non-member { color: #dc3545; opacity: 0.7; background-color: #fff5f5; }
.matrix-cell:hover { filter: brightness(0.95); }
.error-state {
    text-align: center;
    padding: 2rem;
    background: #fff5f5;
    border-radius: var(--border-radius);
    color: var(--danger);
}

/* ========== Transition (yearTransition.js) ========== */
.transition-page {
    max-width: 1200px;
    margin: 0 auto;
}
.transition-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.transition-stats .stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
    border-left: 4px solid var(--primary);
}
.transition-stats .stat-card-warning { border-left-color: var(--warning); }
.transition-stats .stat-card-danger { border-left-color: var(--danger); }
.transition-stats .stat-card-success { border-left-color: var(--success); }
.transition-stats .stat-card-info { border-left-color: var(--primary); }
.transition-stats .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}
.transition-stats .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}
.stat-progress {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.stat-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.3s;
}
.transition-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.transition-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    overflow: hidden;
}
.transition-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
}
.transition-section-header h3 {
    margin: 0;
    font-size: 1rem;
}
.transition-section-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-left: auto;
}
.toggle-icon {
    font-size: 0.75rem;
    color: var(--gray-400);
}
.transition-section-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--gray-100);
    padding-top: 1rem;
}
.transition-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.transition-tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: var(--gray-700);
}
.transition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.transition-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--gray-200);
}
.transition-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.transition-issues-table td {
    padding: 0.5rem 0.6rem;
}
.row-new-subject td { background: #fffef5; }
.row-out-of-range td { background: #f0f7ff; }
.teacher-cell-range small {
    color: var(--gray-500);
    font-size: 0.75rem;
}
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-danger { background: #f8d7da; color: #721c24; }
.transition-teacher-select {
    width: 100%;
    min-width: 200px;
    max-width: 300px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}
.transition-teacher-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}
.transition-execute-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 1.5rem;
    position: sticky;
    bottom: 1rem;
    border: 2px solid var(--gray-200);
}
.transition-execute-info {
    font-size: 0.9rem;
    color: var(--gray-700);
}
.transition-remaining {
    font-weight: 500;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
}
.transition-stages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}
.transition-stage {
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.transition-stage.stage-completed {
    background: #d4edda;
    color: #155724;
}
.transition-stage.stage-in_progress {
    background: #fff3cd;
    color: #856404;
    font-weight: 500;
}
.transition-stage.stage-error {
    background: #f8d7da;
    color: #721c24;
}
.transition-result-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    margin-top: 1rem;
}
.transition-result-card h3 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}
.transition-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.result-item {
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    text-align: center;
}
.result-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}
.result-item span:last-child {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: block;
    margin-top: 0.2rem;
}

.transition-ignore-bar {
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    background: #f8f9ff;
    border-radius: var(--border-radius);
    border: 1px solid #dde3f7;
}
.transition-ignore-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--gray-700);
}
.transition-ignore-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.transition-stats .stat-card-ignored { border-left-color: #8b8cf7; }
.badge-ignored {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.8rem;
    background: #e8e8ff;
    color: #5a5abf;
    font-weight: 500;
}
.row-ignored td {
    background: #f8f8ff;
    color: var(--gray-500);
}
.row-ignored td:last-child {
    text-align: center;
}
.level-ignore-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}
.level-ignore-cb:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.transition-table th:last-child,
.transition-table td:last-child {
    text-align: center;
    width: 60px;
}
.transition-table th:nth-child(3),
.transition-table td:nth-child(3),
.transition-table th:nth-child(4),
.transition-table td:nth-child(4),
.transition-table th:nth-child(5),
.transition-table td:nth-child(5) {
    text-align: center;
}

/* ===== transition auto-carryover ===== */
.row-auto td {
    color: var(--success);
    background: #f0fff4;
}
.row-auto td:first-child {
    font-weight: 500;
}
.row-force-reset td {
    background: #fff5f5;
}
.badge-force-reset {
    background: var(--danger);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.rollback-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.rollback-banner .btn {
    flex-shrink: 0;
}
.text-gray-500 {
    color: var(--gray-500);
}
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
.transition-result-grid .result-item:last-child {
    border-bottom: none;
}

/* ===== transition compare ===== */
.compare-table th {
    font-size: 0.8rem;
}
.compare-table td {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
}
.compare-table td.text-center {
    text-align: center;
}
.compare-row-unchanged td {
    color: var(--gray-500);
}
.compare-row-new td {
    background: #f0fff4;
}
.compare-row-removed td {
    background: #fff5f5;
}
.compare-row-teacher td {
    background: #fff8e1;
}
.compare-row-hours td {
    background: #f0f8ff;
}
.compare-row-both td {
    background: #fef0f0;
}
.compare-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.compare-filter-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}
.compare-filter-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.skip-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.skip-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ===== audit hours ===== */
.audit-section {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
}
.audit-header h3 {
    margin: 0 0 0.5rem 0;
}
.audit-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.audit-stat {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
}
.audit-stat-total { background: #e8e8e8; }
.audit-stat-full { background: #d4edda; color: #155724; }
.audit-stat-short { background: #fff3cd; color: #856404; }
.audit-stat-none { background: #f8d7da; color: #721c24; }
.audit-group {
    margin-bottom: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.audit-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--gray-50);
    font-size: 0.9rem;
    user-select: none;
}
.audit-group-body {
    padding: 0;
}
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.audit-table th {
    background: var(--gray-100);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}
.audit-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--gray-100);
}
.audit-table td.text-center {
    text-align: center;
}
.audit-row-full td { color: var(--gray-500); }
.audit-row-short td { background: #fffcf0; }
.audit-row-none td { background: #fafafa; color: var(--gray-400); }
.audit-bar {
    width: 100px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}
.audit-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.btn-fill {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-fill:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-fill.btn-success {
    background: var(--success);
}
.btn-fill-all {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
.btn-fill-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.audit-filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    align-items: center;
}
.audit-filter-select, .audit-filter-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}
.audit-filter-input {
    min-width: 160px;
}

/* ===== bulk add classes ===== */
.bulk-add-form {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--gray-50);
}
.bulk-add-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.bulk-add-row label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}
.bulk-add-row select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}
.bulk-letters-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}
.bulk-letters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}
.bulk-letter-cb {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.85rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    background: white;
}
.bulk-letter-cb:hover {
    background: var(--gray-100);
}
.bulk-letter-cb input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

/* ===== teacherAssignments matrix ===== */
.parallel-matrix-table {
    border-collapse: collapse;
    width: auto;
    min-width: 100%;
    font-size: 0.85rem;
}
.parallel-matrix-table th,
.parallel-matrix-table td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-200);
    text-align: center;
    white-space: nowrap;
}
.parallel-matrix-table thead th {
    background: var(--gray-50);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 3;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    height: 160px;
    white-space: nowrap;
    font-size: 0.75rem;
    vertical-align: bottom;
    padding: 0.25rem 0.35rem;
    min-width: 30px;
    max-width: 30px;
}
.parallel-matrix-table thead th.matrix-sticky {
    writing-mode: horizontal-tb;
    transform: none;
    height: auto;
    min-width: auto;
    max-width: none;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}
.parallel-matrix-table thead th .split-badge {
    display: block;
    font-size: 0.55rem;
    line-height: 1;
    margin-top: 2px;
}
.parallel-matrix-table .matrix-class-name {
    font-weight: 400;
    font-size: 0.8rem;
    background: var(--gray-100);
}
.matrix-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--gray-50);
}
.parallel-matrix-table .matrix-sticky {
    text-align: left !important;
    font-weight: 500;
    white-space: nowrap;
}
.parallel-matrix-table tbody .matrix-sticky {
    background: white;
}
.parallel-matrix-table tbody tr:hover .matrix-sticky {
    background: var(--gray-50);
}
.parallel-matrix-table td.cell-available {
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
}
.parallel-matrix-table .level-group-header td {
    background: var(--primary-light);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-dark);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.parallel-matrix-table .level-group-header.has-selections td {
    background: #fff3cd !important;
    color: #856404 !important;
}
.toggle-icon {
    display: inline-block;
    width: 1rem;
    font-size: 0.75rem;
}
.building-breakdown {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}
.parallel-matrix-table td.cell-apply {
    cursor: pointer;
    user-select: none;
}
.parallel-matrix-table td.cell-apply:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}
.parallel-matrix-table .status-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin: 0 2px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    transition: all 0.15s ease;
}
.parallel-matrix-table .status-marker.free {
    background: var(--gray-200);
    color: var(--gray-400);
    border: 2px solid var(--gray-300);
}
.parallel-matrix-table .status-marker.partial {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffe69c;
}
.parallel-matrix-table .status-marker.assigned {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}
.parallel-matrix-table .status-marker.selected.partial {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.parallel-matrix-table .status-marker.selected {
    box-shadow: 0 0 0 2px var(--primary), 0 0 0 4px white;
    transform: scale(1.15);
    font-weight: 900;
}
.parallel-matrix-table .status-marker.selected.free {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.parallel-matrix-table .status-marker.selected.assigned {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.teacher-apply-panel {
    background: white;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.teacher-apply-panel .apply-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}
.teacher-apply-btn-active {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: white !important;
}

/* ===== Inline style replacements ===== */
.curriculum-assign-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 150px;
    text-align: center;
}
.stat-card strong {
    font-size: 1.5rem;
    display: block;
    color: var(--primary);
}
.stat-card span {
    font-size: 0.9rem;
    color: var(--gray-600);
}
.vanga-input-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.vanga-input-panel > * {
    flex: 1;
    min-width: 300px;
}
.text-white-80 {
    color: rgba(255, 255, 255, 0.8);
}
.assign-curriculum-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
}
.curriculum-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--gray-800);
}
.curriculum-card-meta {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    min-height: 2.4em;
}
.curriculum-card-id {
    font-size: 0.8rem;
    color: var(--gray-600);
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(2px);
}
.curriculum-card-status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-600);
}
.curriculum-legend span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}
.curriculum-legend .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 0;
    border: 1px solid var(--gray-300);
}
.curriculum-legend .legend-color.gray {
    background: #f8f9fa;
}
.curriculum-legend .legend-color.green {
    background: #d4edda;
    border-color: var(--success);
}
.curriculum-legend .legend-color.orange {
    background: #ffe5b4;
    border-color: #fd7e14;
}
.curriculum-card.curriculum-card--none,
.curriculum-card.curriculum-card--assigned,
.curriculum-card.curriculum-card--deleted {
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05);
}
.vanga-input-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
}
.vanga-compare-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}
.vanga-compare-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.curriculum-grand-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .curriculum-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
  }
  .curriculum-stats {
    width: 100%;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.1rem;
  }
  .stat-value {
    font-size: 1.1rem;
  }
  .stat-label {
    font-size: 0.55rem;
  }
  .curriculum-title h3 {
    font-size: 1rem;
  }
  .curriculum-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .card-actions {
    justify-content: flex-end;
  }
}

/* ===== Unload ===== */
.unload-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.375rem;
}
.unload-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    position: relative;
}
.unload-item.pending-remove .unload-card {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
    background: #fef2f2;
}
.unload-item.pending-transfer .unload-card {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: #eef2ff;
}
.unload-card {
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    padding: 0.375rem 0.625rem;
    text-align: center;
    min-width: 60px;
    border: 1px solid var(--gray-200);
    transition: background 0.2s, border-color 0.2s;
}
.unload-card.status-full {
    background: #d4edda;
    border-color: #c3e6cb;
}
.unload-card.status-none {
    background: var(--gray-200);
    border-color: var(--gray-400);
}
.unload-card-class {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
}
.unload-card-hours {
    font-size: 0.8rem;
    color: var(--gray-600);
}
.unload-item-actions {
    display: flex;
    gap: 0.125rem;
    margin-top: 0.25rem;
    align-items: center;
}
.unload-pending-label {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.label-remove { color: var(--danger); }
.label-transfer { color: var(--primary); }
.btn-unload-remove,
.btn-unload-transfer {
    width: 26px;
    height: 26px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}
.btn-unload-remove:hover { background: #fee2e2; border-color: var(--danger); }
.btn-unload-transfer:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-unload-remove.active { background: var(--danger); color: white; border-color: var(--danger); }
.unload-summary-table { width: 100%; border-collapse: collapse; }
.unload-summary-table th,
.unload-summary-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.unload-summary-table th { background: var(--gray-100); font-weight: 600; font-size: 0.85rem; }

/* ===== Unload level sections ===== */
.unload-level-section {
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.unload-level-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
}
.unload-level-header strong {
    flex: 1;
}
.btn-unload-level-remove,
.btn-unload-level-transfer {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.btn-unload-level-remove:hover { background: rgba(239,68,68,0.6); }
.btn-unload-level-transfer:hover { background: rgba(255,255,255,0.3); }

/* ===== Unload subject group ===== */
.unload-subject-group {
    margin: 0.25rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}
.unload-subject-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;
}
.unload-subject-header strong {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: var(--gray-800);
}
.unload-subject-header .btn-unload-subject-remove,
.unload-subject-header .btn-unload-subject-transfer {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    white-space: nowrap;
}
.unload-subject-header .btn-unload-subject-remove:hover {
    background: #fee2e2;
    border-color: var(--danger);
    color: var(--danger);
}
.unload-subject-header .btn-unload-subject-transfer:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.unload-subject-header .btn-unload-subject-remove:disabled,
.unload-subject-header .btn-unload-subject-transfer:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== Unload entry items (checkbox) ===== */
.unload-entry-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    margin: 0.125rem 0;
    transition: background 0.2s;
}
.unload-entry-item:hover {
    background: var(--gray-50);
}
.unload-entry-item.pending-remove {
    background: #fef2f2;
    border-color: var(--danger);
}
.unload-entry-item.pending-transfer {
    background: #eef2ff;
    border-color: var(--primary);
}
.unload-entry-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.unload-entry-label input[type="checkbox"] {
    flex-shrink: 0;
}
.unload-entry-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}
.unload-entry-class {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    white-space: nowrap;
}
.unload-entry-teacher {
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
}
.unload-entry-hours {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 600;
    white-space: nowrap;
}

/* ===== Unload entry action buttons ===== */
.entry-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: auto;
}
.btn-entry-remove,
.btn-entry-transfer {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    color: var(--gray-700);
}
.btn-entry-remove:hover {
    background: #fee2e2;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-entry-transfer:hover {
    background: #eef2ff;
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== Search input ===== */
.unload-search-input {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    min-width: 200px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.unload-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* ===== Sticky footer ===== */
.unload-sticky-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 2px solid var(--primary);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    margin-top: 1.5rem;
    border-radius: var(--border-radius);
}
.unload-footer-info {
    font-size: 0.9rem;
    color: var(--gray-600);
}
.unload-footer-info strong {
    color: var(--gray-800);
}

/* ===== Building label ===== */
.unload-level-section .building-breakdown {
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 0.25rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    font-weight: 500;
}

/* ===== Тарификация ===== */
.tarification-exclude-panel {
    width: 100%;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    border: 1px solid var(--gray-200);
}
.tarification-exclude-panel label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.tarification-exclude-panel label:hover {
    background: var(--gray-200);
}
.tarification-exclude-panel input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tarification-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tarification-toolbar .form-group {
    margin-bottom: 0;
    min-width: 200px;
}
.tarification-toolbar label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}
.tarification-toolbar select,
.tarification-toolbar input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
}

.tarification-forms {
    display: flex;
    flex-direction: row;
    gap: 0;
    width: 100%;
}
.tarification-copy {
    width: 50%;
    padding: 15mm 10mm;
    box-sizing: border-box;
    font-size: 10pt;
    line-height: 1.4;
    font-family: 'Times New Roman', Times, serif;
}
.tarification-copy:first-child {
    border-right: 1px dashed #999;
}
.tarification-copy.single {
    width: 100%;
    padding: 15mm 20mm;
}
.copy-label {
    text-align: center;
    font-size: 9pt;
    color: #999;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
}
.tarification-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.tarification-header h2 {
    font-size: 14pt;
    font-weight: 700;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
}
.tarification-header p {
    font-size: 11pt;
    margin: 0;
}
.tarification-body {
    margin-bottom: 1rem;
}
.tarification-body p {
    margin: 0.5rem 0;
    font-size: 10pt;
}
.tarification-body p.centered {
    text-align: center;
}
.tarification-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem auto;
    font-size: 9pt;
}
.tarification-table th,
.tarification-table td {
    border: 1px solid #000;
    padding: 3px 5px;
    text-align: center;
    vertical-align: middle;
}
.tarification-table th {
    font-weight: 700;
    background: #f0f0f0;
    font-size: 8pt;
}
.tarification-table .level-header {
    font-weight: 700;
    text-align: left;
    padding: 4px 8px;
    background: #e8e8e8;
}
.tarification-table .total-row td {
    font-weight: 700;
    border-top: 2px solid #000;
}
.tarification-signature {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tarification-signature .sig-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 10pt;
}
.tarification-signature .sig-line .sig-place {
    flex: 1;
    border-bottom: 1px solid #000;
    min-width: 120px;
    height: 1.2em;
}
.tarification-signature .sig-label {
    white-space: nowrap;
}

@page {
    margin: 10mm;
}
@media print {
    body {
        background: white !important;
    }
    .app-container {
        background: white !important;
        box-shadow: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: auto !important;
    }
    .sidebar,
    .content-header,
    .tarification-toolbar,
    .tarification-exclude-panel,
    .nav-btn,
    .btn,
    .filter-bar {
        display: none !important;
    }
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        flex: none !important;
        width: 100% !important;
    }
    .content-body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }
    .tarification-forms {
        display: flex;
        flex-direction: row;
        width: 100%;
    }
    .tarification-copy {
        width: 50%;
        padding: 5mm;
        box-sizing: border-box;
    }
    .tarification-copy.single {
        width: 100%;
        padding: 8mm 12mm;
    }
    .tarification-copy:first-child {
        border-right: 2px dashed #999;
    }
    .tarification-copy.single:first-child {
        border-right: none;
    }
    .tarification-copy:first-child {
        border-right: 2px dashed #999;
    }
    .tarification-forms {
        font-size: 8pt;
    }
    .tarification-copy {
        padding: 5mm;
    }
    .tarification-header h2 {
        font-size: 11pt;
    }
    .tarification-header p {
        font-size: 9pt;
    }
    .tarification-body p {
        font-size: 8pt;
        margin: 0.3rem 0;
    }
.tarification-table td.empty-cell {
    border: 1px dashed #aaa !important;
}
    .tarification-table {
        width: 100%;
        font-size: 7pt;
    }
    .tarification-table th,
    .tarification-table td {
        padding: 1px 2px;
    }
    .tarification-table th {
        font-size: 6.5pt;
    }
    .tarification-table .level-header {
        font-size: 7pt;
        padding: 2px 6px;
    }
    .tarification-signature {
        margin-top: 1rem;
        gap: 0.4rem;
    }
    .tarification-signature .sig-line {
        font-size: 8pt;
    }
}

/* ===== Dashboard ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: var(--transition);
}
.stat-card:hover {
    box-shadow: var(--box-shadow);
    transform: translateY(-2px);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-teachers { background: #eef2ff; color: #4361ee; }
.stat-icon-classes { background: #fef3c7; color: #d97706; }
.stat-icon-subjects { background: #d1fae5; color: #059669; }
.stat-icon-assignments { background: #ede9fe; color: #7c3aed; }
.stat-icon-buildings { background: #fce7f3; color: #db2777; }
.stat-icon-history { background: #e0f2fe; color: #0284c7; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-label { font-size: 0.875rem; color: var(--gray-500); font-weight: 500; }
.stat-sub { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dashboard-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Load table — modern accordion */
.load-table {
  font-size: 0.9rem;
}
.load-th {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0.5rem;
  align-items: center;
}
.load-th-label {
  text-align: left;
}

.load-group {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
  background: white;
}
.load-group:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.load-group-btn {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: none;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: right;
  align-items: center;
  transition: background 0.15s;
}
.load-group-btn:hover {
  background: var(--gray-100);
}
.load-group-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}
.load-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--gray-400);
}
.collapsed > .load-group-btn .load-chevron,
.collapsed > .load-subgroup-btn .load-chevron {
  transform: rotate(-90deg);
}
.load-group-body {
  border-top: 1px solid var(--gray-100);
  overflow: hidden;
}
.collapsed > .load-group-body,
.collapsed > .load-edu-body,
.collapsed > .load-subgroup-body {
  display: none;
}

.load-edu-group {
  border-top: 1px solid var(--gray-100);
}
.load-edu-btn {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 1rem;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  text-align: right;
  align-items: center;
  transition: background 0.15s;
}
.load-edu-btn:hover {
  background: var(--gray-50);
}
.load-edu-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}
.load-edu-body {
  border-top: 1px solid var(--gray-200);
}
.collapsed > .load-edu-btn .load-chevron {
  transform: rotate(-90deg);
}

.load-subgroup-btn {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2rem;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: right;
  align-items: center;
  transition: background 0.15s;
}
.load-subgroup-btn:hover {
  background: var(--gray-50);
}
.load-subgroup-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}
.load-subgroup-body {
  border-top: 1px solid var(--gray-100);
}

.load-row {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  padding: 0.4rem 0.85rem 0.4rem 3.5rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  align-items: center;
  transition: background 0.1s;
}
.load-row:nth-child(even) {
  background: var(--gray-50);
}
.load-row:hover {
  background: var(--primary-light);
}
.load-row-label {
  text-align: left;
}

.load-cell {
  text-align: right;
  min-width: 55px;
  white-space: nowrap;
}
.load-cell--bold {
  font-weight: 700;
  color: var(--gray-800);
}
.load-cell--students-header {
  color: #7c3aed;
}
.load-cell-vacant {
  color: #d97706;
}
.load-cell-remaining {
  color: var(--primary);
  font-weight: 600;
}

.load-total {
  display: grid;
  grid-template-columns: 1fr repeat(5, 75px);
  gap: 0.3rem;
  padding: 0.75rem 0.85rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--gray-200);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  align-items: center;
}
.load-total-label {
  text-align: left;
}

/* Test results card */
.test-results-card { margin-top: 1rem; }
.test-results-card h3 { margin-bottom: 0.75rem; }
.test-results { display: flex; flex-direction: column; gap: 0.4rem; }
.test-suite { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; padding: 0.3rem 0; }
.test-suite-icon { flex-shrink: 0; }
.test-suite-name { flex: 1; color: var(--gray-700); }
.test-suite-count { font-weight: 600; color: var(--gray-500); min-width: 3rem; text-align: right; }
.test-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--gray-200); font-weight: 600; color: var(--primary); }
.btn-test-run { font-size: 0.8rem; padding: 0.3rem 0.8rem; }

/* Recent changes */
.changes-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.changes-header h3 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.changes-user { font-size: 0.8rem; color: var(--gray-400); background: var(--gray-100); padding: 0.2rem 0.6rem; border-radius: 10px; }
.recent-changes { display: flex; flex-direction: column; gap: 0.25rem; max-height: 1000px; flex: 1; overflow-y: auto; }
.change-item { display: grid; grid-template-columns: 85px 1fr auto; gap: 0.5rem; align-items: center; padding: 0.4rem 0.6rem; border-radius: var(--border-radius-sm); font-size: 0.82rem; transition: var(--transition); }
.change-item:hover { background: var(--gray-50); }
.change-date { color: var(--gray-400); font-size: 0.78rem; }
.change-desc { color: var(--gray-700); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-hours { color: var(--gray-500); font-weight: 500; white-space: nowrap; font-size: 0.82rem; }

/* ===== snapshots ===== */
.snapshots-page { }
.snapshots-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.snapshot-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.snapshot-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    background: var(--gray-50);
    user-select: none;
}
.snapshot-card-header:hover {
    background: var(--gray-100);
}
.snapshot-card-header .toggle-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.snapshot-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.snapshot-card-stats {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--gray-500);
}
.snapshot-card-body {
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem;
}
.snapshot-detail h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.snapshot-parallel {
    margin-bottom: 0.5rem;
}
.snapshot-parallel ul {
    margin: 0.2rem 0 0 1.2rem;
    padding: 0;
    font-size: 0.85rem;
    color: var(--gray-700);
}
.snapshot-parallel li {
    margin-bottom: 0.15rem;
}

/* ===== snapshot tabs ===== */
.snapshot-summary {
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.snapshot-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 0.5rem;
}
.stab {
    padding: 0.4rem 0.8rem;
    border: none;
    background: var(--gray-50);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-radius: 4px 4px 0 0;
    margin-right: 2px;
    transition: background 0.15s;
}
.stab:hover { background: var(--gray-100); }
.stab.active {
    background: var(--primary);
    color: white;
}
.stab-pane {
    padding: 0;
}
.stab-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.stab-filter {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.82rem;
    background: white;
}
.stab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.stab-table th {
    background: var(--gray-100);
    padding: 0.35rem 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.stab-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.stab-table td.text-right { text-align: right; }
.stab-table td.text-center { text-align: center; }
.stab-table tbody tr:hover { background: var(--gray-50); }

/* ===== snapshot card ===== */
.compare-check-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin-right: 0.5rem;
}
.compare-check-label input[type="checkbox"] {
    width: 14px; height: 14px; accent-color: var(--primary);
}
.snapshot-compare-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--primary-light, #e3f2fd);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* ===== compare result ===== */
.compare-result h3 { margin: 0 0 0.5rem 0; }
.compare-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}
.diff-added td { background: #d4edda !important; }
.diff-removed td { background: #f8d7da !important; }
.diff-changed td { background: #fff3cd !important; }

.snapshot-card-name {
    font-weight: 600;
    color: var(--primary);
}

/* ===== snap curriculum cards ===== */
.snap-cur-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.snap-cur-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.snap-cur-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    background: var(--gray-50);
    font-size: 0.88rem;
}
.snap-cur-stats {
    font-size: 0.78rem;
    color: var(--gray-500);
    white-space: nowrap;
}
.snap-cur-body {
    padding: 0.4rem 0.5rem;
}
.snap-cur-group {
    margin-bottom: 0.35rem;
}
.snap-cur-group-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.15rem;
}

/* ===== homeroom info ===== */
.hr-class-tag {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    margin: 0.15rem;
    background: var(--primary);
    color: white;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
}
.homeroom-section {
    margin-top: 0.75rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
}
.homeroom-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.2rem 0.5rem;
    margin: 0 0 0.5rem 0.5rem;
    font-size: 0.8rem;
}

/* ===== load return (Возврат нагрузки) ===== */
.load-return-page { padding: 0; }
.lr-summary {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.lr-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
    font-size: 1rem;
}
.lr-filters {
    margin-bottom: 1.25rem;
}
.lr-teachers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.lr-teacher-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.lr-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.lr-teacher-header:hover {
    background: var(--gray-100);
}
.lr-teacher-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.lr-teacher-info strong {
    font-size: 0.95rem;
    color: var(--gray-800);
}
.lr-teacher-stats {
    font-size: 0.82rem;
    color: var(--gray-600);
}
.lr-expand-icon {
    font-size: 0.75rem;
    color: var(--gray-400);
    flex-shrink: 0;
    margin-left: 1rem;
}
.lr-teacher-body {
    border-top: 1px solid var(--gray-200);
    padding: 0;
    overflow-x: auto;
}
.lr-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.lr-items-table th {
    background: var(--gray-100);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
.lr-items-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.lr-items-table tbody tr:hover {
    background: var(--gray-50);
}
.lr-item-row.status-free_full td {
    background: rgba(40, 167, 69, 0.05);
}
.lr-item-row.status-free_partial td {
    background: rgba(255, 193, 7, 0.05);
}
.lr-item-row.status-occupied td {
    background: rgba(108, 117, 125, 0.05);
}
.lr-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.lr-badge-success {
    background: #d4edda;
    color: #155724;
}
.lr-badge-warning {
    background: #fff3cd;
    color: #856404;
}
.lr-badge-danger {
    background: #f8d7da;
    color: #721c24;
}
.lr-blocked-tooltip {
    cursor: help;
    font-size: 1rem;
}
.lr-blocked-report {
    margin-top: 2rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.lr-blocked-report h3 {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
    font-size: 1rem;
}
.lr-blocked-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.lr-blocked-table th {
    background: var(--gray-100);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.lr-blocked-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: top;
}
.lr-blocked-table tbody tr:hover {
    background: var(--gray-50);
}
.text-small {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.stat-success .stat-value {
    color: #28a745;
}
.stat-warning .stat-value {
    color: #dc3545;
}
.lr-current-teachers {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.lr-teacher-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray-700);
    white-space: nowrap;
}
.lr-block-reasons {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.lr-block-reason {
    font-size: 0.78rem;
    color: var(--gray-600);
    line-height: 1.3;
}

/* Return All button bar */
.lr-return-all-bar {
    margin-bottom: 1rem;
}

/* Return All Modal */
.lr-return-all-summary {
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--primary);
}

.lr-return-all-list {
    max-height: 50vh;
    overflow-y: auto;
}

.lr-return-all-group {
    margin-bottom: 1.25rem;
}

.lr-return-all-group:last-child {
    margin-bottom: 0;
}

.lr-return-all-teacher {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.5rem;
}

.lr-return-all-parallel {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.25rem 0 0.25rem 1rem;
}

.lr-return-all-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.375rem 0 0.375rem 2rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
}

.lr-return-all-row:last-child {
    border-bottom: none;
}

.lr-return-all-row .name {
    color: var(--gray-700);
    min-width: 60px;
}

.lr-return-all-row .subject {
    color: var(--gray-600);
    flex: 1;
}

.lr-return-all-row .hours {
    color: var(--gray-800);
    font-weight: 600;
    white-space: nowrap;
}

/* ===== Комплектование (Staffing) ===== */

.staffing-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.staffing-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.staffing-teacher-select {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-900);
    width: 100%;
    cursor: pointer;
    transition: border-color 0.15s;
}

.staffing-teacher-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.staffing-filters {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

/* === Edit Bar === */

.staffing-edit-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.staffing-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: color 0.15s;
}

.staffing-toggle-label.active {
    color: var(--primary);
    font-weight: 500;
}

.staffing-toggle-label input[type="checkbox"] {
    display: none;
}

.staffing-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--gray-300);
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.staffing-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.staffing-toggle-label.active .staffing-toggle-switch {
    background: var(--primary);
}

.staffing-toggle-label.active .staffing-toggle-switch::after {
    transform: translateX(16px);
}

.staffing-edit-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.staffing-selection-count {
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.staffing-selection-count strong {
    color: var(--gray-900);
}

/* === Content sections === */

.staffing-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.staffing-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.staffing-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.7rem 1rem;
    margin: 0;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

/* === Level block (collapsible) === */

.staffing-level-block {
    border-bottom: 1px solid var(--gray-100);
}

.staffing-level-block:last-child {
    border-bottom: none;
}

.staffing-level-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.staffing-level-header:hover {
    background: var(--gray-50);
}

.staffing-level-toggle {
    font-size: 0.75rem;
    color: var(--gray-500);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.staffing-level-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.staffing-level-count {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-left: auto;
    font-weight: 500;
}

.staffing-level-body {
    padding: 0 0.5rem 0.5rem;
    overflow-x: auto;
    position: relative;
    background:
        linear-gradient(to right, transparent 97%, var(--gray-100)) local,
        linear-gradient(to right, var(--white), transparent) 0 0 / 20px 100% local,
        linear-gradient(to right, transparent, var(--gray-100)) 100% 0 / 40px 100% scroll;
    background-repeat: no-repeat;
}

/* === Workload cards (like teacherAssignments) === */

.staffing-workload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
}

.staffing-workload-grid .subject-class-card {
    background: var(--white);
    border-radius: var(--border-radius-sm);
    padding: 0.85rem;
    width: 200px;
    transition: all 0.2s ease;
    border: 2px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.staffing-workload-grid .subject-class-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--gray-400);
}

.staffing-workload-grid .subject-class-card.status-none {
    background: var(--white);
    border-color: var(--gray-300);
}

.staffing-workload-grid .subject-class-card.status-partial {
    background: #fef9c3;
    border-color: #eab308;
}

.staffing-workload-grid .subject-class-card.status-full {
    background: #dcfce7;
    border-color: #22c55e;
}

.staffing-workload-grid .card-class {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.15rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.staffing-workload-grid .card-class .card-meta-badge {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--gray-600);
    background: var(--gray-200);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    white-space: nowrap;
}

.staffing-workload-grid .card-subject {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.staffing-workload-grid .card-hours {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}

.staffing-workload-grid .card-status {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.staffing-workload-grid .subject-class-card.card-vacant {
    border-color: var(--danger);
    border-width: 1.5px;
}

/* === Matrix table === */

.staffing-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

.staffing-matrix thead th {
    padding: 0.65rem 0.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-800);
    border-bottom: 3px solid var(--gray-300);
    white-space: nowrap;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
}

.staffing-matrix-th-corner {
    text-align: left !important;
    min-width: 180px;
    padding: 0.65rem 0.75rem !important;
}

.staffing-matrix thead th:not(.staffing-matrix-th-corner) {
    min-width: 80px;
    max-width: 120px;
    padding: 0.65rem 0.35rem;
}

.staffing-matrix-subject {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    border-right: 2px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-200);
    white-space: normal;
    word-break: break-word;
    color: var(--gray-900);
    background: var(--white);
    position: sticky;
    left: 0;
    z-index: 2;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.staffing-matrix tbody tr:hover .staffing-matrix-subject {
    background: var(--gray-50);
}

/* === Cells === */

.staffing-cell {
    text-align: center;
    padding: 0.5rem 0.35rem;
    border: 1px solid var(--gray-200);
    transition: all 0.12s;
    vertical-align: middle;
    font-size: 0.9rem;
    background: var(--white);
}

.staffing-cell.disabled {
    color: var(--gray-400);
    font-size: 0.85rem;
    background: var(--gray-50);
}

.staffing-cell[data-key]:not(.disabled):hover {
    background: #eef2ff;
}

/* workload cells */
.staffing-cell-workload {
    cursor: default;
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.staffing-cell-workload.taken {
    color: var(--gray-800);
    font-weight: 600;
    background: #dcfce7;
    border-color: #86efac;
}

.staffing-cell-workload.split {
    padding: 0.15rem 0.1rem;
}

/* available cells - clickable */
.staffing-cell[data-key]:not(.disabled):not(.staffing-cell-workload) {
    cursor: pointer;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
}

.staffing-cell[data-key]:not(.disabled):not(.staffing-cell-workload):hover {
    background: #dcfce7;
    border-color: #86efac;
}

.staffing-cell.selected:not(.disabled) {
    background: #1d4ed8;
    border: 2px solid #1e3a8a;
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #60a5fa;
}

.staffing-cell.selected:not(.disabled):hover {
    background: #1e40af;
}

.staffing-cell.selected:not(.disabled) .staffing-cell-single {
    color: #000000;
    font-size: 1.1rem;
}

.staffing-cell.selected:not(.disabled) .staffing-cell-info {
    color: #1e293b;
    font-size: 0.85rem;
}

.staffing-cell.vacant-avail:not(.disabled) {
    background: #fef2f2;
    border: 2px dashed #f87171;
}

.staffing-cell.vacant-avail[data-key]:not(.disabled):hover {
    background: #fecaca;
    border-color: #ef4444;
}

.staffing-cell.vacant-avail.selected:not(.disabled) {
    background: #dc2626;
    border: 2px solid #b91c1c;
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #fca5a5;
}

.staffing-cell.vacant-avail.selected:not(.disabled):hover {
    background: #b91c1c;
}

.staffing-cell.vacant-avail.selected:not(.disabled) .staffing-cell-single {
    color: #000000;
    font-size: 1.1rem;
}

.staffing-cell.vacant-avail.selected:not(.disabled) .staffing-cell-info {
    color: #1e293b;
    font-size: 0.85rem;
}

.staffing-cell.split.selected:not(.disabled) .staffing-cell-halves {
    border-color: #1e3a8a;
}

.staffing-cell.vacant-avail.split.selected:not(.disabled) .staffing-cell-halves {
    border-color: #b91c1c;
}

/* taken cells with teacher info */
.staffing-cell.cell-taken {
    background: var(--gray-50);
    padding: 0.35rem 0.3rem;
    vertical-align: top;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.staffing-cell.cell-taken:hover {
    background: #eef2ff;
    border-color: var(--primary);
}

.staffing-cell.cell-taken-vacant {
    border-left: 4px solid var(--danger);
}

.staffing-cell.cell-taken .cell-teachers-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.staffing-cell.cell-taken .cell-teacher-row {
    font-size: 0.8rem;
    color: var(--gray-700);
    line-height: 1.35;
    text-align: center;
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.staffing-cell.cell-taken .cell-teacher-hours {
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
}

.staffing-cell-info {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
    line-height: 1.2;
}

.staffing-cell-single {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--primary);
    font-weight: 700;
}

/* === Split cell halves === */

.staffing-cell-halves {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-50);
    min-height: 32px;
}

.staffing-half {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.12s;
    padding: 4px 2px;
    min-height: 28px;
}

.staffing-half.clickable {
    cursor: pointer;
}

.staffing-half.clickable:hover {
    background: var(--gray-200);
}

.staffing-half.selected {
    background: #1d4ed8;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 700;
}

.staffing-half.selected:hover {
    background: #1e40af;
}

.staffing-half.half-taken {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.staffing-half.half-empty {
    background: var(--gray-50);
    color: var(--gray-400);
}

.staffing-half-divider {
    width: 2px;
    background: var(--gray-300);
    flex-shrink: 0;
}

.staffing-cell.split.selected .staffing-cell-halves {
    border-color: var(--primary);
}

/* === Teacher info === */

.staffing-teacher-info {
    margin-bottom: 0.6rem;
}

.staffing-teacher-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0;
}

.staffing-teacher-info-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.staffing-teacher-info-details {
    font-size: 0.85rem;
    color: var(--gray-600);
    display: flex;
    gap: 1.5rem;
    margin-top: 0.2rem;
}

.staffing-teacher-info-details span {
    white-space: nowrap;
}

.staffing-teacher-info-details strong {
    color: var(--gray-800);
}

.staffing-dashboard-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* === Dashboard === */

.staffing-dashboard {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
}

.staffing-dashboard-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.staffing-dash-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.staffing-dash-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.staffing-dash-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.staffing-dash-stat.editing-stat .staffing-dash-value {
    color: var(--primary);
}

.staffing-dash-stat.total-stat .staffing-dash-value {
    color: #059669;
}

.staffing-dash-stat.over-limit .staffing-dash-label {
    color: var(--danger);
}

.staffing-dash-stat.over-limit .staffing-dash-value {
    color: var(--danger);
    font-weight: 800;
}

.staffing-dashboard-vacant {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #b45309;
    font-weight: 500;
}

.staffing-dashboard-excess {
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.staffing-excess-bar {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.staffing-excess-fill {
    height: 100%;
    background: var(--gray-500);
    border-radius: 4px;
    transition: width 0.3s;
}

.staffing-dashboard-excess.excess-warn .staffing-excess-fill {
    background: #eab308;
}

.staffing-dashboard-excess.excess-warn .staffing-excess-text {
    color: #a16207;
    font-weight: 600;
}

.staffing-dashboard-excess.excess-high .staffing-excess-fill {
    background: var(--danger);
}

.staffing-dashboard-excess.excess-high .staffing-excess-text {
    color: var(--danger);
    font-weight: 700;
}

/* === Staffing assignment modal === */

.staffing-assignment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.4rem;
    transition: background 0.15s;
}

.staffing-assignment-item:hover {
    background: var(--gray-100);
}

.staffing-assignment-item .assignment-teacher {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
}

.staffing-assignment-item .hours-input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-size: 0.9rem;
}

.staffing-assignment-item .hours-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.staffing-assignment-item.readonly {
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.staffing-assignment-item .assignment-hours-readonly {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.staffing-assignment-item .btn-delete {
    flex-shrink: 0;
}

.staffing-vacant-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.staffing-vacant-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.replace-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: transparent;
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius-sm);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.replace-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.staffing-workload-grid .subject-class-card[data-class-id] {
    cursor: pointer;
}

.staffing-workload-grid .subject-class-card[data-class-id]:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

/* ===== Analysis ===== */
.analysis-container {
    padding: 1rem;
}
.analysis-summary {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.analysis-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
}
.analysis-summary .summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.analysis-summary .stat-card {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
}
.analysis-summary .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.analysis-summary .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
}
.timeline-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.timeline-date-group {
    margin-bottom: 2rem;
}
.timeline-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}
.timeline-date-header h4 {
    margin: 0;
    color: var(--gray-700);
    font-weight: 600;
}
.date-badge {
    background: var(--gray-200);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-600);
}
.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}
.timeline-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.timeline-item.action-create {
    border-left-color: #28a745;
}
.timeline-item.action-update {
    border-left-color: #ffc107;
}
.timeline-item.action-delete {
    border-left-color: #dc3545;
}
.item-time {
    min-width: 80px;
    font-size: 0.875rem;
    color: var(--gray-500);
    font-family: monospace;
}
.item-content {
    flex: 1;
}
.item-main {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.item-teacher {
    font-weight: 600;
    color: var(--gray-800);
}
.item-subject {
    color: var(--gray-700);
}
.item-class {
    color: var(--gray-600);
}
.item-hours {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.old-hours {
    color: var(--gray-500);
    text-decoration: line-through;
}
.arrow {
    color: var(--gray-400);
}
.new-hours {
    font-weight: 600;
    color: var(--gray-800);
}
.diff {
    font-weight: 600;
    margin-left: 0.5rem;
}
.diff.positive {
    color: #28a745;
}
.diff.negative {
    color: #dc3545;
}
.item-action-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-200);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.summary-table-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-x: auto;
}
.summary-table-container h3 {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
}
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.summary-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}
.summary-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.summary-table tbody tr:hover td {
    background: var(--gray-50);
}
.summary-table .hours-cell {
    font-family: monospace;
    font-weight: 600;
}
.action-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.action-badge.action-create {
    background: #d4edda;
    color: #155724;
}
.action-badge.action-update {
    background: #fff3cd;
    color: #856404;
}
.action-badge.action-delete {
    background: #f8d7da;
    color: #721c24;
}
.table-note {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    padding: 1rem;
}
.summary-table .positive {
    color: #28a745;
    font-weight: 600;
}
.summary-table .negative {
    color: #dc3545;
    font-weight: 600;
}
@media (max-width: 768px) {
    .period-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .item-main {
        flex-direction: column;
        gap: 0.25rem;
    }
    .timeline-item {
        flex-direction: column;
    }
    .item-time {
        min-width: auto;
    }
    .summary-table {
        font-size: 0.8rem;
    }
    .summary-table th,
    .summary-table td {
        padding: 0.5rem;
    }
}

/* ===== Teacher Assignments ===== */
.teacher-section {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.teacher-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.teacher-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
}
.teacher-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.teacher-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.total-hours {
    font-weight: 600;
    color: var(--primary);
}
.teacher-classes {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.teacher-classes .subject-class-card {
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.teacher-classes .subject-class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.teacher-classes .subject-class-card.status-none {
    background: #f8f9fa;
    border-color: var(--gray-400);
}
.teacher-classes .subject-class-card.status-partial {
    background: #fff3cd;
    border-color: #ffc107;
}
.teacher-classes .subject-class-card.status-full {
    background: #d4edda;
    border-color: #28a745;
}
.teacher-classes .card-class {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
}
.teacher-classes .card-subject {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}
.teacher-classes .card-hours {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}
.teacher-classes .card-status {
    font-size: 0.8rem;
    color: var(--gray-600);
}
.teacher-classes .card-teachers {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
}
.teacher-classes .card-teacher {
    color: var(--gray-600);
    white-space: nowrap;
}
.teacher-section.teacher-load-low {
    background-color: #fee2e2;
}
.teacher-section.teacher-load-normal {
    background-color: #d4edda;
}
.teacher-section.teacher-load-high {
    background-color: #fff3cd;
}
.teacher-section.teacher-load-very-high {
    background-color: #e0d4fc;
}

/* Сворачивание секции учителя */
.teacher-section.collapsed .teacher-classes,
.teacher-section.collapsed .homeroom-badge {
    display: none;
}
.teacher-section.collapsed .teacher-header {
    border-bottom: none;
}

/* Иконка и указатель сворачивания */
.teacher-header {
    cursor: pointer;
}
.teacher-expand-icon {
    display: inline-block;
    font-size: 0.75rem;
    transition: transform 0.2s;
    margin-right: 0.25rem;
    color: var(--gray-500);
}

/* Статус-бейдж учителя */
.teacher-status-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 0.25rem;
    font-weight: 500;
    vertical-align: middle;
}
.status-работает   { background: #d4edda; color: #155724; }
.status-декрет     { background: #cce5ff; color: #004085; }
.status-больничный { background: #fff3cd; color: #856404; }
.status-уволен     { background: #f8d7da; color: #721c24; }
.status-студент    { background: #e2d9f3; color: #5a3d7a; }
.status-проект     { background: #d1ecf1; color: #0c5460; }

.modal-add-header {
    margin-bottom: 1rem;
}
.add-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
}
.no-assignments {
    width: 100%;
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-style: italic;
}

/* ===== Universal Report ===== */
.universal-report .report-filters {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.universal-report .filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.universal-report .filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.universal-report .filter-actions button {
    min-width: 150px;
}
.universal-report .report-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #eff0f1ff 0%, #f3eff7ff 100%);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    color: white;
    flex-wrap: wrap;
}
.universal-report .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.universal-report .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
}
.universal-report .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}
.universal-report .report-table-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}
.universal-report .report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.universal-report .report-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
}
.universal-report .report-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.universal-report .report-table tbody tr:hover td {
    background: var(--gray-50);
}
.universal-report .report-table .homeroom-row {
    background-color: #fff3cd;
}
.universal-report .report-table .homeroom-row:hover td {
    background-color: #ffe69c;
}
.universal-report .hours-cell {
    font-weight: 600;
    color: var(--primary-dark);
    text-align: right;
}
.universal-report .badge-homeroom {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--warning);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}
.universal-report .empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: var(--border-radius);
    color: var(--gray-500);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.universal-report .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.universal-report .error-state {
    text-align: center;
    padding: 3rem;
    background: #fee2e2;
    border-radius: var(--border-radius);
    color: var(--danger);
}
@media (max-width: 768px) {
    .universal-report .filters-grid {
        grid-template-columns: 1fr;
    }
    .universal-report .filter-actions {
        flex-direction: column;
    }
    .universal-report .filter-actions button {
        width: 100%;
    }
    .universal-report .report-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .universal-report .report-table {
        font-size: 0.8rem;
    }
    .universal-report .report-table th,
    .universal-report .report-table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

/* ===== Admin Panel ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.admin-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}
.admin-table tr:hover td {
    background: var(--gray-50);
}
.badge-group {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.badge-admin { background: var(--primary-light); color: var(--primary); }
.badge-manager { background: #fff3cd; color: #856404; }
.badge-user { background: #d1fae5; color: #065f46; }
.badge-readonly { background: #e2e8f0; color: #475569; }

/* ===== Admin Page ===== */
.admin-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%) fixed;
}

.admin-page .main-content {
    background: transparent;
}

.admin-page .content-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
}

.admin-page .content-header h1 {
    color: var(--gray-800);
}

.admin-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 1rem;
}

.admin-card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.admin-card-body {
    padding: 1.5rem;
    color: var(--gray-700);
}

.admin-card-body p {
    color: var(--gray-500);
}

.admin-card .admin-table {
    margin: -1.5rem;
    border-radius: 0;
    box-shadow: none;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn.edit:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.action-btn.delete:hover {
    background: #fee2e2;
    color: var(--danger);
}

.shift-limits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 480px;
}

.shift-limits-grid .form-group {
    margin-bottom: 0;
}

.api-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.api-status-bar.status-ok .status-text {
    color: rgba(255, 255, 255, 0.95);
}

/* ===== Cabinet Subject Checkbox Grid ===== */
.subject-checkbox-grid {
    max-height: 320px;
    overflow-y: auto;
}

.subject-area-group {
    margin-bottom: 1rem;
}

.subject-area-group:last-child {
    margin-bottom: 0;
}

.subject-area-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--gray-200);
}

.subject-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

.subject-tile {
    position: relative;
}

.subject-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.subject-tile label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
    text-align: center;
    min-height: 2.5rem;
    user-select: none;
}

.subject-tile label::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--gray-400);
    border-radius: 3px;
    flex-shrink: 0;
    transition: var(--transition);
}

.subject-tile input:checked + label {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.subject-tile input:checked + label::before {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.subject-tile label:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

/* ===== Корректировка нагрузки ===== */
.lc-page {
    max-width: 1000px;
}
.lc-dashboard {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}
.lc-dash-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 180px;
    border-left: 4px solid var(--gray-300);
}
.lc-dash-warn { border-left-color: var(--warning); }
.lc-dash-danger { border-left-color: var(--danger); }
.lc-dash-info { border-left-color: var(--primary); }
.lc-dash-icon { font-size: 1.5rem; }
.lc-dash-body { display: flex; flex-direction: column; }
.lc-dash-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.lc-dash-label { font-size: 0.8rem; color: var(--gray-500); }
.lc-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.lc-teacher-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.lc-teacher-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}
.lc-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: 0.5rem;
}
.lc-teacher-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lc-teacher-icon { font-size: 1.25rem; }
.lc-teacher-name { font-weight: 600; font-size: 1rem; }
.lc-teacher-total { color: var(--gray-500); font-size: 0.85rem; margin-left: 0.5rem; }
.lc-teacher-stats { display: flex; gap: 0.5rem; }
.lc-stat-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
}
.lc-stat-excess { background: #fef2f2; color: var(--danger); }
.lc-stat-count { background: var(--gray-100); color: var(--gray-600); }
.lc-teacher-body { padding: 0.5rem 0; }
.lc-subject-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
    gap: 1rem;
}
.lc-subject-item:hover { background: var(--gray-50); }
.lc-subject-item.lc-excluded {
    opacity: 0.5;
    background: var(--gray-100);
}
.lc-subject-item.lc-excluded .lc-hours-norm,
.lc-subject-item.lc-excluded .lc-hours-fact {
    text-decoration: line-through;
}
.lc-subject-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}
.lc-subject-name { font-weight: 500; font-size: 0.9rem; }
.lc-split-badge { cursor: help; }
.lc-class-name {
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.lc-hours-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.lc-hours-norm { font-size: 0.85rem; color: var(--gray-600); }
.lc-hours-fact { font-size: 0.85rem; color: var(--gray-600); }
.lc-hours-fact.lc-excess { color: var(--danger); font-weight: 600; }
.lc-excess-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--danger);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.lc-item-actions {
    display: flex;
    align-items: center;
}
.lc-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}
.lc-toggle-btn:hover { background: var(--gray-200); }

/* Multi-select dropdown */
.multi-select-dropdown {
    position: relative;
    min-width: 160px;
}
.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: border-color 0.15s;
}
.multi-select-trigger:hover {
    border-color: var(--primary);
}
.multi-select-trigger .arrow {
    font-size: 0.7rem;
    color: var(--gray-500);
}
.multi-select-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem 0;
    margin-top: 2px;
}
.multi-select-panel.open {
    display: block;
}
.multi-select-panel label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
}
.multi-select-panel label:hover {
    background: var(--gray-50);
}
.multi-select-panel input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
