/* ==========================================================================
   منصة آية - الركيزة البصرية المتجاوبة والحيوية v3.0
   Responsive & Animated UI Core (Mobile, Tablet, TV)
   تم التحديث: دعم أفضل لـ RTL، إصلاح الـ Overflow، ونظام Flexbox للقائمة
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    /* الألوان الأساسية المعتمدة */
    --aya-primary: #1a3a6b;
    --aya-primary-light: #2a5298;
    --aya-primary-dark: #0f2347;
    --aya-secondary: #f0f4ff;
    --aya-card-bg: #ffffff;
    --aya-border-color: #e0d8c9;
    --aya-accent: #4a90d9;
    /* ألوان النصوص والحالات */
    --aya-text-main: #2c332b;
    --aya-text-muted: #757c74;
    --aya-text-dark: #000000;
    --aya-status-present: #2e7d32;
    --aya-status-late: #ef6c00;
    --aya-status-excused: #0288d1;
    --aya-status-absent: #c62828;
    /* المتغيرات الحركية والأبعاد */
    --aya-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --aya-transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --aya-radius-sm: 8px;
    --aya-radius: 12px;
    --aya-shadow-sm: 0 2px 8px rgba(45, 90, 39, 0.04);
    --aya-shadow-md: 0 8px 24px rgba(45, 90, 39, 0.08);
    --aya-shadow-hover: 0 12px 30px rgba(45, 90, 39, 0.12);
}

/* ==========================================================
   التنسيقات الشخصية السبعة (Themes)
   ========================================================== */

/* التنسيق 1 — الأخضر والذهبي (الافتراضي) */
[data-theme="1"] {
    --aya-primary: #2d5a27;
    --aya-primary-light: #3d7336;
    --aya-primary-dark: #1f3d1a;
    --aya-accent: #c5a059;
    --aya-secondary: #faf6ee;
}

/* التنسيق 2 — الأزرق الغني */
[data-theme="2"] {
    --aya-primary: #1a3a6b;
    --aya-primary-light: #2a5298;
    --aya-primary-dark: #0f2347;
    --aya-accent: #4a90d9;
    --aya-secondary: #f0f4ff;
}

/* التنسيق 3 — الترابي المتطور */
[data-theme="3"] {
    --aya-primary: #5c3d2e;
    --aya-primary-light: #7a5240;
    --aya-primary-dark: #3d2820;
    --aya-accent: #c47c5a;
    --aya-secondary: #fdf6f0;
}

/* التنسيق 4 — الرمادي المعدني */
[data-theme="4"] {
    --aya-primary: #2d3436;
    --aya-primary-light: #4a5568;
    --aya-primary-dark: #1a1f20;
    --aya-accent: #95a5a6;
    --aya-secondary: #f5f6fa;
}

/* التنسيق 5 — الخمري العميق */
[data-theme="5"] {
    --aya-primary: #6b1f2a;
    --aya-primary-light: #8b2d3a;
    --aya-primary-dark: #4a1520;
    --aya-accent: #d4a5a5;
    --aya-secondary: #fdf0f0;
}

/* التنسيق 6 — البنفسجي الغامق */
[data-theme="6"] {
    --aya-primary: #3d1a6b;
    --aya-primary-light: #5a2a98;
    --aya-primary-dark: #280f47;
    --aya-accent: #a07dd4;
    --aya-secondary: #f5f0ff;
}

/* التنسيق 7 — البرتقالي المحروق */
[data-theme="7"] {
    --aya-primary: #7a3100;
    --aya-primary-light: #a04200;
    --aya-primary-dark: #521f00;
    --aya-accent: #c47c5a;
    --aya-secondary: #fff5f0;
}

/* ==========================================================
   أزرار التنسيق في Sidebar
   ========================================================== */
.aya-theme-switcher {
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.aya-theme-carousel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aya-theme-colors {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 5px;
    flex: 1;
    scroll-behavior: smooth;
}

.aya-theme-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: var(--aya-transition-fast);
    padding: 0;
}

.aya-theme-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--aya-transition-fast);
    padding: 0;
}

.aya-theme-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

