.top-nav {
    margin-bottom: 16px;
}

.top-nav a {
    color: #1a3a6c;
    font-weight: 600;
    text-decoration: none;
}

.teacher-panel,
.teacher-results {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.teacher-panel {
    padding: 18px;
}

.teacher-controls {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 150px auto;
    gap: 12px;
    align-items: end;
}

.teacher-controls label {
    display: grid;
    gap: 6px;
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
}

.teacher-controls input,
.teacher-controls select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

.teacher-controls button {
    padding: 12px 18px;
    border: 0;
    border-radius: 6px;
    background-color: #1a3a6c;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.teacher-summary {
    margin-top: 12px;
    color: #666;
}

.teacher-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 14px;
}

.teacher-view-switch {
    display: flex;
    gap: 2px;
    width: fit-content;
    padding: 3px;
    border-radius: 8px;
    background: #e9eef5;
}

.teacher-view-switch button {
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #526171;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.teacher-view-switch button.is-active {
    background: #fff;
    color: #1a3a6c;
    box-shadow: 0 1px 3px rgba(24, 58, 108, .18);
}

.teacher-week-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.teacher-week-navigation button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #1a3a6c;
    border-radius: 6px;
    background: #fff;
    color: #1a3a6c;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}

.teacher-week-navigation button:hover:not(:disabled) {
    background: #eef5fc;
}

.teacher-week-navigation button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.teacher-active-week {
    display: grid;
    min-width: 220px;
    text-align: center;
}

.teacher-active-week span {
    color: #6b7785;
    font-size: .72rem;
}

.teacher-active-week strong {
    color: #1a3a6c;
    font-size: .9rem;
}

.hidden {
    display: none !important;
}

.teacher-results {
    overflow-x: auto;
}

.teacher-calendar {
    margin-bottom: 20px;
}

.calendar-title {
    margin-bottom: 10px;
    color: #1a3a6c;
    font-weight: 800;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(180px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.calendar-day {
    min-height: 240px;
    border: 1px solid #dbe3ed;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.calendar-day-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    background: #eff5fb;
    color: #1a3a6c;
    font-size: .86rem;
}

.calendar-lessons {
    padding: 8px;
}

.calendar-lesson {
    margin-bottom: 8px;
    padding: 9px;
    border-left: 3px solid #1a3a6c;
    border-radius: 5px;
    background: #f8fafc;
    font-size: .88rem;
}

.calendar-lesson time {
    display: block;
    margin-bottom: 4px;
    color: #1a3a6c;
    font-weight: 800;
}

.calendar-subject {
    font-weight: 700;
}

.calendar-meta {
    margin-top: 4px;
    color: #5f6b78;
}

.calendar-groups {
    margin-top: 6px;
}

.calendar-groups .teacher-group {
    font-size: .78rem;
}

.calendar-free,
.calendar-empty {
    margin: 0;
    color: #7a8795;
}

.calendar-empty {
    padding: 22px;
    border-radius: 8px;
    background: #fff;
}

.teacher-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.teacher-table th,
.teacher-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    vertical-align: top;
}

.teacher-table th {
    background-color: #f8f9fa;
    color: #1a3a6c;
    font-weight: 700;
    position: sticky;
    top: 0;
}

.teacher-table tr:hover td {
    background-color: #f7fbff;
}

.teacher-note {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.85rem;
}

.teacher-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background-color: #eef2ff;
    color: #1a3a6c;
    font-size: 0.78rem;
    white-space: nowrap;
}

.teacher-group {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: #f1f5f9;
    white-space: nowrap;
}

.teacher-group-compact {
    max-width: 100%;
    line-height: 1.45;
    white-space: normal;
}

@media (max-width: 768px) {
    .teacher-controls {
        grid-template-columns: 1fr;
    }

    .teacher-table {
        min-width: 0;
    }

    .teacher-table thead {
        display: none;
    }

    .teacher-table,
    .teacher-table tbody,
    .teacher-table tr,
    .teacher-table td {
        display: block;
        width: 100%;
    }

    .teacher-table tr {
        padding: 10px;
        border-bottom: 1px solid #e9ecef;
    }

    .teacher-table td {
        padding: 4px 0;
        border-bottom: 0;
    }

    .teacher-table td::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 105px;
        color: #666;
        font-weight: 700;
    }

    .teacher-view-switch {
        width: 100%;
    }

    .teacher-view-switch button {
        flex: 1;
    }

    .teacher-results-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-week-navigation {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .teacher-active-week {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        padding: 4px 0;
    }

    #currentWeekButton {
        grid-column: 1 / -1;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .calendar-day {
        min-height: 0;
    }
}
