/* =========================================
   ألوان وهوية المجد + أساسيات عامة
   ========================================= */
:root {
  /* العنّابي (اللون الرئيسي) */
  --b:  #6B1F1A;  /* أساسي مطابق للّوجو */
  --b2: #3C1512;  /* أغمق للهور/العناوين الثقيلة */

  /* لمسات ذهبية متناغمة */
  --gold:   #B87B1B;  /* ذهبي دافئ */
  --gold-2: #F3E4C7;  /* ذهبي فاتح للخلفيات/الشيب */

  /* القواعد العامة المتناسقة */
  --bg:   #FBF9F8;   /* خلفية محايدة دافئة */
  --line: #E6E0DD;   /* حدود فاتحة */
  --muted:#5E5452;   /* نص ثانوي */
  --ink:  #2A211F;   /* نص أساسي (حبر) */

  /* ظل لطيف بلون الهوية */
  --shadow: 0 10px 24px rgba(107, 31, 26, .12);

  /* أنصاف الأقطار كما هي */
  --radius-10: 10px;
  --radius-12: 12px;
  --radius-16: 16px;
}

/* اختياري: وضع داكن بنفس الهوية */
[data-theme="dark"] {
  --bg:   #141110;
  --line: #3A302E;
  --ink:  #F5F2F1;
  --muted:#CFC7C4;
  --shadow: 0 10px 24px rgba(0, 0, 0, .35);
}


/* تحسين تجربة اللمس والجوال 
*/
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%
    
    
    
}
html[dir="rtl"] body{direction:rtl;text-align:right}

* {
    box-sizing: border-box
}

body {
    font-family: 'Cairo', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--b);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

/* حاوية عامة مع هوامش مناسبة للجوال */
.container-app {
    max-width: 1200px;
    margin-inline: auto;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px))
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important
    }
}

/* =========================================
   Navbar / Links
   ========================================= */
.navbar .nav-link {
    border-radius: var(--radius-10)
}

.navbar .nav-link.active {
    background: #fff6d6;
    font-weight: 700;
    color: var(--b)
}

.navbar-brand {
    font-weight: 800;
    color: var(--b) !important
}

.footer-logo {
    max-height: 48px;
    width: auto
}

.nav-link:hover {
    color: var(--gold) !important
}

/* =========================================
   بطاقات وكروت
   ========================================= */
.card {
    border: none;
    border-radius: var(--radius-16);
    box-shadow: 0 10px 25px rgba(0, 59, 115, .08)
}

.cardx {
    border-radius: var(--radius-16);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: #fff
}

.card-dashboard {
    background: #fff;
    border-radius: var(--radius-16);
    box-shadow: 0 5px 15px rgba(0, 59, 115, .08);
    border: 0;
    transition: .2s
}

.card-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 59, 115, .15)
}

.info-box {
    background: #fff;
    border-radius: var(--radius-12);
    border: 1px dashed #dfe7e2;
    padding: 1rem
}

.section-title {
    font-weight: 800;
    color: var(--b)
}

.key {
    color: var(--muted);
    min-width: 120px;
    display: inline-block
}

.val {
    font-weight: 700;
    color: var(--b)
}

.done-row {
    background: rgba(0, 59, 115, .05)
}

/* صف مكتمل */

/* =========================================
   فورم/حقول
   ========================================= */
.form-control,
.form-select {
    border-radius: var(--radius-10);
    border: 1px solid #ddd;
    padding: .75rem 1rem
}

.form-control:focus,
.form-select:focus {
    border-color: var(--b);
    box-shadow: 0 0 0 .2rem rgba(0, 59, 115, .25)
}

.tools-inline .form-control,
.tools-inline .form-select {
    border-radius: var(--radius-12)
}

.tools-inline .btn {
    border-radius: var(--radius-12)
}

.input-group-text {
    background: #faf4c9;
    border: 1px solid #ddd;
    border-radius: 10px 0 0 10px
}

.filter-section {
    background: var(--bg);
    border-radius: var(--radius-12);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef
}

.filter-label {
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--b)
}

/* =========================================
   KPI / بطاقات مؤشرات
   ========================================= */
.kpi {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    text-align: center
}

.kpi .n,
.kpi .value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--b)
}

.kpi .label {
    color: #6c757d;
    font-size: .9rem
}

.kpi-card {
    background: linear-gradient(135deg, #fff, var(--bg));
    border-radius: 12px;
    padding: 1.2rem;
    border-left: 4px solid var(--b);
    height: 100%;
    transition: .3s
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 59, 115, .15)
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: .8;
    margin-bottom: 1rem
}