body {
    direction: rtl;
    text-align: right;
    background-color: var(--aya-secondary);
    font-family: 'Cairo', sans-serif;
    color: var(--aya-text-main);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ==========================================================
   نظام الحركة والأنيميشن (Animations Framework)
   ========================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(197, 160, 89, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--aya-transition-smooth);
}

    .animate-on-scroll.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ==========================================================
   التخطيط الرئيسي (Layout & Wrapper)
   ========================================================== */
.aya-wrapper {
    width: 100%;
    min-height: 100vh;
    display: block;
}

.aya-main-content {
    margin-right: 300px;
    width: calc(100% - 300px);
    min-height: 100vh;
    padding: 30px;
    background-color: var(--aya-secondary);
    box-sizing: border-box;
}

/* ==========================================================
   القائمة الجانبية (Sidebar)
   ========================================================== */
.aya-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    background-color: var(--aya-primary);
    color: #ffffff;
    overflow: hidden;
    z-index: 1040;
}

.aya-sidebar-brand {
    padding: 24px;
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.aya-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aya-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aya-brand-subtitle {
    font-size: 0.68rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* الحاوية الوسطى للروابط تأخذ المساحة المتبقية */
.aya-sidebar .nav {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 15px;
}

.aya-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 8px 14px;
    margin: 2px 10px;
    border-radius: var(--aya-radius-sm);
    transition: var(--aya-transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.aya-sidebar .nav-link i {
    font-size: 0.95rem;
}

    .aya-sidebar .nav-link:hover,
    .aya-sidebar .nav-link.active {
        background-color: rgba(255, 255, 255, 0.12);
        color: var(--aya-accent);
    }

/* تذييل القائمة (معلومات المستخدم وزر الخروج) */
.aya-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.05);
}

/* اسم المستخدم في التذييل */
.aya-sidebar-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* تسمية ألوان التنسيق */
.aya-theme-label {
    color: rgba(255, 255, 255, 0.45);
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

/* زر التنسيق النشط — يُكتب هنا بدل المكرر السابق */

.aya-user-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--aya-transition-fast);
}

    .btn-logout:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

/* ==========================================================
   البطاقات والجداول (Cards & Tables) - معالجة القص
   ========================================================== */
.aya-card {
    background-color: var(--aya-card-bg);
    border: 1px solid var(--aya-border-color);
    border-radius: var(--aya-radius);
    margin-bottom: 24px;
    box-shadow: var(--aya-shadow-sm);
    transition: var(--aya-transition-smooth);
    animation: fadeInUp 0.6s ease-out forwards;
    /*
     * overflow: clip بدلاً من overflow: hidden
     * الفرق: clip يقص المحتوى بصرياً عند border-radius دون إنشاء BFC جديد.
     * BFC يمتص الهوامش السلبية لـ Bootstrap .row ويقصّها، وهو أصل مشكلة DataTables في RTL.
     */
    overflow: clip;
}

    .aya-card:hover {
        box-shadow: var(--aya-shadow-hover);
        transform: translateY(-4px);
    }

.aya-card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--aya-border-color);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aya-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--aya-text-dark);
}

.aya-card-body {
    padding: 24px;
}

/* ==========================================================
   إصلاح DataTables داخل .aya-card (RTL + Bootstrap .row)
   يمنع الهوامش السلبية من إحداث قص أفقي في واجهة RTL
   ========================================================== */
.aya-card .dataTables_wrapper .row {
    margin-right: 0;
    margin-left: 0;
}

.aya-card .dataTables_wrapper .row > * {
    padding-right: 0;
    padding-left: 0;
}

/* التمرير الأفقي على table-responsive فقط، لا على البطاقة كاملة */
.aya-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── wrapper خاص بجدول التسميع — يسمح للـ dropdown بالخروج من الجدول ── */
.recitation-table-wrapper {
    overflow: visible !important;
}

.recitation-table-wrapper table {
    overflow: visible !important;
}

.recitation-table-wrapper td {
    overflow: visible !important;
    position: relative;
}

