/* teacher-covers.css — كل أنماط صفحة «پەڕێ تۆمارێ (بەرگ)» */
@import url('../fonts/fonts.css');
@font-face {
    font-family: 'UniQAIDAR_Free_005';
    src: url('../fonts/UniQAIDAR_Free_005.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'UniQAIDAR Free 005';
    src: url('../fonts/UniQAIDAR_Free_005.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bs-primary-rgb: 99, 102, 241;
    /* Soft Indigo */
    --bs-success-rgb: 16, 185, 129;
    /* Soft Emerald */
    --bs-warning-rgb: 245, 158, 11;
    /* Soft Amber */
    --bs-danger-rgb: 239, 68, 68;
    /* Soft Rose */
    --bs-info-rgb: 6, 182, 212;
    /* Soft Cyan */

    --bs-body-bg: #e5eaf2;
    /* Playful soft gray-blue backdrop */
    --bs-body-color: #1e293b;
    /* Charcoal text */
    --bs-card-bg: #ffffff;
    --bs-border-color: rgba(255, 255, 255, 0.5);
    --bs-table-striped-bg: #f8fafc;

    /* Claymorphism shadows */
    --clay-outer-shadow: 10px 10px 20px rgba(166, 180, 200, 0.45), -10px -10px 20px rgba(255, 255, 255, 0.95);
    --clay-inner-shadow: inset 4px 4px 8px rgba(255, 255, 255, 0.85), inset -4px -4px 8px rgba(166, 180, 200, 0.25);
    --clay-btn-shadow: 5px 5px 12px rgba(166, 180, 200, 0.5), -5px -5px 12px rgba(255, 255, 255, 0.95), inset 3px 3px 6px rgba(255, 255, 255, 0.9), inset -3px -3px 6px rgba(0, 0, 0, 0.08);
    --clay-btn-active: inset 3px 3px 6px rgba(0, 0, 0, 0.15), inset -3px -3px 6px rgba(255, 255, 255, 0.7);
    --clay-input-shadow: inset 3px 3px 6px rgba(166, 180, 200, 0.35), inset -3px -3px 6px rgba(255, 255, 255, 0.95);

    --card-border-radius: 2.5rem;
    --elem-border-radius: 1.25rem;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #0b0f19;
    /* Ultimate Deep Dark Slate */
    --bs-body-color: #f8fafc;
    --bs-card-bg: #151f32;
    --bs-border-color: rgba(255, 255, 255, 0.03);
    --bs-table-striped-bg: #1a263c;

    /* Dark Claymorphism shadows */
    --clay-outer-shadow: 12px 12px 24px rgba(0, 0, 0, 0.55), -12px -12px 24px rgba(255, 255, 255, 0.02);
    --clay-inner-shadow: inset 4px 4px 8px rgba(255, 255, 255, 0.04), inset -4px -4px 8px rgba(0, 0, 0, 0.4);
    --clay-btn-shadow: 5px 5px 12px rgba(0, 0, 0, 0.45), -5px -5px 12px rgba(255, 255, 255, 0.02), inset 3px 3px 6px rgba(255, 255, 255, 0.08), inset -3px -3px 6px rgba(0, 0, 0, 0.4);
    --clay-btn-active: inset 3px 3px 6px rgba(0, 0, 0, 0.5), inset -3px -3px 6px rgba(255, 255, 255, 0.02);
    --clay-input-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.55), inset -3px -3px 6px rgba(255, 255, 255, 0.02);
}

body {
    font-family: "Noto Kufi Arabic", sans-serif;
    font-size: 0.95rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   BUILT-IN ROBUST DROPDOWN STYLES (Self-Contained Safety)
   ========================================================================== */
.dropdown,
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 1050;
    min-width: 12rem;
    padding: 0.5rem;
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #1e293b;
    text-align: right;
    list-style: none !important;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dropdown-menu.show,
.show>.dropdown-menu {
    display: block !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.45rem 0.75rem;
    clear: both;
    font-weight: 500;
    color: #334155;
    text-align: right;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: #1e293b;
    background-color: #f1f5f9;
}

.dropdown-item.active,
.dropdown-item:active {
    color: #ffffff;
    background-color: #4f46e5;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    color: #f8fafc;
    background-color: #334155;
}

body.modal-open {
    overflow: hidden;
}

.main-container {
    margin-top: 30px;
    margin-bottom: 50px;
    display: block;
}

/* --- Bootstrap Helper Classes Redesigned as Claymorphism --- */
.shadow-sm {
    box-shadow: var(--clay-outer-shadow) !important;
}

.border {
    border: 2px solid var(--bs-border-color) !important;
}

.border-0 {
    border: none !important;
}

.rounded-2,
.rounded-3 {
    border-radius: var(--elem-border-radius) !important;
}

.bg-white,
.bg-light {
    background-color: var(--bs-card-bg) !important;
}

.text-primary {
    color: #6366f1;
}

.text-success {
    color: #059669 !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-warning {
    color: #d97706 !important;
}

.text-info {
    color: #0891b2 !important;
}

/* Claymorphism Cards */
.card {
    box-shadow: var(--clay-outer-shadow), var(--clay-inner-shadow);
    border-radius: var(--card-border-radius);
    border: 3px solid var(--bs-border-color);
    background-color: var(--bs-card-bg);
    overflow: visible !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    margin-bottom: 25px;
    padding: 10px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 12px 12px 24px rgba(166, 180, 200, 0.55), -12px -12px 24px rgba(255, 255, 255, 0.95), var(--clay-inner-shadow);
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.6), -15px -15px 30px rgba(255, 255, 255, 0.03), var(--clay-inner-shadow);
}

.card-header {
    padding: 1.75rem 2.25rem;
    background-color: transparent;
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-bs-theme="dark"] .card-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================================
   SUPER 3D CLAYMORPHISM BUTTONS (كلاي مورفيزم ثلاثي الأبعاد لجميع الأزرار)
   ========================================================== */

/* Claymorphic Pill Trays (Button Groups) */
.btn-group,
.control-panel .btn-group,
.btn-group-vertical {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    display: inline-flex !important;
    gap: 0.6rem !important;
}

.btn-group>.btn,
.btn-group-vertical>.btn,
.btn-group>.btn-group>.btn {
    border-radius: 50px !important;
    border: none !important;
}

/* Base Button Styling with Claymorphism */
.btn {
    font-weight: 700;
    border-radius: 50px;
    padding: 0.45rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    color: #1e293b;
    box-shadow: 0 5px 12px -2px rgba(148, 163, 184, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.9),
        inset -2px -2px 4px rgba(100, 116, 139, 0.18) !important;
    text-shadow: none;
    user-select: none;
}

.btn-sm,
.control-panel .btn,
.control-panel .btn-group>.btn {
    padding: 0.4rem 0.85rem !important;
    font-size: 0.82rem !important;
    min-height: 36px !important;
    border-radius: 50px !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
}

.control-panel {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    width: 100% !important;
}

.control-panel .btn-group {
    display: inline-flex !important;
    margin: 0 !important;
    gap: 0 !important;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 18px -1px rgba(148, 163, 184, 0.5),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(100, 116, 139, 0.15) !important;
}

.btn:active,
.btn.active,
.show>.btn.dropdown-toggle {
    transform: translateY(1px) scale(0.98);
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.2),
        inset -2px -2px 4px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Primary (Indigo Clay) */
.btn-primary {
    background: linear-gradient(145deg, #a5b4fc, #6366f1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.28),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-primary:hover {
    background: linear-gradient(145deg, #c7d2fe, #818cf8) !important;
    color: #ffffff !important;
    box-shadow: 0 7px 16px -2px rgba(99, 102, 241, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.10) !important;
}

.btn-primary:active,
.btn-primary.active,
.show>.btn-primary.dropdown-toggle {
    background: linear-gradient(145deg, #818cf8, #4f46e5) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Success (Emerald Clay) */
.btn-success {
    background: linear-gradient(145deg, #86efac, #10b981) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.28),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-success:hover {
    background: linear-gradient(145deg, #bbf7d0, #22c55e) !important;
    color: #ffffff !important;
    box-shadow: 0 7px 16px -2px rgba(16, 185, 129, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.10) !important;
}

.btn-success:active,
.btn-success.active,
.show>.btn-success.dropdown-toggle {
    background: linear-gradient(145deg, #4ade80, #059669) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Danger (Coral Red Clay) */
.btn-danger {
    background: linear-gradient(145deg, #fecaca, #f87171) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.28),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-danger:hover {
    background: linear-gradient(145deg, #fee2e2, #fca5a5) !important;
    color: #ffffff !important;
    box-shadow: 0 7px 16px -2px rgba(239, 68, 68, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.10) !important;
}

.btn-danger:active,
.btn-danger.active,
.show>.btn-danger.dropdown-toggle {
    background: linear-gradient(145deg, #fca5a5, #ef4444) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Info (Sky Cyan Clay) */
.btn-info {
    background: linear-gradient(145deg, #67e8f9, #22d3ee) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 12px -2px rgba(6, 182, 212, 0.28),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btn-info:hover {
    background: linear-gradient(145deg, #a5f3fc, #38e1fa) !important;
    color: #ffffff !important;
    box-shadow: 0 7px 16px -2px rgba(6, 182, 212, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.10) !important;
}

.btn-info:active,
.btn-info.active,
.show>.btn-info.dropdown-toggle {
    background: linear-gradient(145deg, #0891b2, #075985) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.35),
        inset -2px -2px 4px rgba(255, 255, 255, 0.18),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Secondary / Light (Soft Slate Clay) */
.btn-secondary,
.btn-outline-secondary,
.btn-light {
    background: linear-gradient(145deg, #f8fafc, #cbd5e1) !important;
    color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 6px 15px -2px rgba(148, 163, 184, 0.45),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(100, 116, 139, 0.2) !important;
    text-shadow: none !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-light:hover {
    background: linear-gradient(145deg, #ffffff, #d8e2ed) !important;
    color: #0f172a !important;
    box-shadow: 0 9px 20px -2px rgba(148, 163, 184, 0.55),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(100, 116, 139, 0.18) !important;
}

.btn-secondary:active,
.btn-outline-secondary:active,
.btn-light:active,
.show>.btn-secondary.dropdown-toggle,
.show>.btn-outline-secondary.dropdown-toggle {
    background: linear-gradient(145deg, #cbd5e1, #94a3b8) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Outline Buttons (Clean 2D Flat) */
.btn-outline-primary {
    background: transparent !important;
    color: #4f46e5 !important;
    border: 1.5px solid #4f46e5 !important;
    box-shadow: none !important;
}

.btn-outline-primary:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow: none !important;
}

.btn-outline-success {
    background: transparent !important;
    color: #059669 !important;
    border: 1.5px solid #059669 !important;
    box-shadow: none !important;
}

.btn-outline-success:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
    box-shadow: none !important;
}

.btn-outline-danger {
    background: transparent !important;
    color: #dc2626 !important;
    border: 1.5px solid #dc2626 !important;
    box-shadow: none !important;
}

.btn-outline-danger:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: none !important;
}

/* Circular Icon Clay Buttons */
.btn.rounded-circle,
.rounded-circle.btn {
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Bouncy close button for modals */
.btn-close {
    box-shadow: none !important;
    opacity: 0.85 !important;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-close:hover {
    opacity: 1 !important;
    transform: scale(1.18) rotate(90deg);
}

.btn-close:active {
    box-shadow: none !important;
    transform: scale(0.95);
}

/* SweetAlert2 Flat Modern Buttons */
.swal2-styled.swal2-confirm,
.swal2-confirm {
    border-radius: 50px !important;
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 0.65rem 1.8rem !important;
    transition: opacity 0.15s ease !important;
}

.swal2-styled.swal2-confirm:hover,
.swal2-confirm:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9 !important;
}

.swal2-styled.swal2-cancel,
.swal2-cancel {
    border-radius: 50px !important;
    background: #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.65rem 1.8rem !important;
    transition: opacity 0.15s ease !important;
}

.swal2-styled.swal2-cancel:hover,
.swal2-cancel:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9 !important;
}

.swal2-styled.swal2-deny,
.swal2-deny {
    border-radius: 50px !important;
    background: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 0.65rem 1.8rem !important;
    transition: opacity 0.15s ease !important;
}

/* ==========================================================
   DARK MODE FLAT 2D BUTTONS
   ========================================================== */
[data-bs-theme="dark"] .btn {
    border: 1px solid #334155 !important;
    background: #1e293b;
    color: #f8fafc;
    box-shadow: none !important;
    transform: none !important;
}

[data-bs-theme="dark"] .btn:hover {
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.9 !important;
}

[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-light {
    background: #334155 !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] #stageSelectorBtn {
    background: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-success {
    background: #059669 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-info {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    background: transparent !important;
    color: #818cf8 !important;
    border-color: #6366f1 !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-outline-success {
    background: transparent !important;
    color: #34d399 !important;
    border-color: #10b981 !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    background: transparent !important;
    color: #f87171 !important;
    border-color: #ef4444 !important;
    box-shadow: none !important;
}

/* Hollowed Clay Inputs */
.form-control,
.form-select {
    border-radius: var(--elem-border-radius);
    border: 2px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    padding: 0.7rem 1.4rem;
    box-shadow: var(--clay-input-shadow);
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    box-shadow: var(--clay-input-shadow), 0 0 0 4px rgba(var(--bs-primary-rgb), 0.2);
    outline: none;
}

#scheduleSelector {
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-weight: 800 !important;
    border: 2px solid #cbd5e1 !important;
    cursor: pointer !important;
    min-width: 150px;
    max-width: 220px;
}

[data-bs-theme="dark"] #scheduleSelector {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}

#scheduleSelector option {
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
}

[data-bs-theme="dark"] #scheduleSelector option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Clay Tabs (Pill Layout) */
.nav-tabs {
    border-bottom: none;
    background-color: var(--bs-body-bg);
    border-radius: 50px;
    padding: 6px;
    gap: 0.4rem;
    box-shadow: var(--clay-input-shadow);
    margin-bottom: 1.5rem;
    display: inline-flex;
    width: auto;
}

.nav-tabs .nav-link {
    border-radius: 50px;
    font-weight: 800;
    color: var(--bs-body-color);
    opacity: 0.75;
    border: none;
    padding: 0.7rem 1.75rem;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.nav-tabs .nav-link i {
    margin: 0 !important;
    display: inline-block !important;
}

.nav-tabs .nav-link:hover {
    opacity: 1;
    transform: scale(1.04);
}

.nav-tabs .nav-link.active {
    opacity: 1;
    color: #ffffff !important;
    background: linear-gradient(145deg, #6366f1, #4f46e5) !important;
    box-shadow: 0 7px 16px -2px rgba(99, 102, 241, 0.48),
        inset 2px 2px 4px rgba(255, 255, 255, 0.45),
        inset -2px -2px 4px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Clean, Premium SaaS Table Grid Layout with Unrestricted Vertical Scrolling */
.table-responsive,
.sub-master-scroll-container {
    border-radius: var(--elem-border-radius);
    border: 1px solid var(--bs-border-color) !important;
    background-color: var(--bs-card-bg);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

[data-bs-theme="dark"] .table-responsive,
[data-bs-theme="dark"] .sub-master-scroll-container {
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: none;
}

.table {
    vertical-align: middle;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background-color: transparent !important;
    width: 100%;
    contain: layout style;
}

.table th {
    font-weight: 700;
    border: 1px solid var(--bs-border-color) !important;
    border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.2) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.05) !important;
    color: rgba(var(--bs-primary-rgb), 1) !important;
    padding: 12px 10px;
    text-align: center;
    font-size: 0.9rem;
    background-clip: padding-box;
}

[data-bs-theme="dark"] .table th {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
    color: #a5b4fc !important;
}

.table td {
    border: 1px solid var(--bs-border-color) !important;
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color);
    padding: 10px 8px;
    text-align: center;
    font-size: 0.9rem;
    background-clip: padding-box;
}

/* Zero-Lag 60fps Scroll Optimizations for All Tables */
.table,
.table *,
.table-responsive,
.table-responsive *,
.sub-master-scroll-container,
.sub-master-scroll-container * {
    transition: none !important;
    animation: none !important;
}

.table-responsive table td *,
.sub-master-scroll-container table td *,
.table td .badge,
.table td .shadow-sm,
.table td .shadow {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
}

/* Prevent Card Hover 3D Shift & Repaint for Tables */
.card:has(.table),
.card:has(.table-responsive),
.card:has(.sub-master-scroll-container) {
    transform: none !important;
    transition: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
}

.card:has(.table):hover,
.card:has(.table-responsive):hover,
.card:has(.sub-master-scroll-container):hover {
    transform: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04) !important;
}

/* ==========================================================
   Master Table (Grid) Specific Font Sizes and Distinct Colors
   Targeting divs directly inside td, NOT inside .timetable-item
   ========================================================== */
#timetableGridContainer table td {
    padding: 6px 2px !important;
}

#timetableGridContainer table td>div.text-primary,
#timetableGridContainer table td>div:first-child:not(.timetable-item) {
    font-size: calc(0.2vw + 0.45rem) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #0056b3 !important;
    /* Deep Blue for Subject */
    font-weight: 900 !important;
}

[data-bs-theme="dark"] #timetableGridContainer table td>div.text-primary,
[data-bs-theme="dark"] #timetableGridContainer table td>div:first-child:not(.timetable-item) {
    color: #60a5fa !important;
}

#timetableGridContainer table td>div.text-muted,
#timetableGridContainer table td>div:last-child:not(.timetable-item) {
    font-size: calc(0.18vw + 0.4rem) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #c62828 !important;
    /* Crimson Red for Teacher */
    font-weight: 800 !important;
}

[data-bs-theme="dark"] #timetableGridContainer table td>div.text-muted,
[data-bs-theme="dark"] #timetableGridContainer table td>div:last-child:not(.timetable-item) {
    color: #f87171 !important;
}

.drag-handle {
    cursor: grab;
    color: rgba(var(--bs-primary-rgb), 0.4);
    padding: 4px;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: rgba(var(--bs-primary-rgb), 0.8);
}

.btn-delete-col {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: transparent;
    color: rgba(239, 68, 68, 0.6);
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.2s ease-in-out;
    padding: 4px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50px;
}

.btn-delete-col:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.15);
}

th:hover .btn-delete-col {
    opacity: 1;
}

/* Claymorphic Modals (Soft rounded windows) */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
}

.modal-content {
    border-radius: var(--card-border-radius);
    border: 6px solid rgba(255, 255, 255, 0.55);
    box-shadow: 18px 18px 36px rgba(0, 0, 0, 0.15), var(--clay-inner-shadow);
    background-color: var(--bs-card-bg);
    padding: 10px;
}

[data-bs-theme="dark"] .modal-content {
    border-color: rgba(255, 255, 255, 0.03);
    box-shadow: 18px 18px 36px rgba(0, 0, 0, 0.6), var(--clay-inner-shadow);
}

.modal-header {
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
    padding: 1.5rem 2rem;
    background-color: transparent;
}

[data-bs-theme="dark"] .modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.03);
}

.modal-footer {
    border-top: 2px solid rgba(0, 0, 0, 0.03);
    padding: 1.25rem 2rem;
    background-color: transparent;
}

[data-bs-theme="dark"] .modal-footer {
    border-top: 2px solid rgba(255, 255, 255, 0.03);
}

.modal-body {
    padding: 2.25rem;
}

.modal-header .btn-close {
    margin-left: 0;
    margin-right: auto;
}

/* Stat Cards */
.stat-card {
    background-color: var(--bs-card-bg);
    border: 3px solid var(--bs-border-color);
    border-radius: var(--elem-border-radius);
    box-shadow: var(--clay-outer-shadow), var(--clay-inner-shadow);
    transition: all 0.3s ease;
    padding: 1.5rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 14px 14px 28px rgba(166, 180, 200, 0.45), var(--clay-inner-shadow);
}

.stat-card h6 {
    color: rgba(var(--bs-primary-rgb), 1);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

/* Custom Rounded Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--bs-primary-rgb), 0.25);
    border-radius: 50px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--bs-primary-rgb), 0.45);
}

/* Switch Toggle Customizations */
.form-check-input:checked {
    background-color: rgba(var(--bs-primary-rgb), 1);
    border-color: rgba(var(--bs-primary-rgb), 1);
}

.form-check-input {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.15);
    border-color: rgba(var(--bs-primary-rgb), 0.5);
}

/* Claymorphic Dropdown menus */
.dropdown-menu {
    border-radius: var(--elem-border-radius);
    border: 2px solid var(--bs-border-color);
    box-shadow: var(--clay-outer-shadow);
    background-color: var(--bs-card-bg);
    padding: 8px;
    margin-top: 8px !important;
}

.dropdown-item {
    border-radius: 50px;
    padding: 8px 16px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    transform: scale(1.02);
}

/* Claymorphic SweetAlert2 Dialogues */
.swal2-popup {
    border-radius: var(--card-border-radius) !important;
    border: 6px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 18px 18px 36px rgba(0, 0, 0, 0.15), var(--clay-inner-shadow) !important;
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color) !important;
}

.swal2-title,
.swal2-html-container {
    color: var(--bs-body-color) !important;
}

.swal2-confirm {
    background-color: #4f46e5 !important;
    background: #4f46e5 !important;
    border: none !important;
    box-shadow: var(--clay-btn-shadow) !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    color: #fff !important;
    padding: 0.75rem 1.8rem !important;
}

.swal2-cancel {
    background-color: #ef4444 !important;
    background: #ef4444 !important;
    border: none !important;
    box-shadow: var(--clay-btn-shadow) !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    color: #fff !important;
    padding: 0.75rem 1.8rem !important;
}

/* Claymorphic Availability Grid Buttons */
.period-block-btn {
    border-radius: 50px !important;
    padding: 10px 6px;
    font-size: 0.8rem;
    font-weight: 800;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none !important;
    box-shadow: 3px 3px 6px rgba(166, 180, 200, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.period-block-btn.btn-outline-success {
    color: #059669;
    border-color: rgba(16, 185, 129, 0.4) !important;
    background-color: #d1fae5 !important;
    background: #d1fae5 !important;
}

.period-block-btn.btn-outline-success:hover {
    color: #fff;
    background-color: #059669 !important;
    background: #059669 !important;
    border-color: transparent !important;
    transform: scale(1.05);
}

.period-block-btn.btn-danger {
    background-color: #ef4444 !important;
    background: #ef4444 !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 3px 3px 6px rgba(239, 68, 68, 0.3) !important;
}

.period-block-btn.btn-danger:hover {
    transform: scale(1.05);
    background-color: #dc2626 !important;
    background: #dc2626 !important;
    box-shadow: 4px 4px 10px rgba(239, 68, 68, 0.4) !important;
}

/* Modal Tabs styling */
#teacherModalTabs .nav-link {
    border-radius: 50px;
    font-size: 0.9rem;
    padding: 0.6rem 1.35rem;
    margin-bottom: 0.5rem;
}

#teacherModalTabs .nav-link.active {
    border: none;
    background-color: #6366f1 !important;
    background: #6366f1 !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2) !important;
}

#teacherModalTabs .nav-link:not(.active) {
    border: none;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--bs-body-color);
}

/* Class Input list in Modal */
.teacher-class-row {
    background-color: rgba(var(--bs-primary-rgb), 0.02);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--elem-border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.teacher-class-row:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.2);
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

/* Fix select arrow overlapping with RTL text */
.form-select {
    background-position: left 0.75rem center !important;
    padding-left: 2.25rem !important;
    padding-right: 0.75rem !important;
}

/* ==========================================================
   Responsive & Multi-Device Compatibility Styles
   (Mobile, Tablet, Laptop, Desktop, Ultra-Wide)
   ========================================================== */

/* Universal Responsive Tweaks */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    width: 100%;
}

/* Touch-friendly buttons and inputs globally */
.btn,
.form-control,
.form-select,
.nav-link {
    touch-action: manipulation;
}

/* Smooth scrolling for touch devices in tables */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Responsive Breakpoints */

/* 1. Large Desktops & Laptops (max-width: 1200px) */
@media screen and (max-width: 1200px) {
    .card-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.65rem 1.4rem;
        font-size: 0.9rem;
    }}

/* 2. Tablets Landscape & Medium Screens (max-width: 992px) */
@media screen and (max-width: 992px) {
    :root {
        --card-border-radius: 1.75rem;
        --elem-border-radius: 1rem;
    }

    .main-container {
        margin-top: 15px;
        margin-bottom: 30px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        border-width: 2px;
        padding: 6px;
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    /* Modal Layout on Tablets */
    .modal-dialog {
        max-width: 92% !important;
        margin: 1.5rem auto;
    }

    #teacherForm .row>[class*="col-"] {
        border-inline-end: none !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: 2px dashed var(--bs-border-color);
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Table adjustments */
    .table th,
    .table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }}

/* 3. Mobile Devices (max-width: 767px) */
@media screen and (max-width: 767px) {
    :root {
        --card-border-radius: 1.35rem;
        --elem-border-radius: 0.85rem;
    }

    /* Card Header Mobile Stack */
    .card-header .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    /* Scrollable Nav Tabs on Mobile */
    .nav-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap !important;
        width: 100% !important;
        border-radius: 30px !important;
        padding: 4px !important;
        gap: 0.25rem !important;
        margin-bottom: 1rem !important;
        scrollbar-width: none;
    }

    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 1.1rem !important;
        font-size: 0.825rem !important;
        border-radius: 25px !important;
    }

    /* Control Panel Controls Tablet */
    .control-panel {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .control-panel .btn-group {
        display: inline-flex !important;
        margin: 0 !important;
    }

    .control-panel .btn,
    .control-panel .btn-group>.btn {
        padding: 0.38rem 0.65rem !important;
        font-size: 0.76rem !important;
        min-height: 34px !important;
        border-radius: 50px !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    /* Timetable Header Mobile */
    #timetable-tab-pane .d-flex.justify-content-between {
        flex-direction: column;
        align-items: center !important;
        gap: 0.5rem;
    }

    /* Timetable Grid Container */
    #timetableGridContainer {
        min-height: 350px !important;
    }

    #timetableGridContainer table td>div.text-primary,
    #timetableGridContainer table td>div:first-child:not(.timetable-item) {
        font-size: 0.75rem !important;
    }

    #timetableGridContainer table td>div.text-muted,
    #timetableGridContainer table td>div:last-child:not(.timetable-item) {
        font-size: 0.68rem !important;
    }

    /* Modal adjustments for small screens */
    .modal-dialog {
        max-width: 96% !important;
        margin: 0.5rem auto !important;
    }

    .modal-content {
        padding: 6px !important;
        border-width: 3px !important;
    }

    .modal-header {
        padding: 1rem 1.25rem !important;
    }

    .modal-body {
        padding: 1.25rem 1rem !important;
    }

    .modal-footer {
        padding: 1rem 1.25rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }

    /* Stat Cards Grid on Mobile */
    .stat-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }}

