/* CSS lịch A/B: lưới, hàng/cột cố định, trạng thái vùng chọn/môn và hộp thoại; dữ liệu lịch được JavaScript dựng. */

.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.schedule-note {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid #26a7e8;
    border-radius: 0.4rem;
    background: #f0f9ff;
    color: #36536c;
    font-size: 0.875rem;
}

/* Vùng cuộn của lưới lịch; các cột/hàng sticky tiếp theo giữ mốc thứ và tiết khi cuộn. */
.schedule-scroll {
    overflow-x: auto;
    border: 2px solid #26a7e8;
    border-radius: 0.65rem;
}

/* Bố cục lưới thời khóa biểu; các ô dữ liệu được JavaScript tạo cho hai kỳ A/B. */
.schedule-table {
    width: 100%;
    min-width: 850px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    text-align: center;
}

.schedule-table th,
.schedule-table td {
    height: 48px;
    border-right: 1px solid #dce3eb;
    border-bottom: 1px solid #dce3eb;
    padding: 0.5rem 0.25rem;
}

.schedule-table thead th,
.schedule-table tfoot th {
    height: 52px;
    color: #475569;
    font-weight: 600;
}

.schedule-table .schedule-axis {
    width: 72px;
}

.schedule-table tbody th,
.schedule-table tbody .schedule-time {
    background: linear-gradient(135deg, #48b6e9, #199cdd);
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.schedule-table tr > :last-child {
    border-right: 0;
}

.schedule-table tfoot th {
    border-bottom: 0;
}

.schedule-table .afternoon-start > * {
    border-top: 3px solid #b9d9ec;
}

/* Ô trống cho phép chọn vùng; JavaScript xử lý pointer và bàn phím, CSS chỉ thể hiện trạng thái. */
.schedule-table tbody td[data-day] { cursor: cell; user-select: none; }
/* Màu vùng tiết đang chọn, chưa có nghĩa môn đã được lưu. */
.schedule-table td.selected { background: #dbeeff; box-shadow: inset 0 0 0 2px #229fe2; }
.schedule-table td.occupied { background: #e2f3ed; color: #155b4b; font-weight: 600; overflow-wrap: anywhere; cursor: default; }
.schedule-table td.occupied.selected { background: #ffe5d9; }
.schedule-table td:focus-visible { outline: 2px solid #005baa; outline-offset: -3px; }
.schedule-dialog { width: min(440px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; padding: 0; border: 0; border-radius: 1rem; box-shadow: 0 1rem 3rem #0003; }
.schedule-dialog::backdrop { background: #0f172a80; }

/* Môn đang hiển thị trong bản lịch; JavaScript gộp buổi học qua rowSpan, CSS định dạng ô đó. */
.schedule-table td.occupied {
    vertical-align: middle;
    border-top: 0;
}

.schedule-table td.occupied { cursor: pointer; }