/* جداول البيانات */
.table-aya {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px; /* ضمان عدم تكسر الجدول */
}

    .table-aya th {
        background-color: rgba(45, 90, 39, 0.04);
        color: var(--aya-primary);
        font-weight: 700;
        padding: 16px;
        border-bottom: 2px solid var(--aya-border-color);
        white-space: nowrap;
    }

    .table-aya td {
        padding: 16px;
        border-bottom: 1px solid var(--aya-border-color);
        vertical-align: middle;
    }

    .table-aya tr:last-child td {
        border-bottom: none;
    }

/* ==========================================================
   عناصر الإحصائيات (Stat Cards)
   ========================================================== */
.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .stat-card.live-status {
        position: relative;
    }

        .stat-card.live-status::before {
            content: '';
            position: absolute;
            top: 15px;
            left: 15px;
            width: 12px;
            height: 12px;
            background-color: var(--aya-status-present);
            border-radius: 50%;
            animation: livePulse 2s infinite;
        }

.stat-card-info h3 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: var(--aya-primary);
}

.stat-card-info p {
    margin: 0;
    color: var(--aya-text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-card-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--aya-radius);
    background-color: rgba(45, 90, 39, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aya-primary);
    font-size: 1.6rem;
}

/* ==========================================================
   الأزرار والشارات (Buttons & Badges)
   ========================================================== */
