/* =========================================
   Ultimate System Timetable CSS - v11.6 - TEST
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* --- Subscription UI Components --- */
.sub-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 99px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s ease;
    color: #818cf8;
}

.sub-status-badge i { font-size: 0.9rem; }
.sub-status-badge:hover { background: rgba(99, 102, 241, 0.2); transform: translateY(-1px); }

.sub-status-badge.warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.sub-status-badge.danger { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.15); color: #f87171; }

.sub-warning-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 9999;
}

.sub-warning-banner.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.sub-warning-banner .btn-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 12px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}

.sub-warning-banner .btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
}


.manual,
.report-cell-manual {
    background: linear-gradient(180deg, #f3e8ff 0%, #e9d5ff 100%) !important;
    border: 1px solid #d8b4fe !important;
    color: #6b21a8 !important;
}

:root {
    --primary-color: #2563eb;
    /* Modern Blue */
    --secondary-color: #10b981;
    /* Emerald */
    --accent-color: #f59e0b;
    /* Amber */
    --navy-blue: #f8fafc;
    /* Light background */
    --navy-light: #ffffff;
    /* White cards */
    --navy-lighter: #e2e8f0;
    /* Light gray */
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --text-white: #1e293b;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #2563eb;
    --bg-main: #f1f5f9;
    /* Light gray page background */
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    direction: rtl;
    background: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Globals & Utilities */
.text-light {
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: normal;
    background: #ef4444;
    color: #fff;
    text-align: center;
    z-index: 1000;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* Matrix Control Buttons - Modern Flat Style */
.matrix-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-matrix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.2s ease-in-out;
    font-family: 'Tajawal', sans-serif;
    color: white;
    box-shadow: none;
    /* Flat design */
}

.btn-matrix.additions {
    background-color: #3498db;
}

.btn-matrix.save {
    background-color: #2ecc71;
}

.btn-matrix.print {
    background-color: #5dade2;
}

.btn-matrix.refresh {
    background-color: #5499c7;
}

.btn-matrix.undo {
    background-color: #f39c12; /* Orange for attention */
}
.btn-matrix.undo:hover {
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.4);
}

.btn-matrix:hover {
    filter: brightness(1.08);
    /* Brighter for feedback */
    transform: translateY(-1px);
}

.btn-matrix.save:hover {
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

.btn-matrix.additions:hover,
.btn-matrix.print:hover,
.btn-matrix.refresh:hover {
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.3);
}

.btn-matrix:active {
    transform: translateY(0);
}

.btn-matrix i {
    font-size: 0.95rem;
}



.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* --- Royal Action Buttons --- */
.royal-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.royal-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.royal-action-btn i {
    font-size: 1.1rem;
}

.danger-outline-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #ef4444;
    border: 1.5px solid #ef4444;
    border-radius: 12px;
    padding: 9px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.danger-outline-btn:hover {
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.1);
}


/* Inputs and Forms */
.form-control,
.styled-class-select,
input[type="text"],
input[type="date"],
select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 10px 15px;
    border-radius: var(--radius);
    outline: none;
}

.form-control:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select option {
    background: #ffffff;
    color: #0f172a;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.collapsed .sidebar-header i {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 10px;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-icon.sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.logo-icon.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-header h2 {
    margin: 0;
    font-weight: 800;
    color: #1e293b;
}

.sidebar-nav {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.nav-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.nav-item.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item.help-btn i {
    color: var(--info);
}

.nav-item.logout i {
    color: var(--danger);
}

/* Main Content */
.main-content {
    margin-right: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-main);
    position: relative;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-right: 70px;
}

/* --- Base Top Bar (Slim & Elegant Mode - Sub-pages) --- */
.top-bar {
    position: relative !important;
    /* Non-fixed: scrolls naturally */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    height: 98px;
    /* Comfortable Slim Height (Increased 25%) */

    background: linear-gradient(135deg, #e0f2fe 0%, #f1f5f9 100%);
    /* Light Sky Blue to Pale */
    border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    color: #0f172a;
    /* Dark Navy contrast text */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium Banner Transformation for all pages except Dashboard */
.top-bar:not(.main-page-header) {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1e3a8a 100%) !important;
    color: white !important;
    height: 120px !important;
    border-bottom: none;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.2);
}

/* Ensuring identity stack is visible on sub-pages */
.top-bar:not(.main-page-header) #header-academic-wrap {
    display: flex !important;
}

/* Completely hide the old centered identity group from all banners */
.hero-identity-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Premium Logo Frame for ALL banners - Consistent White Matte Style */
.hero-logo-frame {
    display: flex !important;
    /* background: #ffffff !important; */
    padding: 8px !important;
    border-radius: 15px !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4) !important;
    width: 75px !important;
    height: 75px !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-logo-frame.has-logo {
    background: #ffffff !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4) !important;
}

.hero-logo-frame:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.55) !important;
}

.hero-logo-frame img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    /* Note: display is controlled by JS (show/hide based on logo availability) */
}

/* Extra icon styling in case image is missing */
.hero-logo-frame i {
    color: #1e3a8a !important; /* Dark blue to contrast with white box */
    font-size: 2.2rem !important;
}

#logo-placeholder-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
}

.top-bar:not(.main-page-header) .sidebar-toggle,
.top-bar:not(.main-page-header) .notification-bell,
.top-bar:not(.main-page-header) .user-profile,
.top-bar:not(.main-page-header) .cloud-sync {
    color: white !important;
}

.top-bar:not(.main-page-header) .principal-info-wrap strong,
.top-bar:not(.main-page-header) .principal-role-label {
    color: white !important;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar-center {
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.page-main-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.top-bar:not(.main-page-header) .page-main-title {
    font-family: 'Cairo', sans-serif !important;
    font-size: 2.8rem !important; /* Optimized size as per request */
    font-weight: 900 !important;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    letter-spacing: -1.5px;
    position: relative;
    padding-bottom: 12px;
    margin-top: -10px; /* Offset for larger size */
}

.top-bar:not(.main-page-header) .page-main-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 6px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    border-radius: 10px;
}


/* --- Drag and Drop Conflict Tooltip --- */
.drag-conflict-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    background: rgba(220, 38, 38, 0.95); /* Deep Red */
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25), 0 5px 15px rgba(220, 38, 38, 0.4);
    display: none;
    max-width: 320px;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: opacity 0.15s ease, transform 0.1s ease-out;
    opacity: 0;
    text-align: right;
    direction: rtl;
}

.drag-conflict-tooltip.show {
    display: block;
    opacity: 1;
}

.drag-conflict-tooltip i {
    margin-left: 10px;
    font-size: 1.1rem;
}

.drag-conflict-tooltip .tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 6px;
    font-weight: 800;
}

.drag-conflict-tooltip .tooltip-body {
    font-weight: 500;
    opacity: 0.95;
}

/* Icons & Profile Group Alignment */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Cloud Sync Styling */
.cloud-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #16a34a;
    /* Success Green */
    cursor: pointer;
    background: rgba(22, 163, 74, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.cloud-sync:hover {
    background: rgba(22, 163, 74, 0.15);
}

/* Notification Bell */
.notification-bell {
    font-size: 1.2rem;
    color: #475569;
    cursor: pointer;
    position: relative;
    padding: 5px;
    transition: transform 0.2s;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-bell .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
}

/* Principal Profile Linkage */
.hero-principal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hero-principal-card .principal-info-wrap {
    text-align: center;
    color: white;
}

.hero-principal-card .principal-role-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.hero-principal-card strong {
    font-size: 1.1rem;
    display: block;
    margin-top: 2px;
}

.principal-info-wrap {
    text-align: center;
    /* Standardized centering */
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.principal-role-label {
    font-size: 0.6rem;
    color: #64748b;
    display: block;
}



/* Main Page (Dashboard) Premium Header - Ultra Wide Matte Mode */
/* Main Page (Dashboard) Premium Header - Gradient Glass Mode */
.top-bar.main-page-header {
    background: linear-gradient(135deg, #020617 0%, #002366 50%, #020617 100%) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    height: 180px;
    padding: 0 45px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
    position: relative !important;
    /* Unfixed Behavior: Scrolls Away */
}

/* --- Academic Info - Classic vs Hero --- */
.academic-info-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin-top: -2px;
}



.academic-separator {
    display: inline;
    margin: 0 5px;
    color: #cbd5e1;
}

.top-bar.main-page-header .academic-info-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    /* Clear Black Line (Outline) for high readability */
    text-shadow:
        -1.5px -1.5px 0 #000,
        1.5px -1.5px 0 #000,
        -1.5px 1.5px 0 #000,
        1.5px 1.5px 0 #000,
        0 4px 8px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    margin-bottom: 5px;
}

.top-bar.main-page-header .academic-separator {
    display: none !important;
}




.top-bar.main-page-header .top-bar-right,
.top-bar.main-page-header .top-bar-center,
.top-bar.main-page-header .top-bar-left {
    z-index: 10;
    color: white;
    height: 100%;
    /* Ensure full height for vertical centering */
    display: flex;
    align-items: center;
}

.top-bar.main-page-header .top-bar-right {
    padding-right: 20px;
    /* Safe space reduced as sidebar toggle is moved */
    justify-content: flex-start;
}

/* Hide navigation/utility elements in Hero Mode (Sidebar toggle removed from hide list) */
.top-bar.main-page-header .page-main-title,
.top-bar.main-page-header .cloud-sync,
.top-bar.main-page-header .notification-bell,
.top-bar.main-page-header .header-attendance-pill {
    display: none !important;
}

/* Dashboard Exclusive Sidebar Toggle - Integrated into Profile Area */
.top-bar.main-page-header .sidebar-toggle {
    display: flex !important;
    color: #ffffff !important;
    font-size: 1.6rem;
    position: relative; /* Removed Absolute Positioning */
    top: 0;
    right: 0;
    /* Extreme top-right corner */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    /* Above everything */
    opacity: 0.9;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.top-bar.main-page-header .sidebar-toggle:hover {
    color: #f1c40f !important;
    /* Golden Glow on Hover */
    transform: scale(1.15);
    opacity: 1;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}


/* Base frame is now handled above for consistency */

.top-bar.main-page-header

/* --- Intelligent Search & Normalization Styles --- */
.column-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
}

.column-dropdown-search i {
    color: #94a3b8;
    font-size: 0.8rem;
}

.column-dropdown-search input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.8rem;
    width: 100%;
    outline: none;
    transition: all 0.3s;
}

.column-dropdown-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.mini-search-box {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s;
}

.mini-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.05);
}

.mini-search-box i {
    font-size: 0.75rem;
    color: #94a3b8;
}

.mini-search-box input {
    border: none;
    outline: none;
    font-size: 0.75rem;
    width: 80px;
    color: #1e293b;
}

.highlight-match {
    background-color: rgba(255, 235, 59, 0.4);
    font-weight: 700;
    border-radius: 2px;
    padding: 0 2px;
    box-shadow: 0 0 5px rgba(255, 235, 59, 0.2);
}

tr.matching-row {
    transition: background 0.3s, box-shadow 0.3s;
}

tr.matching-row:not([style*="display: none"]) {
    box-shadow: inset 4px 0 0 var(--primary-color);
    background-color: rgba(37, 99, 235, 0.02);
}

.draggable-card.matching-card {
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.15);
    transform: translateY(-3px) scale(1.02);
    z-index: 5;
}

/* Global Search Header Integration */
.header-search-wrap .mini-search-box-modern {
    height: 34px;
    width: 200px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 12px;
}

.mini-search-box-modern i {
    flex-shrink: 0;
    margin-left: 2px;
}

.mini-search-box-modern input::placeholder {
    color: #94a3b8;
    opacity: 0.7;
    font-size: 0.8rem;
}

tr.matching-row {
    background-color: rgba(59, 130, 246, 0.1) !important;
    box-shadow: inset 5px 0 0 #3b82f6 !important;
    transition: all 0.3s ease;
}

.highlight-match {
    background: #fef08a;
    /* Soft Yellow */
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.top-bar.main-page-header .hero-logo-frame img {
    max-height: 70px !important;
    /* Hero Height */
    border-radius: 10px;
}


/* Central School Label & Subtitle */
.hero-identity-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.top-bar.main-page-header #global-school-name {
    font-family: 'Cairo', sans-serif !important;
    font-size: 3rem !important;
    font-weight: 900 !important;
    color: white !important;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 255, 255, 0.08);
    letter-spacing: 2px;
    line-height: 1;
}

.hero-school-subtitle {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    /* Corrected to Pure White */
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
}

.hero-school-tagline {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.85;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: -2px;
}



/* Identity stack enabled for all headers including dashboard */
.top-bar.main-page-header #header-academic-wrap {
    display: flex !important;
}

/* Premium 3-Line Stack Alignment System - Unified White Mode */
.header-identity-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1px;
    padding: 0 15px;
}

.identity-name {
    font-family: 'Cairo', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff; /* Explicitly white */
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.identity-subtitle {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    background: transparent;
    padding: 0;
    margin: 1px 0;
}

.identity-academic {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    gap: 6px;
}







/* Director Profile on the Left */
/* Executive Manager Card Branding */
.top-bar.main-page-header .hero-principal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.top-bar.main-page-header #principal-avatar-wrap {
    width: 70px !important;
    height: 70px !important;
    border: 3px solid white !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: #fff !important;
}

.top-bar.main-page-header #header-principal-name {
    color: white !important;
    font-size: 1.15rem !important;
    /* Slightly larger for executive feel */
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 2px;
}


/* Default Page Title vs Hero School Identity */
.page-main-title {
    display: block;
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 800;
}

.hero-identity-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.top-bar .page-main-title {
    display: none !important;
}

/* Premium Primary Branding: Centered School Name */
.hero-school-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    padding: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-align: center;
    transition: all 0.3s ease;
}

.hero-school-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-school-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1px;
}

@media (max-width: 768px) {
    .hero-school-name {
        font-size: 1.4rem;
    }
}


/* Sidebar Toggle Colors */
.sidebar-toggle {
    color: #0f172a !important;
    /* Default Dark Navy */
}

.top-bar.main-page-header .sidebar-toggle {
    color: #ffffff !important;
}

/* Avatar Styling Logic */
#principal-avatar-wrap {
    width: 54px !important;
    height: 54px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #cbd5e1 !important;
}

#header-principal-name {
    font-size: 1rem !important;
    color: #1e293b !important;
    font-weight: 800 !important;
}

.top-bar.main-page-header #principal-avatar-wrap {
    width: 70px !important;
    height: 70px !important;
}
.top-bar.main-page-header #principal-avatar-icon {
    color: #1e293b !important; /* Make icon visible on white circle */
}

.top-bar.main-page-header #header-principal-name {
    color: #ffffff !important;
}

/* Horizontal Attendance Rows in Slim Mode */
.attendance-pills-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
}

.top-bar.main-page-header .attendance-pills-row {
    flex-direction: column !important;
}

.header-attendance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.05);
    color: #1e293b;
    padding: 6px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 800;
    border: 1px solid rgba(15, 23, 42, 0.15);
    transition: all 0.3s;
}

.header-attendance-pill i {
    font-size: 0.7rem;
}

/* Hero Mode Overrides for Icons */
.top-bar.main-page-header .cloud-sync {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.top-bar.main-page-header .notification-bell {
    color: #ffffff;
}

.top-bar.main-page-header .principal-role-label {
    color: rgba(255, 255, 255, 0.7);
}

.top-bar.main-page-header .header-attendance-pill {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}






/* Dashboard Sections */
.dashboard-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    gap: 30px;
}