/* =========================================
   جداول
   ========================================= */



.table thead th {
    background: linear-gradient(135deg, var(--b), var(--b2));
    color: #fff;
    border: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: center !important;
    font-size: 11px !important;
}

.table td {
    vertical-align: middle;
    text-align: center !important
}

.table th {
    border-top: none;
    font-weight: 500
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 59, 115, .06)
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 59, 115, .05)
}

.sticky-head th {
    position: sticky;
    top: 0;
    background: var(--b);
    color: #fff;
    z-index: 2
}

/* جداول متجاوبة للموبايل */
@media (max-width:575.98px) {
    .table thead {
        display: none
    }

    .table tbody tr {
        display: block;
        margin-bottom: .85rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(0, 59, 115, .06)
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
        border: 0 !important;
        padding: .5rem .2rem
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 400;
        color: var(--b);
        min-width: 100px
    }
}

/* DataTables أزرار الصفحة */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 5px !important;
    margin: 0 3px;
    padding: .3em .9em
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--b) !important;
    border-color: var(--b) !important
}

/* =========================================
   شريط التقدم Progress
   ========================================= */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef
}

.progress-bar {
    background: linear-gradient(90deg, var(--b2), var(--gold));
    border-radius: 4px
}

.progress--lg {
    height: 10px;
    border-radius: 5px
}

/* =========================================
   شارات/بادجات وحالات حضور
   ========================================= */
.badge-soft {
    background: rgba(220, 183, 52, .15);
    color: #8a6d00;
    border: 1px solid #f1e1a3
}

.badge-pill {
    border-radius: 999px;
    font-weight: 700
}

.status-pill {
    border-radius: 999px;
    padding: .25rem .6rem;
    font-weight: 700
}

.status-present {
    background: rgba(0, 59, 115, .1);
    color: var(--b)
}

.status-late {
    background: rgba(220, 183, 52, .15);
    color: #8a6d00
}

.status-absent {
    background: rgba(231, 74, 59, .12);
    color: #b42318
}

/* =========================================
   أزرار عامة وتصدير
   ========================================= */
.btn {
    min-height: 44px
}

/* لمسيّة مريحة */
.btn-brand {
    background: linear-gradient(135deg, var(--b), var(--gold));
    border: 0;
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    padding: .5rem 1.2rem;
    transition: .2s
}

.btn-brand:hover {
    filter: brightness(1.05);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 59, 115, .25)
}

.btn-outline-brand {
    border: 1px solid var(--b);
    color: var(--b);
    border-radius: 12px;
    font-weight: 700;
    transition: .2s
}

.btn-outline-brand:hover {
    background: var(--b);
    color: #fff;
    transform: translateY(-2px)
}

.btn-export {
    border-radius: 8px;
    padding: .5rem 1rem;
    font-weight: 600;
    background: var(--b);
    color: #fff;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    transition: .2s
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    background: var(--gold);
    color: var(--b)
}

.btn-print {
    margin-top: 20px;
    margin-inline-start: 10px
}

/* زر عائم للعودة للأعلى */
.back-to-top-fab {
    position: fixed;
    inset-inline-end: 1rem;
    inset-block-end: calc(1rem + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: .6rem;
    background: var(--b);
    color: #faf4c9;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .25);
    z-index: 1060;
    transition: .2s
}

.back-to-top-fab:hover {
    background: var(--gold);
    color: var(--b);
    transform: translateY(-2px)
}

@media print {
    .back-to-top-fab {
        display: none !important
    }
}

/* =========================================
   الخيارات (اختبارات/اختيارات)
   ========================================= */
.opt {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: .9rem 1rem;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    transition: .2s
}

.opt:hover {
    background: #fff6d6;
    transform: translateY(-2px)
}

.opt.selected {
    border-color: var(--b);
    background: rgba(0, 59, 115, .08)
}

.opt.correct {
    border-color: var(--gold);
    background: rgba(220, 183, 52, .15)
}

.opt.wrong {
    opacity: .6
}

/* =========================================
   أقسام بصرية مساعدة
   ========================================= */
.hl {
    background: #fff6d6;
    padding: .1em .25em;
    border-radius: .25rem
}

.hint {
    font-size: .85rem;
    color: var(--muted)
}

.brand-pill {
    background: rgba(0, 59, 115, .08);
    color: var(--b);
    border: 1px solid rgba(0, 59, 115, .18)
}

/* =========================================
   شهادة (Certificate)
   ========================================= */
.certificate {
    background: #fff;
    border: 20px solid var(--gold);
    padding: 40px;
    text-align: center;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 0 20px rgba(0, 59, 115, .15);
    position: relative;
    background-image: url('https://almajdedu.online/golden.png');
    background-repeat: repeat;
    background-blend-mode: soft-light
}



.certificate:before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px solid var(--gold);
    pointer-events: none
}