.btn-aya {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 20px;
    border-radius: var(--aya-radius-sm);
    transition: var(--aya-transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.btn-aya-primary {
    background-color: var(--aya-primary);
    color: #ffffff;
}

    .btn-aya-primary:hover {
        background-color: var(--aya-primary-light);
        color: #ffffff;
    }

.btn-aya-accent {
    background-color: var(--aya-accent);
    color: #ffffff;
}

    .btn-aya-accent:hover {
        background-color: #b38f4b;
        color: #ffffff;
    }

.btn-aya.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.badge-aya {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    display: inline-block;
}

.badge-present {
    background-color: var(--aya-status-present);
}

.badge-late {
    background-color: var(--aya-status-late);
}

.badge-excused {
    background-color: var(--aya-status-excused);
}

.badge-absent {
    background-color: var(--aya-status-absent);
}

/* ══════════════════════════════════════════════════════
   Badges التقييم السلوكي — خمسة مستويات (1=ضعيف … 5=ممتاز)
   تتبع نفس بنية .badge-aya (padding, radius, font-weight)
   ══════════════════════════════════════════════════════ */

/* ممتاز — أخضر غامق */
.badge-behavior-5 {
    background-color: #1b5e20;
}

/* جيد جداً — أخضر فاتح */
.badge-behavior-4 {
    background-color: #388e3c;
}

/* جيد — أزرق */
.badge-behavior-3 {
    background-color: #1565c0;
}

/* مقبول — برتقالي */
.badge-behavior-2 {
    background-color: #e65100;
}

/* ضعيف — أحمر */
.badge-behavior-1 {
    background-color: #c62828;
}

/* Badge حالة التقييم في جلسة التقييم */
.badge-status-evaluated {
    background-color: var(--aya-status-present);
}

.badge-status-pending {
    background-color: #757c74;
}

/* زر القائمة للشاشات الصغيرة */
.mobile-toggle-btn {
    display: none;
    background: #ffffff;
    color: var(--aya-text-main);
    border: 1px solid var(--aya-border-color);
    padding: 10px 20px;
    border-radius: var(--aya-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--aya-shadow-sm);
    margin-bottom: 20px;
    width: 100%;
    text-align: right;
}

    .mobile-toggle-btn i {
        margin-left: 8px;
        color: var(--aya-primary);
    }

/* ==========================================================
   التجاوب مع الشاشات (Responsive Layouts)
   ========================================================== */

/* 1. الشاشات الكبيرة (1440px+) */
@media (min-width: 1440px) {
    .aya-wrapper {
        max-width: 1920px;
        margin: 0 auto;
    }

    body {
        font-size: 110%;
    }

    .stat-card-info h3 {
        font-size: 2.5rem;
    }
}

/* 2. التابلت (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .aya-sidebar {
        width: 260px;
        min-width: 260px;
        max-width: 260px;
    }

    .aya-main-content {
        margin-right: 260px;
        width: calc(100% - 260px);
        padding: 20px;
    }
}

/* 3. الهواتف الذكية (Max 767px) */
@media (max-width: 767px) {
    .mobile-toggle-btn {
        display: block;
    }

    .aya-sidebar {
        position: fixed;
        top: 0;
        right: -300px;
        height: 100vh;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        transition: right 0.3s ease;
        z-index: 1050;
    }

    .aya-sidebar.mobile-open {
        right: 0;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    }

    .aya-main-content {
        margin-right: 0 !important;
        width: 100% !important;
        filter: none !important;
        transition: none !important;
        padding: 15px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .aya-card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .aya-card {
        margin-bottom: 15px;
    }
}

/* خلفية التظليل للموبايل — بدون blur نهائياً */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1040;
    display: none;
}

/* ==========================================================
   بطاقات التنسيق في صفحة الإعدادات
   ========================================================== */
.aya-settings-theme-card {
    background: var(--aya-card-bg);
    border: 2px solid var(--aya-border-color);
    border-radius: var(--aya-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--aya-transition-fast);
    height: 100%;
}

.aya-settings-theme-card:hover {
    border-color: var(--aya-primary);
    box-shadow: var(--aya-shadow-hover);
    transform: translateY(-2px);
}

.aya-settings-theme-card.selected {
    border-color: var(--aya-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.15);
}

.aya-theme-selected-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(45, 90, 39, 0.1);
    color: var(--aya-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    width: 100%;
    justify-content: center;
}

/* ==========================================================
   بطاقات الموبايل (Mobile Cards)
   ========================================================== */

.aya-mobile-cards {
    display: none;
}

@media (max-width: 767px) {

    .aya-table-desktop {
        display: none !important;
    }

    .aya-mobile-cards {
        display: block;
    }

    .aya-mobile-card {
        background: var(--aya-card-bg);
        border: 1px solid var(--aya-border-color);
        border-radius: var(--aya-radius);
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: var(--aya-shadow-sm);
        transition: var(--aya-transition-fast);
    }

    .aya-mobile-card:active {
        transform: scale(0.98);
    }

    .aya-mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--aya-border-color);
    }

    .aya-mobile-card-title {
        font-weight: 700;
        font-size: 1rem;
        color: var(--aya-text-dark);
        margin: 0;
    }

    .aya-mobile-card-code {
        font-size: 0.78rem;
        color: var(--aya-primary);
        background: rgba(45, 90, 39, 0.08);
        padding: 3px 10px;
        border-radius: 50px;
        font-weight: 600;
    }

    .aya-mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        font-size: 0.88rem;
    }

    .aya-mobile-card-label {
        color: var(--aya-text-muted);
        font-weight: 500;
    }

    .aya-mobile-card-value {
        color: var(--aya-text-main);
        font-weight: 600;
        text-align: left;
    }

    .aya-mobile-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid var(--aya-border-color);
    }

    .aya-mobile-card-actions .btn-aya {
        flex: 1;
        justify-content: center;
        padding: 10px;
        font-size: 0.85rem;
    }

    .aya-mobile-empty {
        text-align: center;
        padding: 40px 20px;
        color: var(--aya-text-muted);
    }

    .aya-mobile-empty i {
        font-size: 3rem;
        color: var(--aya-border-color);
        display: block;
        margin-bottom: 12px;
    }

    .aya-mobile-empty p {
        font-size: 0.95rem;
        margin: 0;
    }
}

/* ==========================================================
   عناوين مجموعات القائمة الجانبية
   ========================================================== */
.aya-sidebar-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 10px 16px 4px 16px;
    color: rgba(255, 255, 255, 0.35) !important;
    letter-spacing: 0.5px;
}