/* Reduced spacing for sub-pages with banners */
.top-bar:not(.main-page-header) + .dashboard-content {
    padding-top: 30px !important;
}

/* Removed redundant Welcome Hero styles */


.welcome-term-info {
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--glass-border);
}

.welcome-term-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--glass-bg);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    background: #f1f5f9;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

/* Dashboard Panels */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-panel {
    background: var(--glass-bg);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Countdown Card */
.period-countdown-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid #e2e8f0;
}

#current-period-display {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #64748b;
}

.period-value {
    font-weight: 800;
    color: #1e293b;
    font-size: 1.5rem;
    display: block;
}

#countdown-display .time-left {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    display: block;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   QUICK SETUP GUIDE Ã¢â‚¬â€ Full 3-Column Modern Redesign
   Layout: [Steps 1-2-3 Right] | [Engine Center] | [Stats Left]
   Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

/* Main Panel Container */
.setup-guide-panel {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.04), 0 0 20px rgba(59, 130, 246, 0.05);
}

/* Panel Header */
.setup-guide-header {
    padding: 16px 22px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.setup-guide-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.setup-guide-date {
    font-size: 0.8rem;
    color: #64748b;
}

.setup-guide-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.setup-guide-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
}

.setup-guide-close {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    /* Circular as requested */
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.setup-guide-close i {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.setup-guide-panel.collapsed .setup-guide-close i {
    transform: rotate(180deg);
}

.setup-guide-close:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25), 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
    /* Slight interactive expansion */
}

/* Collapsible Wrapper with Smooth Transition */
.setup-guide-collapsible {
    padding: 0 20px 20px 20px;
    /* Adjust for smooth transition */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 1;
    max-height: 1200px;
    overflow: visible;
    /* Ensure shadows and animations work */
}

/* UI Harmony: Smoothly hide content without shifting surrounding elements abruptly */
.setup-guide-panel.collapsed .setup-guide-collapsible {
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border-top-color: transparent;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬
   Body Grid: Steps | Engine | Stats
   Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.setup-guide-body {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 20px;
    align-items: stretch;
    /* Ã˜Â¶Ã™â€¦Ã˜Â§Ã™â€  Ã™â€¦Ã˜Â­Ã˜Â§Ã˜Â°Ã˜Â§Ã˜Â© Ã˜Â£Ã™ÂÃ™â€šÃ™Å Ã˜Â© Ã™â€¦Ã˜ÂªÃ™Ë†Ã˜Â§Ã˜Â²Ã™Å Ã˜Â© Ã˜ÂªÃ™â€¦Ã˜Â§Ã™â€¦Ã˜Â§Ã™â€¹ */
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ RIGHT: Steps 1-2-3 Ã¢â€â‚¬Ã¢â€â‚¬ */
.setup-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
    border-radius: 20px;
    padding: 24px;
    height: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.03), 
        0 0 15px rgba(59, 130, 246, 0.05),
        inset 0 0 60px rgba(255, 255, 255, 0.5) !important;
}

.setup-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    width: 100%;
    /* Force full width for centering alignment */
}

.setup-section-title i {
    color: #3b82f6;
}

/* Colored Step Cards Ã¢â‚¬â€ Floating 3D Effect */
.setup-step {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    align-items: flex-start;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Deep Soft Shadow for Depth */
    background: white;
    /* Ensure base is clean */
}

.setup-step:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.step-color-1 {
    background: linear-gradient(135deg, #fff0f6 0%, #fce7f3 100%);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-right: 4px solid #e91e63;
}

.step-color-2 {
    background: linear-gradient(135deg, #fff7f0 0%, #ffedd5 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-right: 4px solid #ff5722;
}

.step-color-3 {
    background: linear-gradient(135deg, #f0f5ff 0%, #dbeafe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-right: 4px solid #2196f3;
}

/* Step Number / Icon Circle */
.setup-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.step-color-1 .setup-step-number {
    background: rgba(233, 30, 99, 0.12);
    color: #e91e63;
}

.step-color-2 .setup-step-number {
    background: rgba(255, 87, 34, 0.12);
    color: #ff5722;
}

.step-color-3 .setup-step-number {
    background: rgba(33, 150, 243, 0.12);
    color: #2196f3;
}

.setup-step:hover .setup-step-number {
    transform: scale(1.12) rotate(6deg);
}

/* Step Number Badge (inline) */
.step-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
    margin-left: 4px;
    vertical-align: middle;
}

.step-color-1 .step-num-badge {
    background: rgba(233, 30, 99, 0.15);
    color: #e91e63;
}

.step-color-2 .step-num-badge {
    background: rgba(255, 87, 34, 0.15);
    color: #ff5722;
}

.step-color-3 .step-num-badge {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

/* Step Content */
.setup-step-content {
    flex: 1;
}

.setup-step-content h4 {
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 3px;
}

.setup-step-content p {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 9px;
    line-height: 1.5;
}

/* Step Action Button */
.btn-setup-action {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 6px 13px;
    border-radius: 18px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
}

.btn-setup-action:hover {
    background: #1e293b;
    color: #fff;
    border-color: transparent;
    transform: translateX(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Checkmark badge */
.setup-step-check-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1rem;
    color: #22c55e;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.setup-step.step-done .setup-step-check-badge {
    opacity: 1;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ CENTER: Distribution Engine Ã¢â€â‚¬Ã¢â€â‚¬ */
.setup-engine-center {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.04),
        0 0 30px rgba(46, 204, 113, 0.1),
        inset 0 0 40px rgba(255, 255, 255, 0.6) !important;
    border: 1.5px solid rgba(46, 204, 113, 0.2) !important;
    height: 100%;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.setup-engine-center::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.12) 0%, transparent 75%) !important;
    pointer-events: none;
    filter: blur(20px);
}

.setup-engine-center::after {
    content: '';
    position: absolute;
    bottom: -35px;
    left: -35px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 70%);
    pointer-events: none;
}

/* Engine badge label */
.engine-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 13px;
    border-radius: 18px;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.4px;
    margin-bottom: 5px;
    /* Ã™â€¦Ã˜Â³Ã˜Â§Ã™ÂÃ˜Â© Ã™â€žÃ™â€žÃ™â€¦Ã˜Â­Ã˜Â§Ã˜Â°Ã˜Â§Ã˜Â© Ã™â€¦Ã˜Â¹ Ã˜Â§Ã™â€žÃ˜Â¹Ã™â€ Ã˜Â§Ã™Ë†Ã™Å Ã™â€  Ã˜Â§Ã™â€žÃ˜Â¬Ã˜Â§Ã™â€ Ã˜Â¨Ã™Å Ã˜Â© */
}

.engine-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* Ã™â€¦Ã˜Â³Ã˜Â§Ã™ÂÃ˜Â© Ã™â€¦Ã˜ÂªÃ™â€ Ã˜Â§Ã˜Â³Ã™â€šÃ˜Â© Ã˜Â¨Ã™Å Ã™â€  Ã˜Â§Ã™â€žÃ˜Â¹Ã™â€ Ã˜Â§Ã˜ÂµÃ˜Â± Ã˜Â§Ã™â€žÃ˜Â¯Ã˜Â§Ã˜Â®Ã™â€žÃ™Å Ã˜Â© */
    width: 100%;
}

/* Large icon circle */
.engine-icon-large {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background: rgba(46, 204, 113, 0.18) !important;
    border: 2px solid rgba(46, 204, 113, 0.38) !important;
    color: #2ecc71 !important;
    font-size: 1.7rem !important;
    animation: engine-pulse 2.4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes engine-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(46, 204, 113, 0);
    }
}

.engine-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    /* Soft Dark for White Background */
    margin: 0;
    position: relative;
    z-index: 1;
}

.engine-desc {
    font-size: 0.82rem;
    color: #64748b;
    /* Muted Slate Text */
    line-height: 1.55;
    margin: 0;
    max-width: 235px;
    position: relative;
    z-index: 1;
}

/* Main Generate Button */
.btn-generate-main {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    border: none;
    padding: 13px 26px;
    border-radius: 30px;
    font-size: 0.97rem;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 6px 22px rgba(46, 204, 113, 0.48), 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-generate-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.55);
    filter: brightness(1.07);
}

.btn-generate-main:active {
    transform: translateY(-1px);
}

.btn-generate-main i {
    animation: sparkle-anim 1.6s ease-in-out infinite;
}

@keyframes sparkle-anim {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(18deg) scale(1.22);
    }
}

/* Ã°Å¸â€™Â¡ Dynamic Tip Stylings Ã¢â‚¬â€ Modern Glossy Glassmorphism */
.setup-hint-box {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 10px 20px !important;
    margin-top: 15px !important;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: fit-content !important;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    animation: tip-float 3s ease-in-out infinite;
    transition: all 0.4s ease;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    cursor: pointer;
    /* Single line forced */
    text-decoration: none;
}

.setup-hint-box:hover {
    transform: translateY(-5px) scale(1.03);
    background: linear-gradient(135deg, #2d3e50 0%, #1a2a3a 100%) !important;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.25) !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
}

.setup-hint-box:active {
    transform: translateY(-2px) scale(0.98);
}

/* Smooth exit for the dynamic tip to create a premium feel */
.setup-guide-panel.collapsed .setup-hint-box {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
}

@keyframes tip-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.setup-hint-box i {
    color: #fbbf24 !important;
    /* Golden bulb */
    font-size: 0.9rem;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.4));
}

.setup-hint-box span {
    font-size: 0.78rem;
    color: #334155 !important;
    /* Dark Slate text */
    font-weight: 600;
    letter-spacing: 0.1px;
}


/* Removed old detailed hints style for minimalist look */

/* Ã¢â€â‚¬Ã¢â€â‚¬ LEFT: Statistics Panel Ã¢â€â‚¬Ã¢â€â‚¬ */
.setup-guide-analytics {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.03), 
        0 0 15px rgba(59, 130, 246, 0.05),
        inset 0 0 60px rgba(255, 255, 255, 0.5) !important;
    height: 100%;
    box-sizing: border-box;
}

/* Circular Progress Ring */
.circular-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    /* Ensure it spans full width for centering */
}

.circular-progress-ring {
    position: relative;
    width: 160px;
    /* Increased from 128px (+25%) */
    height: 160px;
}

