/* ========== Schedules ========== */

.section-schedules { animation: fadeIn 0.2s ease; }

/* ========== Nav ========== */

.sched-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.schedule-nav-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-light);
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.schedule-nav-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

.schedule-week-label {
    font-size: 16px; font-weight: 700; color: var(--text-dark);
    min-width: 240px; text-align: center;
}

.schedule-today-btn {
    padding: 7px 16px; border: 1px solid var(--primary-color);
    background: rgba(59,130,246,0.06); color: var(--primary-color);
    border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.schedule-today-btn:hover { background: rgba(59,130,246,0.12); }

/* ========== Layout ========== */

.sched-layout {
    display: flex;
    gap: 16px;
}

.sched-main {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.sched-sidebar-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 32px;
    align-self: flex-start;
}

.sched-sidebar-title {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.sched-libre-list {
    padding: 8px;
}

.sched-libre-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.1s;
}

.sched-libre-item:hover {
    background: var(--bg-hover);
}

.sched-libre-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sched-libre-select {
    width: 100px;
    padding: 5px 8px;
    font-size: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.sched-libre-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 900px) {
    .sched-layout {
        flex-direction: column;
    }
    .sched-sidebar-panel {
        width: 100%;
    }
}

/* ========== Table ========== */

.sched-table-wrap {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.sched-table {
    width: 100%; border-collapse: collapse; table-layout: fixed;
}

.sched-table th {
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 14px 6px; text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.sched-table th:first-child {
    text-align: left; padding-left: 12px; width: 120px;
    color: var(--text-dark); font-size: 12px;
}

.sched-table td {
    padding: 3px; border-bottom: 1px solid var(--border-color);
    text-align: center; vertical-align: middle; height: 70px;
}

.sched-table td:first-child { text-align: left; padding-left: 12px; }
.sched-table tr:last-child td { border-bottom: none; }

.sched-today-col {
    background: rgba(59, 130, 246, 0.03);
    box-shadow: inset 0 -2px 0 var(--primary-color);
}

/* ========== Total Row ========== */

.sched-total-row td {
    border-top: 2px solid var(--border-color);
    height: 48px !important;
    background: var(--bg-light) !important;
    font-size: 13px;
}

/* ========== Cell Empty ========== */

.sched-cell-empty {
    width: 100%; height: 64px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 12px;
    transition: all 0.2s;
}

.sched-cell-empty::after {
    content: '+';
    font-size: 18px;
    color: transparent;
    transition: color 0.2s;
}

.sched-cell-empty:hover {
    background: rgba(255,255,255,0.03);
}

.sched-cell-empty:hover::after {
    color: var(--text-light);
}

/* ========== Block (filled cell) ========== */

.sched-block {
    width: 100%; height: 64px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.sched-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.sched-block-icon {
    font-size: 14px;
    line-height: 1;
}

.sched-block-times {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}

.sched-block-dur {
    font-size: 10px;
    font-weight: 700;
    padding: 0px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* ========== Morning (yellow/warm) ========== */

.sched-block.sched-morning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
}
.sched-block.sched-morning .sched-block-times { color: #92400e; }
.sched-block.sched-morning .sched-block-dur { background: rgba(146,64,14,0.12); color: #92400e; }

/* ========== Afternoon (orange/sunset) ========== */

.sched-block.sched-afternoon {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border: 1px solid #f97316;
}
.sched-block.sched-afternoon .sched-block-times { color: #7c2d12; }
.sched-block.sched-afternoon .sched-block-dur { background: rgba(124,45,18,0.12); color: #7c2d12; }

/* ========== Night (purple/dark) ========== */

.sched-block.sched-libre {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.3);
}
.sched-block.sched-libre .sched-block-times { color: #94a3b8; }

.sched-block.sched-enfermo {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}
.sched-block.sched-enfermo .sched-block-times { color: #ef4444; }

.sched-block.sched-personal {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
.sched-block.sched-personal .sched-block-times { color: #f59e0b; }

.sched-block.sched-night {
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
    border: 1px solid #8b5cf6;
}
.sched-block.sched-night .sched-block-times { color: #3b0764; }
.sched-block.sched-night .sched-block-dur { background: rgba(59,7,100,0.12); color: #3b0764; }
