* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f0f4f9;
    padding: 20px;
    color: #1e2a3a;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 25px 20px 30px;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    color: #0b2a4a;
    margin-bottom: 4px;
}

.subtitle {
    text-align: center;
    font-size: 1rem;
    color: #4a5b6e;
    margin-bottom: 20px;
    border-bottom: 2px solid #e6edf5;
    padding-bottom: 15px;
}

/* ----- переключатель ----- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 25px;
    font-weight: 500;
    color: #1e3a5f;
}

.toggle-label {
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #b0c4de;
    transition: 0.3s;
    border-radius: 34px;
}

.slider::before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .slider {
    background-color: #1e3a5f;
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(26px);
}

/* ----- таблица ----- */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
}

thead th {
    background: #1e3a5f;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #2b4a72;
    white-space: nowrap;
}

tbody td {
    border: 1px solid #dde4ed;
    padding: 10px 8px;
    vertical-align: middle;
    background: white;
}

/* Чтобы строки были одинаковой высоты */
tbody tr {
    height: 70px;
}

/* Если в ячейке несколько занятий, высота увеличивается,
   но минимальная высота сохраняется за счёт height у tr */
.lesson-item {
    padding: 2px 0;
    border-bottom: 1px dashed #e9eef4;
}

.day-cell {
    background: #eef3f9;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    width: 110px;
}

.pair-cell {
    text-align: center;
    font-weight: 500;
    width: 60px;
}

.time-cell {
    text-align: center;
    white-space: nowrap;
    font-size: 0.9rem;
    width: 130px;
}

.lesson-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-name {
    font-weight: 600;
    color: #0b2a4a;
}

.lesson-type {
    display: inline-block;
    background: #dbeafe;
    color: #1e3a5f;
    font-size: 0.7rem;
    padding: 0 10px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 6px;
}

.lesson-meta {
    font-size: 0.85rem;
    color: #3d5a78;
    margin-top: 2px;
}

.lesson-meta span {
    margin-right: 14px;
}

.empty-lesson {
    color: #8a9db0;
    font-style: italic;
    padding: 4px 0;
}

.subgroup-badge {
    display: inline-block;
    background: #e6f0fa;
    color: #1e4a7a;
    font-size: 0.7rem;
    padding: 0 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.footnote {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #6c7e94;
    text-align: center;
    border-top: 1px solid #e6edf5;
    padding-top: 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    table {
        font-size: 0.85rem;
        min-width: 0;
    }
    .time-cell {
        font-size: 0.8rem;
        width: auto;
    }
    .day-cell {
        width: 80px;
    }
    .pair-cell {
        width: 40px;
    }
    .toggle-wrapper {
        gap: 10px;
        flex-wrap: wrap;
    }
    .toggle-label {
        font-size: 0.9rem;
    }
}