.circular-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ring-center-text strong {
    font-size: 1.85rem;
    /* Scaled for larger circle */
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.ring-center-text span {
    font-size: 0.58rem;
    color: #64748b;
    font-weight: 600;
    text-align: center;
}

.ring-label {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

/* Dual Stat Boxes Ã¢â‚¬â€ Spatial Optimization */
.analytics-dual-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
    /* Slightly more push to balance height */
    width: 100%;
    /* Spans across to center elements */
}

.analytics-box {
    border-radius: 13px;
    padding: 22px 8px;
    /* Increased padding for more height (+10px) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
}

.analytics-box strong {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.analytics-box>span:not(.go-arrow) {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.3;
}

.analytics-box-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-bottom: 1px;
}

/* Distributed box */
.box-distributed {
    background: linear-gradient(135deg, #ffffff 0%, rgba(34, 197, 94, 0.08) 100%) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
    border-bottom: 5px solid #22c55e !important;
}

.box-distributed>span {
    color: #15803d;
}

.box-distributed .analytics-box-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

/* Unscheduled box (clickable) */
.box-unscheduled {
    background: linear-gradient(135deg, #ffffff 0%, rgba(239, 68, 68, 0.06) 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
    border-bottom: 6px solid #f87171 !important; /* Calm Red */
}

.box-unscheduled .analytics-box-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.box-unscheduled span {
    color: #e11d48 !important; /* Premium Red */
    font-weight: 800 !important;
}

.go-arrow {
    position: absolute;
    bottom: 6px;
    left: 8px;
    font-size: 0.65rem;
    color: #ef4444;
    opacity: 0.7;
}

/* Ã°Å¸â€œÅ  Live Attendance Card Ã¢â‚¬â€ Clean Premium Executive Layout */
.live-attendance-summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    margin: 5px 0 15px 0;
}

.attendance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.att-rate {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e3a8a !important;
    /* Premium Dark Navy */
    min-width: 45px;
    text-align: right;
}

.att-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    flex: 1;
    text-align: center;
}

.att-category-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.att-category-icon.purple {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.att-category-icon.sky-blue {
    background: linear-gradient(135deg, #7dd3fc 0%, #0284c7 100%);
}

.attendance-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);
    width: 90%;
    margin: 4px auto;
}

/* Ã°Å¸â€â€ž Live Sync Badge Ã¢â‚¬â€ Discrete & Elegant */
.sync-info-badge {
    font-size: 0.68rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 12px;
    margin-top: auto;
    /* Push to bottom for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.sync-info-badge i {
    font-size: 0.75rem;
    color: #38bdf8;
    animation: rotate-sync 3s linear infinite;
}

@keyframes rotate-sync {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ Responsive Ã¢â€â‚¬Ã¢â€â‚¬ */
@media (max-width: 1100px) {
    .setup-guide-body {
        grid-template-columns: 1fr 1fr;
    }

    .setup-engine-center {
        grid-column: 1 / -1;
        order: -1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .setup-guide-body {
        grid-template-columns: 1fr;
    }
}

/* Quota Chart Styling */
.quota-chart-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 10px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chart-label {
    width: 100px;
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e293b;
}

.chart-bar-bg {
    flex: 1;
    background: #e2e8f0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 1s ease-out;
}

.chart-value {
    width: 30px;
    font-weight: bold;
    text-align: left;
    color: var(--text-muted);
}

/* Data Tables */
.data-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius);
    transition: 0.3s;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* --- Old Data Header Styles Removed --- */

.table-wrapper {
    background: var(--navy-light);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    overflow-x: auto;
}


/* --- Modern Grid System (Basic Data) --- */
.modern-data-table-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 24px;
    overflow-x: auto;
    margin-top: 10px;
}

.modern-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    /* Gap between row cards */
    text-align: right;
}


.modern-data-table td {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    padding: 22px 20px;
    /* Refined for better symmetry with smaller text */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #334155;
    font-weight: 400;
    /* Subordinate Regular style for data */
    font-size: 0.95rem;
    /* Reduced by 2pts for clear hierarchy */
    letter-spacing: 0.4px;
    /* Added spacing for scanning comfort */
    vertical-align: middle;
}

/* Rounded corners for the "strip" card */
.modern-data-table td:first-child {
    border-radius: 12px 0 0 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.modern-data-table td:last-child {
    border-radius: 0 12px 12px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.modern-data-table tr:hover td {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    border-color: #3b82f6;
}

/* Dynamic Action Buttons */
.btn-action-modern {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 4px;
    font-size: 1rem;
}

.btn-action-modern.edit {
    background: #e0f2fe;
    color: #0284c7;
    box-shadow: 0 4px 6px rgba(2, 132, 199, 0.1);
}

.btn-action-modern.edit:hover {
    background: #3b82f6;
    color: #ffffff;
    animation: pulse-blue 1.5s infinite;
    transform: scale(1.1);
}

.btn-action-modern.delete {
    background: #fee2e2;
    color: #ef4444;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.1);
}

.btn-action-modern.delete:hover {
    background: #ef4444;
    color: #ffffff;
    animation: pulse-red 1.5s infinite;
    transform: scale(1.1);
}

.btn-action-modern.whatsapp {
    background: #dcfce7;
    color: #16a34a;
}

.btn-action-modern.whatsapp:hover {
    background: #22c55e;
    color: white;
}

.btn-action-modern.insight {
    background: #e0f2fe;
    color: #0284c7;
}

.btn-action-modern.insight:hover {
    background: #0ea5e9;
    color: white;
}

@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 3D Floating Action Button */
.btn-add-modern {
    background: linear-gradient(145deg, #2563eb, #1e40af);
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    border: none;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-add-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

.btn-add-modern:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(37, 99, 235, 0.2);
}

/* Data Styling Capsules Ã¢â‚¬â€ Precisely Scaled to Data Size */
.modern-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    /* Scaled down to match subordinate font */
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-quota-safe {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-quota-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-quota-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    animation: danger-glow 2s infinite alternate;
}

.badge-quota-warning {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.row-deficit td {
    background: rgba(255, 248, 241, 0.8) !important;
}

.row-deficit .name-primary {
    color: #c2410c !important;
}

.th-sort-icon {
    font-size: 0.8rem;
    transition: all 0.2s;
}

@keyframes danger-glow {
    from {
        box-shadow: 0 0 2px #fecaca;
    }

    to {
        box-shadow: 0 0 8px #f87171;
    }
}

.badge-lead {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fce7f3;
}

.badge-subject {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ede9fe;
}

.badge-class {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.badge-grade-inline {
    font-size: 0.72rem;
    color: #2563eb;
    font-weight: 800;
    background: rgba(37, 99, 235, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    margin-right: 6px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-period {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fef3c7;
}

.cell-content-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.cell-icon {
    font-size: 0.9rem;
    /* Scaled to match names */
    opacity: 0.8;
}

.name-primary {
    color: #1e293b;
    font-weight: 800;
}


/* Draggables */
.draggable-source-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.draggable-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* =========================================
   Universal Timetable Cell Formatting 
   ========================================= */

.cell-content-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 2px 4px !important;
}

.draggable-card {
    position: relative;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    border-radius: 10px;
    cursor: grab;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-width: 80px;
    width: 100%;
    height: 100% !important;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex !important;
    overflow: hidden !important;
}

.draggable-card:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.draggable-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

.draggable-card .cell-content-wrapper {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.draggable-card .subject {
    font-weight: 800;
    font-size: 0.75rem !important;
    /* Slightly larger for main text */
    color: inherit;
    margin-bottom: 2px;
    line-height: 1.1;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.draggable-card .details {
    font-size: 0.58rem !important;
    /* Global 10% Reduction */
    color: inherit;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

/* Big Bold Class Styling for Teacher View */
.big-bold-class {
    font-size: 0.8rem !important;
    font-weight: 900 !important;
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 0px !important;
}

.remaining-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    /* Clean corner positioning */
    background: #ef4444;
    /* Modern Red */
    color: white;
    font-size: 0.52rem;
    /* Tiny badge */
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 2;
    line-height: 1;
}

.remaining-badge.completed {
    background: #10b981;
    /* Modern Green */
}

/* Completed Subject Card - Greyscale & Disabled Look */
.draggable-card.fully-scheduled {
    background: #f1f5f9 !important;
    /* Light Grey Workspace Look */
    border-color: #e2e8f0 !important;
    color: #64748b !important;
    /* Neutral Muted Text */
    cursor: not-allowed !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
    filter: grayscale(1) opacity(0.7);
    pointer-events: none;
}

/* Dim content but keep metadata legible */
.draggable-card.fully-scheduled .cell-content-wrapper {
    opacity: 0.5 !important;
}

/* Keep the 'Done' badge clear and vibrant */
.draggable-card.fully-scheduled .remaining-badge.completed {
    opacity: 1 !important;
    background: #10b981 !important;
    top: 4px;
    left: 4px;
}

.draggable-items .draggable-card {
    width: 80px !important;
    height: 80px !important;
    margin: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
}

.draggable-card .classroom {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 5px;
    color: #475569;
}

/* Soft Pastel Palette (Ultra-Light for High Contrast Text) */
.science,
.report-cell-science {
    background: linear-gradient(180deg, #e6ffed 0%, #d1f7e0 100%) !important;
    border: 1px solid #bbf7d0 !important;
    color: #065f46 !important;
}

.islamic,
.report-cell-islamic {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
    border: 1px solid #bfdbfe !important;
    color: #1e40af !important;
}

.ccdi,
.report-cell-ccdi {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

.literary,
.report-cell-literary {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
}

.language,
.report-cell-language {
    background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%) !important;
    border: 1px solid #e9d5ff !important;
    color: #7e22ce !important;
}

.activity,
.report-cell-activity {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
    border: 1px solid #fde68a !important;
    color: #c2410c !important;
}

.math,
.report-cell-math {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
}

.arabic,
.report-cell-arabic {
    background: linear-gradient(180deg, #fffcf0 0%, #fef3c7 100%) !important;
    border: 1px solid #fbbf24 !important;
    color: #b45309 !important;
}

.english,
.report-cell-english {
    background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%) !important;
    border: 1px solid #ddd6fe !important;
    color: #6d28d9 !important;
}

.history,
.report-cell-history {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%) !important;
    border: 1px solid #fecaca !important;
    color: #be123c !important;
}

.draggable-card.other,
.report-cell-other {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border: 1px solid #e5e7eb !important;
    color: #4b5563 !important;
}

/* View Options */
.view-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 25px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.view-btn {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.3s;
}

.view-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Timetable Grid System */
.grid-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #ffffff;
    padding: 10px;
    font-weight: 800;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 2px 6px rgba(37, 99, 235, 0.3);
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

.grid-header-period {
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.grid-header-time {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    margin-top: 3px;
    font-weight: 600;
    direction: ltr;
}

.grid-day-header {
    background: linear-gradient(180deg, #1e3a5f 0%, #0f2342 100%);
    color: #e2e8f0;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset -3px 0 0 rgba(0,0,0,0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.grid-cell {
    background: #ffffff;
    transition: 0.25s;
    border: 1px solid #dde3ee;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -1px 0 rgba(0,0,0,0.04);
    position: relative;
}

/* Alternate row background for visual clarity */
.grid-cell:nth-child(even) {
    background: #f8fbff;
}

.grid-cell:not(.inactive-cell):hover {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: inset 0 0 0 2px #93c5fd, 0 2px 8px rgba(37,99,235,0.1);
    transform: scale(1.01);
    z-index: 5;
}

.grid-header.empty-corner {
    background: linear-gradient(135deg, #0f2342 0%, #1e3a5f 100%);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

.timetable-wrapper {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid #c8d6f0;
    padding: 0;
    overflow: hidden;
    overflow-x: auto;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.08), 0 2px 8px rgba(0,0,0,0.06);
}

.timetable-grid-header {
    display: grid;
    grid-template-columns: 120px repeat(8, 1fr);
    background: #f1f5f9;
    border-radius: 10px 10px 0 0;
    border-bottom: 3px solid #cbd5e1;
}

.header-cell {
    padding: 15px;
    text-align: center;
    font-weight: 800;
    border-left: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.95rem;
}

.timetable-row {
    display: grid;
    grid-template-columns: 120px repeat(8, 1fr);
    min-height: 110px;
    border-bottom: 1px solid #e2e8f0;
}

.day-label {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-left: 1px solid #e2e8f0;
    font-size: 1.1rem;
    color: #475569;
}

.drop-zone {
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    padding: 10px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    background: #f1f5f9;
}

/* Intelligent Drop Zone Feedback */
.drop-zone.valid-drop {
    background: #f0fdf4 !important;
    /* Extremely Light Green */
    border: 2px dashed #22c55e !important;
    position: relative;
    z-index: 10;
    transition: all 0.2s ease;
}

.drop-zone.invalid-drop {
    background: #fff1f2 !important;
    /* Pale Red/Coral */
    border: 2px dashed #f43f5e !important;
    opacity: 0.9;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    transform: scale(0.99);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05) !important;
}

.drop-zone.valid-drop.drag-over {
    background: #dcfce7 !important;
    /* Slightly deeper green on hover */
    border-style: solid !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.15) !important;
}

.drop-zone.invalid-drop.drag-over {
    background: #ffe4e6 !important;
    border-style: solid !important;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.15) !important;
}

/* Teacher Tab Specific Styling embedded in draggable drops */
.teacher-view-card {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.teacher-view-card .big-bold-class {
    font-size: 1.8rem;
    font-weight: 900;
}

.teacher-view-card .details {
    color: inherit;
    font-weight: bold;
}

/* Removed hardcoded section colors since we dynamically assign them via pastel classes based on classId now */

/* Master Matrix */
.matrix-card .table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 75vh;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    position: relative;
    background: #fff;
}

#page-master-matrix {
    overflow: visible !important;
}

/* Smart Matrix Dropdown Modernization */
#smart-matrix-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 250px;
    z-index: 1000;
    padding: 0;
    text-align: right;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.smart-drop-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.smart-drop-item:hover {
    background: #f8fafc;
}

.smart-drop-item button {
    flex: 1;
    text-align: right;
    padding: 12px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.smart-drop-item button:last-child {
    padding: 12px 15px;
    color: #e74c3c;
    width: 45px;
    text-align: center;
    border-right: 1px solid #eee;
    flex: 0;
}

.smart-drop-item.custom {
    padding: 8px 10px;
    gap: 5px;
}

.smart-drop-item.custom input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.8rem;
    outline: none;
}

.smart-drop-item.custom button {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
    flex: 0;
}

.btn-clear-all-smart {
    width: 100%;
    text-align: right;
    padding: 12px 15px;
    border: none;
    background: #fff5f5;
    cursor: pointer;
    color: #e74c3c;
    font-family: 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.btn-clear-all-smart:hover {
    background: #fee2e2;
}


.master-matrix-table {
    width: auto;
    min-width: max-content;
    border-collapse: collapse; /* Better border connectivity */
    table-layout: fixed;
    background: #ffffff;
}

.master-matrix-table th,
.master-matrix-table td {
    border: 1px solid #e2e8f0;
    padding: 2px 1px;
    text-align: center;
    color: #1e293b;
    min-width: 28px;
    max-width: 32px;
    font-size: 11px;
    position: relative;
    word-break: break-all;
}

.master-matrix-table .day-separator {
    border-left: 3px solid #1e293b !important;
}

.master-matrix-table .subject-group-separator td {
    border-bottom: 3px solid #000000 !important;
}

.master-matrix-table .sticky-col {
    position: sticky;
    right: 0;
    background: #ffffff;
    z-index: 100 !important;
    min-width: 170px;
    max-width: 170px;
    text-align: right;
    padding: 2px 10px;
    border-left: 2px solid #e2e8f0 !important;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08); /* Shadow on the inner edge */
    vertical-align: middle;
    transition: background-color 0.2s;
}

.master-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 90;
    background: #f8fafc;
}

.master-matrix-table thead th.sticky-col {
    z-index: 110 !important;
    top: 0;
    right: 0;
}

/* Header/Footer lines within sticky-col */
.teacher-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.teacher-info-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    /* Increased gap */
    width: 100%;
    margin-top: 4px;
    /* More spacing from top row */
}

.teacher-name-sm {
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
    text-align: right;
    line-height: 1.2;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-left: 5px;
    color: #1e293b;
}

.teacher-subject-sm {
    font-size: 11px;
    color: #64748b;
    white-space: pre-wrap;
    text-align: right;
    line-height: 1.2;
}

.teacher-info-footer .leader-badge {
    margin-right: auto;
    /* Push leader badge to the other side */
}

.workload-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.workload-badge.under {
    background: #3b82f6;
    color: #ffffff;
}

.workload-badge.met {
    background: #22c55e;
    color: #ffffff;
}

.workload-badge.over {
    background: #ef4444;
    color: #ffffff;
    animation: pulse-error 2s infinite;
}

@keyframes pulse-error {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Subject Group Colors - Soft Pastel with 3D feel */
.subject-color-0 {
    background-color: #f0f9ff !important;
    border-bottom: 2px solid #bae6fd !important;
}

.subject-color-1 {
    background-color: #f0fdf4 !important;
    border-bottom: 2px solid #bbf7d0 !important;
}

.subject-color-2 {
    background-color: #fffaf0 !important;
    border-bottom: 2px solid #fed7aa !important;
}

.subject-color-3 {
    background-color: #fdf2f8 !important;
    border-bottom: 2px solid #fbcfe8 !important;
}

.subject-color-4 {
    background-color: #f5f3ff !important;
    border-bottom: 2px solid #ddd6fe !important;
}

.subject-color-5 {
    background-color: #ecfeff !important;
    border-bottom: 2px solid #a5f3fc !important;
}

.subject-color-6 {
    background-color: #fff7ed !important;
    border-bottom: 2px solid #ffedd5 !important;
}

.subject-color-7 {
    background-color: #f1f5f9 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.subject-color-8 {
    background-color: #fff1f2 !important;
    border-bottom: 2px solid #fecdd3 !important;
}

.subject-color-9 {
    background-color: #f0fdfa !important;
    border-bottom: 2px solid #99f6e4 !important;
}

.subject-color-0:hover,
.subject-color-1:hover,
.subject-color-2:hover {
    filter: brightness(0.97);
}

.leader-badge {
    background: #dcfce7;
    color: #166534;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid #bbf7d0;
    white-space: nowrap;
}

/* Consolidated into definition above */

.teacher-subject-sm {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}



.master-matrix-table th.sticky-col {
    background: #f1f5f9;
    z-index: 120 !important;
    /* Highest priority for corner intersection */
}


/* Shading for teacher column */
.master-matrix-table td.sticky-col.report-cell-science {
    background-color: #f0fdf4 !important;
}

.master-matrix-table td.sticky-col.report-cell-literary {
    background-color: #f0f9ff !important;
}

.master-matrix-table td.sticky-col.report-cell-language {
    background-color: #faf5ff !important;
}

.master-matrix-table td.sticky-col.report-cell-activity {
    background-color: #fffaf0 !important;
}

.master-matrix-table td.sticky-col.report-cell-math {
    background-color: #f0f9ff !important;
}

.master-matrix-table td.sticky-col.report-cell-arabic {
    background-color: #fefce8 !important;
}

.master-matrix-table td.sticky-col.report-cell-english {
    background-color: #faf5ff !important;
}

.master-matrix-table td.sticky-col.report-cell-history {
    background-color: #fef2f2 !important;
}

.master-matrix-table td.sticky-col.report-cell-other {
    background-color: #f8fafc !important;
}


.master-matrix-table th {
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-weight: 800;
    color: #475569;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 8px 5px;
    box-sizing: border-box;
}

/* Sticky Day Header (First Row) */
.master-matrix-table tr:nth-child(1) th {
    top: 0;
    z-index: 102;
    height: 48px; /* Fixed height for precision */
}

/* Sticky Period Header (Second Row) */
.master-matrix-table tr:nth-child(2) th {
    top: 48px; /* Perfectly aligns with bottom of row 1 */
    z-index: 101;
    border-bottom: 2px solid #1e293b !important;
    height: 38px;
    padding: 0 !important;
}

.master-matrix-table th.day-header {
    background: rgba(237, 242, 247, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid #1e293b !important;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 900;
    text-align: center;
}

.master-matrix-table .matrix-period-header {
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    vertical-align: middle;
    text-align: center;
}

/* Typography Upgrade: Teacher/Subject anchor */
.master-matrix-table th.sticky-col {
    background: rgba(238, 242, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #1e293b !important;
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    text-align: center;
    border-bottom: 2px solid #1e293b !important;
    z-index: 120 !important;
}

/* Period Number Badge */
.period-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    margin: 0 auto;
}

/* Updated Vibrant Pastel Shading for teacher column */
.master-matrix-table td.sticky-col.report-cell-science {
    background-color: #e6fffa !important;
}

.master-matrix-table td.sticky-col.report-cell-literary {
    background-color: #e3f2fd !important;
}

.master-matrix-table td.sticky-col.report-cell-language {
    background-color: #f3e5f5 !important;
}

.master-matrix-table td.sticky-col.report-cell-activity {
    background-color: #fff9db !important;
}

.master-matrix-table td.sticky-col.report-cell-math {
    background-color: #e3f2fd !important;
}

.master-matrix-table td.sticky-col.report-cell-arabic {
    background-color: #fff9db !important;
}

.master-matrix-table td.sticky-col.report-cell-english {
    background-color: #f3e5f5 !important;
}

.master-matrix-table td.sticky-col.report-cell-history {
    background-color: #ffebee !important;
}

.master-matrix-table td.sticky-col.report-cell-other {
    background-color: #f1f5f9 !important;
}


.matrix-cell {
    transition: transform 0.2s;
    cursor: pointer;
    height: 36px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
    font-size: 0.65rem;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.matrix-cell:hover {
    transform: scale(1.02);
    z-index: 10;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.matrix-data-cell {
    padding: 2px 0;
    border: 1px solid #e2e8f0;
    font-weight: 900;
    font-size: 1.2rem;
    /* Increased 25% from 0.95rem */
    line-height: 1.1;
    text-align: center;
    vertical-align: middle;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    /* Ensure it's below the sticky headers and columns */
}

.matrix-data-cell:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.matrix-cell-empty {
    height: auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: normal;
}


/* Smart Constraints Page */
.nll-container {
    background: #ffffff;
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    border-right: 4px solid var(--primary-color);
    border-bottom: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    /* Increased for detail */
    gap: 24px;
    padding: 10px 0;
}

/* --- Modern Teacher Profile Cards --- */
.teacher-modern-card {
    background: #ffffff;
    border: 1px solid #e0f2fe;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 2px;
}

.teacher-modern-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: currentColor;
}

/* --- Subject-Specific 3D Coloring --- */
.card-subject-islamic, .teacher-row-islamic {
    --subject-color-100-percent: #3b82f6;
    --subject-color-20-percent: rgba(59, 130, 246, 0.2);
    --subject-color: #3b82f6;
    --subject-bg: rgba(59, 130, 246, 0.2);
    --subject-color: #3b82f6;
    --subject-color-hover: #2563eb;
    --subject-bg: rgba(59, 130, 246, 0.2);
}
.card-subject-islamic {
    --subject-color-100-percent: #3b82f6;
    --subject-color-20-percent: rgba(59, 130, 246, 0.2);
    --subject-color: #3b82f6;
    --subject-bg: rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-right: 4px solid var(--subject-color) !important;
    color: #1e40af;
}

.card-subject-islamic .modern-avatar-halo {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.card-subject-ccdi, .teacher-row-ccdi {
    --subject-color-100-percent: #64748b;
    --subject-color-20-percent: rgba(100, 116, 139, 0.2);
    --subject-color: #64748b;
    --subject-bg: rgba(100, 116, 139, 0.2);
    --subject-color: #64748b;
    --subject-color-hover: #475569;
    --subject-bg: rgba(100, 116, 139, 0.2);
}
.card-subject-ccdi {
    --subject-color-100-percent: #64748b;
    --subject-color-20-percent: rgba(100, 116, 139, 0.2);
    --subject-color: #64748b;
    --subject-bg: rgba(100, 116, 139, 0.2);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-right: 4px solid var(--subject-color) !important;
    color: #334155;
}

.card-subject-ccdi .modern-avatar-halo {
    border-color: #e2e8f0;
    background: #f1f5f9;
}

.card-subject-science, .teacher-row-science {
    --subject-color-100-percent: #10b981;
    --subject-color-20-percent: rgba(16, 185, 129, 0.2);
    --subject-color: #10b981;
    --subject-bg: rgba(16, 185, 129, 0.2);
    --subject-color: #10b981;
    --subject-color-hover: #059669;
    --subject-bg: rgba(16, 185, 129, 0.2);
}
.card-subject-science {
    --subject-color-100-percent: #10b981;
    --subject-color-20-percent: rgba(16, 185, 129, 0.2);
    --subject-color: #10b981;
    --subject-bg: rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-right: 4px solid var(--subject-color) !important;
    color: #065f46;
}

.card-subject-science .modern-avatar-halo {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.card-subject-literary, .teacher-row-literary {
    --subject-color-100-percent: #2563eb;
    --subject-color-20-percent: rgba(37, 99, 235, 0.2);
    --subject-color: #2563eb;
    --subject-bg: rgba(37, 99, 235, 0.2);
    --subject-color: #2563eb;
    --subject-color-hover: #1d4ed8;
    --subject-bg: rgba(37, 99, 235, 0.2);
}
.card-subject-literary {
    --subject-color-100-percent: #2563eb;
    --subject-color-20-percent: rgba(37, 99, 235, 0.2);
    --subject-color: #2563eb;
    --subject-bg: rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-right: 4px solid var(--subject-color) !important;
    color: #1e3a8a;
}

.card-subject-literary .modern-avatar-halo {
    border-color: #dbeafe;
    background: #eff6ff;
}

.card-subject-language {
    --subject-color-100-percent: #a855f7;
    --subject-color-20-percent: rgba(168, 85, 247, 0.2);
    --subject-color: #a855f7;
    --subject-bg: rgba(168, 85, 247, 0.2);
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    border-right: 4px solid #a855f7 !important;
    color: #581c87;
}

.card-subject-language .modern-avatar-halo {
    border-color: #f3e8ff;
    background: #faf5ff;
}

.card-subject-activity {
    --subject-color-100-percent: #f59e0b;
    --subject-color-20-percent: rgba(245, 158, 11, 0.2);
    --subject-color: #f59e0b;
    --subject-bg: rgba(245, 158, 11, 0.2);
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border-right: 4px solid #f59e0b !important;
    color: #92400e;
}

.card-subject-activity .modern-avatar-halo {
    border-color: #fef3c7;
    background: #fffbeb;
}

.card-subject-other {
    --subject-color-100-percent: #9ca3af;
    --subject-color-20-percent: rgba(156, 163, 175, 0.2);
    --subject-color: #9ca3af;
    --subject-bg: rgba(156, 163, 175, 0.2);
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-right: 4px solid #9ca3af !important;
    color: #374151;
}

.card-subject-other .modern-avatar-halo {
    border-color: #f3f4f6;
    background: #f9fafb;
}

/* 3D Reflection Effect on Cards */
.teacher-modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.modern-card-inner {
    padding: 20px;
}

.modern-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

/* Avatar Halo Effect */
.modern-avatar-halo {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 58, 138, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 1.5px solid rgba(37, 99, 235, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.teacher-modern-card:hover .modern-avatar-halo {
    border-color: #2563eb;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

.modern-avatar-core {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #94a3b8;
    font-size: 1.5rem;
}

.modern-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Teacher Meta info */
.modern-teacher-info {
    flex: 1;
}

.teacher-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    /* Dark Navy */
    margin-bottom: 4px;
}

.teacher-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.subject-tag,
.quota-tag {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-btn {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 2px;
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.2);
}

/* Slots Matrix System */
.modern-slots-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-day-label {
    width: 45px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-align: right;
}

.modern-periods-group {
    display: flex;
    gap: 4px;
    flex: 1;
}

/* Individual Slot Button */
.modern-slot-btn {
    flex: 1;
    aspect-ratio: 1;
    border: none;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 2px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modern-slot-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 4px;
    pointer-events: none;
}

.period-num {
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.status-icon {
    font-size: 0.55rem;
    margin-top: 1px;
}

/* Slot Status Styles */
.modern-slot-btn.is-available {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.modern-slot-btn.is-available:hover {
    background: #ffffff;
    color: #3b82f6;
    border-color: #3b82f6;
    transform: scale(1.15);
    z-index: 10;
}

.modern-slot-btn.is-blocked {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    color: #ef4444;
    border: 1px solid #fca5a5;
    box-shadow: 0 4px 0 #ef4444, 0 6px 10px rgba(239, 68, 68, 0.1);
}

.modern-slot-btn.is-blocked:hover {
    transform: scale(1.1) translateY(2px);
    box-shadow: 0 2px 0 #ef4444;
}

.modern-slot-btn.is-meeting {
    background: var(--subject-color-20-percent, rgba(33, 150, 243, 0.15)) !important;
    color: var(--subject-color-100-percent, #2196f3) !important;
    border: 2px solid var(--subject-color-100-percent, #2196f3) !important;
    box-shadow: 0 4px 0 var(--subject-color-100-percent, #2196f3), 0 5px 12px rgba(0,0,0,0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-slot-btn.is-meeting:hover {
    transform: scale(1.1) translateY(2px);
    background: var(--subject-color-100-percent, #2196f3) !important;
    color: #fff !important;
    box-shadow: 0 2px 0 var(--subject-color-100-percent, #2196f3);
}

.modern-slot-btn.is-meeting:hover .status-icon {
    color: #fff !important;
}




/* --- Subject Modern Cards --- */
.subject-modern-card {
    background: #ffffff;
    border: 1px solid #e0f2fe;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 2px;
}

.subject-modern-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.1);
    border-color: #3b82f6;
}

.modern-avatar-halo.is-hard {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(153, 27, 27, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.subject-modern-card:hover .modern-avatar-halo.is-hard {
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.modern-avatar-halo.is-hard .modern-avatar-core {
    color: #ef4444;
}

.modern-avatar-halo.is-normal {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 58, 138, 0.05) 100%);
    border-color: rgba(37, 99, 235, 0.2);
}

.subject-modern-card:hover .modern-avatar-halo.is-normal {
    border-color: #2563eb;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

.modern-avatar-halo.is-normal .modern-avatar-core {
    color: #2563eb;
}

/* Modern Switches Group */
.modern-switches-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
}

.modern-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
}

.modern-switch-row:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.switch-label-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}

.switch-label-wrap i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.icon-red {
    color: #ef4444;
}

.icon-blue {
    color: #3b82f6;
}

.icon-orange {
    color: #f59e0b;
}

/* Modern Toggle Switch Component */
.modern-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.modern-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.modern-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .3s;
    border-radius: 34px;
}

.modern-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-toggle input:checked+.modern-slider {
    background-color: #3b82f6;
}

.modern-toggle input:checked+.modern-slider:before {
    transform: translateX(20px);
}

.modern-toggle input:focus+.modern-slider {
    box-shadow: 0 0 1px #3b82f6;
}

.report-template-cards,
.excel-export-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card,
/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   Excel Import/Export - Premium Redesign
   Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

.excel-grid-container {
    margin-bottom: 40px;
}

.excel-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.excel-card-modern {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.excel-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(26, 35, 126, 0.1);
    border-color: rgba(26, 35, 126, 0.15);
}

.excel-card-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform 0.4s ease;
}

.excel-card-modern:hover .excel-card-icon-wrap {
    transform: scale(1.15) rotate(-5deg);
}

.icon-green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
}

.icon-purple {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #7e22ce;
}

.icon-orange {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #c2410c;
}

.icon-violet {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #6d28d9;
}

.excel-card-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #1a237e;
    font-weight: 800;
}

.excel-card-content p {
    margin: 0 0 20px 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
}

.btn-download-glass {
    background: rgba(26, 35, 126, 0.05);
    border: 1px solid rgba(26, 35, 126, 0.1);
    padding: 10px 18px;
    border-radius: 12px;
    color: #1a237e;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
}

.excel-card-modern:hover .btn-download-glass {
    background: #1a237e;
    color: white;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.3);
}

/* Import Landing Platform */
.import-landing-platform {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 40px;
}

.import-section-header {
    margin-bottom: 25px;
}

.import-section-header h4 {
    font-size: 1.35rem;
    color: #1e293b;
    font-weight: 900;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.import-section-header p {
    color: #64748b;
    font-size: 0.95rem;
}

.import-drop-zone {
    background: white;
    border: 2px dashed #bae6fd;
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.import-drop-zone.dragover {
    border-color: #0ea5e9;
    background: #f0f9ff;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cloud-icon {
    font-size: 3.5rem;
    color: #0ea5e9;
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.drop-zone-content p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
}

/* Reports Visual Gallery */
.reports-gallery-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 30px;
    border-radius: 20px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.global-report-settings {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Modern Minimalist Select Styling */
.modern-minimal-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") no-repeat left 15px center;
    background-size: 12px;
    padding: 10px 20px 10px 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    outline: none;
    min-width: fit-content;
}

.modern-minimal-select:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.modern-minimal-select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

.modern-minimal-select option {
    background: #1e293b;
    color: white;
    padding: 10px;
}

.modern-qr-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.modern-qr-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.modern-qr-toggle input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.drop-zone-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.btn-import-royal {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.btn-import-royal:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-template-white {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-template-white:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Progress Bar Support */
.import-progress-wrap {
    margin-top: 30px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 8px;
}

.import-progress-bar {
    height: 10px;
    background: #e2f1f9;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.import-progress-fill {
    height: 100%;
    background: #0ea5e9;
    width: 0%;
    transition: width 0.3s ease;
}

/* Footer Tip */
.import-instruction-footer {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    /* Single line */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.import-instruction-footer i {
    color: #fbbf24 !important;
    /* Golden bulb icon */
    font-size: 0.85rem;
}

.import-instruction-footer span {
    font-size: 0.72rem;
    color: #ffffff !important;
    /* Pure white text */
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    overflow-y: auto;
    /* Ã˜Â§Ã™â€žÃ˜Â³Ã™â€¦Ã˜Â§Ã˜Â­ Ã˜Â¨Ã˜Â§Ã™â€žÃ˜ÂªÃ™â€¦Ã˜Â±Ã™Å Ã˜Â± Ã™â€žÃ™Æ’Ã˜Â§Ã™â€¦Ã™â€ž Ã˜Â§Ã™â€žÃ™â€ Ã˜Â§Ã™ÂÃ˜Â°Ã˜Â© */
    padding: 20px 0;
}

.modal.show {
    z-index: 2000;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    width: 95%;
    max-width: 420px;
    /* Ultra-compact width */
    padding: 25px;
    /* Tighter internal space */
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5);
    transform: translateY(-30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    color: #1e293b;
    text-align: right;
}

.modal-content h2 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 25px;
    color: #0f172a;
    border-bottom: 2px solid rgba(15, 23, 42, 0.05);
    padding-bottom: 15px;
}

/* Redesigned Form Groups - Vertical Stack */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    /* Even tighter vertical gaps */
    text-align: right;
}

/* --- Live Session Tracker (Neon Blue Glow) --- */
.current-session-highlight {
    position: relative;
    z-index: 100 !important;
    background: rgba(14, 165, 233, 0.15) !important;
    border: 2.5px solid #0ea5e9 !important;
    animation: live-session-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4), inset 0 0 10px rgba(14, 165, 233, 0.2) !important;
    transform: scale(1.02);
}

/* Corner "Live" Indicator */
.current-session-highlight::after {
    content: 'LIVE';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #0ea5e9;
    color: white;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
    z-index: 101;
    letter-spacing: 1px;
    animation: blink-live 1s steps(2, start) infinite;
}

@keyframes live-session-pulse {
    0% { border-color: #0ea5e9; box-shadow: 0 0 10px rgba(14, 165, 233, 0.3); }
    50% { border-color: #38bdf8; box-shadow: 0 0 25px rgba(14, 165, 233, 0.6); }
    100% { border-color: #0ea5e9; box-shadow: 0 0 10px rgba(14, 165, 233, 0.3); }
}

@keyframes blink-live {
    to { visibility: hidden; }
}

.form-group label {
    display: block;
    font-weight: 800;
    font-size: 0.85rem;
    /* Smaller for density */
    color: #334155;
    margin-bottom: 6px;
    padding-right: 4px;
}

/* Input & Select Styling - Premium Look */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    /* Compact padding for small modal */
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.8);
    font-weight: 700;
    font-family: inherit;
    font-size: 0.9rem;
    /* Balanced size */
    color: #0f172a;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* RTL Select Arrow Alignment */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 20px center;
    /* Arrow on the left for RTL */
    padding-left: 45px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.form-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Modal Actions - Bottom Left alignment */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    /* In RTL, flex-end is LEFT */
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.modal-footer .btn-primary,
form>button[type="submit"] {
    width: 100%;
    /* Full-width for modern anchor feel */
    margin-top: 10px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 900;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    border-radius: 14px;
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Utilities */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(241, 245, 249, 0.9);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive */
@media(max-width:1100px) {
    .dashboard-grid-main {
        grid-template-columns: 1fr;
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(100%);
        width: 260px;
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-right: 0;
    }

    .top-bar-center {
        position: static;
        transform: none;
    }

    .page-main-title {
        font-size: 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Duty Management Styles */
.duty-section-card {
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    padding: 25px;
}

.duty-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: #1e293b;
}

.sub-controls-card,
.sub-results-card {
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    padding: 20px;
}

.duty-week-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.duty-day-tab {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 700;
}

.duty-day-tab.active,
.duty-day-tab:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.duty-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--radius);
    overflow: hidden;
}

.duty-table th {
    background: #f1f5f9;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
    color: #475569;
}

.duty-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.duty-suggestions-panel {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.duty-suggestions-title {
    font-weight: 800;
    font-size: 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #1e293b;
}

/* Live Dashboard Styles */
.live-dashboard-controls {
    background: #ffffff;
    padding: 15px 25px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.live-dashboard-preview {
    background: #f1f5f9;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.live-header {
    background: #1e293b;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.live-header-right,
.live-header-center,
.live-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.live-attendance-badge {
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-rate {
    font-size: 1.5rem;
    font-weight: 900;
}

.live-clock-wrap {
    text-align: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 20px;
    border-radius: 15px;
}

.live-clock {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.live-countdown {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.live-period-indicator {
    background: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 25px;
    background: #f1f5f9;
    flex: 1;
    overflow-y: auto;
}

.live-event-ticker {
    background: #1e293b;
    padding: 10px 20px;
    border-top: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ticker-label {
    background: var(--primary-color);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ticker-track-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    font-weight: 600;
    font-size: 1rem;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- Modern Grade Allocation Modal --- */
.modal-allocation {
    width: 850px !important;
    max-width: 95vw;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.alloc-modal-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alloc-modal-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alloc-modal-icon {
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #3b82f6;
}

.alloc-modal-title h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alloc-subject-sub {
    margin: 3px 0 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

.alloc-info-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 30px;
    display: flex;
    flex-wrap: wrap;
    /* Ã˜Â£Ã˜Â¶Ã™ÂÃ™â€ Ã˜Â§ Ã™â€¡Ã˜Â°Ã˜Â§ Ã™â€žÃ˜Â¶Ã™â€¦Ã˜Â§Ã™â€  Ã˜Â¹Ã˜Â¯Ã™â€¦ Ã˜Â®Ã˜Â±Ã™Ë†Ã˜Â¬ Ã˜Â§Ã™â€žÃ™â€ Ã˜Âµ */
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #475569;
}

.alloc-info-bar strong {
    color: #3b82f6;
    font-size: 1.1rem;
    font-weight: 900;
}

.alloc-affected-teachers {
    margin-right: auto;
    color: #db2777;
    background: #fdf2f8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alloc-rows-container {
    padding: 20px 30px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alloc-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    /* Ã˜Â§Ã™â€žÃ˜Â³Ã™â€¦Ã˜Â§Ã˜Â­ Ã˜Â¨Ã˜Â§Ã™â€žÃ˜Â§Ã™â€žÃ˜ÂªÃ™ÂÃ˜Â§Ã™Â Ã™ÂÃ™Å  Ã˜Â§Ã™â€žÃ˜Â´Ã˜Â§Ã˜Â´Ã˜Â§Ã˜Âª Ã˜Â§Ã™â€žÃ˜ÂµÃ˜ÂºÃ™Å Ã˜Â±Ã˜Â© */
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

.alloc-row:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.alloc-row-num {
    width: 25px;
    height: 25px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.alloc-grade-select {
    flex: 1;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background-color: #fff;
    font-weight: 600;
    outline: none;
}

.alloc-periods-input {
    width: 80px;
    padding: 10px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-weight: 800;
    color: #0f172a;
}

.alloc-periods-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.alloc-row-calc {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f9ff;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.alloc-section-count {
    font-size: 0.8rem;
    color: #0369a1;
    font-weight: 700;
    white-space: nowrap;
}

.alloc-multiply-icon {
    font-size: 0.9rem;
    color: #3b82f6;
    font-weight: 900;
}

.alloc-row-total-badge {
    color: #ffffff;
    background: #0ea5e9;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 900;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

/* Deficit Badge Ã¢â‚¬â€ shown inline in the alloc-row-calc area */
.alloc-deficit-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.alloc-deficit-badge.complete {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alloc-deficit-badge.deficit {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    animation: deficit-pulse 2s ease-in-out infinite;
}

@keyframes deficit-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

@keyframes draft-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0px rgba(251, 146, 60, 0); }
    50% { opacity: 0.85; box-shadow: 0 0 12px rgba(251, 146, 60, 0.6); }
}

.alloc-row-delete {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.alloc-row-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

@keyframes pulse-update {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        color: #059669;
    }

    100% {
        transform: scale(1);
    }
}

.pulse-update {
    animation: pulse-update 0.4s ease-out;
    display: inline-block;
}

.alloc-row-delete {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    cursor: pointer;
    transition: 0.2s;
}

.alloc-row-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
}

.btn-alloc-add {
    margin: 10px 30px;
    background: #f1f5f9;
    color: #475569;
    border: 2px dashed #cbd5e1;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-alloc-add:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #1e293b;
}

.alloc-modal-footer {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* --- Allocation Button in Grid --- */
.btn-allocate {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-allocate:hover {
    background: #e2e8f0;
    border-color: #3b82f6;
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-allocate.has-allocation {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-allocate.has-allocation:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* --- Modern Data Toolbar & Settings --- */
.column-settings-container {
    position: relative;
    display: inline-block;
}

#btn-column-settings {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #1e293b;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

#btn-column-settings:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(15, 23, 42, 0.2);
}

.column-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: dropdown-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.column-dropdown h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.column-dropdown label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.column-dropdown label:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #1e293b;
}

.column-dropdown input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* --- Enhanced Table Headers --- */
.modern-data-table thead tr {
    background: #f1f5f9;
    /* Quiet Blue-Gray */
}

.modern-data-table th {
    background: transparent;
    color: #020617;
    /* High contrast dark color */
    font-weight: 900;
    /* Bold header typography */
    font-size: 1.15rem;
    /* Prominent size */
    padding: 22px 25px;
    border: none;
    text-align: right;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* --- Visual Polish & Alignment --- */
.modern-data-table th:first-child {
    border-radius: 16px 0 0 16px;
}

.modern-data-table th:last-child {
    border-radius: 0 16px 16px 0;
}

/* --- Modernizing data-header --- */
.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
    flex-wrap: wrap;
    gap: 15px;
}

.data-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    color: #1e293b;
    position: relative;
    padding-right: 15px;
}

.data-header h3::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background: #3b82f6;
    border-radius: 10px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* --- Polishing Search Inputs --- */
.search-container {
    position: relative;
    min-width: 250px;
}

.search-container .form-control {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    padding: 10px 40px 10px 15px;
    transition: 0.3s;
    font-weight: 600;
    color: #1e293b;
    width: 100%;
}

.search-container .form-control:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    color: #0f172a;
}

.search-container::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

/* --- Professional Print UI & Engine --- */
.btn-print-modern {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid #3b82f6;
    color: #2563eb;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
    cursor: pointer;
}

.btn-print-modern:hover {
    background: #eff6ff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Print Layout Styles (Screen and Print) */
#print-document-container {
    display: none;
    background: white;
    color: black;
    padding: 40px;
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.print-header-center {
    text-align: center;
}

.print-header-center h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
}

.print-header-center p {
    margin: 5px 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #444;
}

.print-logo-box {
    width: 100px;
    text-align: center;
}

.print-logo-box img {
    max-width: 80px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.print-info-box {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.6;
}

.print-table-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: underline;
}

.modern-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.modern-print-table th {
    background: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #000;
    padding: 12px;
    border: 1px solid #cbd5e1;
    font-weight: 800;
    font-size: 1rem;
}

.modern-print-table td {
    padding: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    vertical-align: middle;
    text-align: center;
}

@media print {
    body * {
        visibility: hidden;
    }

    #print-document-container,
    #print-document-container * {
        visibility: visible;
    }

    #print-document-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        padding: 0;
    }

    @page {
        size: A4;
        margin: 1cm;
    }
}

/* --- Student Management UI --- */
.student-total-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    font-weight: 700;
    color: #475569;
    font-size: 0.9rem;
}

.student-total-container i {
    color: #3b82f6;
    font-size: 1.1rem;
}

.badge-student-total {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    min-width: 40px;
    display: inline-flex;
    justify-content: center;
    padding: 4px 10px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.th-sort-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-right: 5px;
    transition: 0.2s;
}

.modern-data-table th:hover .th-sort-icon {
    color: #3b82f6;
    transform: scale(1.2);
}

.badge-student-count {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    font-weight: 800;
    font-size: 1rem;
}

/* --- Print Column Control UI --- */
.th-print-control {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.col-print-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #3b82f6;
    opacity: 0.6;
    transition: 0.2s;
}

.col-print-checkbox:hover {
    opacity: 1;
    transform: scale(1.1);
}

.col-print-checkbox:checked {
    opacity: 1;
}

/* =========================================
   Modern Column Settings Dropdown
   ========================================= */

.column-settings-container {
    position: relative;
    display: inline-block;
}

.column-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 15px;
    z-index: 1000;
    margin-top: 8px;
    animation: dropdownFadeIn 0.25s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.column-dropdown h4 {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 8px;
}

.column-dropdown label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    user-select: none;
}

.column-dropdown label:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    transform: translateX(-5px);
}

.column-dropdown input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Modern Button Polish */
.btn-secondary.btn-sm {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

.btn-secondary.btn-sm:hover {
    background: #ffffff !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* =========================================
   Premium Search Box Styles
   ========================================= */

.search-container {
    position: relative;
    max-width: 250px;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    /* RTL context: Right padding for icon */
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    color: #1e293b;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1), 0 5px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.search-container:focus-within .search-icon {
    color: var(--primary-color);
}

.search-container input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

/* Modern Data Table Rows Hover */
.modern-data-table tbody tr {
    transition: all 0.2s;
}

.modern-data-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.02) !important;
    transform: scale(1.002);
    box-shadow: inset -4px 0 0 var(--primary-color);
    /* RTL: Accent on Right */
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   SweetAlert2 Ã¢â‚¬â€ Custom Overrides for Distribution Engine
   Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

.swal2-popup {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif !important;
    border-radius: 20px !important;
    padding: 30px 28px 24px !important;
    direction: rtl !important;
}

.swal-success-popup {
    max-width: 460px !important;
    border: 1px solid rgba(46, 204, 113, 0.2) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(46, 204, 113, 0.1) !important;
}

.swal2-title {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 900 !important;
    font-size: 1.35rem !important;
    color: #1e293b !important;
    direction: rtl !important;
}

.swal2-icon.swal2-success {
    border-color: #2ecc71 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(46, 204, 113, 0.3) !important;
}

.swal2-icon.swal2-success [class^=swal2-success-line] {
    background-color: #2ecc71 !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
}

.swal2-confirm {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    padding: 10px 24px !important;
    border-radius: 25px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.25s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.swal2-cancel {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    transition: all 0.2s ease !important;
}

.swal2-actions {
    gap: 10px !important;
    margin-top: 8px !important;
}

.swal2-backdrop-show {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(4px) !important;
}

.swal2-html-container {
    direction: rtl !important;
    text-align: center !important;
    font-family: 'Tajawal', sans-serif !important;
    color: #475569 !important;
    margin-top: 4px !important;
}

.animate__faster {
    animation-duration: 0.3s !important;
}

/* Reports Visual Gallery - Premium Design */
.reports-gallery-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 30px;
    border-radius: 20px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â Reports Visual Gallery (Refined) Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.reports-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
    margin-top: 35px;
}

.report-card-modern {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.report-card-modern:hover { transform: scale(1.01); box-shadow: 0 20px 40px rgba(26, 35, 126, 0.12); border-color: rgba(26, 35, 126, 0.3); background: #ffffff;
}

.report-card-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(26, 35, 126, 0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.report-card-modern:hover::after {
    opacity: 1;
}

.card-icon-pastel {
    width: 80px; height: 80px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
    flex-shrink: 0;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.report-card-modern:hover .card-icon-pastel { transform: scale(1.1);
}

.icon-blue {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0369a1;
    box-shadow: 0 5px 15px rgba(3, 105, 161, 0.1);
}

.report-card-modern:hover .icon-blue {
    box-shadow: 0 8px 25px rgba(3, 105, 161, 0.25);
}

.icon-purple {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #7e22ce;
    box-shadow: 0 5px 15px rgba(126, 34, 206, 0.1);
}

.report-card-modern:hover .icon-purple {
    box-shadow: 0 8px 25px rgba(126, 34, 206, 0.25);
}

.icon-teal {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #0f766e;
    box-shadow: 0 5px 15px rgba(15, 118, 110, 0.1);
}

.report-card-modern:hover .icon-teal {
    box-shadow: 0 8px 25px rgba(15, 118, 110, 0.25);
}

.icon-orange {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #c2410c;
    box-shadow: 0 5px 15px rgba(194, 65, 12, 0.1);
}

.report-card-modern:hover .icon-orange {
    box-shadow: 0 8px 25px rgba(194, 65, 12, 0.25);
}

.icon-red {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #b91c1c;
    box-shadow: 0 5px 15px rgba(185, 28, 28, 0.1);
}

.report-card-modern:hover .icon-red {
    box-shadow: 0 8px 25px rgba(185, 28, 28, 0.25);
}

.icon-grey {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    box-shadow: 0 5px 15px rgba(71, 85, 105, 0.1);
}

.report-card-modern:hover .icon-grey {
    box-shadow: 0 8px 25px rgba(71, 85, 105, 0.25);
}

.card-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-main-content h4 { margin: 0 0 10px 0; font-size: 1.4rem;
    color: #1a237e;
    font-weight: 800;
}

.card-main-content p { margin: 0 0 15px 0; font-size: 0.95rem; color: #64748b; line-height: 1.6;
}

.card-controls { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: auto; width: 100%;
}

.btn-customize-glass {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-customize-glass:hover {
    background: #f1f5f9;
    color: #1a237e;
}

.card-actions-glass {
    display: flex;
    gap: 8px;
}

.btn-preview-glass,
.btn-print-glass {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.btn-preview-glass {
    background: #eef2ff;
    color: #4338ca;
}

.btn-print-glass {
    background: #1a237e;
    color: white;
}

.btn-preview-glass:hover {
    background: #e0e7ff;
}

.btn-print-glass:hover {
    background: #0d47a1;
    box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
}

/* reports footer tip */
.reports-footer-tip {
    margin: 30px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 25px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 500;
    max-width: fit-content;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.reports-footer-tip i {
    color: #fbbf24 !important;
    /* Golden Bulb icon */
    font-size: 1rem;
    animation: pulse-light 2s infinite;
}

@keyframes pulse-light {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â Quick Setup Alignment Fixes Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */
.setup-guide-body {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 20px;
    align-items: stretch;
    /* Crucial for equal height */
}

.setup-guide-steps,
.setup-engine-center,
.setup-guide-analytics {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #ffffff !important;
}

.setup-engine-center {
    justify-content: flex-start !important;
    /* Start from top to align heading */
    padding: 24px !important;
    background: #ffffff !important;
}

.engine-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center the engine content vertically */
    gap: 20px;
}

/* Modern SWAL improvements */
.modern-swal-popup {
    border-radius: 25px !important;
    padding: 20px !important;
}

.modern-swal-confirm-btn {
    border-radius: 12px !important;
    padding: 12px 30px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
}

view-glass {
    flex: 0 0 45px;
}

.btn-print-glass {
    flex: 1;
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

.btn-customize-glass:hover {
    background: #f8fafc;
}

.btn-preview-glass:hover {
    background: #f1f5f9;
    color: #0369a1;
    border-color: #bae6fd;
}

.btn-print-glass:hover {
    background: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

/* Customization Dropdown */
.custom-dropdown-wrap {
    position: relative;
    width: 100%;
}

.report-custom-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border: 1px solid #e2e8f0;
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 5px;
}

.report-custom-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
}

.report-custom-dropdown input[type="checkbox"] {
    accent-color: #1e293b;
    width: 16px;
    height: 16px;
}

/* Removed redundant styling for reports-footer-tip as it's unified above */

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Smart Entity Picker Popover
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.smart-entity-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    max-width: 300px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    z-index: 200;
    overflow: hidden;
    animation: pickerSlideIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pickerSlideIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.picker-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.picker-search-icon { color: #94a3b8; font-size: 0.8rem; flex-shrink: 0; }

.picker-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    color: #334155;
    direction: rtl;
    font-family: inherit;
}

.picker-search-input::placeholder { color: #cbd5e1; }

.picker-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 0;
}

.picker-list::-webkit-scrollbar { width: 4px; }
.picker-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    gap: 8px;
    direction: rtl;
    transition: background 0.15s;
}

.picker-item:hover { background: #f0f9ff; }
.picker-item.selected { background: #e0f2fe; }
.picker-item.selected .picker-item-name { color: #0369a1; font-weight: 700; }

.picker-item-name {
    font-size: 0.88rem;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.picker-item-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.picker-item.selected .picker-item-sub { background: #bae6fd; color: #0369a1; }



/* Preview Area Modern */
.report-preview-area-modern {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 50px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.preview-header-modern {
    background: rgba(248, 250, 252, 0.8);
    padding: 25px 30px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.preview-title {
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-controls-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.minimal-select {
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-family: inherit;
    font-size: 0.9rem;
    background: white;
    color: #475569;
    min-width: 180px;
}

.btn-print-main {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-print-main:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

.preview-box-modern {
    min-height: 400px;
    padding: 40px 20px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Each A4 page in preview â€“ stack vertically centered */
.preview-box-modern .print-page {
    width: 100%;
    max-width: 860px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    text-align: center;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Teacher Info Strip (below header)
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.teacher-info-strip { display:flex; align-items:center; gap:16px; padding:12px 30px; background:#fff; border-bottom:2px solid #e8eaf6; margin:0; }
.teacher-info-avatar { width:48px; height:48px; border-radius:50%; background:linear-gradient(135deg,#1a237e,#283593); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.3rem; flex-shrink:0; box-shadow:0 2px 10px rgba(26,35,126,0.25); }
.teacher-info-details { flex:1; }
.teacher-info-name { font-size:1.05rem; font-weight:800; color:#1a237e; margin-bottom:6px; }
.teacher-info-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.teacher-info-item { display:inline-flex; align-items:center; gap:5px; font-size:0.8rem; color:#475569; background:#f1f5f9; padding:3px 11px; border-radius:20px; white-space:nowrap; }
.teacher-info-item i { color:#1a237e; font-size:0.72rem; }
.teacher-info-item strong { color:#1a237e; font-weight:700; }
.teacher-info-sep { color:#cbd5e1; font-size:0.9rem; }
.teacher-info-leader { background:#fef3c7; color:#b45309; }
.teacher-info-leader i, .teacher-info-leader strong { color:#b45309; }

/* =========================================
   Visual Substitution Hub & Duty Board
   ========================================= */

.substitution-hub-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 1. Dashboard Header (Triple Alignment) */
.sub-hub-header {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Left: Completion Progress */
.sub-completion-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 1px solid #f1f5f9;
    padding-left: 20px;
}

.circular-progress-sub {
    position: relative;
    width: 75px;
    height: 75px;
}

.circular-progress-sub svg {
    transform: rotate(-90deg);
}

.circular-progress-sub .progress-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 4;
}

.circular-progress-sub .progress-bar {
    fill: none;
    stroke: #2563eb;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text-sub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 900;
    color: #0f172a;
    transition: all 0.3s ease;
}

.updating-pulse {
    animation: sub-pulse 0.6s ease-out;
    stroke: #3b82f6 !important;
    stroke-width: 6 !important;
}

.updating-text {
    transform: translate(-50%, -50%) scale(1.3);
    color: #2563eb;
}

@keyframes sub-pulse {
    0% { stroke-width: 4; }
    50% { stroke-width: 8; opacity: 0.7; }
    100% { stroke-width: 4; }
}

.progress-desc {
    display: flex;
    flex-direction: column;
}

.progress-desc .main-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
}

.progress-desc .sub-val {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Center: Deficit Bar (Momentary Deficit Bar) */
.deficit-bar-center {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    max-width: 100%;
}

.deficit-bar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deficit-capsules-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.deficit-capsule {
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.deficit-capsule.absent {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

.deficit-capsule.covered {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.deficit-capsule i {
    font-size: 0.85rem;
}

/* Right: Sidebar Action Badges */
.sub-steps-badges {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sub-step-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: #f8fafc;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.sub-step-badge.active {
    background: rgba(37, 99, 235, 0.04);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.1);
}

.sub-step-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.active .sub-step-icon {
    background: #2563eb;
    color: white;
}

/* 2. Modern Switch Tabs */
.sub-nav-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 6px;
    border-radius: 16px;
    gap: 5px;
    width: fit-content;
    margin: 0 auto;
}

.sub-nav-tab {
    padding: 10px 30px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #64748b;
    border: none;
    cursor: pointer;
    background: transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub-nav-tab.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 3. Duty Board Visual Substitution */
.duty-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.duty-card-modern {
    background: white;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.duty-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.duty-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.location-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.location-icon-box {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #f0f9ff;
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.location-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
    color: #0f172a;
}

.location-info .sub-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

.duty-teacher-zone {
    padding: 18px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.duty-teacher-zone:hover {
    border-color: #2563eb;
    background: #f1f7ff;
}

.assigned-teacher-wrap {
    text-align: center;
    width: 100%;
}

.assigned-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    display: block;
}

.assigned-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.assigned-meta span i {
    color: #94a3b8;
    margin-left: 4px;
}

/* 4. Smart Substitution Center */
.sub-candidate-card-modern {
    background: white;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.sub-candidate-card-modern:hover {
    transform: scale(1.02) translateX(-5px);
    border-color: #2563eb;
}

.candidate-avatar {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #94a3b8;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.candidate-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cand-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cand-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.fairness-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fairness-badge.low {
    background: #dcfce7;
    color: #16a34a;
}

.fairness-badge.med {
    background: #fef3c7;
    color: #d97706;
}

.fairness-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

.cand-details {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.cand-details span i {
    color: #cbd5e1;
    margin-left: 4px;
}

/* 5. UI Extras */
.smart-advice-tip {
    background: transparent;
    border-top: 1px dashed #e2e8f0;
    margin-top: 40px;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
}

.smart-advice-tip i {
    font-size: 1.5rem;
    color: #fbbf24;
}

.transition-page {
    animation: slideUpIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Overrides */
@media print {
    .hide-on-print {
        display: none !important;
    }

    .page-section {
        display: block !important;
        background: white !important;
    }

    .sub-hub-header {
        display: none !important;
    }

    .sub-nav-tabs {
        display: none !important;
    }
}

/* =========================================
   Live Dashboard Modern - Premium UX
   ========================================= */

#page-live-dashboard {
    background: #f8fafc;
    min-height: 100vh;
}

.live-dashboard-preview {
    background: white;
    border-radius: 30px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

/* 1. Integrated Live Header */
.live-header-premium {
    background: #0f172a;
    /* Dark Navy Premium */
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    direction: rtl;
}

.live-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-school-logo-wrap {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-school-logo-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.live-school-logo-wrap i {
    font-size: 1.8rem;
    color: #38bdf8;
}

.live-title-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.live-title-area h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.live-title-area p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

/* Status Badges - Glass */
.live-status-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.status-badge-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge-glass .badge-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
}

.status-badge-glass .badge-value {
    font-size: 1rem;
    font-weight: 900;
    color: #38bdf8;
}

/* Active Status Button - Glow */
.btn-status-glow {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.btn-status-glow.outside {
    background: #64748b;
    box-shadow: 0 0 20px rgba(100, 116, 139, 0.2);
}

.btn-status-glow i {
    font-size: 1.1rem;
}

/* 2. Clock & Pulse - Modern Premium */
.live-clock-premium {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.live-clock-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.digital-clock-modern {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: white;
    display: flex;
    align-items: baseline;
    gap: 4px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.clock-sep {
    color: #38bdf8;
    animation: blink-sep 1s infinite;
    opacity: 0.8;
}

.clock-sep-sec {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 2px;
}

.clock-seconds {
    font-size: 1.6rem;
    color: #38bdf8;
    font-weight: 600;
    min-width: 1.8ch;
}

.clock-ampm {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.live-clock-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

@keyframes blink-sep {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fb7185;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(251, 113, 133, 0.1);
    padding: 4px 12px;
    border-radius: 50px;
}

.pulse-dot-red {
    width: 10px;
    height: 10px;
    background: #fb7185;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(251, 113, 133, 0.8);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7);
    }

    70% {
        transform: scale(1.1);
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(251, 113, 133, 0);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(251, 113, 133, 0);
    }
}

.live-countdown-modern {
    display: flex;
    align-items: center;
    gap: 12px;
}

#live-countdown {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
    font-size: 1.3rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    padding: 6px 18px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    min-width: 80px;
    text-align: center;
}

.day-chip-modern {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3. Central Live Stage */
.central-live-stage {
    padding: 40px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    /* White/Light Grey Gradient */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-live-card {
    background: white;
    border-radius: 35px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.05);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* Empty State / Night Mode */
.empty-state-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
}

.moon-stars-container {
    position: relative;
    margin-bottom: 30px;
}

.moon-stars-container .fa-moon {
    font-size: 5rem;
    color: #94a3b8;
    filter: drop-shadow(0 15px 30px rgba(148, 163, 184, 0.3));
    animation: float-night 4s ease-in-out infinite;
}

.moon-stars-container .fa-star {
    position: absolute;
    color: #fbbf24;
    font-size: 1.2rem;
    opacity: 0.6;
    animation: twinkle 3s infinite alternate;
}

.star-1 {
    top: -10px;
    right: -15px;
    animation-delay: 0s;
}

.star-2 {
    bottom: 10px;
    left: -20px;
    animation-delay: 1.5s;
    font-size: 0.8rem !important;
}

@keyframes float-night {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes twinkle {
    from {
        opacity: 0.2;
        transform: scale(0.8);
    }

    to {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.empty-state-hero h3 {
    font-size: 2rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 12px;
}

.empty-state-hero p {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Grid and Cards */
.live-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 30px;
}

.live-class-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.live-class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    background: white;
    border-color: #38bdf8;
}

/* Footer & Tips */
.live-footer-premium {
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    direction: rtl;
}

.live-footer-tip {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-footer-tip i {
    color: #fbbf24;
    font-size: 1.1rem;
}

.live-last-sync {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Fullscreen Mode Overrides */
.live-dashboard-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.live-dashboard-fullscreen .central-live-stage {
    padding: 20px;
}

.live-dashboard-fullscreen .hero-live-card {
    border-radius: 20px;
}

/* Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â
   Dual-Wing Attendance Panel
   Right = Students | Left = Teachers
   Ã¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢ÂÃ¢â€¢Â */

.live-attendance-dual-panel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    background: linear-gradient(135deg, #f0f7ff 0%, #fafafa 50%, #f5f0ff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    direction: rtl;
    min-height: 175px;
}

/* Each Wing */
.attendance-wing {
    padding: 22px 35px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Wing Section Header */
.wing-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wing-title {
    font-size: 1rem;
    font-weight: 900;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.wing-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.students-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.35);
}

.teachers-icon {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    box-shadow: 0 6px 15px rgba(124, 58, 237, 0.35);
}

/* Stat Row */
.wing-stats-row {
    display: flex;
    gap: 20px;
}

.wing-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: white;
    border-radius: 14px;
    padding: 12px 20px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s;
}

.wing-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.wing-stat-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.wing-stat-value {
    font-size: 1.8rem;
    font-weight: 950;
    line-height: 1;
}

.wing-stat-value.primary {
    color: #1e293b;
}

.wing-stat-value.danger {
    color: #dc2626;
}

.wing-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
}

/* Rate Box (big bottom box) */
.wing-rate-box {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wing-rate-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}

.wing-rate-value {
    font-size: 2rem;
    font-weight: 950;
    color: #1e293b;
    line-height: 1;
}

.wing-rate-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.wing-rate-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.students-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.students-rate {
    border-right: 4px solid #3b82f6;
}

.teachers-fill {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.teachers-rate {
    border-right: 4px solid #7c3aed;
}

/* Badge */
.wing-rate-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
}

.wing-rate-badge.badge-good {
    background: #dcfce7;
    color: #16a34a;
}

.wing-rate-badge.badge-ok {
    background: #fef3c7;
    color: #d97706;
}

.wing-rate-badge.badge-low {
    background: #fee2e2;
    color: #dc2626;
}

.wing-rate-badge.badge-none {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Vertical Divider */
.wing-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    gap: 8px;
    width: 50px;
}

.wing-divider-line {
    flex: 1;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #cbd5e1, transparent);
}

.wing-divider-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

/* 4. Premium Settings Layout */
.settings-premium-layout {
    display: flex;
    gap: 30px;
    min-height: 700px;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.03);
    direction: rtl;
    margin-top: 30px;
}

.settings-sidebar {
    width: 250px;
    background: #f8fafc;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 16px;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-nav-item:hover {
    background: rgba(15, 23, 42, 0.04);
}

.settings-nav-item.active {
    background: #0f172a;
    color: white;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.settings-content-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
    animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header-iconic {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.card-header-iconic .icon-wrap {
    width: 60px;
    height: 60px;
    background: #0f172a;
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-header-iconic h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 950;
    color: #1e293b;
}

.settings-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-group-modern label {
    font-weight: 800;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    /* Use right for RTL start position */
    right: 20px;
    color: #64748b;
    z-index: 10;
    pointer-events: none;
    /* Ensures the icon doesn't block clicking/focusing the input */
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: all 0.3s ease;
}

.input-with-icon .interactive-avatar {
    position: absolute;
    right: 12px;
    z-index: 15;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
    top: 50%;
    transform: translateY(-50%);
}

.input-with-icon .interactive-avatar:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-icon .interactive-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.input-with-icon .interactive-avatar i {
    position: static;
    pointer-events: none;
    font-size: 1rem;
    color: #94a3b8;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    /* 
       Optimized RTL padding-right: 
       - 50px for standard font-awesome icons
    */
    padding: 14px 50px 14px 20px !important;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Tajawal', sans-serif;
    text-align: right;
    /* Explicitly right-align for RTL */
}

/* Specific clearance for inputs with interactive avatars which are larger */
.input-with-icon .interactive-avatar ~ input,
.input-with-icon .interactive-avatar ~ select {
    padding-right: 65px !important;
}

/* Special fix for time and number inputs which have browser UI on the right/left */
.input-with-icon input[type="time"],
.input-with-icon input[type="number"] {
    padding-right: 50px !important;
}

.input-with-icon input:focus {
    background: white;
    border-color: #0f172a;
    box-shadow: 0 0 0 5px rgba(15, 23, 42, 0.06);
    outline: none;
}

.logo-upload-section {
    display: flex;
    gap: 30px;
    background: #f1f5f9;
    padding: 25px;
    border-radius: 20px;
    align-items: center;
}

.current-logo-preview {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e1;
    overflow: hidden;
}

.current-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Removed display: block; to let JS toggle visibility */
}

.btn-upload-glass {
    background: #0f172a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

.settings-action-bar {
    margin-top: 30px;
    background: white;
    padding: 25px 40px;
    border-radius: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.05);
}

.btn-save-premium {
    background: #0f172a;
    color: white;
    border: none;
    padding: 16px 45px;
    border-radius: 18px;
    font-weight: 900;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-save-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.35);
}

/* Settings form inputs (without icon wrapper) */
.form-group-modern input,
.form-group-modern select,
.form-group-modern textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 700;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group-modern input:focus,
.form-group-modern select:focus {
    outline: none;
    border-color: #0f172a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.07);
}

/* Live tab rate display */
.live-rate-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 18px 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.live-rate-box .rate-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-rate-box .rate-value {
    font-size: 2rem;
    font-weight: 950;
    background: linear-gradient(135deg, #0f172a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Settings nav item improvements */
.settings-nav-item {
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.settings-nav-item:hover {
    transform: translateX(-4px);
}

/* Classes Table Specific Font Enhancements */
#classes-table .name-primary {
    font-size: 1.2rem;
    font-weight: 800;
}

#classes-table .modern-badge {
    font-size: 1rem;
    padding: 6px 15px;
    font-weight: 800;
}

#classes-table td i {
    font-size: 1.1rem;
}

/* --- Standardized Toolbar Header --- */
.toolbar-standard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1.5px solid rgba(0, 0, 0, 0.04);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- Badge: Unallocated (Purple) --- */
.badge-unallocated-modern {
    background: #f3e8ff !important;
    color: #581c87 !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e9d5ff !important;
    box-shadow: 0 4px 12px rgba(88, 28, 135, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge-unallocated-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(88, 28, 135, 0.15);
    background: #ede9fe !important;
}

/* --- Badge: Completed (Green) --- */
.badge-completed-modern {
    background: #f0fdf4 !important;
    color: #15803d !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dcfce7 !important;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.08);
}

/* --- Advanced Search & Spotlight Engine --- */
.mini-search-box-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(15px) saturate(200%);
    -webkit-backdrop-filter: blur(15px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.5); /* Seamless glass border */
    padding: 8px 18px;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 320px;
    box-sizing: border-box;
    position: relative;
    /* Remove all internal gray shadows */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); 
}

.mini-search-box-modern:focus-within {
    background: #ffffff !important;
    border-color: #6366f1;
    /* Pure Halo Effect: No gray shadows */
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 
                0 15px 30px -10px rgba(99, 102, 241, 0.15);
    width: 380px;
}

.mini-search-box-modern i {
    color: #6366f1;
    font-size: 1rem;
    transition: transform 0.3s;
}

.mini-search-box-modern:focus-within i {
    transform: scale(1.1) rotate(5deg);
}

.mini-search-box-modern input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important; /* Force remove any browser default shadows */
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    width: 100%;
    padding: 0;
    margin: 0;
    font-family: 'Tajawal', sans-serif;
}

.mini-search-box-modern input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

/* Predictive Dropdown */
.search-autocomplete-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    padding: 8px;
    animation: qi-slide-down 0.3s ease;
}

.search-autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    font-weight: 700;
    color: #334155;
    font-size: 0.88rem;
}

.autocomplete-item:hover {
    background: #f1f5f9;
    color: #6366f1;
    padding-right: 20px;
}

.autocomplete-item .subj-tag {
    font-size: 0.7rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    color: #64748b;
}

/* Spotlight Highlight (Amber-Gold Theme) */
.spotlight-row {
    animation: spotlight-pulse 1.8s ease-in-out infinite !important;
    position: relative;
    z-index: 50;
    transition: all 0.4s ease;
}

.spotlight-row td {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-top: 1px solid rgba(245, 158, 11, 0.4) !important;
    border-bottom: 2px solid #f59e0b !important;
    position: relative;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}

.spotlight-row .sticky-col {
    background: #fffcf0 !important;
    border-right: 5px solid #f59e0b !important;
    box-shadow: 10px 0 15px -5px rgba(245, 158, 11, 0.2) !important;
}

@keyframes spotlight-pulse {
    0% { 
        box-shadow: inset 0 0 0 rgba(245, 158, 11, 0); 
        background-color: rgba(245, 158, 11, 0.08);
    }
    50% { 
        box-shadow: inset 0 0 25px rgba(245, 158, 11, 0.3); 
        background-color: rgba(245, 158, 11, 0.18);
    }
    100% { 
        box-shadow: inset 0 0 0 rgba(245, 158, 11, 0); 
        background-color: rgba(245, 158, 11, 0.08);
    }
}

/* --- Styled Select for Toolbar --- */
.toolbar-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 40px;
}

.toolbar-select-modern {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 0 35px 0 15px;
    /* RTL Handling - Select Icon on Left */
    height: 40px;
    min-width: 130px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    direction: rtl;
}

.toolbar-select-modern:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.toolbar-select-wrap .select-icon {
    position: absolute;
    left: 12px;
    font-size: 0.8rem;
    color: #94a3b8;
    pointer-events: none;
}

/* --- Enhanced Mini Search Box --- */
.mini-search-box-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 0 15px;
    height: 40px;
    transition: all 0.3s;
    width: 220px;
    box-sizing: border-box;
}

.mini-search-box-modern:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    width: 280px;
}

.mini-search-box-modern i {
    color: #94a3b8;
    font-size: 0.85rem;
}

.mini-search-box-modern input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    color: #1e293b;
}

.settings-nav-item.active {
    background: #0f172a;
    color: white;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
    transform: translateX(-4px);
}

/* =========================================
   Premium Matrix Browse Mode
   ========================================= */
.dashboard-content.full-bleed {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    height: calc(100vh - 0px); /* Fill space */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#page-master-matrix {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.matrix-browse-toolbar {
    background: linear-gradient(to bottom, #ffffff, #f8fafc) !important;
    border-bottom: 2px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    flex-shrink: 0;
}

.btn-matrix-zoom {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #ffffff;
    color: #475569;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-matrix-zoom:hover {
    background: #4338ca;
    color: white;
    transform: translateY(-1px);
}

.btn-matrix-print-premium {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-matrix-print-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-matrix-refresh-premium {
    width: 42px;
    height: 42px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.btn-matrix-refresh-premium:hover {
    background: #f1f5f9;
    color: #4338ca;
    border-color: #4338ca;
    transform: rotate(45deg);
}

/* Ensure matrix table fills space and is scrollable */
#page-master-matrix .matrix-card {
    flex: 1;
    overflow: auto;
    background: #f8fafc;
    padding: 30px;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#master-matrix-container {
    transition: zoom 0.2s ease-in-out;
    display: inline-block;
    width: 100%;
}

/* Animation for the clean look - REMOVED for Direct Entry Speed */
#page-master-matrix:not(.hidden) {
    animation: none;
}

/* --- Context-Aware Toolbar Visibility --- */

/* 1. In Standalone Browse Page */
#page-master-matrix .matrix-edit-toolbar {
    display: none !important;
}
#page-master-matrix .matrix-browse-toolbar {
    display: flex !important;
}

/* 2. Inside Schedule Setup Workflow Tabs */
#page-schedule-setup .matrix-edit-toolbar {
    display: flex !important;
}
#page-schedule-setup .matrix-browse-toolbar {
    display: none !important;
}

/* Ensure no legacy nav appears in browse mode */
#page-master-matrix .smart-nav-bar,
#page-master-matrix .data-nav {
    display: none !important;
}

/* ============================================================
   SMART SESSION CARD (QUICK INFO POPUP)
   ============================================================ */
.matrix-quick-info {
    position: absolute;
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding: 0;
    overflow: hidden;
    animation: qi-slide-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
}

@keyframes qi-slide-up {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.matrix-quick-info.is-flipped {
    animation: qi-slide-down 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.15);
}

@keyframes qi-slide-down {
    from { opacity: 0; transform: translateY(-15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.qi-header {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: white;
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qi-header.vacant {
    background: linear-gradient(135deg, #64748b, #94a3b8);
}

.qi-close {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.qi-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.qi-body {
    padding: 15px;
}

.qi-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 4px;
}

.qi-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.qi-label {
    color: #64748b;
    font-weight: 500;
}

.qi-val {
    color: #1e293b;
    font-weight: 700;
}

.qi-status {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #ef4444;
    background: #fef2f2;
    padding: 6px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* Teacher Quota Detail Styles */
.teacher-quota-wide {
    width: 380px !important;
}

.tq-info-box {
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tq-info-item {
    display: flex;
    flex-direction: column;
}

.tq-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
}

.tq-val-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.tq-val-quota {
    font-size: 1.2rem;
    font-weight: 900;
}

.tq-val-quota small {
    font-size: 0.85rem;
    color: #94a3b8;
}

.tq-empty {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-style: italic;
}

.tq-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.tq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tq-table th {
    background: #f1f5f9;
    padding: 8px 12px;
    text-align: right;
    color: #475569;
    font-weight: 800;
    position: sticky;
    top: 0;
}

.tq-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    color: #1e293b;
}

.tq-badge-frozen {
    background: #e0f2fe;
    color: #0284c7;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #bae6fd;
}

.tq-badge-manual {
    background: #fef3c7;
    color: #d97706;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #fde68a;
}

/* --- Master Matrix Premium Print System --- */
@media print {
    /* Set page to A3 Landscape - This ensures the large table fits */
    @page {
        size: A3 landscape;
        margin: 5mm;
    }

    /* Target the specific printing state triggered via JS */
    body.ra-printing-active {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        font-family: 'Tajawal', sans-serif !important;
        overflow: visible !important;
    }

    /* Force background colors and images for all browsers */
    body.ra-printing-active th, 
    body.ra-printing-active td,
    body.ra-printing-active div,
    body.ra-printing-active .matrix-cell-content {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide everything except the dashboard content which contains our analytics page */
    body.ra-printing-active > *:not(.dashboard-main-content),
    body.ra-printing-active .sidebar-modern,
    body.ra-printing-active .main-page-header,
    body.ra-printing-active .top-bar,
    body.ra-printing-active .matrix-browse-toolbar,
    body.ra-printing-active .ra-quick-actions,
    body.ra-printing-active .ra-footer-info,
    body.ra-printing-active .ra-analytics-top-banner,
    body.ra-printing-active .ra-section-header,
    body.ra-printing-active .ra-insight-panel {
        display: none !important;
    }

    body.ra-printing-active .dashboard-main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
    }

    body.ra-printing-active .dashboard-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        background: transparent !important;
    }

    /* Ensure ONLY the Master Matrix section is visible */
    body.ra-printing-active #ra-page-results-analytics {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.ra-printing-active #ra-trend-section {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.ra-printing-active .ra-section {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    body.ra-printing-active .matrix-card {
        box-shadow: none !important;
        border: 1px solid #94a3b8 !important;
        border-radius: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    body.ra-printing-active #master-matrix-container {
        width: 100% !important;
        transform: none !important;
        zoom: 1 !important;
        background: white !important;
    }

    body.ra-printing-active .master-matrix-table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1px solid #000 !important;
        background: white !important;
        /* Ultimate trick: Zoom down everything to force-fit */
        zoom: 0.8 !important; 
    }

    body.ra-printing-active .master-matrix-table th,
    body.ra-printing-active .master-matrix-table td {
        border: 0.5px solid #000 !important;
        padding: 0px !important; 
        height: 10px !important;
        line-height: 0.8 !important;
        text-align: center !important;
        vertical-align: middle !important;
        font-size: 5pt !important; /* Extremely small */
    }

    /* Column Widths - Standardized to be very narrow */
    body.ra-printing-active .matrix-period-header,
    body.ra-printing-active .matrix-data-cell {
        width: 8px !important;
        min-width: 8px !important;
    }

    /* Day headers */
    body.ra-printing-active .day-header {
        background: #e2e8f0 !important;
        font-size: 6pt !important;
        height: 12px !important;
    }

    /* Teacher Name Column - Narrowed further */
    body.ra-printing-active .sticky-col {
        position: static !important;
        background: #f8fafc !important;
        width: 65px !important; 
        min-width: 65px !important;
        padding: 0 1px !important;
        text-align: right !important;
        border-right: 1px solid #000 !important;
    }

    body.ra-printing-active .teacher-name-sm {
        font-weight: 800 !important;
        color: black !important;
        font-size: 5pt !important;
        white-space: nowrap;
        display: block;
        max-width: 60px;
        overflow: hidden;
    }

    body.ra-printing-active .teacher-subject-sm {
        font-size: 4pt !important;
        display: block;
        line-height: 0.7;
    }

    body.ra-printing-active .matrix-cell-content {
        font-size: 5pt !important;
        font-weight: 800 !important;
        width: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove everything that adds height */
    body.ra-printing-active .workload-badge,
    body.ra-printing-active .leader-badge,
    body.ra-printing-active .period-number-badge {
        display: none !important;
    }
    
    /* Re-add just the period number as text in the header */
    body.ra-printing-active .matrix-period-header::after {
        content: attr(data-col);
        font-size: 4pt;
        display: block;
    }
    /* Wait, data-col is 'sun-1', we just want the number. Let's use a selector. */
    body.ra-printing-active .matrix-period-header .period-number-badge {
        display: block !important;
        background: transparent !important;
        color: black !important;
        font-size: 5pt !important;
        box-shadow: none !important;
        width: auto !important;
        height: auto !important;
    }

    /* Badges should be simplified for print */
    body.ra-printing-active .workload-badge {
        border: 1px solid #cbd5e1 !important;
        background: white !important;
        color: black !important;
        padding: 1px 4px !important;
    }

    /* Hide empty cell markers or style them */
    body.ra-printing-active .matrix-cell-empty {
        color: #e2e8f0 !important;
    }

    /* Preserve colors of class categories */
    body.ra-printing-active [class*="report-cell-"] {
        border: 1px solid rgba(0,0,0,0.1) !important;
    }
}

/* Frozen/Locked Timetable Items Styles */
.is-frozen-locked {
    border: 1.5px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.item-lock-indicator {
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}

/* Timetable Smart Swap & Safe Zones */
.swap-source-active {
    box-shadow: 0 0 0 4px var(--primary-color) inset !important;
    background: rgba(37, 99, 235, 0.15) !important;
    animation: pulse-swap 2s infinite;
    z-index: 100;
    position: relative;
}

@keyframes pulse-swap {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.safe-zone {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 2px dashed rgba(16, 185, 129, 0.5) !important;
    cursor: copy !important;
    transition: all 0.2s;
}

.safe-zone:hover {
    background: rgba(16, 185, 129, 0.4) !important;
}

.conflict-zone {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.cell-swap-flash {
    animation: flash-swap 1.2s ease-out;
    z-index: 101;
}

@keyframes flash-swap {
    0% { background-color: var(--accent-color); box-shadow: 0 0 20px var(--accent-color); }
    100% { background-color: transparent; box-shadow: none; }
}

/* --- Global Drag & Drop System Styles --- */
.switch-modern { position: relative; display: inline-block; width: 44px; height: 22px; vertical-align: middle; }
.switch-modern input { opacity: 0; width: 0; height: 0; }
.slider-modern { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider-modern:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider-modern { background-color: #10b981; }
input:checked + .slider-modern:before { transform: translateX(22px); }

.slot-item-draggable { cursor: grab !important; user-select: none; transition: transform 0.2s; }
.slot-item-draggable:active { cursor: grabbing !important; }
.is-dragging { opacity: 0.3 !important; transform: scale(0.95) !important; background: #f1f5f9 !important; border: 1px dashed #94a3b8 !important; }
.safe-zone-drag { background-color: rgba(34, 197, 94, 0.1) !important; border: 2.5px solid #22c55e !important; box-shadow: inset 0 0 12px rgba(34, 197, 94, 0.2) !important; }
.conflict-zone-drag { background-color: rgba(239, 68, 68, 0.1) !important; border: 2.5px solid #ef4444 !important; }
.drop-zone-active { outline: 2.5px dashed #2563eb; outline-offset: -5px; background: rgba(37, 99, 235, 0.05); }

.drag-conflict-tooltip {
    position: fixed; pointer-events: none; z-index: 10005;
    background: rgba(220, 38, 38, 0.98); color: white;
    padding: 12px 18px; border-radius: 14px; font-size: 0.95rem;
    font-weight: 700; box-shadow: 0 15px 45px rgba(0,0,0,0.3);
    display: none; direction: rtl; text-align: right;
    backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.2);
}
.drag-conflict-tooltip.show { display: block; }
.drag-conflict-tooltip .tooltip-header { font-weight: 900; font-size: 1.05rem; border-bottom: 1.5px solid rgba(255,255,255,0.4); margin-bottom: 8px; padding-bottom: 5px; }

/* --- Manual Assignment Slot Stylings --- */
.manual-slot-color {
    background-color: #f1f5f9 !important; /* Slate 100 - Professional Light Gray */
    border: 1.5px dashed #94a3b8 !important;
    color: #1e293b !important; /* Slate 800 - Deep Dark Text */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
    position: relative;
    overflow: hidden;
}

.manual-slot-color .subject {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.manual-slot-color .details {
    color: #64748b !important;
    font-weight: 600 !important;
}

.manual-slot-pin {
    position: absolute;
    top: -2px;
    right: 2px;
    font-size: 0.65rem;
    color: #64748b;
    opacity: 0.7;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.8));
    z-index: 5;
}



/* =========================================
   Universal Context Menu (Premium Design)
   ========================================= */
.context-menu, .meeting-ctx-menu, .avatar-ctx-menu {
    position: absolute;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2), 0 5px 15px -10px rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    padding: 8px;
    min-width: 220px;
    z-index: 999999 !important;
    animation: ctxFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-header {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.ctx-item {
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.ctx-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    transform: translateX(-4px);
}

.ctx-item i {
    width: 20px;
    font-size: 1rem;
    opacity: 0.8;
}

.ctx-item-cancel, .ctx-item-close {
    color: #ef4444 !important;
}

.ctx-item-cancel:hover, .ctx-item-close:hover {
    background: #fef2f2 !important;
}

.ctx-item-group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}















/* =========================================
   Highlighting and Focus
   ========================================= */
.entity-highlight {
    animation: highlightGlow 2s infinite alternate;
    position: relative;
    z-index: 1001;
    border: 3px solid #2563eb !important;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

@keyframes highlightGlow {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(37, 99, 235, 0.3); }
    100% { transform: scale(1.03); box-shadow: 0 0 30px rgba(37, 99, 235, 0.6); }
}

.highlight-row {
    background-color: rgba(37, 99, 235, 0.1) !important;
    transition: background-color 0.3s ease;
}

.highlight-pin {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 1002;
}

/* RESPONSIVE OVERRIDES FOR ALLOCATION MODAL */
#grade-allocation-modal.modal-allocation {
    width: 90% !important;
    max-width: 650px !important;
    max-height: 85vh !important;
    height: auto !important;
}
#grade-allocation-modal .alloc-rows-container {
    flex: 1 !important;
    max-height: none !important;
    overflow-y: auto !important;
}

@media (max-width: 600px) {
    .alloc-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .alloc-grade-select {
        width: 100% !important;
        flex: none !important;
    }
    .alloc-row-calc {
        width: 100% !important;
        justify-content: center !important;
    }
    .alloc-info-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 10px 15px !important;
    }
    .alloc-affected-teachers {
        margin-right: 0 !important;
        width: 100% !important;
    }
}

/* NEW SMART ROW-BASED CONTROLLER STYLES */
.alloc-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    padding: 15px 25px !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 12px !important;
}

.alloc-row:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-2px) !important;
}

.alloc-row-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 2 !important;
    min-width: 250px !important;
}

.alloc-grade-label {
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    color: #1e293b !important;
    background: #f1f5f9 !important;
    padding: 6px 15px !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

.alloc-class-count {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #3b82f6 !important;
    background: #eff6ff !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
}

.alloc-total-periods {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    background: #f8fafc !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    border: 1px dashed #cbd5e1 !important;
}

.alloc-deficit-wrapper {
    flex: 1.5 !important;
    display: flex !important;
    justify-content: center !important;
}

.alloc-deficit-badge {
    width: 100% !important;
    justify-content: center !important;
    padding: 8px 15px !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
}

.alloc-deficit-badge.deficit {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    animation: deficit-pulse 1.5s infinite !important;
}

#stat-card-absent-teachers {
    border-right: 5px solid #e53935 !important;
    border-radius: 12px;
    animation: v118-red 2.5s infinite ease-in-out !important;
}

.alloc-input-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #f8fafc !important;
    padding: 5px 15px !important;
    border-radius: 15px !important;
    border: 1px solid #e2e8f0 !important;
}

#stat-card-attendance {
    border-right: 5px solid #6366f1 !important;
    border-radius: 12px;
    animation: v118-indigo 2.5s infinite ease-in-out !important;
}

.alloc-periods-input {
    width: 65px !important;
    border: none !important;
    background: transparent !important;
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    text-align: center !important;
    padding: 0 !important;
}

#stat-card-classes {
    border-right: 5px solid #4caf50 !important;
    border-radius: 12px;
    animation: v118-green 2.5s infinite ease-in-out !important;
}

#stat-card-teachers {
    border-right: 5px solid #2196f3 !important;
    border-radius: 12px;
    animation: v118-blue 2.5s infinite ease-in-out !important;
}

.alloc-periods-label {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
}

.alloc-row-actions {
    display: flex !important;
    gap: 8px !important;
}

.alloc-row-num {
    display: none !important; /* Hide old row num if not needed */
}

@media (max-width: 900px) {
    .alloc-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    .alloc-row-info {
        min-width: 0 !important;
        justify-content: space-between !important;
    }
}



/* Force colors and images to appear in print */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}


/* End of Live Monitor Overhaul */












/* --- Live Monitor Premium UI (v15.9) --- */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 10px 30px #0d4e961a;
    }
    50% {
        box-shadow: 0 10px 50px #0d4e9640,
                   0 0 20px #0d4e9680;
    }
    100% {
        box-shadow: 0 10px 30px #0d4e961a;
    }
}

@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.live-monitor-premium-banner {
    background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 100%) !important;
    padding: 25px 35px !important;
    margin: -35px -35px 35px -35px !important;
    border-radius: 30px 30px 0 0 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    animation: none !important;
}

.live-monitor-premium-banner::after {
    display: none;
}

.live-monitor-premium-banner h3 {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.live-monitor-premium-banner select {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    padding: 8px 18px !important;
    font-weight: 800 !important;
    transition: all 0.3s ease;
    cursor: pointer;
}

.live-monitor-premium-banner select:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.live-monitor-premium-banner select option {
    background: #1e3a5f;
    color: #fff;
}

.live-monitor-container-premium {
    animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-red-glass {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); background: rgba(254,242,242,0.5); }
    70% { box-shadow: 0 0 20px 5px rgba(239,68,68,0.1); background: rgba(254,242,242,0.8); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); background: rgba(254,242,242,0.5); }
}

.card-class-now {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* 3D Depth & Shadows */
    box-shadow: 
        20px 20px 60px #bebebe, 
        -20px -20px 60px #ffffff;
    transform: perspective(1000px) rotateX(1deg);
    gap: 8px;
}

/* Strategic Gap Recommendations Print Styles */
.print-break-avoid {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

@media print {
    #gap-recommendations-box {
        display: block !important;
        border: 1px solid #bae6fd !important;
        background: #f0f9ff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
.card-class-now:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-10px) scale(1.02);
    box-shadow: 
        30px 30px 70px #b0b0b0, 
        -25px -25px 70px #ffffff;
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--grade-color);
}

.card-class-now::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: var(--grade-color);
    box-shadow: 0 0 15px var(--grade-color);
}

.card-class-now.vacant-alert {
    animation: pulse-red-glass 2s infinite !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.card-class-now .status-blob {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.live-monitor-grade-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 40px 0 20px;
}

.live-monitor-grade-divider::before {
    content: '';
    flex: 0 0 40px;
    height: 3px;
    background: var(--grade-color);
    border-radius: 2px;
}

.live-monitor-grade-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--grade-color), transparent);
    opacity: 0.3;
}

.live-monitor-grade-divider span {
    font-size: 1rem;
    font-weight: 900;
    color: #1e293b;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 6px 18px;
    border-radius: 12px;
    border-right: 5px solid var(--grade-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.card-stats-classes {
    border-right: 5px solid #4caf50 !important;
    border-radius: 12px;
    animation: pulse-green-glow 2s infinite ease-in-out;
}

.card-stats-teachers {
    border-right: 5px solid #2196f3 !important;
    border-radius: 12px;
    animation: pulse-blue-glow 2s infinite ease-in-out;
}

#stat-card-attendance {
    animation: pulse-indigo-glow 2.5s infinite ease-in-out !important;
}

#stat-card-absent-teachers {
    animation: pulse-red-glow 2.5s infinite ease-in-out !important;
}

.card-stats-classes {
    border-right: 5px solid #4caf50 !important;
    border-radius: 12px;
    animation: pulse-green-glow 2.5s infinite ease-in-out !important;
}

.card-stats-teachers {
    border-right: 5px solid #2196f3 !important;
    border-radius: 12px;
    animation: pulse-blue-glow 2.5s infinite ease-in-out !important;
}

@keyframes pulse-indigo-glow {
    0% { box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1); }
    50% { box-shadow: 0 6px 35px rgba(99, 102, 241, 0.6), 0 0 15px rgba(99, 102, 241, 0.2); }
    100% { box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1); }
}

@keyframes pulse-red-glow {
    0% { box-shadow: 0 6px 20px rgba(229, 57, 53, 0.1); }
    50% { box-shadow: 0 6px 35px rgba(229, 57, 53, 0.6), 0 0 15px rgba(229, 57, 53, 0.2); }
    100% { box-shadow: 0 6px 20px rgba(229, 57, 53, 0.1); }
}

@keyframes pulse-green-glow {
    0% { box-shadow: 0 6px 20px rgba(76, 175, 80, 0.1); }
    50% { box-shadow: 0 6px 35px rgba(76, 175, 80, 0.6), 0 0 15px rgba(76, 175, 80, 0.2); }
    100% { box-shadow: 0 6px 20px rgba(76, 175, 80, 0.1); }
}

@keyframes pulse-blue-glow {
    0% { box-shadow: 0 6px 20px rgba(33, 150, 243, 0.1); }
    50% { box-shadow: 0 6px 35px rgba(33, 150, 243, 0.6), 0 0 15px rgba(33, 150, 243, 0.2); }
    100% { box-shadow: 0 6px 20px rgba(33, 150, 243, 0.1); }
}

/* ══════════════════════════════════════════════════════════════════
   MASTER UNIFIED PRINT ENGINE - CSS SYSTEM (A4 COMPLIANT)
   ══════════════════════════════════════════════════════════════════ */

/* Hidden-on-screen utility */
.hidden-on-screen {
    display: none !important;
}

@media print {
    /* 1. Global Reset for Printing */
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm; /* A4 Width */
        min-height: 297mm;
        font-family: 'Tajawal', sans-serif !important;
        direction: rtl !important;
    }

    /* 2. Hide Dashboard UI completely */
    .app-container,
    .sidebar,
    .top-bar,
    .nav-bar,
    .settings-modal,
    .modal,
    button,
    .no-print,
    #drag-conflict-tooltip,
    .modern-context-menu {
        display: none !important;
    }

    /* 3. Show Unified Print Wrapper only */
    #unified-print-wrapper {
        display: block !important;
        visibility: visible !important;
        padding: 10mm;
        box-sizing: border-box;
        width: 100%;
        color: #000;
    }

    /* 4. Print Header Styling */
    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #1e293b;
        padding-bottom: 12px;
        margin-bottom: 25px;
    }

    .header-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .header-right { align-items: flex-start; text-align: right; }
    .header-center { align-items: center; text-align: center; }
    .header-left { align-items: flex-end; text-align: left; }

    .report-title {
        font-size: 1.8rem !important;
        font-weight: 800;
        margin: 0;
        color: #1e293b;
        padding-bottom: 5px;
    }

    .print-metadata {
        font-size: 0.9rem;
        color: #475569;
        font-weight: 600;
    }

    /* 5. Content Area Styling (Tables/Charts) */
    .content-area {
        width: 100%;
        min-height: 180mm;
    }

    .content-area table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 10px;
    }

    .content-area th, .content-area td {
        border: 1px solid #000 !important;
        padding: 8px 5px !important;
        text-align: center !important;
        font-size: 0.95rem !important;
        color: #000 !important;
    }

    .content-area th {
        background-color: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: 800;
    }

    /* 6. Signature & Footer System */
    .signatures-container {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        margin-top: 40px;
        padding: 0 10mm;
    }

    .sig-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 140px;
    }

    .sig-title {
        font-weight: 800;
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .sig-name {
        font-weight: 700;
        font-size: 0.95rem;
    }

    .stamp-box {
        position: relative;
    }

    .official-stamp-label {
        font-size: 0.75rem;
        color: #94a3b8;
        font-weight: 600;
        margin-bottom: 5px;
        text-transform: uppercase;
    }

    .stamp-circle {
        width: 80px;
        height: 80px;
        border: 2px dashed #94a3b8;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.4;
    }

    .print-footer {
        position: fixed;
        bottom: 5mm;
        left: 0;
        right: 0;
        text-align: center;
        border-top: 1px solid #e2e8f0;
        padding-top: 10px;
        font-size: 0.8rem;
        color: #64748b;
    }

    /* Page Break Logic */
    .page-break {
        page-break-before: always;
    }

    tr { page-break-inside: avoid; }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
.swal2-container {
    z-index: 99999 !important;
}
