.hidden {
    display: none;
}

.timetable-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
}

.timetable-page .card {
    padding: 22px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.schedule-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 44px;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.schedule-row select {
    width: 100%;
}

.icon-btn {
    height: 40px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.icon-btn:hover {
    background: #cbd5e1;
}

.small {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.row-actions {
    display: flex;
    gap: 10px;
}

.row-actions button {
    flex: 1;
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.legend-item,
.legend-empty {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdff;
}

.legend-left {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 2px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.legend-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.legend-times {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.legend-empty {
    color: var(--muted);
}

.timetable-board-wrap {
    overflow-x: auto;
}

.timetable-board {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    min-width: 680px;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

.timetable-board th,
.timetable-board td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.timetable-board th:last-child,
.timetable-board td:last-child {
    border-right: none;
}

.timetable-board tr:last-child td {
    border-bottom: none;
}

.timetable-board thead th {
    height: 44px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
}

.time-col {
    width: 84px;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
}

.slot-cell {
    height: 58px;
    padding: 0;
    background: #fff;
}

.slot-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.slot-content.continuation {
    font-size: 0;
}

@media (max-width: 960px) {
    .timetable-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .schedule-row {
        grid-template-columns: 1fr;
    }

    .row-actions {
        flex-direction: column;
    }
}