.certificate-title {
    font-size: 36px;
    color: var(--b);
    font-weight: bold;
    margin-bottom: 10px
}

.student-name {
    font-size: 28px;
    font-weight: bold;
    color: var(--b);
    display: inline-block;
    margin: 15px 0;
    padding: 5px 20px;
    border-bottom: 2px solid var(--gold)
}

.quran-part {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
    display: inline-block;
    margin: 10px 0
}

.certificate-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap
}

.signature {
    border-top: 1px solid #000;
    width: 200px;
    text-align: center;
    padding-top: 10px;
    margin: 10px
}

.signature-name {
    font-weight: bold;
    margin-top: 5px
}

.date-field {
    margin-top: 20px;
    font-weight: bold
}

.decoration {
    position: absolute;
    opacity: .08;
    z-index: 0
}

.decoration-1 {
    top: 10%;
    right: 5%;
    font-size: 80px;
    transform: rotate(15deg);
    color: var(--b)
}

.decoration-2 {
    bottom: 15%;
    left: 5%;
    font-size: 80px;
    transform: rotate(-15deg);
    color: var(--gold)
}

/* =========================================
   أزرار/عناصر إضافية ذُكرت سابقًا
   ========================================= */
.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center
}

.icon-shape {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center
}

.bg-primary-soft {
    background-color: rgba(0, 59, 115, .2)
}

.bg-success-soft {
    background-color: rgba(28, 200, 138, .2)
}

.bg-info-soft {
    background-color: rgba(54, 185, 204, .2)
}

.export-section {
    background: linear-gradient(to right, var(--bg), #fff);
    border-radius: var(--radius-16);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0
}

.export-title {
    color: var(--b);
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e3e6f0;
    padding-bottom: .5rem
}

.stat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74a3b;
    color: #fff;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2)
}

/* =========================================
   تجربة “تطبيق” على الجوال (Tabbar سفلي)
   ========================================= */
.app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1090;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: max(8px, env(safe-area-inset-bottom, 0px)) 12px calc(8px + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: 8px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .06)
}

.app-tabbar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    color: var(--b);
    font-weight: 700;
    font-size: .85rem
}

.app-tabbar .tab-item.active {
    background: #fff6d6;
    color: var(--b)
}

/* اجعل المحتوى لا يختبئ خلف التاب بار */
.has-tabbar {
    padding-bottom: 90px
}

/* =========================================
   الطباعة
   ========================================= */
@media print {

    nav,
    .no-print {
        display: none !important
    }

    .cardx {
        box-shadow: none;
        border: 1px solid #ccc
    }

    .certificate,
    .certificate * {
        visibility: visible
    }

    .certificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        background-image: none
    }

    .decoration {
        display: none
    }

    body {
        background: #fff
    }
}


/* عرّف الألوان مرة واحدة */
:root {
  --b:  #6B1F1A;  /* العنّابي الأساسي */
  --b2: #3C1512;  /* درجة أغمق للعنّابي (للهوفر/العناوين) */
}

/* وضع داكن (اختياري) */
[data-theme="dark"] {
  --b:  #7A251E;  /* درجة مناسبة للوضع الداكن */
  --b2: #96332C;  /* أغمق قليلًا للهوفر */
}


/* رأس الجدول مع تدرّج ولصق */
.table thead th{
  background:linear-gradient(135deg,var(--b),var(--b2));
  color:#fff;
  border:0;
  text-align:center !important;
  font-size:11px !important;
  position:sticky;  /* مهم */
  top:0;            /* مهم */
  z-index:5;        /* فوق محتوى tbody */
}

/* لو بتستخدم كلاس مخصص على thead */
.table thead.sticky-head th{ /* نفس القواعد للتوافق */
  position:sticky; top:0;
}

/* محاذاة خلايا الجسم */
.table td{vertical-align:middle; text-align:center !important}

/* لمسة جمالية */
.table th{border-top:none; font-weight:600}
.table-hover tbody tr:hover{background-color:rgba(0,59,115,.06)}
.table-striped > tbody > tr:nth-of-type(odd){background-color:rgba(0,59,115,.05)}

/* تأكد من أن الغلاف يسمح باللصق */
.table-responsive{
  overflow:auto;           /* اللصق يعمل مقابل هذا السكورل */
  -webkit-overflow-scrolling:touch;
}