/* 4. Small Mobile Phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    :root {
        --card-border-radius: 1rem;
        --elem-border-radius: 0.75rem;
    }

    body {
        font-size: 0.875rem;
    }

    .card-title {
        font-size: 1.1rem !important;
    }

    .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.78rem !important;
        border-radius: 25px !important;
    }

    .form-control,
    .form-select {
        padding: 0.55rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    .table th,
    .table td {
        padding: 8px 5px !important;
        font-size: 0.78rem !important;
    }

    /* Availability Grid responsive buttons on mobile */
    #teacherAvailabilityGrid .d-flex {
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }

    .period-block-btn {
        font-size: 0.72rem !important;
        padding: 6px 4px !important;
        flex: 1 1 30px !important;
        min-width: 32px !important;
    }

    /* Footer Mobile */
    footer {
        padding: 1rem 0.5rem !important;
        font-size: 0.78rem !important;
    }

    footer .fab {
        font-size: 1.25rem;
    }}

/* --- Mobile Phone Optimized Layout (Phones & Small Devices) --- */
@media screen and (max-width: 767px) {
    body {
        overflow-x: hidden !important;
        width: 100vw;
    }

    .main-container {
        margin-top: 8px !important;
        margin-bottom: 15px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .card {
        padding: 6px !important;
        border-radius: 1rem !important;
        margin-bottom: 12px !important;
    }

    /* Top Bar Header on Phones */
    .card-title {
        font-size: 1.05rem !important;
        text-align: center;
        width: 100%;
    }

    .card .d-flex.flex-wrap.align-items-center.justify-content-between {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    /* Mobile Pill Navigation Tabs */
    .nav-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none;
        padding: 4px !important;
        background: rgba(0, 0, 0, 0.03);
        border-radius: 50px;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        flex: 0 0 auto !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.85rem !important;
        border-radius: 30px !important;
    }

    /* Action Control Buttons Grid on Mobile Phone */
    .control-panel {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
        gap: 0.3rem !important;
        width: 100% !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .control-panel>.btn,
    .control-panel>.btn-group,
    .control-panel>.btn-group>.btn {
        width: 100% !important;
        margin: 0 !important;
    }

    .control-panel .btn {
        padding: 0.35rem 0.3rem !important;
        font-size: 0.72rem !important;
        min-height: 34px !important;
        border-radius: 50px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        text-align: center !important;
    }

    /* Table sticky columns for phone */
    .table-responsive {
        max-width: 100vw !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 0.75rem !important;
    }

    /* Sticky first name column in mobile table view */
    .table th:nth-child(3),
    .table td:nth-child(3) {
        position: sticky;
        right: 0;
        background-color: var(--bs-card-bg);
        z-index: 2;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
    }

    /* Mobile Modal Dialogs */
    .modal-dialog {
        margin: 0.25rem !important;
        max-width: calc(100vw - 0.5rem) !important;
    }

    .modal-content {
        border-radius: 1.25rem !important;
        padding: 8px !important;
    }

    .modal-body {
        padding: 1rem 0.75rem !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }}

/* Print Styles */
@media print {

    .no-print,
    .no-print * {
        display: none !important;
    }

    .page-break {
        page-break-before: always !important;
        break-before: page !important;
    }

    .row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .table-responsive {
        overflow: visible !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        width: 100% !important;
    }

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

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        font-size: 0.9vw !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .table th,
    .table td {
        padding: 0.2vw 0.4vw !important;
        border: 1px solid #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .preserve-table-styles th,
    .preserve-table-styles td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .subject-color-chip {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        margin: 0.5cm;
    }}

/* --- Max Speed & GPU Acceleration Optimizations --- */
.table-responsive {
    contain: layout style;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}

.table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: 0 45px;
}

.modal-content,
.card {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.draggable-badge,
.badge {
    will-change: transform;
    transform: translateZ(0);
}

/* Scale the entire UI to 70% on screen (Desktop only) */
@media screen and (min-width: 992px) {
    .main-container {
        zoom: 0.7;
    }

    /* The user tuned the distribution tables to 57%. 
       Since the parent is at 70%, we use ~0.814 (0.814 * 0.7 = 0.57) */
    #tableContainer table,
    #additionalTablesContainer {
        zoom: 0.81428;
    }

    /* Make all modals (windows) 50% smaller (zoom out) */
    .modal-dialog {
        zoom: 0.5;
    }}

.subject-restrict-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 16px 20px;
    margin-bottom: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease-in-out;
}

.subject-restrict-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.subject-restrict-toolbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.subject-restrict-search {
    position: relative;
}

.subject-restrict-search input {
    border-radius: 50px;
    padding-left: 2.2rem;
    padding-right: 2.2rem;
    font-size: 0.88rem;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease;
}

.subject-restrict-search input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.subject-restrict-search .search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

[dir="rtl"] .subject-restrict-search .search-icon,
body.rtl .subject-restrict-search .search-icon {
    right: 14px;
}

[dir="ltr"] .subject-restrict-search .search-icon {
    left: 14px;
}

.period-chip-btn {
    min-width: 44px;
    height: 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid;
    cursor: pointer;
    user-select: none;
}

.period-chip-btn.is-allowed {
    background-color: #f8fafc !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

.period-chip-btn.is-allowed:hover {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.period-chip-btn.is-blocked {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15) !important;
    transform: translateY(-1px);
}

.period-chip-btn.is-blocked:hover {
    background-color: #fecaca !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}

.day-chip-btn {
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1.5px solid;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.day-chip-btn.is-allowed {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

.day-chip-btn.is-allowed:hover {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}

.period-block-btn {
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    padding: 6px 10px !important;
    min-width: 42px !important;
    font-weight: bold !important;
    transition: all 0.2s ease-in-out !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.period-block-btn.btn-outline-success {
    background-color: #d1fae5 !important;
    border-color: #a7f3d0 !important;
    color: #059669 !important;
}

.period-block-btn.btn-outline-success:hover {
    background-color: #a7f3d0 !important;
    color: #047857 !important;
    transform: scale(1.04);
}

.period-block-btn.btn-danger {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.2) !important;
}

.period-block-btn.btn-danger:hover {
    background-color: #fecaca !important;
    color: #b91c1c !important;
}

.subject-grid-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 16px 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.subject-pills-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
}

.swal-master-swap-modal {
    max-width: 96vw !important;
    width: 96vw !important;
    zoom: 0.70 !important;
    padding: 0.75rem !important;
}

/* --- Validation Modal Compact Styling (Scaled ~30% for Optimal Display) --- */
.swal-validation-compact {
    max-width: 490px !important;
    width: 92% !important;
    border-radius: 20px !important;
    padding: 14px 18px !important;
    zoom: 0.70 !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18) !important;
}

.swal-validation-compact .swal2-icon {
    width: 52px !important;
    height: 52px !important;
    margin: 8px auto 10px !important;
    border-width: 3px !important;
}

.swal-validation-compact .swal2-icon.swal2-success [class^='swal2-success-line'] {
    height: 4px !important;
}

.swal-validation-compact .swal2-icon.swal2-success .swal2-success-ring {
    width: 52px !important;
    height: 52px !important;
}

.swal-validation-compact .swal2-icon.swal2-warning {
    font-size: 2.2rem !important;
    line-height: 52px !important;
}

.swal-validation-compact .swal2-title {
    font-size: 1.05rem !important;
    padding: 0 0 8px !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

.swal-validation-compact .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.swal-validation-compact .swal2-actions {
    margin-top: 10px !important;
}

.swal-validation-compact .swal2-confirm {
    padding: 6px 24px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
}

/* ========================================================
   Substitute Teacher Finder (دیتنا جهگرێ مامۆستایێ مۆڵەتپێدای)
   ======================================================== */
.substitute-slot-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease-in-out;
}

.substitute-slot-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.substitute-cand-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    transition: all 0.15s ease;
}

.substitute-cand-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.substitute-cand-item.is-same-spec {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.substitute-cand-item.is-same-spec:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.substitute-assigned-banner {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1.5px solid #10b981;
    border-radius: 10px;
    padding: 10px 14px;
    color: #065f46;
}

/* ========================================================
   Modern Responsive Substitute Top Header & Tabs (Adaptive for All Screens)
   ======================================================== */
.substitute-header-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    padding: 10px 14px !important;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .substitute-header-card {
    background: linear-gradient(145deg, #1e293b, #0f172a) !important;
    border-color: #334155 !important;
}

.substitute-toolbar-tier1 {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

[data-bs-theme="dark"] .substitute-toolbar-tier1 {
    border-color: #334155 !important;
}

.substitute-avatar-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.substitute-segmented-nav {
    background-color: #f1f5f9;
    padding: 3px;
    border-radius: 50rem !important;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .substitute-segmented-nav {
    background-color: #0f172a;
    border-color: #334155;
}

.substitute-segmented-tab {
    border-radius: 50rem !important;
    border: none !important;
    font-size: 0.81rem;
    font-weight: 700;
    padding: 5px 12px !important;
    transition: all 0.2s ease;
    color: #475569;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    margin: 0;
    height: 32px;
    background: transparent;
}

.substitute-segmented-tab:hover:not(.active) {
    color: #1e293b;
    background-color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .substitute-segmented-tab:hover:not(.active) {
    color: #f1f5f9;
    background-color: rgba(255, 255, 255, 0.08);
}

.substitute-segmented-tab.active {
    background: linear-gradient(145deg, #4338ca 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(67, 56, 202, 0.35) !important;
}

.substitute-select {
    border-radius: 50rem !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    height: 34px !important;
    padding: 4px 28px 4px 12px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .substitute-select {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.substitute-select:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
    outline: none !important;
}

.substitute-filters-group {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50rem !important;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .substitute-filters-group {
    background-color: #0f172a;
    border-color: #334155;
}

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

.substitute-btn-action {
    height: 34px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    border-radius: 50rem !important;
    padding: 5px 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    transition: all 0.18s ease-in-out;
}

.substitute-btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.substitute-btn-auto {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.28) !important;
}

.substitute-btn-auto:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.38) !important;
    filter: brightness(1.05);
}

/* Tablet & Medium Breakpoint (<= 991px) */
@media screen and (max-width: 991px) {
    .substitute-toolbar-tier1 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .substitute-filters-group {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .substitute-filters-group select {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }

    .substitute-toolbar-tier2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .substitute-status-info {
        width: 100% !important;
    }

    .substitute-actions-toolbar {
        width: 100% !important;
        justify-content: flex-start !important;
    }}

/* Mobile Breakpoint (<= 767px) */
@media screen and (max-width: 767px) {
    .substitute-header-card {
        padding: 8px 10px !important;
        border-radius: 12px !important;
    }

    .substitute-segmented-nav {
        display: flex !important;
        width: 100% !important;
        border-radius: 12px !important;
        padding: 2px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    .substitute-segmented-tab {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 5px 3px !important;
        font-size: 0.74rem !important;
        height: 30px !important;
    }

    .substitute-filters-group {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
    }

    .substitute-filters-group select {
        width: 100% !important;
        max-width: none !important;
        font-size: 0.76rem !important;
        height: 32px !important;
        padding: 3px 20px 3px 6px !important;
    }

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

    .substitute-actions-toolbar .substitute-btn-auto {
        grid-column: 1 / -1 !important;
        height: 36px !important;
        font-size: 0.82rem !important;
    }

    .substitute-actions-toolbar .substitute-btn-action {
        width: 100% !important;
        height: 34px !important;
        padding: 4px 6px !important;
        font-size: 0.76rem !important;
        border-radius: 8px !important;
        justify-content: center !important;
    }}

@media print {
    .no-print-substitute {
        display: none !important;
    }

    .print-only-substitute {
        display: block !important;
    }}

.substitute-general-wrapper table {
    border-collapse: separate;
    border-spacing: 0;
}

.substitute-general-wrapper th {
    font-weight: 700;
    vertical-align: middle;
}

.substitute-general-wrapper td {
    transition: background-color 0.15s ease;
}

.print-signature-left {
    float: left !important;
    width: 230px !important;
    max-width: 230px !important;
    text-align: center !important;
    direction: rtl !important;
    margin-left: 20px !important;
    margin-right: auto !important;
    margin-top: 15px !important;
    display: block !important;
    page-break-inside: avoid !important;
}

.print-signature-wrapper {
    width: 100% !important;
    display: block !important;
    clear: both !important;
    margin-top: 15px !important;
}

/* --- Modern Timetable Toolbar Styles (Adaptive for All Screens) --- */
.timetable-toolbar-wrapper {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    padding: 10px 14px !important;
    transition: all 0.2s ease;
    position: relative !important;
    z-index: 50 !important;
    overflow: visible !important;
}

.timetable-toolbar-wrapper:has(.dropdown-menu.show),
.timetable-toolbar-wrapper:focus-within {
    z-index: 1060 !important;
}

[data-bs-theme="dark"] .timetable-toolbar-wrapper {
    background: linear-gradient(145deg, #1e293b, #0f172a) !important;
    border-color: #334155 !important;
}

.tt-toolbar-tier1 {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 8px;
    position: relative;
    z-index: 51;
    overflow: visible !important;
}

.tt-toolbar-tier2 {
    position: relative;
    z-index: 52;
    overflow: visible !important;
}

.tt-toolbar-tier2:has(.dropdown-menu.show),
.tt-toolbar-tier2:focus-within {
    z-index: 1060 !important;
}

[data-bs-theme="dark"] .tt-toolbar-tier1 {
    border-color: #334155 !important;
}

.tt-select-wrapper select {
    border-radius: 50rem !important;
    font-size: 0.81rem !important;
    font-weight: 700 !important;
    height: 34px !important;
    padding: 4px 28px 4px 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .tt-select-wrapper select {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.tt-select-wrapper select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}

/* --- Smooth Responsive Main Tabs --- */
#scheduleTabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

#scheduleTabs::-webkit-scrollbar {
    display: none;
}

#scheduleTabs .nav-item {
    flex-shrink: 0;
}

/* Tablet & Medium Breakpoint (<= 991px) */
@media screen and (max-width: 991px) {
    .tt-toolbar-tier1 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .tt-select-wrapper {
        width: 100% !important;
    }

    .tt-select-wrapper select {
        width: 100% !important;
        max-width: none !important;
    }

    .tt-toolbar-tier2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }}

/* Mobile Breakpoint (<= 767px) */
@media screen and (max-width: 767px) {
    .timetable-toolbar-wrapper {
        padding: 8px 10px !important;
        border-radius: 12px !important;
    }

    .tt-select-wrapper select {
        font-size: 0.76rem !important;
        height: 32px !important;
        padding: 3px 20px 3px 6px !important;
    }}

/* --- Supervision Responsive Control Toolbar --- */
.supervision-header-card {
    background: #ffffff;
    position: relative;
    z-index: 10 !important;
    overflow: visible !important;
}

.supervision-header-card:focus-within,
.supervision-header-card:has(.dropdown-menu.show) {
    z-index: 20 !important;
}

.supervision-actions-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    position: relative;
    z-index: 12;
    overflow: visible !important;
}

.supervision-actions-grid .dropdown {
    position: relative;
    z-index: 14;
}

.supervision-actions-grid .dropdown-menu {
    z-index: 1000 !important;
}

@media screen and (max-width: 991px) {
    .supervision-toolbar-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .supervision-title-bar {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .supervision-quota-box {
        margin-left: auto;
    }

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

    .supervision-actions-grid .btn,
    .supervision-actions-grid .dropdown,
    .supervision-actions-grid .dropdown>.btn {
        width: 100% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 7px 8px !important;
        font-size: 0.78rem !important;
        border-radius: 50rem !important;
        white-space: nowrap !important;
    }}

/* --- Mentors Responsive Toolbar --- */
.mentors-toolbar-card {
    background: #ffffff;
    position: relative;
    z-index: 10 !important;
    overflow: visible !important;
}

.mentors-actions-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

@media screen and (max-width: 767px) {
    .mentors-toolbar-card .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

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

    .mentors-actions-grid .btn,
    .mentors-actions-grid .dropdown,
    .mentors-actions-grid .dropdown>.btn {
        width: 100% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 7px 8px !important;
        font-size: 0.78rem !important;
        border-radius: 50rem !important;
        white-space: nowrap !important;
    }}

/* --- Subject Class Row in Teacher Modal (Nisab Auto-Fill & Manual Editing) --- */
.subject-class-row {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    cursor: pointer;
}

.subject-class-row:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12) !important;
    border-color: #6366f1 !important;
}

.subject-class-row:active {
    transform: translateY(0) scale(0.99);
}

.subject-class-row.is-assigned {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08)) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08) !important;
}

.subject-class-row.is-assigned span.small {
    color: #4338ca !important;
    font-weight: 700 !important;
}

.subject-class-row input[type="number"] {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0 !important;
}

.subject-class-row input[type="number"]:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none !important;
}

[data-bs-theme="dark"] .subject-class-row.is-assigned {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.18)) !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
}