/* تمرير Sidebar ناعم */
.custom-scrollbar {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

    .custom-scrollbar::-webkit-scrollbar {
        width: 4px;
    }

    .custom-scrollbar::-webkit-scrollbar-track {
        background: transparent;
    }

    .custom-scrollbar::-webkit-scrollbar-thumb {
        background-color: rgba(255,255,255,0.2);
        border-radius: 4px;
    }

        .custom-scrollbar::-webkit-scrollbar-thumb:hover {
            background-color: rgba(255,255,255,0.4);
        }

/* زر التنسيق النشط */
.aya-theme-btn.active {
    border: 2px solid #fff !important;
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* زر تسجيل الخروج */
.btn-logout-aya {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: Cairo, sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}
.btn-logout-aya:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff8787;
    border-color: rgba(220, 53, 69, 0.3);
}


/* ==========================================================
   التنسيقات الشخصية 8-12
   ========================================================== */

/* التنسيق 8 — الفيروزي العميق */
[data-theme="8"] {
    --aya-primary: #0e4955;
    --aya-primary-light: #1a6b7a;
    --aya-primary-dark: #082f38;
    --aya-accent: #2ab8c8;
    --aya-secondary: #f0fafb;
}

/* التنسيق 9 — الزيتوني الهادئ */
[data-theme="9"] {
    --aya-primary: #3b4a3a;
    --aya-primary-light: #4e6350;
    --aya-primary-dark: #252e25;
    --aya-accent: #8aab7a;
    --aya-secondary: #f5f8f5;
}

/* التنسيق 10 — البنفسجي الداكن */
[data-theme="10"] {
    --aya-primary: #342a45;
    --aya-primary-light: #4a3d63;
    --aya-primary-dark: #1f1929;
    --aya-accent: #9b7fd4;
    --aya-secondary: #f7f5ff;
}

/* التنسيق 11 — الليلي الأنيق */
[data-theme="11"] {
    --aya-primary: #1a1a24;
    --aya-primary-light: #2d2d3f;
    --aya-primary-dark: #0d0d14;
    --aya-accent: #6c8cff;
    --aya-secondary: #f0f0f8;
}

/* التنسيق 12 — النحاسي الدافئ */
[data-theme="12"] {
    --aya-primary: #965d34;
    --aya-primary-light: #b8744a;
    --aya-primary-dark: #6b4025;
    --aya-accent: #d4a574;
    --aya-secondary: #fdf5ee;
}

/* التنسيق 13 — الوردي الناعم */
[data-theme="13"] {
    --aya-primary: #9b6a73;
    --aya-primary-light: #b88590;
    --aya-primary-dark: #704d55;
    --aya-accent: #d6a5b0;
    --aya-secondary: #fdf0f2;
}

/* التنسيق 14 — اللافندر الهادئ */
[data-theme="14"] {
    --aya-primary: #6c5b7b;
    --aya-primary-light: #8a7598;
    --aya-primary-dark: #4e4059;
    --aya-accent: #a695b5;
    --aya-secondary: #f8f5ff;
}

/* التنسيق 15 — الخوخي الدافئ */
[data-theme="15"] {
    --aya-primary: #b56576;
    --aya-primary-light: #cc8291;
    --aya-primary-dark: #8a4a58;
    --aya-accent: #e8a0b0;
    --aya-secondary: #fff5f7;
}

/* التنسيق 16 — التوتي الأنيق */
[data-theme="16"] {
    --aya-primary: #884860;
    --aya-primary-light: #a6607c;
    --aya-primary-dark: #633346;
    --aya-accent: #c67a95;
    --aya-secondary: #fdf0f5;
}

/* ==========================================================
   حقوق النشر في تذييل القائمة الجانبية
   ========================================================== */
.aya-sidebar-copyright {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    line-height: 1.6;
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;

}

.aya-sidebar-copyright span {
    display: block;
}

/* ─── aya-eval-counter ─────────────────────────────────── */
.aya-eval-counter {
    display: inline-flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: var(--aya-radius-sm, 6px);
    overflow: hidden;
    height: 40px;
    background-color: #fff;
}

.btn-eval {
    background-color: #f8f9fa;
    border: none;
    color: #495057;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-eval:hover {
    background-color: #e2e6ea;
    color: var(--aya-primary);
}

.btn-eval:active {
    background-color: #dae0e5;
}

.eval-input {
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    border-radius: 0;
    text-align: center;
    width: 60px;
    height: 100%;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    padding: 0;
    box-shadow: none !important;
}

.eval-input::-webkit-outer-spin-button,
.eval-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.eval-input[type=number] {
    -moz-appearance: textfield;
}

/* ==========================================================
   مكونات الصفحة الرئيسية (Dashboard Components)
   ========================================================== */

/* بطاقة الترحيب */
.aya-welcome-card {
    background: linear-gradient(135deg, var(--aya-primary) 0%, var(--aya-primary-light) 100%);
    color: #ffffff;
    border-radius: var(--aya-radius);
    padding: 24px 30px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    animation: fadeInUp 0.5s ease-out forwards;
}

.aya-welcome-card .welcome-text h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #ffffff;
}

