:root {
    --sis-blue: #134874;
    --sis-active: #1b67a7;
    --bg-light: #f4f7f9;
    --border-color: #e1e9f1;
    --text-dark: #333;
    --text-muted: #6c757d;
}

/* Timetable Specific Styles */
.school-info-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    flex-wrap: wrap;
}

.school-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.school-info-item .info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.school-info-item .info-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--sis-blue);
    background: #eef4fb;
    padding: 4px 14px;
    border-radius: 4px;
    border: 1px solid #d4e4f5;
    white-space: nowrap;
}

.school-info-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

.semester-tabs {
    display: inline-flex;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.semester-tab {
    padding: 6px 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #fff;
    color: var(--text-muted);
    transition: all 0.2s;
    border-right: 1px solid #ced4da;
    margin: 0;
}

.semester-tab:last-child {
    border-right: none;
}

.semester-tab.active {
    background: #1a6ab7;
    color: #fff;
}

.semester-tab:hover:not(.active) {
    background: #f0f4f8;
    color: var(--text-dark);
}

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f4f8;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.version-badge i {
    font-size: 13px;
    color: #1a6ab7;
}

.timetable-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    margin-bottom: 20px;
    /* Custom Scrollbar for better visibility */
    scrollbar-width: auto;
    scrollbar-color: #888 #f1f1f1;
}

.timetable-wrapper::-webkit-scrollbar {
    height: 10px;
}

.timetable-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.timetable-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.timetable-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.timetable {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.timetable thead th {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 10px 6px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-dark);
    text-align: center;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.timetable thead th.th-day {
    background: #f8fafc;
    width: 90px;
    min-width: 90px;
    font-size: 12px;
    color: var(--sis-blue);
}

.timetable thead th.th-session {
    background: #f0f4f8;
    width: 70px;
    min-width: 70px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.timetable thead th.th-period {
    background: #f8fafc;
    width: 55px;
    min-width: 55px;
    font-size: 11px;
    color: var(--text-muted);
}

.timetable thead th.th-class {
    background: #134874;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 10px;
    min-width: 150px;
    white-space: nowrap;
}

.timetable tbody td {
    border: 1px solid var(--border-color);
    padding: 0;
    vertical-align: middle;
    text-align: center;
    height: 40px;
}

.timetable tbody td.td-day {
    background: #f8fafc;
    font-weight: 700;
    font-size: 12px;
    color: var(--sis-blue);
    vertical-align: middle;
    white-space: nowrap;
}

.timetable tbody td.td-session {
    background: #f0f4f8;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    vertical-align: middle;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.timetable tbody td.td-period {
    background: #f8fafc;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.subject-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 38px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s;
    cursor: default;
    white-space: nowrap;
}

.subject-cell:hover {
    filter: brightness(0.95);
}

.cell-empty {
    color: #ccc;
    font-size: 16px;
    font-weight: 300;
    user-select: none;
}

/* Subject color palette */
.subj-khmer { background: #dbeafe; color: #1e40af; }
.subj-math { background: #dcfce7; color: #166534; }
.subj-physics { background: #fef3c7; color: #92400e; }
.subj-chemistry { background: #fce7f3; color: #9d174d; }
.subj-biology { background: #d1fae5; color: #065f46; }
.subj-history { background: #ede9fe; color: #5b21b6; }
.subj-geography { background: #ccfbf1; color: #115e59; }
.subj-english { background: #e0e7ff; color: #3730a3; }
.subj-french { background: #f3e8ff; color: #6b21a8; }
.subj-it { background: #cffafe; color: #155e75; }
.subj-pe { background: #ffedd5; color: #9a3412; }
.subj-civic { background: #fef9c3; color: #854d0e; }
.subj-earth { background: #e0f2fe; color: #075985; }
.subj-art { background: #fce4ec; color: #880e4f; }
.subj-music { background: #f3e5f5; color: #6a1b9a; }
.subj-morality { background: #fff3e0; color: #e65100; }
.subj-scout { background: #e8f5e9; color: #2e7d32; }

.session-separator td {
    height: 6px !important;
    padding: 0 !important;
    background: #1a6ab7 !important;
    border-color: #1a6ab7 !important;
}

.btn-dark-blue {
    background-color: var(--sis-blue);
    border-color: var(--sis-blue);
    color: white;
}

.btn-dark-blue:hover {
    background-color: #0d3251;
    border-color: #0d3251;
    color: white;
}

/* Print-specific */
@media print {
    #sidebar, .top-navbar, .search-card, .schedule-toolbar, .no-print, .school-info-bar {
        display: none !important;
    }
    #main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .content-body {
        padding: 0 !important;
    }
    .timetable thead th {
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .th-class {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .subject-cell {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .session-separator td {
        background: #666 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