[data-bs-theme="dark"] .subject-class-row.is-assigned span.small {
    color: #c7d2fe !important;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Modern Clay Cards */
.sup-modern-card {
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.sup-modern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
    border-color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .sup-modern-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .sup-modern-card strong {
    color: #f1f5f9 !important;
}

/* 3. Official Table View */
.sup-official-table {
    border-radius: 14px;
    overflow: hidden;
}

.sup-official-table thead th {
    font-weight: 700;
    color: #334155;
    border-bottom: 2px solid #cbd5e1 !important;
}

.sup-official-table td {
    vertical-align: middle;
}

[data-bs-theme="dark"] .sup-official-table {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .sup-official-table thead th {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .sup-official-table tbody td {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .sup-official-table tfoot {
    background: #1e293b !important;
}

/* 4. Ultra-Compact List */
.sup-compact-item {
    transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.sup-compact-item:hover {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    transform: translateX(-1px);
}

[data-bs-theme="dark"] .sup-compact-item {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .sup-compact-item strong {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .sup-compact-item:hover {
    background: #334155 !important;
}

.sup-action-btn-danger:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
}

.period-supervisor-item,
.sup-period-clay-item {
    background: #ffffff !important;
    border: 1.5px solid #ffffff !important;
    border-radius: 14px !important;
    padding: 6px 8px !important;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 3px 10px -2px rgba(148, 163, 184, 0.2),
        inset 1.5px 1.5px 2px rgba(255, 255, 255, 1),
        inset -1.5px -1.5px 2px rgba(0, 0, 0, 0.03) !important;
}

.period-supervisor-item:hover,
.sup-period-clay-item:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 6px 14px -2px rgba(148, 163, 184, 0.3) !important;
    transform: translateY(-1px);
}

.period-supervisor-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: #0f172a;
    padding: 0 2px;
    display: inline-block;
}

.sup-period-compact-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px 8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sup-period-table-slot {
    min-width: 130px;
    vertical-align: top !important;
    padding: 4px 6px !important;
}

/* ==========================================================================
   GLOBAL Z-INDEX & STACKING SYSTEM: PREVENT ANY WINDOW/MODAL/DROPDOWN FROM APPEARING IN THE BACK
   ========================================================================== */

/* 1. Global Dropdown Menus: Always appear in front of all cards, tables, headers, and backgrounds */
.dropdown-menu,
.dropdown-menu.show,
.dropdown-menu[data-bs-popper],
.supervision-actions-grid .dropdown-menu,
#supervisionWeeklyGrid .supervisor-slot-card .dropdown-menu,
.period-bell-card .dropdown-menu,
.class-mentors-dashboard .dropdown-menu {
    z-index: 2000 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 2. Toolbars and wrappers in ALL sections: base z-index 50 and overflow visible */
.timetable-toolbar-wrapper,
.substitute-toolbar-card,
.supervision-header-card,
.mentors-toolbar-card,
.tt-toolbar-tier1,
.tt-toolbar-tier2,
.sub-view-bar-tier1,
.sub-view-bar-tier2,
.supervision-actions-grid,
.mentors-actions-grid,
.tt-actions-tray,
.substitute-actions-tray {
    position: relative !important;
    z-index: 50 !important;
    overflow: visible !important;
}

/* 3. When ANY container holds an active dropdown menu, promote its stacking context to 1060 */
.card:has(.dropdown-menu.show),
.card:focus-within:has(.dropdown-menu.show),
.timetable-toolbar-wrapper:has(.dropdown-menu.show),
.timetable-toolbar-wrapper:focus-within,
.substitute-toolbar-card:has(.dropdown-menu.show),
.substitute-toolbar-card:focus-within,
.tt-toolbar-tier2:has(.dropdown-menu.show),
.tt-toolbar-tier1:has(.dropdown-menu.show),
.sub-view-bar-tier2:has(.dropdown-menu.show),
.sub-view-bar-tier1:has(.dropdown-menu.show),
.supervision-header-card:has(.dropdown-menu.show),
.mentors-toolbar-card:has(.dropdown-menu.show),
.tt-actions-tray:has(.dropdown-menu.show),
.substitute-actions-tray:has(.dropdown-menu.show),
.btn-group:has(.dropdown-menu.show),
.dropdown:has(.dropdown-menu.show),
.dropdown-active-parent {
    position: relative !important;
    z-index: 1060 !important;
    overflow: visible !important;
}

/* 4. Bootstrap Modals & Backdrops: Always strictly above all page content and toolbars */
.modal-backdrop {
    z-index: 10490 !important;
}

.modal {
    z-index: 10500 !important;
}

.modal-dialog {
    z-index: 10501 !important;
}

/* 5. Tooltips and Popovers */
.tooltip,
.popover {
    z-index: 10600 !important;
}

/* 6. SweetAlert2 Dialogs & Popups: Highest priority, always on top of modals and page content */
.swal2-container {
    z-index: 20000 !important;
}

/* 7. Select2 Dropdowns */
.select2-container--open,
.select2-dropdown {
    z-index: 30000 !important;
}

/* 8. When a modal is open, lower in-page toolbars so they cannot overlay the modal backdrop */
body.modal-open .timetable-toolbar-wrapper,
body.modal-open .substitute-toolbar-card,
body.modal-open .supervision-header-card,
body.modal-open .supervision-actions-grid,
body.modal-open .supervision-wrapper,
body.modal-open .class-mentors-dashboard,
body.modal-open .mentors-toolbar-card,
body.modal-open #supervisionWeeklyGrid .day-card,
body.modal-open #supervisionWeeklyGrid .supervisor-slot-card,
body.modal-open .dropdown-active-parent {
    z-index: 1 !important;
}

@keyframes clayBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-4px) scale(1.08);
    }
}

/* ==========================================================
   HEADER, TABS & TOOLBAR EXACT SCREENSHOT LAYOUT & STYLES
   ========================================================== */

/* 1. Top Header Card */
.top-header-card {
    background-color: var(--bs-card-bg);
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    border-radius: 1.15rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    padding: 0.6rem 1.25rem !important;
    margin-bottom: 0.65rem !important;
    transform: none !important;
}

.top-header-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

[data-bs-theme="dark"] .top-header-card {
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

.header-app-title {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--bs-body-color);
    letter-spacing: -0.2px;
}

/* ==========================================================
   TOP HEADER 3D CLAYMORPHISM CONTROLS (أدوات الهيدر ثلاثية الأبعاد)
   ========================================================== */

/* 1. Header Card Styling */
.top-header-card {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05),
        inset 1px 1px 2px rgba(255, 255, 255, 0.95) !important;
    transition: all 0.25s ease !important;
}

[data-bs-theme="dark"] .top-header-card {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45),
        inset 1px 1px 2px rgba(255, 255, 255, 0.08) !important;
}

/* 2. Branding App Icon 3D Badge */
.header-app-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(145deg, #c7d2fe, #6366f1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.35),
        inset 2px 2px 3px rgba(255, 255, 255, 0.8),
        inset -2px -2px 3px rgba(0, 0, 0, 0.12);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.header-app-icon-badge i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* 3. Base 3D Claymorphism Circle Button */
.header-circle-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer !important;
    user-select: none !important;
    text-decoration: none !important;
}

.header-circle-btn i {
    font-size: 0.88rem !important;
    transition: transform 0.22s ease !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.header-circle-btn:hover {
    transform: translateY(-2px) scale(1.08) !important;
}

.header-circle-btn:hover i {
    transform: scale(1.15) !important;
}

.header-circle-btn:active {
    transform: translateY(1px) scale(0.95) !important;
}

/* 4. Rename Button (3D Sky Cyan Clay) */
.header-circle-rename {
    background: linear-gradient(145deg, #a5f3fc, #0ea5e9) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(14, 165, 233, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
}

.header-circle-rename:hover {
    box-shadow: 0 6px 16px -2px rgba(14, 165, 233, 0.48),
        inset 2px 2px 4px rgba(255, 255, 255, 0.9),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1) !important;
}

.header-circle-rename:active {
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* 5. Delete Button (3D Coral Ruby Red Clay) */
.header-circle-delete {
    background: linear-gradient(145deg, #fecaca, #f87171) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
}

.header-circle-delete:hover {
    box-shadow: 0 6px 16px -2px rgba(239, 68, 68, 0.48),
        inset 2px 2px 4px rgba(255, 255, 255, 0.9),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1) !important;
}

.header-circle-delete:active {
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* 6. Language Button (3D Soft Periwinkle Clay) */
.header-circle-lang {
    background: linear-gradient(145deg, #c7d2fe, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
}

.header-circle-lang:hover {
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.48),
        inset 2px 2px 4px rgba(255, 255, 255, 0.9),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1) !important;
}

.header-circle-lang:active {
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* 7. Active Schedule 3D Claymorphism Pill Dropdown */
.header-active-schedule-btn {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    color: #1e293b !important;
    border: 1.5px solid rgba(203, 213, 225, 0.9) !important;
    min-width: 150px;
    height: 36px !important;
    padding: 0.35rem 0.9rem !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 12px -2px rgba(100, 116, 139, 0.15),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(0, 0, 0, 0.04) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.header-active-schedule-btn:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 7px 16px -2px rgba(100, 116, 139, 0.22),
        inset 2px 2px 4px rgba(255, 255, 255, 0.95),
        inset -2px -2px 4px rgba(0, 0, 0, 0.04) !important;
}

.header-active-schedule-btn:active {
    transform: translateY(1px) scale(0.98) !important;
}

/* Calendar Icon 3D Badge inside Schedule Pill */
.header-schedule-icon-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #93c5fd, #3b82f6);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35),
        inset 1px 1px 2px rgba(255, 255, 255, 0.75),
        inset -1px -1px 2px rgba(0, 0, 0, 0.12);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.header-schedule-icon-badge i {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* 8. Header Divider */
.header-divider {
    width: 2px;
    height: 24px;
    background-color: #cbd5e1;
    border-radius: 2px;
    align-self: center;
    margin: 0 0.2rem;
}

/* 9. Custom 3D Claymorphism Theme Toggle Switch */
.header-theme-toggle-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.header-theme-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.header-theme-clay-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 66px;
    height: 36px;
    border-radius: 50px;
    background: linear-gradient(145deg, #f1f5f9, #cbd5e1);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.12),
        inset -2px -2px 4px rgba(255, 255, 255, 0.8),
        0 3px 8px -2px rgba(100, 116, 139, 0.2);
    cursor: pointer;
    padding: 3px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 0;
}

.theme-track-icons {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 9px;
    pointer-events: none;
}

.theme-track-icons .track-icon-sun {
    font-size: 0.78rem;
    color: #f59e0b;
    opacity: 0.35;
    transition: opacity 0.25s ease;
}

.theme-track-icons .track-icon-moon {
    font-size: 0.78rem;
    color: #6366f1;
    opacity: 0.75;
    transition: opacity 0.25s ease;
}

/* Knob 3D Clay Sphere */
.theme-knob-clay {
    position: absolute;
    left: 4px;
    top: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fef08a, #f59e0b);
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.4),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.9),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.82rem;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.theme-knob-clay i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.theme-knob-icon-sun {
    display: block;
}

.theme-knob-icon-moon {
    display: none;
}

/* Checked State (Dark Mode Theme Toggle) */
.header-theme-checkbox:checked+.header-theme-clay-track {
    background: linear-gradient(145deg, #1e1b4b, #312e81);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5),
        inset -2px -2px 4px rgba(255, 255, 255, 0.08),
        0 3px 10px -2px rgba(0, 0, 0, 0.5);
}

.header-theme-checkbox:checked+.header-theme-clay-track .theme-knob-clay {
    left: calc(100% - 32px);
    background: linear-gradient(145deg, #c7d2fe, #6366f1);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.5),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.85),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.15);
}

.header-theme-checkbox:checked+.header-theme-clay-track .theme-knob-icon-sun {
    display: none;
}

.header-theme-checkbox:checked+.header-theme-clay-track .theme-knob-icon-moon {
    display: block;
}

.header-theme-checkbox:checked+.header-theme-clay-track .track-icon-sun {
    opacity: 0.75;
}

.header-theme-checkbox:checked+.header-theme-clay-track .track-icon-moon {
    opacity: 0.3;
}

/* 10. Dark Mode Overrides for Header */
[data-bs-theme="dark"] .header-circle-btn {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .header-circle-rename {
    background: linear-gradient(145deg, #0369a1, #075985) !important;
    color: #bae6fd !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.3),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .header-circle-delete {
    background: linear-gradient(145deg, #b91c1c, #991b1b) !important;
    color: #fecaca !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.3),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .header-circle-lang {
    background: linear-gradient(145deg, #4338ca, #3730a3) !important;
    color: #c7d2fe !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.3),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .header-active-schedule-btn {
    background: linear-gradient(145deg, #334155, #1e293b) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4),
        inset 1.5px 1.5px 3px rgba(255, 255, 255, 0.15),
        inset -1.5px -1.5px 3px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .header-divider {
    background-color: rgba(255, 255, 255, 0.12);
}

/* 2. Main Navigation Tabs Bar */
.main-tabs-card {
    background-color: var(--bs-card-bg);
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    border-radius: 1.15rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    padding: 0.35rem 0.65rem !important;
    margin-bottom: 0.65rem !important;
    transform: none !important;
}

.main-tabs-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

[data-bs-theme="dark"] .main-tabs-card {
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

.custom-main-tabs {
    border: none !important;
    gap: 0.25rem !important;
}

.custom-main-tabs .nav-link {
    border: none !important;
    border-radius: 0.65rem !important;
    padding: 0.5rem 0.85rem !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.custom-main-tabs .nav-link:hover {
    color: #0f172a !important;
    background: rgba(226, 232, 240, 0.6) !important;
    transform: none !important;
}

.custom-main-tabs .nav-link.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.custom-main-tabs .nav-link.active i {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* 1. Stage Selector (سەرەتایی - Soft Pastel Royal Indigo Clay) */
.btn-tb-stage,
#stageSelectorBtn {
    background: linear-gradient(145deg, #a5b4fc, #6366f1) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.28),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
}

.btn-tb-stage:hover,
#stageSelectorBtn:hover {
    background: linear-gradient(145deg, #c7d2fe, #818cf8) !important;
    box-shadow: 0 7px 16px -2px rgba(99, 102, 241, 0.38),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.10) !important;
}

.btn-tb-stage:active,
#stageSelectorBtn:active {
    background: linear-gradient(145deg, #818cf8, #4f46e5) !important;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.25),
        inset -2px -2px 4px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

[data-bs-theme="dark"] .subject-clay-row:hover {
    background: rgba(30, 41, 59, 0.95) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
}

.tt-status-dot {
    width: 9px !important;
    height: 9px !important;
    min-width: 9px !important;
    min-height: 9px !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    flex-shrink: 0 !important;
}

/* ==========================================================================
   MAIN NAVIGATION TABS - CLAYMORPHISM & UNIQUE CALM COLOR PALETTES
   ========================================================================== */

/* 1. Main Navigation Card Container */
.main-tabs-card {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05),
        inset 1px 1px 2px rgba(255, 255, 255, 0.95) !important;
    padding: 0.45rem 0.6rem !important;
    transition: all 0.25s ease !important;
}

[data-bs-theme="dark"] .main-tabs-card {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45),
        inset 1px 1px 2px rgba(255, 255, 255, 0.08) !important;
}

/* 2. Responsive Grid for Navigation Tabs */
.custom-main-tabs {
    display: grid !important;
    grid-template-columns: repeat(9, 1fr) !important;
    gap: 0.45rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.custom-main-tabs .nav-item {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
}

.custom-main-tabs .nav-link {
    width: 100% !important;
    border-radius: 50px !important;
    font-size: 0.90rem !important;
    font-weight: 800 !important;
    padding: 0.48rem 0.75rem !important;
    min-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    user-select: none !important;
    cursor: pointer !important;
    border: 1.5px solid transparent !important;
}

.custom-main-tabs .nav-link i {
    font-size: 0.96rem !important;
    transition: transform 0.22s ease !important;
}

.custom-main-tabs .nav-link:hover i {
    transform: scale(1.15) !important;
}

.custom-main-tabs .nav-link:active {
    transform: translateY(1px) scale(0.97) !important;
}

/* ==========================================================================
   EACH SECTION (TAB) UNIQUE CALM PASTEL CLAYMORPHISM PALETTE (+10% Vibrancy)
   ========================================================================== */

/* --- 1. دابەشکرنا وانان (Distribution: Soft Royal Iris / Slate Periwinkle) --- */
.custom-main-tabs .nav-link.tab-distribution {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #4338ca !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(99, 102, 241, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-distribution:hover {
    background: rgba(99, 102, 241, 0.26) !important;
    color: #312e81 !important;
    border-color: rgba(99, 102, 241, 0.48) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-distribution.active {
    background: linear-gradient(145deg, #a5b4fc, #6366f1) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 2. خشتێ حەفتیانە (Timetable: Soft Cerulean / Deep Sky Blue) --- */
.custom-main-tabs .nav-link.tab-timetable {
    background: rgba(14, 165, 233, 0.18) !important;
    color: #0369a1 !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(14, 165, 233, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-timetable:hover {
    background: rgba(14, 165, 233, 0.26) !important;
    color: #075985 !important;
    border-color: rgba(14, 165, 233, 0.48) !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-timetable.active {
    background: linear-gradient(145deg, #7dd3fc, #0284c7) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(2, 132, 199, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 3. ماموستایێن جێگر (Substitute: Soft Lavender Plum / Amethyst) --- */
.custom-main-tabs .nav-link.tab-substitute {
    background: rgba(168, 85, 247, 0.18) !important;
    color: #6b21a8 !important;
    border-color: rgba(168, 85, 247, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(168, 85, 247, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-substitute:hover {
    background: rgba(168, 85, 247, 0.26) !important;
    color: #581c87 !important;
    border-color: rgba(168, 85, 247, 0.48) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-substitute.active {
    background: linear-gradient(145deg, #d8b4fe, #9333ea) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(147, 51, 234, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 4. خشتێ چاڤدێریێ (Supervision: Soft Sage Mint / Emerald Green) --- */
.custom-main-tabs .nav-link.tab-supervision {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #047857 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(16, 185, 129, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-supervision:hover {
    background: rgba(16, 185, 129, 0.26) !important;
    color: #064e3b !important;
    border-color: rgba(16, 185, 129, 0.48) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-supervision.active {
    background: linear-gradient(145deg, #86efac, #10b981) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 5. ڕێبەرێن پۆلان (Class Mentors: Soft Strawberry Rose / Coral Pink) --- */
.custom-main-tabs .nav-link.tab-mentors {
    background: rgba(244, 63, 94, 0.18) !important;
    color: #be123c !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(244, 63, 94, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-mentors:hover {
    background: rgba(244, 63, 94, 0.26) !important;
    color: #881337 !important;
    border-color: rgba(244, 63, 94, 0.48) !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-mentors.active {
    background: linear-gradient(145deg, #fda4af, #f43f5e) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(244, 63, 94, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 6. نصاب وانان (Quotas / Nisab: Soft Golden Amber / Honey) --- */
.custom-main-tabs .nav-link.tab-nisab {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #b45309 !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(245, 158, 11, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-nisab:hover {
    background: rgba(245, 158, 11, 0.26) !important;
    color: #78350f !important;
    border-color: rgba(245, 158, 11, 0.48) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-nisab.active {
    background: linear-gradient(145deg, #fcd34d, #f59e0b) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(245, 158, 11, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 7. فۆڕما ڕێکخستنا میلاکی (Staff Cadre / Milak: Soft Marine Teal / Turquoise) --- */
.custom-main-tabs .nav-link.tab-milak {
    background: rgba(20, 184, 166, 0.18) !important;
    color: #0f766e !important;
    border-color: rgba(20, 184, 166, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(20, 184, 166, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-milak:hover {
    background: rgba(20, 184, 166, 0.26) !important;
    color: #134e4a !important;
    border-color: rgba(20, 184, 166, 0.48) !important;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-milak.active {
    background: linear-gradient(145deg, #5eead4, #14b8a6) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(20, 184, 166, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* --- 8. ئامار و داتا (Statistics & Data: Soft Orchid Magenta / Pink Pearl) --- */
.custom-main-tabs .nav-link.tab-statistics {
    background: rgba(217, 70, 239, 0.18) !important;
    color: #a21caf !important;
    border-color: rgba(217, 70, 239, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(217, 70, 239, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-statistics:hover {
    background: rgba(217, 70, 239, 0.26) !important;
    color: #701a75 !important;
    border-color: rgba(217, 70, 239, 0.48) !important;
    box-shadow: 0 4px 12px rgba(217, 70, 239, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-statistics.active {
    background: linear-gradient(145deg, #f0abfc, #d946ef) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(217, 70, 239, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   DARK MODE OVERRIDES FOR NAVIGATION TABS
   ========================================================================== */
[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-distribution {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-timetable {
    background: rgba(14, 165, 233, 0.18) !important;
    color: #bae6fd !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-substitute {
    background: rgba(168, 85, 247, 0.18) !important;
    color: #e9d5ff !important;
    border-color: rgba(168, 85, 247, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-supervision {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #a7f3d0 !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-mentors {
    background: rgba(244, 63, 94, 0.18) !important;
    color: #fecdd3 !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-nisab {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-milak {
    background: rgba(20, 184, 166, 0.18) !important;
    color: #99f6e4 !important;
    border-color: rgba(20, 184, 166, 0.35) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-statistics {
    background: rgba(217, 70, 239, 0.18) !important;
    color: #f5d0fe !important;
    border-color: rgba(217, 70, 239, 0.35) !important;
}

/* ==========================================================================
   COMPREHENSIVE UNIVERSAL RESPONSIVE SYSTEM (متناسب مع جميع مقاييس الشاشات)
   Desktops (4K, 2K, 1080p), Laptops, iPads & Tablets, and Mobile Devices
   ========================================================================== */

/* 1. Global Fluid Layout Container */
.main-container {
    width: 100% !important;
    max-width: 1920px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(8px, 1.6vw, 24px) !important;
    padding-right: clamp(8px, 1.6vw, 24px) !important;
    box-sizing: border-box !important;
}

/* 2. Universal Navigation Tabs Grid Breakpoints */
/* Desktops & Ultrawide (> 1360px): 1 Row of 9 Tabs */
@media (min-width: 1361px) {
    .custom-main-tabs {
        grid-template-columns: repeat(9, 1fr) !important;
        gap: 0.45rem !important;
    }}

/* Laptops, MacBooks, Tablets & iPads (768px - 1360px): Exactly 2 balanced Rows of 4 Tabs */
@media (max-width: 1360px) and (min-width: 768px) {
    .custom-main-tabs {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        gap: 0.45rem !important;
    }

    .custom-main-tabs .nav-link {
        font-size: clamp(0.76rem, 0.95vw, 0.82rem) !important;
        padding: 0.42rem 0.55rem !important;
        min-height: 38px !important;
    }}

/* Mobile Devices & Small Tablets (<= 767px): Native App-Like Horizontal Swipeable Ribbon */
@media (max-width: 767px) {
    .main-tabs-card {
        padding: 0.35rem 0.4rem !important;
        border-radius: 16px !important;
        margin-bottom: 0.5rem !important;
        overflow: hidden !important;
    }

    .custom-main-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0.35rem !important;
        padding: 2px 2px !important;
        width: 100% !important;
    }

    .custom-main-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .custom-main-tabs .nav-item {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .custom-main-tabs .nav-link {
        white-space: nowrap !important;
        font-size: 0.79rem !important;
        font-weight: 700 !important;
        padding: 0.4rem 0.85rem !important;
        min-height: 36px !important;
        gap: 0.4rem !important;
        border-radius: 50px !important;
    }

    .custom-main-tabs .nav-link i {
        font-size: 0.82rem !important;
    }}

/* 3. Top Header Bar Mobile Architecture */
@media (max-width: 991px) {
    .top-header-card {
        padding: 0.55rem 0.85rem !important;
        border-radius: 16px !important;
    }

    .header-app-title {
        font-size: 1.05rem !important;
    }}

@media (max-width: 767px) {
    .top-header-card {
        padding: 0.5rem 0.75rem !important;
        border-radius: 18px !important;
        margin-bottom: 0.5rem !important;
    }

    .top-header-card>div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .app-branding {
        justify-content: center !important;
        text-align: center !important;
    }

    .header-app-title {
        font-size: 1.05rem !important;
    }

    .header-divider {
        display: none !important;
    }

    .header-controls {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .header-group-schedule {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    #scheduleDropdownContainer {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .header-active-schedule-btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 34px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.78rem !important;
        gap: 0.35rem !important;
    }

    .header-active-schedule-btn span#activeScheduleLabel {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
        max-width: 80px !important;
    }

    .header-schedule-icon-badge {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.7rem !important;
    }

    .header-circle-btn {
        width: 33px !important;
        height: 33px !important;
        min-width: 33px !important;
        min-height: 33px !important;
        flex-shrink: 0 !important;
    }

    .header-group-system {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
    }

    .header-theme-clay-track {
        width: 56px !important;
        height: 32px !important;
    }

    .theme-knob-clay {
        width: 24px !important;
        height: 24px !important;
        top: 3px !important;
    }

    .header-theme-checkbox:checked+.header-theme-clay-track .theme-knob-clay {
        left: calc(100% - 28px) !important;
    }}

/* Mobile Structured Toolbar Layout (<= 767px) */
@media (max-width: 767px) {

    /* Stage Selector spans 100% full width with zero text clipping */
    .toolbar-group-views .btn-group:last-child,
    #stageSelectorBtn {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }}

/* Timetable Toolbar Dedicated Responsive Mobile Layout (<= 767px) */
@media (max-width: 767px) {

    /* Container & Toolbar card overflow containment */
    #timetable-tab-pane {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* 2. All 4 View Modes in a Perfect Balanced 2x2 Grid (خشتێ پولا, خشتێ ماموستا / ماستر پولان, ماستر ماموستایان) */
    #timetable-tab-pane .tt-view-btn-group,
    #timetable-tab-pane .toolbar-group-views .btn-group,
    #timetable-tab-pane .toolbar-group-views .btn-group[role="group"],
    #timetable-tab-pane .btn-group[role="group"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.35rem !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px !important;
        padding: 4px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        flex-wrap: wrap !important;
    }}

/* 6. Universal Smooth Inertia Touch Scrolling for Tables */
.table-responsive {
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(99, 102, 241, 0.35) rgba(0, 0, 0, 0.04) !important;
}

.table-responsive::-webkit-scrollbar {
    height: 7px !important;
    width: 7px !important;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03) !important;
    border-radius: 10px !important;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #a5b4fc, #6366f1) !important;
    border-radius: 10px !important;
}

[data-bs-theme="dark"] .table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-bs-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #4338ca, #6366f1) !important;
}

/* Mobile Table Cells Compact Padding */
@media (max-width: 767px) {

    .table td,
    .table th {
        padding: 5px 4px !important;
        font-size: 0.78rem !important;
    }

    .table .btn-sm {
        padding: 2px 4px !important;
        font-size: 0.7rem !important;
    }}

/* 7. Modal Windows Fluid Sizing on Mobile */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-content {
        border-radius: 18px !important;
    }}

/* ==========================================================================
   OFFICIAL MINISTRY TABLE FORMAT (خشتێ دابەشکرنا بەهرێن حەفتیانە یێ فەرمی)
   ========================================================================== */
.official-doc-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .official-doc-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

/* Official Document Header (Exact Match to Ministry Document Table) */
.official-top-header-table {
    width: 100%;
    border: 2px solid #0f172a;
    border-collapse: collapse;
    margin-bottom: 4px;
    background: #ffffff;
}

[data-bs-theme="dark"] .official-top-header-table {
    border-color: #94a3b8;
    background: #0f172a;
}

.official-top-header-table td {
    border: none;
    vertical-align: middle;
    padding: 1px 4px !important;
}

.official-staff-line {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

[data-bs-theme="dark"] .official-staff-line {
    color: #f8fafc;
}

.official-main-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
    margin-bottom: 0;
}

[data-bs-theme="dark"] .official-main-title {
    color: #f8fafc;
}

.official-doc-meta {
    font-size: 0.68rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

[data-bs-theme="dark"] .official-doc-meta {
    color: #cbd5e1;
}

.official-school-line {
    font-size: 0.68rem;
    color: #0f172a;
    line-height: 1.2;
}

[data-bs-theme="dark"] .official-school-line {
    color: #f8fafc;
}

.official-header-center {
    text-align: center;
    align-items: center;
    gap: 8px;
}

.official-main-title-badge {
    font-size: 1.20rem;
    font-weight: 900;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 3px;
    letter-spacing: 0.5px;
    display: inline-block;
}

[data-bs-theme="dark"] .official-main-title-badge {
    color: #f8fafc;
    border-bottom-color: #94a3b8;
}

.official-doc-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    flex-wrap: wrap;
}

[data-bs-theme="dark"] .official-doc-meta-row {
    color: #cbd5e1;
}

.official-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.official-header-left {
    align-items: flex-end;
    justify-content: center;
}

.official-staff-summary-table {
    border-collapse: collapse;
    border: 1.5px solid #0f172a;
    width: 100%;
    max-width: 220px;
    font-size: 0.76rem;
    background: #ffffff;
    margin-left: 0;
}

[data-bs-theme="dark"] .official-staff-summary-table {
    border-color: #94a3b8;
    background: #1e293b;
}

.official-staff-summary-table th,
.official-staff-summary-table td {
    border: 1px solid #0f172a;
    padding: 2.5px 6px;
    text-align: center;
    vertical-align: middle;
}

[data-bs-theme="dark"] .official-staff-summary-table th,
[data-bs-theme="dark"] .official-staff-summary-table td {
    border-color: #64748b;
}

.official-staff-summary-table th {
    background: #f1f5f9;
    font-weight: 700;
    text-align: right;
    color: #0f172a;
}

[data-bs-theme="dark"] .official-staff-summary-table th {
    background: #334155;
    color: #f8fafc;
}

.official-staff-sum-row {
    background: #e2e8f0;
    font-weight: 800;
}

[data-bs-theme="dark"] .official-staff-sum-row {
    background: #475569;
}

/* Official Editable Text Fields */
.official-editable-field {
    border-bottom: 1.5px dashed rgba(99, 102, 241, 0.45);
    padding: 1px 4px;
    outline: none;
    display: inline-block;
    min-width: 25px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.official-editable-field:hover,
.official-editable-field:focus {
    background: rgba(99, 102, 241, 0.12);
    border-bottom-color: #4f46e5;
}

.official-sub-table td[contenteditable="true"] {
    outline: none;
    cursor: text;
    transition: background 0.15s ease;
}

.official-sub-table td[contenteditable="true"]:focus {
    background-color: rgba(99, 102, 241, 0.1) !important;
    outline: 1.5px solid #6366f1 !important;
    outline-offset: -1px;
}

/* Official Ministry Table Structure */
.table-official-ministry {
    border: 2px solid #0f172a !important;
    border-collapse: collapse !important;
    width: 100% !important;
    table-layout: auto !important;
    font-size: 0.82rem !important;
    margin-bottom: 0 !important;
}

.official-col-nowrap {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

[data-bs-theme="dark"] .table-official-ministry {
    border-color: #94a3b8 !important;
}

.table-official-ministry th,
.table-official-ministry td {
    border: 1.2px solid #0f172a !important;
    padding: 4px 3px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

[data-bs-theme="dark"] .table-official-ministry th,
[data-bs-theme="dark"] .table-official-ministry td {
    border-color: #64748b !important;
}

.table-official-ministry thead th.official-th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 0.84rem !important;
}

[data-bs-theme="dark"] .table-official-ministry thead th.official-th {
    background: #334155 !important;
    color: #f8fafc !important;
}

/* Class Column Headers */
.official-class-col-header {
    min-width: 32px !important;
    padding: 3px 2px !important;
    white-space: nowrap !important;
}

.official-class-combined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
}

.official-grade-num {
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.official-section-let {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

/* Alternating Shading for Grade Columns (as in Official PDF) */
.official-col-white {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.official-col-shaded {
    background-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .official-col-white {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .official-col-shaded {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

.table-official-ministry tbody tr:hover td {
    filter: brightness(0.96);
}

[data-bs-theme="dark"] .table-official-ministry tbody tr:hover td {
    filter: brightness(1.15);
}

/* Subject items badge in official table */
.official-sub-item {
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: nowrap;
}

.official-sub-item .sub-name {
    font-weight: 600;
}

.official-sub-item .sub-count {
    color: #2563eb;
}

[data-bs-theme="dark"] .official-sub-item .sub-count {
    color: #60a5fa;
}

/* Bottom Official Summary Grid (Page 3 of PDF) */
.official-bottom-container {
    margin-top: 18px;
    border: 2px solid #0f172a;
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

[data-bs-theme="dark"] .official-bottom-container {
    border-color: #94a3b8;
    background: #0f172a;
}

.official-bottom-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.official-bottom-col-right {
    flex: 0 0 35% !important;
    max-width: 35% !important;
    width: 35% !important;
}

.official-bottom-col-left {
    flex: 0 0 65% !important;
    max-width: 65% !important;
    width: 65% !important;
}

.official-sub-main-title {
    background: #e2e8f0 !important;
    font-size: 0.90rem !important;
    font-weight: 900 !important;
    text-align: center !important;
    padding: 4px 6px !important;
    color: #0f172a !important;
    letter-spacing: 0.5px;
}

[data-bs-theme="dark"] .official-sub-main-title {
    background: #334155 !important;
    color: #f8fafc !important;
}

.official-sub-table {
    border: 1.5px solid #0f172a !important;
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 0.8rem !important;
}

[data-bs-theme="dark"] .official-sub-table {
    border-color: #64748b !important;
}

.official-sub-table th,
.official-sub-table td {
    border: 1px solid #0f172a !important;
    padding: 4px 6px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

[data-bs-theme="dark"] .official-sub-table th,
[data-bs-theme="dark"] .official-sub-table td {
    border-color: #64748b !important;
}

.official-sub-table thead th {
    background: #e2e8f0 !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

[data-bs-theme="dark"] .official-sub-table thead th {
    background: #334155 !important;
    color: #f8fafc !important;
}

.official-reasons-header {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

[data-bs-theme="dark"] .official-reasons-header {
    color: #f8fafc;
}

.official-reasons-box {
    border: 1.5px solid #0f172a;
    border-radius: 6px;
    min-height: 80px;
    padding: 8px 12px;
    background: #ffffff;
    font-size: 0.84rem;
    line-height: 1.5;
    outline: none;
}

[data-bs-theme="dark"] .official-reasons-box {
    border-color: #64748b;
    background: #1e293b;
    color: #f8fafc;
}

.official-checkbox-box {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 1.8px solid #0f172a;
    border-radius: 3px;
    background: #ffffff;
    vertical-align: middle;
}

[data-bs-theme="dark"] .official-checkbox-box {
    border-color: #94a3b8;
    background: #1e293b;
}

.official-sign-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

[data-bs-theme="dark"] .official-sign-row {
    border-top-color: #334155;
}

.official-th-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    white-space: nowrap;
    vertical-align: middle;
    padding: 6px 3px !important;
    height: 130px !important;
    min-height: 130px !important;
    min-width: 32px !important;
    font-size: 0.76rem !important;
    line-height: 1 !important;
}

/* Print Optimization for Official Ministry Format */
@media print {
    @page {
        margin: 6mm 7mm !important;
    }

    *, *::before, *::after {
        box-sizing: border-box !important;
    }

    table {
        box-sizing: border-box !important;
    }

    html,
    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        overflow: visible !important;
    }

    /* Hide everything except the official document on print */
    body>*:not(#app):not(.tab-content):not(main):not(.main-container):not(.official-doc-container) {
        display: none !important;
    }

    /* Hide all tab panes except the one containing official doc */
    .tab-pane {
        display: none !important;
    }

    /* Show only official-doc-container and its parents */
    .tab-pane:has(.official-doc-container),
    .tab-pane.active {
        display: block !important;
    }

    /* Override any overflow that prevents page breaking */
    .table-responsive,
    #tableContainer,
    .print-area,
    .official-table-responsive {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        display: block !important;
        height: auto !important;
        max-height: none !important;
    }

    footer,
    .no-print,
    .print-footer,
    .navbar,
    nav,
    .distribution-toolbar-card,
    .nav-tabs,
    .tab-nav,
    [role="tablist"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .official-doc-container {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .official-top-header-table {
        width: 100% !important;
        border: 2px solid #000000 !important;
        border-collapse: collapse !important;
        background: #ffffff !important;
        color: #000000 !important;
        margin-bottom: 2px !important;
        /* page-break rules removed to prevent blank first pages */
    }

    .official-top-header-table td {
        border: none !important;
        color: #000000 !important;
        padding: 1px 4px !important;
        vertical-align: middle !important;
    }

    .official-staff-line,
    .official-school-line {
        font-size: 0.68rem !important;
        color: #000000 !important;
        line-height: 1.15 !important;
    }

    .official-main-title {
        font-size: 0.72rem !important;
        font-weight: 800 !important;
        color: #000000 !important;
        margin-bottom: 0 !important;
        letter-spacing: 0.2px !important;
    }

    .official-doc-meta {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        line-height: 1.15 !important;
    }

    .official-th-vertical {
        writing-mode: vertical-rl !important;
        text-orientation: mixed !important;
        transform: rotate(180deg) !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        padding: 4px 1px !important;
        height: 110px !important;
        min-height: 110px !important;
        width: 24px !important;
        min-width: 24px !important;
        max-width: 26px !important;
        font-size: 0.68rem !important;
        line-height: 1 !important;
    }

    .table-official-ministry {
        border: 2px solid #000000 !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.66rem !important;
        table-layout: auto !important;
    }

    .table-official-ministry thead,
    thead {
        display: table-row-group !important;
    }

    .table-official-ministry tfoot,
    tfoot {
        display: table-row-group !important;
    }

    .official-teacher-tbody,
    .table-official-ministry tbody,
    .table-official-ministry tr,
    tbody,
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        break-inside: avoid-page !important;
    }

    .table-official-ministry th,
    .table-official-ministry td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        padding: 1px 1px !important;
        line-height: 1.1 !important;
    }

    .table-official-ministry thead th.official-th {
        background: #e2e8f0 !important;
        color: #000000 !important;
        font-size: 0.68rem !important;
        font-weight: 800 !important;
    }

    .official-class-col-header {
        width: 17px !important;
        min-width: 17px !important;
        max-width: 20px !important;
        padding: 1px 0 !important;
    }

    .official-grade-num {
        font-size: 0.62rem !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    .official-section-let {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        line-height: 1 !important;
    }

    .official-col-shaded {
        background-color: #cbd5e1 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .official-col-white {
        background-color: #ffffff !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .official-sub-item {
        font-size: 0.66rem !important;
        line-height: 1.15 !important;
    }

    .official-bottom-container {
        border: 2px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 4px 8px !important;
        margin-top: 6px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-sizing: border-box !important;
    }

    .official-bottom-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        align-items: flex-start !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .official-bottom-col-right {
        flex: 0 0 35% !important;
        max-width: 35% !important;
        width: 35% !important;
        box-sizing: border-box !important;
    }

    .official-bottom-col-left {
        flex: 1 1 auto !important;
        max-width: calc(65% - 8px) !important;
        width: calc(65% - 8px) !important;
        box-sizing: border-box !important;
    }

    .official-sub-main-title {
        background-color: #e2e8f0 !important;
        color: #000000 !important;
        font-size: 0.74rem !important;
        font-weight: 800 !important;
        text-align: center !important;
        padding: 2px 4px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .official-sub-table {
        border: 1.5px solid #000000 !important;
        border-collapse: collapse !important;
        width: 100% !important;
        font-size: 0.68rem !important;
        margin-bottom: 0 !important;
    }

    .official-sub-table thead th {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        font-weight: 700 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .official-sub-table th,
    .official-sub-table td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        padding: 1.5px 3px !important;
        line-height: 1.15 !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    .official-reasons-wrapper {
        margin-top: 4px !important;
    }

    .official-reasons-header {
        font-size: 0.74rem !important;
        font-weight: 800 !important;
        color: #000000 !important;
        margin-bottom: 2px !important;
    }

    .official-reasons-box {
        border: 1.2px solid #000000 !important;
        border-radius: 4px !important;
        background: #ffffff !important;
        color: #000000 !important;
        min-height: 38px !important;
        padding: 3px 6px !important;
        font-size: 0.70rem !important;
        line-height: 1.25 !important;
        box-sizing: border-box !important;
    }

    .official-sign-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-top: 8px !important;
        padding-top: 6px !important;
        border-top: 1px dashed #000000 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .official-sign-right {
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    .official-sign-left {
        font-size: 0.74rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        text-align: center !important;
    }

    .official-sign-left .text-muted {
        color: #333333 !important;
        font-size: 0.68rem !important;
    }

    .official-sign-row {
        margin-top: 4px !important;
        padding-top: 3px !important;
    }

    .official-editable-field,
    .official-editable-text {
        border-bottom: none !important;
    }}

/* 5. Tangerine Orange Coral (Matches Auto Quota Button: .btn-tb-nisab) */
.sup-day-orange {
    background: linear-gradient(145deg, #fed7aa, #f97316) !important;
    box-shadow: 0 5px 14px -2px rgba(249, 115, 22, 0.35),
        inset 2px 2px 4px rgba(255, 255, 255, 0.65),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
}

/* Supervisor Item Top Row */
.sup-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sup-teacher-sub {
    font-size: 0.69rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 3D Clay Chips: Location & Free Periods */
.sup-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 5px;
    border-top: 1px dashed #e2e8f0;
}

.sup-location-chip {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2.5px 8px;
    border-radius: 9999px !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 115px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), inset 1px 1px 2px rgba(255, 255, 255, 0.7);
}

.sup-free-periods-chip {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2.5px 7px;
    border-radius: 9999px !important;
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.12), inset 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* ==========================================================
   SUPERVISION TAB: TABLE LAYOUT - 3D CLAYMORPHISM
   ========================================================== */
.sup-clay-table-card {
    background: #ffffff !important;
    border-radius: 24px !important;
    border: 2.5px solid #ffffff !important;
    box-shadow: 0 12px 30px -4px rgba(148, 163, 184, 0.22),
        inset 2px 2px 4px rgba(255, 255, 255, 1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
}

.sup-clay-table {
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
    width: 100% !important;
}

.sup-table-seq-th {
    vertical-align: middle !important;
    padding: 8px 6px !important;
    border: none !important;
}

.sup-table-seq-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0) !important;
    border: 1.5px solid #ffffff !important;
    color: #475569 !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    box-shadow: 0 2px 5px rgba(148, 163, 184, 0.2), inset 1px 1px 2px rgba(255, 255, 255, 1) !important;
}

.sup-table-day-th {
    padding: 6px !important;
    border: none !important;
    min-width: 185px !important;
}

/* 3D Clay Day Headers */
.sup-table-day-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    border-radius: 16px !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22) !important;
    transition: all 0.2s ease !important;
}

.day-clay-hdr-5 {
    background: linear-gradient(145deg, #f472b6, #db2777) !important;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.35), inset 1.5px 1.5px 2px rgba(255, 255, 255, 0.75), inset -1.5px -1.5px 2px rgba(0, 0, 0, 0.12) !important;
}

/* Row Number */
.sup-table-seq-td {
    vertical-align: middle !important;
    padding: 6px !important;
    border: none !important;
}

.sup-table-num-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9) !important;
    border: 1.5px solid #ffffff !important;
    color: #64748b !important;
    font-weight: 800 !important;
    font-size: 0.78rem !important;
    box-shadow: 0 2px 5px rgba(148, 163, 184, 0.15), inset 1px 1px 2px rgba(255, 255, 255, 1) !important;
}

.sup-table-td {
    vertical-align: middle !important;
    border: none !important;
}

/* Table Footer Add Button */
.sup-table-foot-add-btn {
    width: 100% !important;
    padding: 7px 12px !important;
    border-radius: 9999px !important;
    border: 1.5px solid #ffffff !important;
    background: linear-gradient(145deg, #38bdf8, #0284c7) !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3), inset 1px 1px 2px rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.sup-table-foot-add-btn:hover {
    background: linear-gradient(145deg, #0284c7, #0369a1) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 6px 14px rgba(2, 132, 199, 0.42) !important;
}

/* ==========================================
   Class Mentors Single Color Mode Dropdown
   ========================================== */
.btn-tb-color-mode-dropdown {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 14px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    border-radius: 9999px !important;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: #ffffff !important;
    color: #334155 !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.btn-tb-color-mode-dropdown.mode-auto {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border-color: #86efac !important;
    color: #15803d !important;
    box-shadow: 0 3px 8px rgba(34, 197, 94, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.95) !important;
}

.btn-tb-color-mode-dropdown.mode-manual {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%) !important;
    border-color: #f472b6 !important;
    color: #be185d !important;
    box-shadow: 0 3px 8px rgba(219, 39, 119, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.95) !important;
}

.btn-tb-color-mode-dropdown.mode-none {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04), inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.btn-tb-color-mode-dropdown:hover,
.btn-tb-color-mode-dropdown:focus {
    transform: translateY(-1px) scale(1.02) !important;
}

.btn-tb-color-mode-dropdown::after {
    margin-right: 4px;
    vertical-align: middle;
}

[data-bs-theme="dark"] .btn-tb-color-mode-dropdown {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ==========================================================================
   TIMETABLE DAY & PERIOD DISTINCT HEADERS
   ========================================================================== */
#timetableGridTable thead th,
.table thead th {
    letter-spacing: 0.3px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

#timetableGridTable td.fw-bold,
.table td.fw-bold {
    letter-spacing: 0.2px;
}

/* Print accuracy */
@media print {

    #timetableGridTable thead th,
    #timetableGridTable tbody td.fw-bold,
    table.preserve-table-styles thead th,
    table.preserve-table-styles tbody td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }}

/* ==========================================================================
   CLAYMORPHISM: SUBJECT RESTRICTIONS MODAL (قفل و سنوردارکرنا بابەتان)
   ========================================================================== */
.clay-modal-header-indigo {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 45%, #6366f1 100%) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 4px 18px rgba(67, 56, 202, 0.3) !important;
}

/* ==========================================================================
   Save & Close Footer Buttons
   ========================================================================== */
.subj-ref-purple-btn,
.clay-btn-save-indigo {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    padding: 10px 42px !important;
    font-size: 1.05rem !important;
}

.subj-ref-purple-btn:hover,
.clay-btn-save-indigo:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45) !important;
    color: #ffffff !important;
}

.border-indigo-subtle {
    border-color: #c7d2fe !important;
}

/* Navigation Tab 9: Teacher Covers */
.custom-main-tabs .nav-link.tab-teacher-covers {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #4338ca !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.8), 0 2px 6px rgba(99, 102, 241, 0.12) !important;
}

.custom-main-tabs .nav-link.tab-teacher-covers:hover {
    background: rgba(99, 102, 241, 0.26) !important;
    color: #312e81 !important;
    border-color: rgba(99, 102, 241, 0.48) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.22), inset 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.custom-main-tabs .nav-link.tab-teacher-covers.active {
    background: linear-gradient(145deg, #a5b4fc, #6366f1) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 6px 16px -2px rgba(99, 102, 241, 0.42),
        inset 2px 2px 4px rgba(255, 255, 255, 0.75),
        inset -2px -2px 4px rgba(0, 0, 0, 0.12) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .custom-main-tabs .nav-link.tab-teacher-covers {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

/* ==========================================================================
   TEACHER RECORD COVER PAGES (پەڕێن تۆمارا مامۆستایان / سجلات المعلمين)
   ========================================================================== */
.teacher-covers-wrapper {
    width: 100%;
}

.teacher-covers-toolbar-card {
    background-color: var(--bs-card-bg);
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 18px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.tc-format-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 14px;
}

.tc-format-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.teacher-covers-control-panel {
    background-color: var(--bs-card-bg, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 18px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    padding: 0.75rem 1rem !important;
    margin-bottom: 1.25rem !important;
    position: relative;
    z-index: 30;
}

@media (max-width: 992px) {
    .teacher-covers-control-panel {
        padding: 0.65rem 0.85rem !important;
        border-radius: 1rem !important;
    }}

.teacher-covers-pagination-bar {
    background-color: var(--bs-card-bg, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 18px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    position: relative;
    z-index: 1;
}

.teacher-covers-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    padding: 1.5rem 0.5rem;
}

.teacher-cover-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 820px;
}

.teacher-cover-item-actions {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding: 0 0.5rem;
}

.teacher-cover-sheet {
    width: 100%;
    max-width: 800px;
    min-height: 1100px;
    height: auto;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 24px 22px;
    box-sizing: border-box;
    border-radius: 4px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    font-family: 'Cairo', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    --tc-font-scale: 1;
}

@media screen and (max-width: 992px) {
#teacherForm .row>[class*="col-"]:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }}

.teacher-cover-sheet * {
    font-family: inherit !important;
    position: relative;
    page-break-after: always;
    break-after: page;
}

.teacher-cover-outer-frame {
    width: 100%;
    min-height: 1050px;
    border: 2.5px solid #000000;
    border-radius: 24px !important;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.teacher-cover-inner-frame {
    width: 100%;
    flex: 1 1 auto;
    border: 1.8px solid #000000;
    border-radius: 17px !important;
    padding: 22px 20px 18px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    background: #ffffff;
}

.teacher-cover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
}

.teacher-cover-header.no-logos {
    justify-content: center !important;
}

.teacher-cover-logo-col {
    width: var(--tc-logo-width, 220px);
    height: var(--tc-logo-height, 170px);
    max-width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teacher-cover-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
    transition: all 0.2s ease;
}

.teacher-cover-center-info {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    padding: 0 4px;
}

.teacher-cover-dept-title {
    font-size: calc(1.22rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    line-height: 1.4;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
}

.teacher-cover-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px 10px;
    gap: calc(1.5rem * var(--tc-font-scale, 1));
}

.teacher-cover-main-heading {
    font-size: calc(2.5rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

.teacher-cover-num-block {
    font-size: calc(1.85rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    margin: 0;
    line-height: 1.2;
}

.teacher-cover-num-underline {
    display: inline-block;
    border-bottom: 3px double #000000;
    padding: 0 8px;
    min-width: 32px;
}

.teacher-cover-teacher-block {
    font-size: calc(1.65rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    margin: 0;
    line-height: 1.3;
}

.teacher-cover-subject-block {
    font-size: calc(1.65rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    margin: 0;
    line-height: 1.3;
}

.teacher-cover-classes-heading {
    font-size: calc(1.65rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    margin-top: 0.4rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.teacher-cover-classes-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(0.65rem * var(--tc-font-scale, 1));
    width: 100%;
}

.teacher-cover-classes-line {
    font-size: calc(1.25rem * var(--tc-font-scale, 1));
    font-weight: 800;
    color: #000000;
    direction: rtl;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.teacher-cover-footer {
    padding-top: 15px;
    padding-bottom: 10px;
    text-align: center;
}

.teacher-cover-year-text {
    font-size: calc(1.55rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    letter-spacing: 2px;
}

@media print {
.teacher-covers-gallery {
        display: block !important;
        padding: 0 !important;
        gap: 0 !important;
    }

.teacher-cover-preview-item {
        max-width: 100% !important;
        page-break-after: always !important;
        break-after: page !important;
        margin: 0 !important;
    }

.teacher-cover-sheet {
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        height: 282mm !important;
        min-height: 282mm !important;
        padding: 4mm 4mm !important;
        margin: 0 auto !important;
        page-break-after: always !important;
        break-after: page !important;
    }

.teacher-cover-outer-frame {
        height: 100% !important;
        min-height: 272mm !important;
        border-radius: 24px !important;
        padding: 5px !important;
    }

.teacher-cover-inner-frame {
        height: 100% !important;
        border-radius: 17px !important;
        padding: 20px 18px !important;
    }}

.teacher-cover-multi-subjects-list {
    display: flex;
    flex-direction: column;
    gap: calc(1.35rem * var(--tc-font-scale, 1));
    align-items: center;
    width: 100%;
}

.teacher-cover-multi-subject-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(0.45rem * var(--tc-font-scale, 1));
    width: 100%;
}

.teacher-cover-classes-combined-block {
    font-size: calc(1.65rem * var(--tc-font-scale, 1));
    font-weight: 900;
    color: #000000;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    direction: rtl;
    text-align: center;
}

.teacher-cover-classes-text {
    font-weight: 800;
    letter-spacing: 0.5px;
}

.teacher-cover-editable-num {
    cursor: pointer !important;
    border-radius: 4px !important;
    padding: 0 8px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    border-bottom: 3px double #000000 !important;
    min-width: 28px !important;
    display: inline-block !important;
}

.teacher-cover-editable-num:hover {
    background-color: rgba(99, 102, 241, 0.12) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4) !important;
}

.teacher-cover-editable-num:focus {
    background-color: rgba(254, 240, 138, 0.6) !important;
    box-shadow: 0 0 0 2.5px #ca8a04 !important;
}

.teacher-cover-editable-text {
    cursor: text !important;
    border-radius: 6px !important;
    padding: 1px 6px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    display: inline-block !important;
    border: 1px dashed transparent !important;
}

.teacher-cover-editable-text:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.teacher-cover-editable-text:focus {
    background-color: rgba(254, 240, 138, 0.55) !important;
    border-color: #ca8a04 !important;
    box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25) !important;
    color: #000000 !important;
}

.teacher-cover-editable-block {
    cursor: text !important;
    border-radius: 8px !important;
    padding: 3px 8px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    outline: none !important;
    display: block !important;
    width: 100% !important;
    border: 1px dashed transparent !important;
}

.teacher-cover-editable-block:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.teacher-cover-editable-block:focus {
    background-color: rgba(254, 240, 138, 0.55) !important;
    border-color: #ca8a04 !important;
    box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25) !important;
    color: #000000 !important;
}

.teacher-cover-sheet.is-table-layout .teacher-cover-body {
    gap: calc(1.05rem * var(--tc-font-scale, 1)) !important;
}

.teacher-cover-table-wrapper {
    width: 100%;
    max-width: min(530px, 92%);
    margin: calc(0.2rem * var(--tc-font-scale, 1)) auto;
    display: flex;
    justify-content: center;
}

.teacher-cover-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000000;
    background-color: #ffffff;
    direction: rtl;
    text-align: center;
}

.teacher-cover-table th,
.teacher-cover-table td {
    border: 1.5px solid #000000;
    padding: calc(4px * var(--tc-font-scale, 1)) calc(8px * var(--tc-font-scale, 1));
    vertical-align: middle;
    text-align: center;
    color: #000000;
    line-height: 1.25;
}

.teacher-cover-table th {
    background-color: #f3f4f6;
    font-size: calc(1.2rem * var(--tc-font-scale, 1));
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: calc(5px * var(--tc-font-scale, 1)) calc(8px * var(--tc-font-scale, 1));
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.teacher-cover-table td {
    font-size: calc(1.15rem * var(--tc-font-scale, 1));
    font-weight: 800;
}

.teacher-cover-td-num {
    font-weight: 900;
    font-size: calc(1.18rem * var(--tc-font-scale, 1));
    width: 12%;
}

.teacher-cover-td-sub {
    font-weight: 900;
    font-size: calc(1.15rem * var(--tc-font-scale, 1));
    width: 32%;
}

.teacher-cover-td-grade {
    font-weight: 800;
    font-size: calc(1.15rem * var(--tc-font-scale, 1));
    width: 28%;
}

.teacher-cover-td-sec {
    font-weight: 800;
    font-size: calc(1.15rem * var(--tc-font-scale, 1));
    width: 28%;
    direction: rtl;
}

.teacher-cover-table-classes-cell {
    display: inline-block;
    width: 100%;
}

/* ==========================================================================
   CUSTOM SEARCHABLE PICKERS FOR TEACHER & FONT (CLAYMORPHISM POPOVER)
   ========================================================================== */
.tc-custom-picker {
    position: relative;
    display: inline-block;
}

.tc-picker-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 1px 1px 2px #ffffff, 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: all 0.16s ease;
    max-width: 100%;
}

.tc-picker-trigger:hover,
.tc-picker-trigger[aria-expanded="true"] {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.16);
}

.tc-trigger-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.tc-trigger-icon-primary {
    background: #eef2ff;
    color: #4f46e5;
}

.tc-trigger-icon-success {
    background: #ecfdf5;
    color: #059669;
}

.tc-trigger-label {
    color: #64748b;
    font-weight: 700;
    white-space: nowrap;
}

.tc-trigger-value {
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.tc-trigger-pill {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.tc-trigger-pill-soft {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.tc-trigger-caret {
    font-size: 0.68rem;
    color: #64748b;
    margin-inline-start: 2px;
    transition: transform 0.16s ease;
}

.tc-picker-trigger[aria-expanded="true"] .tc-trigger-caret {
    transform: rotate(180deg);
    color: #4f46e5;
}

.tc-picker-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 1200;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 18px;
    box-shadow: 0 18px 42px -10px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.tc-picker-panel.show {
    display: flex;
    flex-direction: column;
    animation: tcPanelFadeIn 0.15s ease-out;
}

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

.tc-teacher-panel {
    width: min(490px, 92vw);
    max-height: 430px;
}

.tc-font-panel {
    width: min(580px, 94vw);
    max-height: 460px;
}

.tc-picker-head {
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tc-picker-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tc-picker-search-wrap i {
    position: absolute;
    inset-inline-start: 12px;
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

.tc-picker-search {
    width: 100%;
    height: 36px;
    padding-inline-start: 34px;
    padding-inline-end: 12px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.15s ease;
}

.tc-picker-search:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.tc-all-teachers-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 12px;
    border-radius: 11px;
    border: 1.5px solid #dbeafe;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tc-all-teachers-btn:hover {
    background: #dbeafe;
}

.tc-all-teachers-btn.active {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    border-color: #4f46e5;
    color: #ffffff;
}

.tc-all-count {
    background: rgba(255, 255, 255, 0.85);
    color: #1e3a8a;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 0.72rem;
    font-weight: 900;
}

.tc-teacher-grid {
    padding: 10px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tc-teacher-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    text-align: start;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tc-teacher-option:hover {
    border-color: #818cf8;
    background: #f8fafc;
    transform: translateY(-1px);
}

.tc-teacher-option.active {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.tc-teacher-opt-num {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tc-teacher-option.active .tc-teacher-opt-num {
    background: #4f46e5;
    color: #ffffff;
}

.tc-teacher-opt-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 2px;
}

.tc-teacher-opt-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-teacher-opt-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.69rem;
    color: #64748b;
    font-weight: 700;
}

.tc-teacher-opt-sub {
    color: #0369a1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-teacher-opt-cnt {
    color: #64748b;
    white-space: nowrap;
}

.tc-opt-check {
    color: #4f46e5;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.tc-picker-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.tc-tab-btn {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tc-tab-btn:hover {
    border-color: #10b981;
    color: #047857;
}

.tc-tab-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.tc-font-grid {
    padding: 10px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tc-font-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    text-align: start;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tc-font-option:hover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: translateY(-1px);
}

.tc-font-option.active {
    border-color: #059669;
    background: #ecfdf5;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.16);
}

.tc-font-opt-top {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.tc-font-opt-num {
    min-width: 24px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tc-font-num-google {
    background: #e0f2fe;
    color: #0369a1;
}

.tc-font-option.active .tc-font-opt-num {
    background: #059669;
    color: #ffffff;
}

.tc-font-option.active .tc-opt-check {
    color: #059669;
}

.tc-font-opt-name {
    font-size: 0.74rem;
    font-weight: 800;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tc-font-opt-preview {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.tc-font-option.active .tc-font-opt-preview {
    background: #ffffff;
    border-color: #6ee7b7;
}

@media (max-width: 600px) {
    .tc-teacher-grid,
    .tc-font-grid {
        grid-template-columns: 1fr;
    }
    .tc-trigger-value {
        max-width: 150px;
    }
}

[data-bs-theme="dark"] .tc-picker-trigger {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: none;
}

[data-bs-theme="dark"] .tc-picker-trigger[aria-expanded="true"],
[data-bs-theme="dark"] .tc-picker-trigger:hover {
    background: #0f172a;
    border-color: #818cf8;
}

[data-bs-theme="dark"] .tc-trigger-value {
    color: #f8fafc;
}

[data-bs-theme="dark"] .tc-picker-panel {
    background: #151f32;
    border-color: #334155;
}

[data-bs-theme="dark"] .tc-picker-head {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .tc-picker-search {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .tc-teacher-option,
[data-bs-theme="dark"] .tc-font-option,
[data-bs-theme="dark"] .tc-tab-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .tc-teacher-opt-name,
[data-bs-theme="dark"] .tc-font-opt-name,
[data-bs-theme="dark"] .tc-font-opt-preview {
    color: #f8fafc;
}

[data-bs-theme="dark"] .tc-font-opt-preview {
    background: #0f172a;
    border-color: #334155;
}

/* ==========================================================================
   CALM PASTEL DOCK LAYOUT & STEPPERS FOR CONTROL PANEL
   ========================================================================== */
.tc-control-dock {
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    padding: 10px 12px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tc-dock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.tc-dock-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tc-dock-ribbon {
    background: #f3f6fb;
    border: 1px solid #e6ecf5;
    border-radius: 14px;
    padding: 6px 10px;
}

.tc-ribbon-cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tc-seg-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.tc-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
}

.tc-seg-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.7);
}

.tc-seg-sky .tc-seg-btn.active {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border-color: #7dd3fc;
    box-shadow: 0 2px 6px rgba(14, 165, 233, 0.14);
}

.tc-seg-indigo .tc-seg-btn.active {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #3730a3;
    border-color: #a5b4fc;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.14);
}

.tc-seg-sage {
    background: #ffffff;
}

.tc-seg-sage .tc-seg-btn.active {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border-color: #6ee7b7;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.14);
}

.tc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tc-btn-print {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.35);
}

.tc-btn-print:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.tc-action-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 900;
}

.tc-btn-html {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.tc-btn-html:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.tc-btn-settings {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.tc-btn-settings:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tc-stepper-pill {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #dbe4f0;
    border-radius: 999px;
    padding: 2px 3px;
    gap: 2px;
    height: 36px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.tc-stepper-sage {
    border-color: #bae6d5;
}

.tc-stepper-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.14s ease;
    flex-shrink: 0;
}

.tc-stepper-btn:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.tc-stepper-select {
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
    direction: ltr;
    padding: 0 6px;
    min-width: 62px;
    cursor: pointer;
    outline: none;
}

.tc-stepper-select-wide {
    min-width: 72px;
}

[data-bs-theme="dark"] .tc-control-dock {
    background: linear-gradient(180deg, #151f32 0%, #111827 100%) !important;
    border-color: #273449 !important;
}

[data-bs-theme="dark"] .tc-dock-ribbon {
    background: #0f172a;
    border-color: #273449;
}

[data-bs-theme="dark"] .tc-seg-group,
[data-bs-theme="dark"] .tc-stepper-pill {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme="dark"] .tc-seg-btn {
    color: #94a3b8;
}

[data-bs-theme="dark"] .tc-stepper-btn {
    background: #0f172a;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .tc-stepper-select {
    color: #f8fafc;
}

[data-bs-theme="dark"] .tc-btn-html {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(110, 231, 183, 0.35);
    color: #6ee7b7;
}

[data-bs-theme="dark"] .tc-btn-settings {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