.aya-welcome-card .welcome-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.aya-welcome-card .welcome-meta {
    text-align: left;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.aya-welcome-card .welcome-meta .time-display {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--aya-accent);
    line-height: 1.1;
}

/* مؤشر صحة النظام */
.system-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
}

.system-health-badge.excellent { background-color: rgba(46, 125, 50, 0.1); color: #2e7d32; }
.system-health-badge.warning   { background-color: rgba(239, 108, 0, 0.1); color: #ef6c00; }
.system-health-badge.critical  { background-color: rgba(198, 40, 40, 0.1); color: #c62828; }

.system-health-badge .health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.system-health-badge.excellent .health-dot { background: #2e7d32; animation: livePulse 2s infinite; }
.system-health-badge.warning   .health-dot { background: #ef6c00; }
.system-health-badge.critical  .health-dot { background: #c62828; animation: livePulse 1s infinite; }

/* منطقة التنبيهات */
.aya-alerts-section .alert {
    border-radius: var(--aya-radius-sm);
    border: none;
    border-right: 4px solid;
    font-size: 0.9rem;
    padding: 14px 18px;
}

.aya-alerts-section .alert-danger  { border-color: var(--aya-status-absent);  background-color: rgba(198, 40, 40, 0.06); }
.aya-alerts-section .alert-warning { border-color: var(--aya-status-late);    background-color: rgba(239, 108, 0, 0.06); }
.aya-alerts-section .alert-info    { border-color: var(--aya-status-excused); background-color: rgba(2, 136, 209, 0.06); }
.aya-alerts-section .alert-success { border-color: var(--aya-status-present); background-color: rgba(46, 125, 50, 0.06); }

/* أزرار الإجراءات السريعة للمعلم */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: var(--aya-radius);
    border: 2px solid var(--aya-border-color);
    background-color: var(--aya-card-bg);
    color: var(--aya-text-main);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--aya-transition-fast);
    min-height: 110px;
}

.quick-action-btn i { font-size: 2rem; }

.quick-action-btn:hover,
.quick-action-btn.primary:hover {
    border-color: var(--aya-primary);
    background-color: var(--aya-primary);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--aya-shadow-hover);
}

.quick-action-btn.accent:hover {
    border-color: var(--aya-accent);
    background-color: var(--aya-accent);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: var(--aya-shadow-hover);
}

/* أفاتار دائرة أبناء ولي الأمر */
.guardian-child-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* بطاقة الشرف */
.honor-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--aya-border-color);
}

.honor-item:last-child { border-bottom: none; }

.honor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--aya-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.honor-stars { color: var(--aya-accent); font-size: 0.85rem; letter-spacing: 2px; }

/* شارات التقييم في الداشبورد */
.badge-excellent { background-color: rgba(46, 125, 50, 0.12);  color: #2e7d32;  padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }
.badge-very-good { background-color: rgba(2, 136, 209, 0.12);  color: #0288d1;  padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }
.badge-good      { background-color: rgba(239, 108, 0, 0.12);  color: #ef6c00;  padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }
.badge-weak      { background-color: rgba(198, 40, 40, 0.12);  color: #c62828;  padding: 3px 10px; border-radius: 50px; font-size: 0.78rem; font-weight: 700; }

/* تجاوب خاص بالداشبورد */
@media (max-width: 767px) {
    .aya-welcome-card { flex-direction: column; text-align: center; }
    .aya-welcome-card .welcome-meta { text-align: center; }
    .quick-action-btn { padding: 16px 10px; font-size: 0.85rem; min-height: 90px; }
    .quick-action-btn i { font-size: 1.6rem; }
}
