/**
 * SIKKHALAY INSTITUTE PORTAL — UNIVERSAL ALL-CLASS WEEKLY ROUTINE STYLES
 * File: css/universal_weekly_routine.css
 * 
 * High-Fidelity All-Class Period-Wise Master Timetable Matching Institutional Standard (media_1791199956351.jpg)
 */

/* ==========================================================================
   1. STUDIO CONTAINER & WORKSPACE CONTROLS
   ========================================================================== */

#view-universal-weekly-routine {
    margin-bottom: 24px;
    animation: fadeInSlide 0.25s ease-out;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.uwr-studio-toolbar {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .uwr-studio-toolbar {
    background: #0f172a;
    border-color: #334155;
}

.uwr-studio-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .uwr-studio-title {
    color: #f8fafc;
}

.uwr-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.uwr-btn {
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.uwr-btn-outline {
    background: var(--bg-surface, #ffffff);
    border-color: var(--border-color, #cbd5e1);
    color: var(--text-main, #334155);
}

[data-theme="dark"] .uwr-btn-outline {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

.uwr-btn-outline:hover {
    border-color: var(--brand-primary, #059669);
    color: var(--brand-primary, #059669);
    background: rgba(5, 150, 105, 0.05);
}

.uwr-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.uwr-btn-primary:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
}

.uwr-btn-print {
    background: #0f172a;
    color: #ffffff;
    border: none;
}

.uwr-btn-print:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* Sheet Wrapper (Canvas) */
.uwr-sheet-wrapper {
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

[data-theme="dark"] .uwr-sheet-wrapper {
    background: #0b1120;
    border-color: #1e293b;
}

/* ==========================================================================
   2. HIGH-FIDELITY OFFICIAL ROUTINE SHEET (A4 LANDSCAPE MASTER CANVAS)
   ========================================================================== */

.uwr-paper-container {
    width: 100%;
    max-width: 1120px;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1.5px solid #000000;
    border-radius: 0;
    padding: 14px 18px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'SolaimanLipi', 'Hind Siliguri', 'Nikosh', 'Vrinda', -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Watermark */
.uwr-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Sheet Header */
.uwr-header {
    text-align: center;
    margin-bottom: 6px;
    position: relative;
    z-index: 2;
}

.uwr-inst-emblem-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.uwr-inst-emblem-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid #000000;
    padding: 1px;
    background: #ffffff;
}

.uwr-inst-title {
    font-family: 'Noto Serif Bengali', 'Kalpurush', 'SolaimanLipi', 'Nikosh', serif !important;
    font-size: 21px;
    font-weight: 800;
    color: #000000 !important;
    margin: 0 0 2px 0;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

.uwr-routine-title {
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'Hind Siliguri', sans-serif !important;
    font-size: 15px;
    font-weight: 700;
    color: #000000 !important;
    margin: 0 0 2px 0;
    line-height: 1.25;
    letter-spacing: 0.1px;
}

.uwr-inst-subtitle {
    font-family: 'Noto Sans Bengali', 'Hind Siliguri', 'Kalpurush', sans-serif !important;
    font-size: 11px;
    font-weight: 600;
    color: #222222 !important;
    margin: 0 0 6px 0;
}

/* ==========================================================================
   3. UNIVERSAL MASTER TABLE (GRID & CELLS)
   ========================================================================== */

.uwr-table-wrapper {
    position: relative;
    z-index: 2;
    overflow-x: auto;
    margin-bottom: 0px;
}

.uwr-master-table {
    width: 100%;
    border-collapse: collapse !important;
    border: 1.5px solid #000000 !important;
    font-size: 11px;
    color: #000000 !important;
    table-layout: fixed;
    background: transparent;
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'SolaimanLipi', 'Hind Siliguri', sans-serif !important;
}

.uwr-master-table th,
.uwr-master-table td {
    border: 1px solid #000000 !important;
    padding: 3px 3px;
    vertical-align: middle;
    text-align: center;
    line-height: 1.25;
    color: #000000 !important;
    position: relative;
    font-family: inherit;
}

/* Headers */
.uwr-master-table thead th {
    background: #f8fafc !important;
    font-weight: 800;
    color: #000000 !important;
    padding: 4px 2px;
}

.uwr-master-table thead .period-name-th {
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Hind Siliguri', sans-serif !important;
    font-size: 12.5px;
    font-weight: 800;
}

.uwr-master-table thead .period-time-th {
    font-size: 9.5px;
    font-weight: 600;
    color: #222222 !important;
    display: block;
    margin-top: 1px;
}

/* Left Assembly Column (Vertical Text) */
.uwr-assembly-th {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 2px 1px !important;
    background: #f8fafc !important;
    border: 1px solid #000000 !important;
    text-align: center;
    vertical-align: middle;
}

.uwr-assembly-th-label {
    font-size: 8.5px;
    font-weight: 800;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: inline-block;
    color: #334155;
    letter-spacing: 0.5px;
}

.uwr-assembly-col {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 4px 1px !important;
    font-size: 10px;
    font-weight: 800;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: #ffffff !important;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

.uwr-assembly-col:hover {
    background: #f0fdf4 !important;
}

/* Class Column */
.uwr-class-th {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 105px !important;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    background: #f8fafc !important;
}

.uwr-class-td {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 105px !important;
    font-size: 11px;
    font-weight: 800;
    background: #ffffff !important;
    padding: 4px 3px !important;
    text-align: center;
    white-space: normal !important;
    word-break: normal !important;
    line-height: 1.25;
    cursor: pointer;
    vertical-align: middle;
}

.uwr-class-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5px;
}

.uwr-class-grade {
    font-size: 11.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.uwr-class-stream {
    font-size: 9.5px;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
}

.uwr-class-td:hover {
    background: #f0fdf4 !important;
    color: #059669 !important;
}

/* Period Headers */
.uwr-period-th {
    min-width: 95px;
    padding: 4px 3px !important;
    text-align: center;
    background: #f8fafc !important;
}

/* Recess / Break Vertical Column */
.uwr-break-th {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 34px !important;
    padding: 2px 1px !important;
    background: #f8fafc !important;
    text-align: center;
    vertical-align: middle;
}

.uwr-break-td {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 34px !important;
    padding: 4px 1px !important;
    background: #ffffff !important;
    text-align: center;
    vertical-align: middle;
}

.uwr-break-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    min-height: 80px;
    padding: 4px 0;
    box-sizing: border-box;
}

.uwr-break-time {
    font-size: 8.5px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    line-height: 1;
}

.uwr-break-letters {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 900;
    color: #000000;
    line-height: 1.1;
    margin: 4px 0;
    font-family: 'Noto Serif Bengali', 'Noto Sans Bengali', 'Kalpurush', serif !important;
}

/* Right Split Note Column */
.uwr-notes-th {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    background: #f8fafc !important;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
}

.uwr-notes-col {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    font-size: 9px;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: #ffffff !important;
    padding: 3px 1px !important;
    text-align: center;
    line-height: 1.1;
}

/* Interactive Subject / Slot Cells */
.uwr-slot-cell {
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 10.5px;
    font-weight: 600;
    min-height: 38px;
    padding: 3px 4px !important;
    vertical-align: middle;
    text-align: center;
    word-break: normal;
}

.uwr-slot-cell:hover {
    background: #f0fdf4 !important;
    outline: 1.5px dashed #059669;
}

/* Single Slot Presentation */
.uwr-single-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    padding: 2px 0;
}

.uwr-single-subject {
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'SolaimanLipi', 'Hind Siliguri', sans-serif !important;
    font-size: 10.5px;
    font-weight: 700;
    color: #000000;
    line-height: 1.25;
    text-align: center;
}

.uwr-single-teacher-row {
    display: flex;
    justify-content: center;
    margin-top: 1px;
}

/* Teacher Short Code Badge */
.uwr-slot-teacher {
    font-size: 8.5px;
    font-weight: 800;
    color: #000000;
    background: #e2e8f0;
    border: 0.5px solid #64748b;
    padding: 0.5px 3.5px;
    border-radius: 2px;
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: 0.2px;
    flex-shrink: 0;
    display: inline-block;
}

/* Split Days inside a single Cell (রবি-মঙ্গল / বুধ-বৃহ) */
.uwr-split-cell-grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1px;
    width: 100%;
    text-align: left;
    padding: 0;
}

.uwr-split-block {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.uwr-split-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1.5px;
}

.uwr-split-day-tag {
    font-size: 8px;
    font-weight: 800;
    color: #334155;
    background: #f1f5f9;
    border: 0.5px solid #cbd5e1;
    padding: 0.5px 3.5px;
    border-radius: 2px;
    white-space: nowrap;
    line-height: 1.1;
    flex-shrink: 0;
}

.uwr-split-subject {
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'SolaimanLipi', 'Hind Siliguri', sans-serif !important;
    font-size: 9.5px;
    font-weight: 700;
    color: #000000;
    line-height: 1.22;
    text-align: center;
    width: 100%;
    word-break: normal;
    padding: 0 1px;
}

.uwr-split-divider {
    border-top: 1px dotted #94a3b8;
    margin: 2px 0;
    width: 100%;
}

/* Empty Cell State */
.uwr-slot-empty {
    color: #94a3b8;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

.uwr-empty-dash {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-block;
    user-select: none;
}

.uwr-slot-empty:hover .uwr-empty-dash {
    color: var(--brand-primary, #059669);
}

/* Teacher Highlight Filter Styles */
.uwr-slot-highlighted {
    background: #dcfce7 !important;
    outline: 2px solid #059669 !important;
    font-weight: 800 !important;
    transform: scale(1.015);
    z-index: 10;
}

.uwr-slot-dimmed {
    opacity: 0.28 !important;
    filter: grayscale(0.6);
}

/* ==========================================================================
   4. BOTTOM SECTIONS: TEACHER LOAD STRIP & DUTY ROSTER TABLE
   ========================================================================== */

/* Teacher Short Code Load Strip */
.uwr-teacher-summary-strip {
    border: 1.5px solid #000000 !important;
    border-top: none !important;
    background: #ffffff;
    display: flex;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.uwr-teacher-summary-title {
    background: #f1f5f9;
    font-size: 9.5px;
    font-weight: 800;
    color: #0f172a;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    border-right: 1px solid #000000;
    white-space: nowrap;
    flex-shrink: 0;
}

.uwr-teacher-boxes-container {
    display: flex;
    flex: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.uwr-teacher-box {
    flex: 1;
    border-right: 1px solid #000000;
    padding: 2.5px 3px;
    text-align: center;
    font-size: 9.5px;
    font-weight: 700;
    color: #000000;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.uwr-teacher-box:last-child {
    border-right: none;
}

.uwr-teacher-box:hover {
    background: #f1f5f9;
}

.uwr-teacher-box-active {
    background: #059669 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
}

.uwr-t-code {
    font-weight: 800;
}

.uwr-t-sep {
    opacity: 0.7;
}

.uwr-t-count {
    font-weight: 800;
}

/* Bottom Duty Roster Table */
.uwr-duty-table-wrapper {
    margin-top: 4px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.uwr-duty-table {
    width: 100%;
    border-collapse: collapse !important;
    border: 1.5px solid #000000 !important;
    font-size: 9.5px;
    color: #000000 !important;
    table-layout: fixed;
    font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'Hind Siliguri', sans-serif !important;
}

.uwr-duty-table th,
.uwr-duty-table td {
    border: 1px solid #000000 !important;
    padding: 2px 3px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.2;
    color: #000000 !important;
}

.uwr-duty-table thead th {
    background: #f8fafc !important;
    font-weight: 800;
}

.uwr-duty-day-th {
    width: 102px;
    font-weight: 800;
    background: #f8fafc !important;
}

/* Signatures Strip */
.uwr-signatures-strip {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding: 0 24px;
    font-size: 11px;
    font-weight: 700;
    color: #000000;
    position: relative;
    z-index: 2;
}

.uwr-sign-box {
    text-align: center;
    width: 180px;
}

.uwr-sign-line {
    border-top: 1px solid #000000;
    margin-bottom: 4px;
}

.uwr-sign-title {
    font-family: 'Noto Sans Bengali', 'Kalpurush', 'Hind Siliguri', sans-serif !important;
    font-weight: 700;
    font-size: 11px;
}

/* ==========================================================================
   5. PRINT STYLING (A4 LANDSCAPE STRICT 1-PAGE FIT & EXACT DESIGN PARITY)
   ========================================================================== */

@media print {
    @page {
        size: A4 landscape;
        margin: 4mm 5mm;
    }

    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    body.print-mode-universal-weekly-routine {
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
    }

    /* Hide Navigation, Headers, Modals and UI Chrome */
    body.print-mode-universal-weekly-routine .sidebar,
    body.print-mode-universal-weekly-routine #mainSidebar,
    body.print-mode-universal-weekly-routine .top-header,
    body.print-mode-universal-weekly-routine .header,
    body.print-mode-universal-weekly-routine #mainHeader,
    body.print-mode-universal-weekly-routine .admin-sub-nav,
    body.print-mode-universal-weekly-routine .routine-hero,
    body.print-mode-universal-weekly-routine .routine-view-tabs,
    body.print-mode-universal-weekly-routine .routine-navigator-panel,
    body.print-mode-universal-weekly-routine .uwr-studio-toolbar,
    body.print-mode-universal-weekly-routine .modal-overlay,
    body.print-mode-universal-weekly-routine .active-filter-bar,
    body.print-mode-universal-weekly-routine .mobile-bottom-nav,
    body.print-mode-universal-weekly-routine .mobile-scroll-hint,
    body.print-mode-universal-weekly-routine #routinePrintModal,
    body.print-mode-universal-weekly-routine #view-routine-matrix,
    body.print-mode-universal-weekly-routine #view-routine-workload,
    body.print-mode-universal-weekly-routine .uwr-empty-build-state,
    body.print-mode-universal-weekly-routine .uwr-day-nav-bar,
    body.print-mode-universal-weekly-routine .no-print {
        display: none !important;
    }

    /* CRITICAL RESET: Neutralize all desktop layout wrappers, sidebars and paddings */
    body.print-mode-universal-weekly-routine #app,
    body.print-mode-universal-weekly-routine .workspace,
    body.print-mode-universal-weekly-routine main,
    body.print-mode-universal-weekly-routine .content-area,
    body.print-mode-universal-weekly-routine .page-view,
    body.print-mode-universal-weekly-routine .routine-builder-workspace,
    body.print-mode-universal-weekly-routine #view-universal-weekly-routine,
    body.print-mode-universal-weekly-routine .uwr-sheet-wrapper {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        float: none !important;
        box-sizing: border-box !important;
    }

    /* Master Paper Container (Strict 1-Page A4 Landscape Canvas) */
    body.print-mode-universal-weekly-routine #uwrPaperContainer {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 2mm 3mm !important;
        border: 1.5px solid #000000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'SolaimanLipi', 'Hind Siliguri', 'Nikosh', 'Vrinda', sans-serif !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
        max-height: 202mm !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.print-mode-universal-weekly-routine .uwr-watermark {
        opacity: 0.035 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-header {
        margin-bottom: 1.5mm !important;
        text-align: center !important;
    }

    body.print-mode-universal-weekly-routine .uwr-inst-emblem-wrap {
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 1px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-inst-emblem-img {
        width: 24px !important;
        height: 24px !important;
        border: 1px solid #000000 !important;
        padding: 0.5px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-inst-title {
        font-family: 'Noto Serif Bengali', 'Kalpurush', 'SolaimanLipi', 'Nikosh', serif !important;
        font-size: 13pt !important;
        margin-bottom: 0px !important;
        color: #000000 !important;
        line-height: 1.15 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-routine-title {
        font-family: 'Noto Sans Bengali', 'Anek Bangla', 'Kalpurush', 'Hind Siliguri', sans-serif !important;
        font-size: 9.5pt !important;
        margin-bottom: 0px !important;
        color: #000000 !important;
        line-height: 1.15 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-inst-subtitle {
        font-family: 'Noto Sans Bengali', 'Hind Siliguri', 'Kalpurush', sans-serif !important;
        font-size: 6.8pt !important;
        margin-bottom: 1.2mm !important;
        color: #222222 !important;
        line-height: 1.1 !important;
    }

    /* Master Timetable Grid with Crisp Borders */
    body.print-mode-universal-weekly-routine .uwr-table-wrapper {
        overflow: visible !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-master-table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1.5px solid #000000 !important;
        font-size: 7.2pt !important;
        table-layout: fixed !important;
        background: #ffffff !important;
    }

    body.print-mode-universal-weekly-routine .uwr-master-table th,
    body.print-mode-universal-weekly-routine .uwr-master-table td {
        border: 1px solid #000000 !important;
        padding: 1px 1.5px !important;
        line-height: 1.12 !important;
        color: #000000 !important;
        background: #ffffff !important;
        vertical-align: middle !important;
        text-align: center !important;
    }

    body.print-mode-universal-weekly-routine .uwr-master-table thead th {
        background: #f1f5f9 !important;
        border: 1px solid #000000 !important;
        font-weight: 800 !important;
        padding: 1.5px 1px !important;
    }

    body.print-mode-universal-weekly-routine .period-name-th {
        font-size: 8pt !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
    }

    body.print-mode-universal-weekly-routine .period-time-th {
        font-size: 6pt !important;
        font-weight: 600 !important;
        color: #111111 !important;
        line-height: 1.05 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-assembly-th,
    body.print-mode-universal-weekly-routine .uwr-assembly-col {
        width: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        padding: 1px 0 !important;
        font-size: 7pt !important;
        font-weight: 800 !important;
        writing-mode: vertical-rl !important;
        transform: rotate(180deg) !important;
        text-align: center !important;
        white-space: nowrap !important;
        background: #ffffff !important;
    }

    body.print-mode-universal-weekly-routine .uwr-class-th,
    body.print-mode-universal-weekly-routine .uwr-class-td {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 85px !important;
        padding: 1.5px 2px !important;
        text-align: center !important;
        vertical-align: middle !important;
        line-height: 1.15 !important;
        word-break: normal !important;
    }

    body.print-mode-universal-weekly-routine .uwr-class-th {
        font-size: 8pt !important;
        font-weight: 800 !important;
        background: #f1f5f9 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-class-name-wrap {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-class-grade {
        font-size: 7.8pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        line-height: 1.1 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-class-stream {
        font-size: 6.8pt !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        line-height: 1.1 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-break-th,
    body.print-mode-universal-weekly-routine .uwr-break-td {
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        padding: 1px !important;
        text-align: center !important;
        vertical-align: middle !important;
        background: #ffffff !important;
    }

    body.print-mode-universal-weekly-routine .uwr-break-th {
        background: #f1f5f9 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-break-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 100% !important;
        padding: 1px 0 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-break-time {
        font-size: 5.6pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.print-mode-universal-weekly-routine .uwr-break-letters {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5px !important;
        font-size: 8pt !important;
        font-weight: 900 !important;
        color: #000000 !important;
        line-height: 1 !important;
        margin: 1px 0 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-notes-th,
    body.print-mode-universal-weekly-routine .uwr-notes-col {
        width: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        font-size: 6.8pt !important;
        font-weight: 700 !important;
        writing-mode: vertical-rl !important;
        transform: rotate(180deg) !important;
        padding: 1px !important;
        text-align: center !important;
        background: #ffffff !important;
    }

    /* Timetable Slots (Crisp & Strictly Compact) */
    body.print-mode-universal-weekly-routine .uwr-slot-cell {
        border: 1px solid #000000 !important;
        font-size: 7.2pt !important;
        font-weight: 600 !important;
        padding: 1px 1.5px !important;
        vertical-align: middle !important;
        overflow: hidden !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-cell-grid {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 0.5px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-block {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-bottom: 0.5px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-day-tag {
        font-size: 5.5pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        background: #f1f5f9 !important;
        border: 0.5px solid #64748b !important;
        padding: 0.2px 1.8px !important;
        border-radius: 1.5px !important;
        white-space: nowrap !important;
        line-height: 1 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-slot-teacher {
        font-size: 6pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        background: #e2e8f0 !important;
        border: 0.5px solid #475569 !important;
        padding: 0.2px 1.8px !important;
        border-radius: 1.5px !important;
        white-space: nowrap !important;
        line-height: 1 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-subject {
        font-size: 6.8pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
        line-height: 1.12 !important;
        text-align: center !important;
        width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.print-mode-universal-weekly-routine .uwr-split-divider {
        border-top: 0.5px dotted #64748b !important;
        margin: 0.5px 0 !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-single-slot {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1px !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-single-subject {
        font-size: 7.2pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
        line-height: 1.15 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-single-teacher-row {
        display: flex !important;
        justify-content: center !important;
        margin-top: 0.5px !important;
    }

    /* Teacher Summary Ledger Boxed Row */
    body.print-mode-universal-weekly-routine .uwr-teacher-summary-strip {
        border: 1.5px solid #000000 !important;
        border-top: none !important;
        background: #ffffff !important;
        display: flex !important;
        align-items: stretch !important;
        width: 100% !important;
        font-size: 6.8pt !important;
    }

    body.print-mode-universal-weekly-routine .uwr-teacher-summary-title {
        background: #f1f5f9 !important;
        font-size: 6.8pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        padding: 1px 4px !important;
        border-right: 1px solid #000000 !important;
        white-space: nowrap !important;
        display: flex !important;
        align-items: center !important;
    }

    body.print-mode-universal-weekly-routine .uwr-teacher-boxes-container {
        display: flex !important;
        flex: 1 !important;
        flex-wrap: nowrap !important;
    }

    body.print-mode-universal-weekly-routine .uwr-teacher-box {
        border-right: 1px solid #000000 !important;
        padding: 1px 1px !important;
        font-size: 6.8pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
        text-align: center !important;
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-teacher-box:last-child {
        border-right: none !important;
    }

    /* Duty Supervision Roster Table */
    body.print-mode-universal-weekly-routine .uwr-duty-table-wrapper {
        margin-top: 1.5mm !important;
        width: 100% !important;
    }

    body.print-mode-universal-weekly-routine .uwr-duty-table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1.5px solid #000000 !important;
        font-size: 6.8pt !important;
        table-layout: fixed !important;
        background: #ffffff !important;
    }

    body.print-mode-universal-weekly-routine .uwr-duty-table th,
    body.print-mode-universal-weekly-routine .uwr-duty-table td {
        border: 1px solid #000000 !important;
        padding: 1px 1.5px !important;
        line-height: 1.1 !important;
        text-align: center !important;
        color: #000000 !important;
        background: #ffffff !important;
    }

    body.print-mode-universal-weekly-routine .uwr-duty-table thead th,
    body.print-mode-universal-weekly-routine .uwr-duty-day-th {
        background: #f1f5f9 !important;
        border: 1px solid #000000 !important;
        font-weight: 800 !important;
        width: 78px !important;
    }

    /* Signatures Block */
    body.print-mode-universal-weekly-routine .uwr-signatures-strip {
        display: flex !important;
        justify-content: space-between !important;
        margin-top: 3mm !important;
        padding: 0 16px !important;
        font-size: 7.2pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    body.print-mode-universal-weekly-routine .uwr-sign-box {
        text-align: center !important;
        width: 140px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-sign-line {
        border-top: 1px solid #000000 !important;
        margin-bottom: 2px !important;
    }

    body.print-mode-universal-weekly-routine .uwr-sign-title {
        font-size: 6.8pt !important;
        font-weight: 700 !important;
    }

    /* --------------------------------------------------------------------------
       CLASS-COUNT SPECIFIC DYNAMIC SCALING FOR PERFECT A4 LANDSCAPE SINGLE PAGE
       -------------------------------------------------------------------------- */

    /* Small Routines (1-6 Classes) */
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="1"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="1"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="2"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="2"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="3"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="3"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="4"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="4"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="5"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="5"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="6"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="6"] .uwr-master-table td {
        padding: 2px 1.5px !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="1"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="2"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="3"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="4"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="5"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="6"] .uwr-signatures-strip {
        margin-top: 6mm !important;
    }

    /* Standard High School Model (9-10 Classes, e.g., Kohaldia High School 6A-10B) */
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"],
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] {
        padding: 1.5mm 2.5mm !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-header,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-header {
        margin-bottom: 1.2mm !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-inst-title,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-inst-title {
        font-size: 12.5pt !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-routine-title,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-routine-title {
        font-size: 9pt !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-inst-subtitle,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-inst-subtitle {
        font-size: 6.5pt !important;
        margin-bottom: 1mm !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-master-table,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-master-table {
        font-size: 6.8pt !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-master-table td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-master-table th,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-master-table td {
        padding: 0.8px 1px !important;
        line-height: 1.08 !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-class-td,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-class-td {
        width: 76px !important;
        max-width: 82px !important;
        padding: 1px !important;
    }

    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="9"] .uwr-signatures-strip,
    body.print-mode-universal-weekly-routine #uwrPaperContainer[data-class-count="10"] .uwr-signatures-strip {
        margin-top: 2.5mm !important;
        font-size: 6.8pt !important;
    }
}

/* ==========================================================================
   6. RESPONSIVE OPTIMIZATIONS (TABLETS & MOBILE < 400PX)
   ========================================================================== */

@media (max-width: 900px) {
    .uwr-studio-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .uwr-toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .uwr-btn {
        justify-content: center;
        text-align: center;
        padding: 6px 8px;
        font-size: 11px;
    }

    .uwr-btn-primary, .uwr-btn-print {
        grid-column: 1 / -1;
    }

    .uwr-sheet-wrapper {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .uwr-toolbar-actions {
        grid-template-columns: 1fr;
    }

    .uwr-btn {
        width: 100%;
    }
}

/* ==========================================================================
   7. UNIVERSAL ROUTINE EMPTY BUILD STATE HERO & ACTIONS
   ========================================================================== */

.uwr-empty-build-state {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    animation: fadeInSlide 0.3s ease-out;
}

.uwr-build-hero-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    padding: 44px 32px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .uwr-build-hero-card {
    background: #0f172a;
    border-color: #334155;
}

.uwr-build-icon-badge {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(16, 185, 129, 0.25));
    color: var(--brand-primary, #059669);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.2);
}

.uwr-build-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main, #0f172a);
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

[data-theme="dark"] .uwr-build-title {
    color: #f8fafc;
}

.uwr-build-subtitle {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--brand-primary, #059669);
    margin-bottom: 14px;
}

.uwr-build-desc {
    max-width: 660px;
    margin: 0 auto 28px auto;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-muted, #64748b);
}

.uwr-build-actions-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}

.uwr-hero-btn {
    padding: 13px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all 0.22s ease;
    border: 1.5px solid transparent;
    text-decoration: none;
}

.uwr-hero-btn i {
    font-size: 20px;
    flex-shrink: 0;
}

.uwr-hero-btn strong {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.3;
}

.uwr-hero-btn small {
    display: block;
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    line-height: 1.25;
}

.uwr-hero-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.28);
}

.uwr-hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.38);
}

.uwr-hero-btn-outline {
    background: var(--bg-surface, #ffffff);
    border-color: var(--border-color, #cbd5e1);
    color: var(--text-main, #1e293b);
}

[data-theme="dark"] .uwr-hero-btn-outline {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

.uwr-hero-btn-outline:hover {
    border-color: var(--brand-primary, #059669);
    color: var(--brand-primary, #059669);
    transform: translateY(-2px);
    background: rgba(5, 150, 105, 0.05);
}

.uwr-build-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    text-align: left;
    margin-top: 18px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.uwr-feat-box {
    background: var(--bg-elevated, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 15px 16px;
    transition: transform 0.2s ease;
}

.uwr-feat-box:hover {
    transform: translateY(-2px);
}

[data-theme="dark"] .uwr-feat-box {
    background: #1e293b;
    border-color: #334155;
}

.uwr-feat-box i {
    font-size: 20px;
    margin-bottom: 10px;
    display: inline-block;
}

.uwr-feat-box h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
}

[data-theme="dark"] .uwr-feat-box h4 {
    color: #f8fafc;
}

.uwr-feat-box p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}

@media (max-width: 640px) {
    .uwr-build-actions-row {
        flex-direction: column;
    }
    .uwr-hero-btn {
        width: 100%;
    }
}

/* ==========================================================================
   Day View Selector & Intelligent Master Sheet Styles
   ========================================================================== */
.uwr-day-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 14px;
}

[data-theme="dark"] .uwr-day-nav-bar {
    background: #1e293b;
    border-color: #334155;
}

.uwr-day-pills-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.uwr-day-pill-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

[data-theme="dark"] .uwr-day-pill-btn {
    background: #0f172a;
    border-color: #475569;
    color: #cbd5e1;
}

.uwr-day-pill-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.uwr-day-pill-btn.active {
    background: var(--brand-primary, #0284c7) !important;
    border-color: var(--brand-primary, #0284c7) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.uwr-break-th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    text-align: center;
}

@media print {
    .uwr-day-nav-bar,
    .no-print {
        display: none !important;
    }
}

