body {
    font-family: 'Outfit', sans-serif;
    background-color: #f8f9fc;
}

[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

.top-nav {
    background: white;
    border-bottom: 1px solid #e3e6f0;
    padding: 15px;
}

.pulse-notify {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, .7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.lang-btn {
    font-size: 0.85rem;
    border-radius: 50px;
    padding: 5px 16px;
    font-weight: 700;
    transition: all 0.2s;
}

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

.custom-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    background: white;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    margin-right: 10px;
    object-fit: cover;
}

/* ضبط الاتجاه والتصحيحات للإنجليزية عبر dir=ltr */
[dir="ltr"] .text-end {
    text-align: right !important;
}

[dir="ltr"] .text-start {
    text-align: left !important;
}

[dir="ltr"] .border-end {
    border-right: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
    border-left: 0 !important;
}

[dir="ltr"] .border-start {
    border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important;
    border-right: 0 !important;
}

/* 🌙 تهيئة الوضع الداكن للعناصر المخصصة بنقاء 100% ودون أي جافا سكريبت ضار */
[data-bs-theme="dark"] body,
[data-theme="dark"] body {
    background-color: #0b0c10 !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .top-nav,
[data-theme="dark"] .top-nav {
    background: #111318 !important;
    border-bottom: 1px solid #222530 !important;
}

[data-bs-theme="dark"] .custom-card,
[data-theme="dark"] .custom-card,
[data-bs-theme="dark"] .card,
[data-theme="dark"] .card {
    background: #111318 !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.35) !important;
    color: #f1f1f4 !important;
    border-color: #222530 !important;
}

[data-bs-theme="dark"] .text-dark,
[data-theme="dark"] .text-dark {
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .text-secondary,
[data-theme="dark"] .text-secondary {
    color: #a1a5b7 !important;
}

[data-bs-theme="dark"] .bg-white,
[data-theme="dark"] .bg-white {
    background-color: #111318 !important;
}

[data-bs-theme="dark"] .input-group-text.bg-white,
[data-theme="dark"] .input-group-text.bg-white {
    background-color: #1a1d24 !important;
    border-color: #2b303c !important;
    color: #a1a5b7 !important;
}

[data-bs-theme="dark"] .form-control.bg-light,
[data-theme="dark"] .form-control.bg-light {
    background-color: #1a1d24 !important;
    border-color: #2b303c !important;
    color: #f1f1f4 !important;
}

/* 🎨 تحويل كافة رؤوس الجداول وبطاقات الفلترة الفاتحة (bg-light & table-light) إلى المظهر الداكن الفاخر */
[data-bs-theme="dark"] .bg-light,
[data-theme="dark"] .bg-light,
[data-bs-theme="dark"] .table-light,
[data-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light th,
[data-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light td,
[data-theme="dark"] .table-light td,
[data-bs-theme="dark"] thead.table-light,
[data-theme="dark"] thead.table-light,
[data-bs-theme="dark"] thead.table-light th,
[data-theme="dark"] thead.table-light th {
    background-color: #1a1d24 !important;
    color: #f1f1f4 !important;
    border-color: #2b303c !important;
}

/* 🎨 معالجة شارات الصفوف البيضاء (.badge.bg-light) لتصبح داكنة ومقروءة بوضوح */
[data-bs-theme="dark"] .badge.bg-light,
[data-theme="dark"] .badge.bg-light {
    background-color: #2b303c !important;
    color: #f1f1f4 !important;
    border: 1px solid #3f4254 !important;
}

/* 🎨 تحسين تباين ووضوح الأزرار الداكنة (btn-dark) في الوضع الليلي */
[data-bs-theme="dark"] .btn-dark,
[data-theme="dark"] .btn-dark {
    background-color: #3a3f50 !important;
    color: #ffffff !important;
    border-color: #4e5464 !important;
}

[data-bs-theme="dark"] .btn-dark:hover,
[data-theme="dark"] .btn-dark:hover {
    background-color: #4a5064 !important;
    color: #ffffff !important;
    border-color: #5d647c !important;
}

/* 🎨 تحسين تباين ووضوح أزرار الإطار الداكنة (btn-outline-dark) في الوضع الليلي */
[data-bs-theme="dark"] .btn-outline-dark,
[data-theme="dark"] .btn-outline-dark {
    color: #e1e1e8 !important;
    border-color: #4e5464 !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-theme="dark"] .btn-outline-dark:hover {
    background-color: #3a3f50 !important;
    color: #ffffff !important;
    border-color: #4e5464 !important;
}

/* 🎨 تحسين تباين ووضوح أزرار الإطار الابتدائية (btn-outline-primary) في الوضع الليلي */
[data-bs-theme="dark"] .btn-outline-primary,
[data-theme="dark"] .btn-outline-primary {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    background-color: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #0dcaf0 !important;
    color: #111318 !important;
    border-color: #0dcaf0 !important;
}

/* 🎨 تهيئة النوافذ المنبثقة (Modals) للوضع الداكن */
[data-bs-theme="dark"] .modal-content,
[data-theme="dark"] .modal-content {
    background-color: #111318 !important;
    color: #f1f1f4 !important;
    border-color: #222530 !important;
}

[data-bs-theme="dark"] .modal-header,
[data-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-footer {
    border-color: #222530 !important;
}

[data-bs-theme="dark"] .modal-body strong,
[data-theme="dark"] .modal-body strong {
    color: #ffffff !important;
}

/* 📊 🌙 تهيئة لوحة القيادة الذكية (Dashboard) للوضع الداكن المالي الفاخر */
[data-bs-theme="dark"] body,
[data-theme="dark"] body {
    background: linear-gradient(135deg, #0b0c10 0%, #111318 100%) !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .glass-header,
[data-theme="dark"] .glass-header {
    background: rgba(17, 19, 24, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .analysis-card,
[data-theme="dark"] .analysis-card {
    background: #111318 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .alert-premium,
[data-theme="dark"] .alert-premium {
    background: #1a1d24 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .alert-warning-p,
[data-theme="dark"] .alert-warning-p {
    background: #2d1724 !important;
    color: #ff8fa3 !important;
}

[data-bs-theme="dark"] .alert-info-p,
[data-theme="dark"] .alert-info-p {
    background: #132238 !important;
    color: #8ec3ff !important;
}

[data-bs-theme="dark"] .nav-btn,
[data-theme="dark"] .nav-btn {
    background: #1a1d24 !important;
    color: #f1f1f4 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .nav-btn:hover,
[data-theme="dark"] .nav-btn:hover {
    background: #3a3f50 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-action-glass,
[data-theme="dark"] .btn-action-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .btn-action-glass:hover,
[data-theme="dark"] .btn-action-glass:hover {
    background: #ffffff !important;
    color: #111318 !important;
}

/* 🖨️ 🌙 تهيئة الأرشيف المالي (Financial Archive) بالكامل للوضع الداكن */
[data-bs-theme="dark"] .live-year-card,
[data-theme="dark"] .live-year-card {
    background: linear-gradient(135deg, #0d1e14 0%, #111a14 100%) !important;
    border-color: #2e7d32 !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .live-year-card .text-dark,
[data-theme="dark"] .live-year-card .text-dark {
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .archived-year-card,
[data-theme="dark"] .archived-year-card {
    background: linear-gradient(135deg, #1b1e24 0%, #111318 100%) !important;
    border-color: #4f5b66 !important;
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .archived-year-card .text-dark,
[data-theme="dark"] .archived-year-card .text-dark {
    color: #f1f1f4 !important;
}

[data-bs-theme="dark"] .stat-box,
[data-theme="dark"] .stat-box {
    background: #1a1d24 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid #2b303c !important;
}

[data-bs-theme="dark"] .stat-box:hover,
[data-theme="dark"] .stat-box:hover {
    background: #2b303c !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .stat-box .stat-label,
[data-theme="dark"] .stat-box .stat-label {
    color: #a1a5b7 !important;
}

[data-bs-theme="dark"] .stat-box .stat-value.text-dark,
[data-theme="dark"] .stat-box .stat-value.text-dark {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .alert-light,
[data-theme="dark"] .alert-light {
    background-color: #1a1d24 !important;
    border-color: #2b303c !important;
    color: #f1f1f4 !important;
}

/* 🌙 100% Complete Dark Mode Fixes - Bulletproof CSS overrides */
[data-bs-theme="dark"],
[data-theme="dark"] {

    /* القوائم المنسدلة */
    .dropdown-menu {
        background-color: #111318 !important;
        border-color: #222530 !important;
        color: #f1f1f4 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    }

    .dropdown-item {
        color: #f1f1f4 !important;
        transition: all 0.2s;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: #1a1d24 !important;
        color: #ffffff !important;
    }

    /* عناصر القوائم والمجموعات */
    .list-group-item {
        background-color: #111318 !important;
        border-color: #222530 !important;
        color: #f1f1f4 !important;
    }

    .list-group-item.active {
        background-color: #198754 !important;
        border-color: #198754 !important;
        color: #ffffff !important;
    }

    /* عناصر النموذج الأساسية */
    .form-control,
    .form-select,
    .form-control:focus,
    .form-select:focus {
        background-color: #1a1d24 !important;
        border-color: #2b303c !important;
        color: #f1f1f4 !important;
    }

    .form-control::placeholder {
        color: #626575 !important;
        opacity: 0.8;
    }

    /* معالجة عناصر التواريخ والزمن بالمتصفحات */
    input[type="date"],
    input[type="time"],
    input[type="month"] {
        color-scheme: dark !important;
    }

    /* ترويسات وتذييلات الكروت */
    .card-header,
    .card-footer {
        background-color: #1a1d24 !important;
        border-color: #2b303c !important;
        color: #ffffff !important;
    }

    /* تنبيهات النظام */
    .alert {
        background-color: rgba(26, 29, 36, 0.9) !important;
        border-color: rgba(43, 48, 60, 0.8) !important;
        color: #f1f1f4 !important;
    }

    .alert-success {
        background-color: rgba(25, 135, 84, 0.15) !important;
        border-color: rgba(25, 135, 84, 0.3) !important;
        color: #a7f3d0 !important;
    }

    .alert-danger {
        background-color: rgba(220, 53, 69, 0.15) !important;
        border-color: rgba(220, 53, 69, 0.3) !important;
        color: #fca5a5 !important;
    }

    .alert-warning {
        background-color: rgba(255, 193, 7, 0.15) !important;
        border-color: rgba(255, 193, 7, 0.3) !important;
        color: #fde047 !important;
    }

    .alert-info {
        background-color: rgba(13, 202, 240, 0.15) !important;
        border-color: rgba(13, 202, 240, 0.3) !important;
        color: #93c5fd !important;
    }

    /* الجداول ورؤوسها */
    table,
    thead,
    tbody,
    tr,
    td,
    th {
        border-color: #222530 !important;
    }

    /* تحويل درجات الألوان الساطعة لرمادية داكنة مريحة للعين */
    .text-dark {
        color: #ffffff !important;
    }

    .text-muted {
        color: #a1a5b7 !important;
    }

    .bg-light {
        background-color: #1a1d24 !important;
    }

    .bg-white {
        background-color: #111318 !important;
    }

    /* معالجة عناصر الترقيم */
    .pagination .page-link {
        background-color: #111318 !important;
        border-color: #222530 !important;
        color: #a1a5b7 !important;
    }

    .pagination .page-item.active .page-link {
        background-color: #198754 !important;
        border-color: #198754 !important;
        color: #ffffff !important;
    }

    .pagination .page-item.disabled .page-link {
        background-color: #0c0d11 !important;
        border-color: #1b1d24 !important;
        color: #4b5563 !important;
    }

    /* 🚀 أزرار النظام والبادجات الشاملة في الوضع الداكن */
    .btn-light {
        background-color: #1a1d24 !important;
        border-color: #2b303c !important;
        color: #f1f1f4 !important;
    }

    .btn-light:hover,
    .btn-light:focus {
        background-color: #2b303c !important;
        border-color: #3f4254 !important;
        color: #ffffff !important;
    }

    .btn-secondary {
        background-color: #2b303c !important;
        border-color: #3f4254 !important;
        color: #f1f1f4 !important;
    }

    .btn-secondary:hover,
    .btn-secondary:focus {
        background-color: #3a3f50 !important;
        border-color: #4e5464 !important;
        color: #ffffff !important;
    }

    .btn-outline-secondary {
        color: #a1a5b7 !important;
        border-color: #3f4254 !important;
        background-color: transparent !important;
    }

    .btn-outline-secondary:hover {
        background-color: #2b303c !important;
        color: #ffffff !important;
    }

    .btn-outline-info {
        color: #0dcaf0 !important;
        border-color: #0dcaf0 !important;
        background-color: transparent !important;
    }

    .btn-outline-info:hover {
        background-color: #0dcaf0 !important;
        color: #111318 !important;
    }

    .btn-outline-success {
        color: #198754 !important;
        border-color: #198754 !important;
        background-color: transparent !important;
    }

    .btn-outline-success:hover {
        background-color: #198754 !important;
        color: #ffffff !important;
    }

    .btn-outline-danger {
        color: #dc3545 !important;
        border-color: #dc3545 !important;
        background-color: transparent !important;
    }

    .btn-outline-danger:hover {
        background-color: #dc3545 !important;
        color: #ffffff !important;
    }

    .btn-outline-warning {
        color: #ffc107 !important;
        border-color: #ffc107 !important;
        background-color: transparent !important;
    }

    .btn-outline-warning:hover {
        background-color: #ffc107 !important;
        color: #111318 !important;
    }

    /* شارات الخلفيات */
    .bg-secondary {
        background-color: #2b303c !important;
        color: #f1f1f4 !important;
    }

    /* روابط النصوص */
    a:not(.btn) {
        color: #3b82f6;
    }

    a:not(.btn):hover {
        color: #60a5fa;
    }

    /* 🚀 تهيئة وتصفية الجداول وقائمة الفروع والصفوف بالوضع الداكن */
    table,
    .table {
        --bs-table-bg: #111318 !important;
        --bs-table-color: #f1f1f4 !important;
        --bs-table-striped-bg: #1a1d24 !important;
        --bs-table-hover-bg: #2b303c !important;
        --bs-table-border-color: #222530 !important;
        background-color: #111318 !important;
        color: #f1f1f4 !important;
        border-color: #222530 !important;
    }

    /* تجاوز أكواد التنسيقات المحلية للـ table-custom ورؤوس الجداول */
    .table-custom th,
    thead th,
    th {
        background-color: #1a1d24 !important;
        color: #ffffff !important;
        border-color: #2b303c !important;
        font-weight: 600;
    }

    .table-custom td,
    tbody td,
    td {
        background-color: #111318 !important;
        color: #f1f1f4 !important;
        border-color: #222530 !important;
    }

    /* تجاوز ألوان خلفية الأكوردون والتخصيصات */
    .accordion-button {
        background-color: #1a1d24 !important;
        color: #ffffff !important;
        border-color: #2b303c !important;
    }

    .accordion-button:not(.collapsed) {
        background-color: #222530 !important;
        color: #1cc88a !important;
        box-shadow: none !important;
    }

    .accordion-item {
        background-color: #111318 !important;
        border-color: #222530 !important;
        color: #f1f1f4 !important;
    }

    /* تلوين نصوص الجداول العامة لكي لا تبقى داكنة */
    .text-dark,
    .fw-bold.text-dark,
    .fw-bold.text-secondary {
        color: #ffffff !important;
    }

    /* معالجة البطاقات المخصصة بكافة الواجهات والتقارير وتعديل البيانات */
    .edit-card,
    .filter-card,
    .marks-card,
    .session-card,
    .dashboard-card,
    .payroll-card,
    .settings-card,
    .archive-card,
    .history-card,
    .card-custom,
    .custom-card {
        background-color: #111318 !important;
        background: #111318 !important;
        color: #f1f1f4 !important;
        border: 1px solid #222530 !important;
        box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.35) !important;
    }

    /* تهيئة التبويبات بالوضع الداكن */
    .tab-content {
        background-color: #111318 !important;
        color: #f1f1f4 !important;
        border-color: #222530 !important;
    }

    .border {
        border-color: #222530 !important;
    }
}

/* 🖨️ تحسينات الطباعة الشاملة (Print Styles) */
@media print {

    /* إعدادات الصفحة الأساسية */
    html,
    body {
        background-color: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* إخفاء العناصر غير الضرورية أثناء الطباعة */
    .top-nav,
    .navbar,
    .btn,
    footer,
    .no-print,
    .glass-header,
    .alert-premium,
    form button,
    #theme-toggle-btn {
        display: none !important;
    }

    /* توضيح الحدود للبطاقات لتوفير الحبر */
    .custom-card,
    .card,
    .analysis-card,
    .stat-card-premium,
    .stat-box,
    .archived-year-card,
    .live-year-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    /* إخفاء الشارات غير الضرورية */
    .stat-icon,
    .badge {
        display: none !important;
    }

    /* توسيع الحاويات */
    .container,
    .main-container,
    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* تجنب تقطيع الجداول عبر الصفحات */
    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }
}

/* ==========================================================================
   📱 نظام التصميم المتجاوب الشامل لكافة الشاشات (Global Responsive Design System)
   ========================================================================== */

/* منع التمرير الأفقي غير المرغوب فيه لكامل الصفحة */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* ── 1. شريط التنقل المتجاوب والقوائم المنسدلة (Responsive Navbar & Dropdowns) ── */
.top-nav {
    position: relative;
    z-index: 1030;
    transition: all 0.25s ease-in-out;
}

/* كبسولات الأقسام في شريط التنقل (Desktop Navigation Pills) */
.nav-group-btn {
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.38rem 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-group-btn:hover,
.nav-group-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* تصميم القوائم المنسدلة العصرية */
.modern-nav-dropdown {
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05) !important;
    padding: 0.6rem !important;
    min-width: 250px !important;
    backdrop-filter: blur(10px);
}

.modern-nav-dropdown .dropdown-header {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    margin-bottom: 0.3rem;
}

.modern-nav-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-nav-dropdown .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.08);
    transform: translateX(-3px);
}

[dir="ltr"] .modern-nav-dropdown .dropdown-item:hover {
    transform: translateX(3px);
}

/* الوضع الداكن للقوائم المنسدلة */
[data-bs-theme="dark"] .modern-nav-dropdown,
[data-theme="dark"] .modern-nav-dropdown {
    background: #161822 !important;
    border-color: #2b2e3e !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="dark"] .modern-nav-dropdown .dropdown-header,
[data-theme="dark"] .modern-nav-dropdown .dropdown-header {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .modern-nav-dropdown .dropdown-item:hover,
[data-theme="dark"] .modern-nav-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: #60a5fa !important;
}

/* ── 2. القائمة الجانبية المنزلقة للهواتف (Mobile Offcanvas Drawer) ── */
.mobile-nav-drawer {
    max-width: 320px;
    border: none;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .mobile-nav-drawer {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

[dir="ltr"] .mobile-nav-drawer {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-nav-drawer .offcanvas-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 1.25rem;
}

.mobile-nav-drawer .accordion-item {
    border: none;
    margin-bottom: 0.5rem;
    border-radius: 12px !important;
    overflow: hidden;
    background: #f8f9fc;
}

[data-bs-theme="dark"] .mobile-nav-drawer .accordion-item,
[data-theme="dark"] .mobile-nav-drawer .accordion-item {
    background: #1a1d27;
}

.mobile-nav-drawer .accordion-button {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-radius: 12px !important;
    background: transparent;
    box-shadow: none !important;
}

.mobile-nav-drawer .accordion-button:not(.collapsed) {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.mobile-nav-drawer .list-group-item {
    border: none;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background 0.15s;
}

.mobile-nav-drawer .list-group-item:hover {
    background: rgba(13, 110, 253, 0.06);
}

/* ── 3. أشرطة الفلترة المتجاوبة (Responsive Filter Bars) ── */
.filter-bar-scrollable {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    padding-top: 4px;
}

.filter-bar-scrollable::-webkit-scrollbar {
    height: 4px;
}

.filter-bar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

[data-bs-theme="dark"] .filter-bar-scrollable::-webkit-scrollbar-thumb,
[data-theme="dark"] .filter-bar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ── 4. الجداول المتجاوبة وسلاسة التمرير (Enhanced Table Responsiveness) ── */
.table-responsive {
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

/* أزرار الإجراءات داخل الجداول */
.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
}

/* ── 5. كروت الإحصاءات والأرقام المتجاوبة (Responsive KPI Cards) ── */
.stat-num-fluid {
    font-size: clamp(1.2rem, 3.5vw, 1.85rem) !important;
    font-weight: 800;
    line-height: 1.2;
}

/* ── 6. التبويبات القابلة للتمرير الأفقي على الموبايل (Scrollable Nav Pills) ── */
.nav-pills-touch-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 6px;
}

.nav-pills-touch-scroll .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 7. نقاط التوقف والتكيف مع أحجام الشاشات المختلفة (Media Queries) ── */

/* الشاشات الصغيرة جداً: هواتف أقل من 576px */
@media (max-width: 575.98px) {
    .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .top-nav {
        padding: 10px !important;
    }

    .top-nav h4 {
        font-size: 1.05rem !important;
    }

    .custom-card, .card {
        border-radius: 10px !important;
    }

    .table td, .table th {
        padding: 0.5rem 0.35rem !important;
        font-size: 0.82rem !important;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* كروت المؤشرات: كرتان في السطر بأبعاد متناسقة */
    .col-6.col-md-3 {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .att-stat-card, .kpi-card {
        padding: 12px 10px !important;
        border-radius: 14px !important;
    }

    .att-stat-card .stat-title,
    .kpi-card .stat-title {
        font-size: 0.75rem !important;
    }

    .att-stat-card .stat-num,
    .kpi-card .stat-num {
        font-size: 1.25rem !important;
    }

    /* العناوين الكبيرة الترحيبية */
    .attendance-hero-header, .report-hero-header {
        padding: 18px 15px !important;
        border-radius: 16px !important;
    }

    .attendance-hero-header h2, .report-hero-header h2 {
        font-size: 1.3rem !important;
    }

    /* شريط الحفظ العائم */
    .floating-save-bar {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        padding: 8px 15px !important;
    }

    .floating-save-bar button {
        width: 100%;
    }
}

/* شاشات الأجهزة اللوحية: 576px إلى 991px */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container, .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .top-nav {
        padding: 12px 18px !important;
    }

    .top-nav h4 {
        font-size: 1.2rem !important;
    }

    .table td, .table th {
        padding: 0.65rem 0.5rem !important;
    }
}

/* الشاشات الكبيرة والعريضة: 1200px فما فوق */
@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1440px;
    }
}