﻿body{
    background:#f5f5f5;
}

.header-card{
    border:1px solid #dbe3f0;
    border-radius:18px;
    box-shadow:0 14px 30px rgba(15,23,42,0.08);
    overflow:visible;
}

.header-card .card-body{
    padding:18px;
    background:linear-gradient(180deg,#f8fbff 0%,#ffffff 100%);
    overflow:visible;
}

.header-row{
    align-items:start;
}

.header-row + .header-row{
    margin-top:6px;
}

.field-block{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.field-label{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
    font-size:12px;
    font-weight:700;
    color:#334155;
    letter-spacing:0.02em;
}

.field-label i{
    width:16px;
    text-align:center;
    color:#2563eb;
}

.field-input{
    border:1px solid #cfd8e3;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 2px 6px rgba(15,23,42,0.04);
}

.field-input .input-group-text{
    background:#eff6ff;
    border:none;
    color:#2563eb;
    min-width:42px;
    justify-content:center;
}

.field-input .form-control,
.field-input .form-select{
    border:none;
    min-height:44px;
    box-shadow:none !important;
    background:#fff;
}

.field-input:focus-within{
    border-color:#93c5fd;
    box-shadow:0 0 0 4px rgba(59,130,246,0.12);
}

.timetable-table{
    font-size:13px;
    border:none;
    margin-bottom:0;
}

.timetable-table th,
.timetable-table td{
    border:1.5px solid #000 !important;
}

.corner-header,
.period-header,
.class-row-header{
    background:linear-gradient(135deg,#1d4ed8,#2563eb);
    color:#fff;
    text-align:center;
    vertical-align:middle;
}

.table-responsive{
    max-height:75vh;
    overflow:auto;
    border:none;
    background:#fff;
}

.timetable-table thead th{
    position:sticky;
    top:0;
    z-index:30;
}

.timetable-cell{
    cursor:pointer;
    min-width:120px;
    min-height:100px;
    vertical-align:top;
    background:white;
    overflow-wrap:anywhere;
    word-break:break-word;
}



.timetable-cell:hover{
    background:#fff8dc;
}

.corner-header{
    width:120px;
    min-width:120px;
    max-width:120px;
    font-weight:bold;
    background:linear-gradient(135deg,#1d4ed8,#2563eb) !important;
    color:#fff !important;
    text-align:center;
    vertical-align:middle;
    white-space:nowrap;
    position:sticky;
    left:0;
    z-index:40;
    box-shadow:2px 0 0 #000;
}

.period-header{
    min-width:140px;
    max-width:140px;
    white-space:nowrap;
}

.class-row-header{
    width:120px;
    min-width:120px;
    max-width:120px;
    font-weight:700;
    position:sticky;
    left:0;
    z-index:20;
    box-shadow:2px 0 0 #000;
}

.class-teacher-header{
    width:190px;
    min-width:190px;
    max-width:190px;
}

.class-teacher-cell{
    min-width:190px;
    width:190px;
    background:#fff7dc;
    vertical-align:middle;
    padding:0 !important;
}

.class-teacher-field-slot{
    height:100%;
    display:flex;
    flex-direction:column;
    position:relative;
    background:#fff7dc;
}

.class-teacher-input{
    width:100%;
    border:none;
    outline:none;
    background:#fff7dc;
    font-size:14px;
    font-weight:600;
    text-align:center;
    border-radius:0;
    box-shadow:none !important;
    box-sizing:border-box;
}

.class-teacher-input::placeholder{
    color:#8a8a8a;
    font-weight:500;
}

.class-teacher-input{
    min-height:96px;
    padding:10px 8px;
    line-height:1.25;
    resize:none;
    white-space:pre-wrap;
    overflow-wrap:break-word;
    word-break:break-word;
    overflow:hidden;
    display:block;
}

.class-teacher-suggestion-menu{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    background:#fff;
    border:1px solid #cbd5e1;
    border-top:none;
    box-shadow:0 10px 20px rgba(15,23,42,0.12);
    max-height:180px;
    overflow:auto;
    z-index:60;
    display:none;
}

.class-teacher-field-slot.is-open .class-teacher-suggestion-menu{
    display:block;
}

.class-teacher-suggestion-item{
    width:100%;
    border:none;
    background:#fff;
    padding:8px 10px;
    text-align:left;
    font-size:13px;
    font-weight:600;
    color:#1f2937;
}

.class-teacher-suggestion-item + .class-teacher-suggestion-item{
    border-top:1px solid #e5e7eb;
}

.class-teacher-suggestion-item:hover,
.class-teacher-suggestion-item:focus{
    background:#eff6ff;
}

.period-title{
    display:block;
    font-size:14px;
    font-weight:700;
    line-height:1.1;
    margin-bottom:6px;
}

.period-time{
    display:block;
    font-size:11px;
    color:rgba(255,255,255,0.9);
    font-weight:500;
    line-height:1.1;
    white-space:nowrap;
}

.interval-header{
    background:#fef3c7 !important;
    color:#92400e !important;
    width:54px;
    min-width:54px;
    max-width:54px;
    padding:0 !important;
    border-bottom:none !important;
    box-shadow:none !important;
}

.interval-cell{
    background:#fef3c7 !important;
    text-align:center;
    font-weight:bold;
    color:#92400e;
    position:relative;
    z-index:10;
}

.interval-merged-cell{
    width:54px;
    min-width:54px;
    max-width:54px;
    padding:0 !important;
    vertical-align:middle;
    border-top:none !important;
}

.interval-vertical-text{
    writing-mode:vertical-rl;
    transform:rotate(180deg);
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    height:100%;
    min-height:100%;
    font-size:12px;
    font-weight:700;
    letter-spacing:0.06em;
    text-transform:uppercase;
}

.timetable-table thead th{
    box-shadow:0 2px 0 #000;
}

.assignment-block{
    border:1px solid #ddd;
    padding:10px;
    margin-bottom:10px;
    border-radius:5px;
    background:#fafafa;
}

.cell-filled{
    background:#d4edda !important;
}

.cell-partial{
    background:#fff3cd !important;
}

.cell-conflict{
    background:#f8d7da !important;
}

.stream-note{
    font-size:13px;
    color:#0d6efd;
    font-weight:600;
}

.toolbar-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.class-group-control{
    transition:all 0.2s ease;
}

.settings-menu{
    position:relative;
    display:flex;
    justify-content:flex-end;
    z-index:80;
}

.settings-toggle{
    width:40px;
    height:40px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    border:1px solid #dbe3f0;
    background:#ffffff;
    color:#334155;
    box-shadow:0 8px 20px rgba(15,23,42,0.08);
}

.settings-toggle:hover,
.settings-toggle:focus{
    background:#f8fafc;
    color:#1d4ed8;
    border-color:#bfdbfe;
}

.settings-toggle::after{
    display:none !important;
}

.settings-dropdown{
    min-width:190px;
    margin-top:10px;
    border-radius:12px;
    border:1px solid #dbe3f0;
    box-shadow:0 10px 30px rgba(15,23,42,0.12);
    padding:8px;
    z-index:90;
}

.settings-dropdown .dropdown-item{
    border-radius:8px;
    font-size:13px;
    padding:10px 12px;
    display:flex;
    align-items:center;
    gap:8px;
}

.teacher-list-row + .teacher-list-row{
    margin-top:10px;
}

.session-note{
    font-size:12px;
    color:#6b7280;
    margin-top:6px;
    padding-left:4px;
}

.cell-summary-item{
    font-size:10px;
    line-height:1.25;
    border-bottom:1px solid #ddd;
    padding-bottom:3px;
    margin-bottom:3px;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.cell-summary-footer{
    font-size:10px;
    font-weight:700;
    color:#333;
}

.print-header{
    display:none;
}

.print-school-name{
    font-size:22px;
    font-weight:700;
    text-align:center;
    line-height:1.2;
    margin-bottom:4px;
}

.print-school-address{
    font-size:12px;
    text-align:center;
    line-height:1.2;
    margin-bottom:6px;
    color:#444;
}

.print-meta-row{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    margin-bottom:10px;
    font-size:12px;
}

.print-session{
    justify-self:center;
    font-weight:600;
}

.print-timing{
    justify-self:end;
    font-weight:600;
}

.print-table-container{
    display:none;
}

.print-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    font-size:12px;
}

.print-table th,
.print-table td{
    border:1px solid #000;
    padding:2px;
    vertical-align:middle;
}

.print-corner-header,
.print-class-header,
.print-period-header{
    background:#1d4ed8 !important;
    color:#fff !important;
    text-align:center;
    font-weight:700;
    font-size:12px;
}

.print-class-teacher-header{
    width:120px;
    background:#fff7dc !important;
    color:#7c5a00 !important;
}

.print-corner-header,
.print-class-header{
    width:70px;
}

.print-period-title{
    display:block;
    font-size:13px;
    font-weight:700;
    line-height:1.1;
}

.print-period-time{
    display:block;
    font-size:10px;
    line-height:1.1;
    margin-top:1px;
    white-space:nowrap;
}

.print-interval-header,
.print-interval-cell{
    background:#fef3c7 !important;
    color:#92400e !important;
    text-align:center;
}

.print-interval-header{
    width:34px;
    font-weight:700;
    font-size:10px;
    line-height:1.05;
}

.print-interval-label,
.print-interval-meta{
    display:block;
}

.print-data-cell{
    font-size:13px;
    line-height:1.3;
    text-align:center;
    vertical-align:middle;
    word-break:break-word;
    overflow-wrap:anywhere;
}

.print-cell-item{
    padding-bottom:2px;
    margin-bottom:2px;
    line-height:1.25;
    text-align:center;
}

.print-cell-subject{
    font-weight:700;
    font-size:12px;
    line-height:1.05;
    white-space:nowrap;
    letter-spacing:-0.02em;
}

.print-cell-footer{
    font-weight:700;
    font-size:11px;
}

.print-class-teacher-cell{
    font-size:12px;
    font-weight:700;
    text-align:center;
    vertical-align:middle;
    background:#fff7dc !important;
}

.print-footer{
    margin-top:10px;
    font-size:12px;
    line-height:1.4;
    color:#111;
}

.print-footer-note{
    margin-bottom:8px;
}

.print-footer-date{
    margin-bottom:22px;
}

.print-footer-signature{
    text-align:right;
    font-weight:700;
}

.print-interval-cell{
    padding:0 !important;
    vertical-align:middle !important;
    position:relative;
    overflow:visible;
    border-top:0 !important;
    border-bottom:0 !important;
}

.print-interval-vertical{
    writing-mode:vertical-rl;
    position:absolute;
    top:50%;
    left:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    transform-origin:center center;
    transform:translate(-50%,-50%) rotate(180deg);
    font-size:12px;
    font-weight:700;
    letter-spacing:0.08em;
    text-transform:uppercase;
    white-space:nowrap;
    z-index:2;
}

.print-interval-cell-first{
    border-top:1px solid #000 !important;
}

.print-interval-cell-last{
    border-bottom:1px solid #000 !important;
}

@media print{
    body{
        background:#fff;
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact;
    }

    .header-card,
    .modal,
    .btn,
    .btn-close{
        display:none !important;
    }

    .print-header{
        display:block;
        margin-bottom:10px;
    }

    .table-responsive{
        display:none !important;
    }

    .print-table-container{
        display:block;
    }

    @page{
        size:landscape;
        margin:5mm;
    }
}

