/* ==========================================================================
   نظام تصميم وألوان مَنْهَج الاحترافية (V 1.0 - 2026)
   المطور لتوفير أقصى درجات الفخامة ودعم الخصوصية والاشتراك المتدرج
   ========================================================================== */

:root {
    /* لوحة الألوان الراقية 2026 - تدرجات لؤلؤية وسماوية مع تفاصيل مذهبة */
    --pearly-bg: #F4F7F6;
    --card-white: #FFFFFF;
    
    --sky-primary: #0284C7;
    --sky-light: #E0F2FE;
    --sky-dark: #0369A1;
    
    --emerald-primary: #10B981;
    --emerald-light: #D1FAE5;
    --emerald-dark: #047857;
    
    --amber-primary: #D97706;
    --amber-light: #FEF3C7;
    --amber-dark: #B45309;
    
    --rose-primary: #E11D48;
    --rose-light: #FFE4E6;
    --rose-dark: #BE123C;

    --purple-primary: #8B5CF6;
    --purple-light: #EDE9FE;
    --purple-dark: #6D28D9;
    
    --text-charcoal: #1E293B;
    --text-slate: #475569;
    --text-light: #94A3B8;
    
    --border-soft: #E2E8F0;
    --border-focus: #0284C7;
    
    --gold-foil: #D97706;
    
    --font-primary: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
}

/* التنسيقات والتهيئة الأساسية */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
}

html, body {
    background: linear-gradient(135deg, #F4F7F6 0%, #EBF3F5 100%);
    color: var(--text-charcoal);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden !important;
}

/* غلاف التطبيق الرئيسي */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px;
}

@media (max-width: 600px) {
    .app-container {
        padding: 8px;
    }
}

/* ==================== أيقونة كتاب مفتوح يشع منه النور (Realistic Simple Book Emitting Light) ==================== */
.daftarna-book-light-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.daftarna-book-light-icon:hover {
    transform: translateY(-4px) scale(1.05);
}

.daftarna-book-light-icon.large {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.daftarna-book-light-icon.small {
    width: 48px;
    height: 48px;
}


/* ==================== شاشة تسجيل الدخول والاشتراك ==================== */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
}

.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 3px solid var(--card-white);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    border-radius: 35px;
    padding: 45px 40px;
    width: 100%;
    max-width: 680px;
    text-align: center;
}

.auth-logo {
    margin-bottom: 25px;
}

/* أيقونة الكتاب المشع الدائرية الفخمة */
.glowing-book-wrapper {
    width: 120px;
    height: 130px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo h1 {
    font-size: 38px;
    font-weight: 900;
    color: var(--text-charcoal);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-logo .desc {
    font-size: 21px;
    color: var(--text-slate);
    font-weight: 600;
    margin-top: 5px;
}

/* روابط الاشتراك واستعادة كلمة السر */
.auth-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    font-size: 17px;
    font-weight: 700;
}

.link-primary {
    color: var(--sky-primary);
    text-decoration: underline;
}

.link-secondary {
    color: var(--text-slate);
}

.link-primary:hover, .link-secondary:hover {
    color: var(--sky-dark);
}

/* ==================== معالج الاشتراك المتدرج (SignUp Wizard) ==================== */
.signup-steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--pearly-bg);
    border-radius: 16px;
    padding: 8px 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-soft);
}

.step-indicator-item {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.step-indicator-item.active {
    background-color: var(--card-white);
    color: var(--sky-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.step-indicator-item.completed {
    color: var(--emerald-dark);
    background-color: var(--emerald-light);
}

.wizard-step-panel h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 6px;
    text-align: right;
}

.step-desc {
    font-size: 18px;
    color: var(--text-slate);
    margin-bottom: 25px;
    text-align: right;
    font-weight: 500;
}

.wizard-actions-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 10px;
}

.wizard-actions-row .btn {
    flex: 1;
}

/* تبويبات الدخول هاتف / Gmail */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background-color: var(--pearly-bg);
    padding: 8px;
    border-radius: 18px;
}

.auth-tab-btn {
    background: none;
    border: none;
    padding: 14px;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-slate);
    cursor: pointer;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.auth-tab-btn:hover {
    color: var(--text-charcoal);
}

.auth-tab-btn.active {
    background-color: var(--card-white);
    color: var(--sky-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* زر دخول جوجل الفخم */
.btn-gmail-google {
    background-color: var(--card-white) !important;
    color: var(--text-charcoal) !important;
    border: 2px solid var(--border-soft) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

.btn-gmail-google:hover {
    background-color: var(--pearly-bg) !important;
    border-color: var(--text-light) !important;
}

.google-logo-svg {
    margin-left: 12px;
}

.gmail-help-desc {
    font-size: 19px;
    color: var(--text-slate);
    margin-bottom: 25px;
    font-weight: 500;
}

/* شاشة مدخلات الكود OTP */
.otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    direction: ltr; /* ترتيب رقمي طبيعي من اليسار لليمين */
}

.otp-digit {
    width: 65px;
    height: 65px;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    border: 3px solid var(--border-soft);
    border-radius: 16px;
    background-color: var(--card-white);
    outline: none;
    transition: all 0.25s ease;
}

.otp-digit:focus {
    border-color: var(--sky-primary);
    box-shadow: 0 0 0 4px var(--sky-light);
}

.btn-back-auth {
    background: none;
    border: none;
    color: var(--sky-primary);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.otp-phone-sent {
    font-size: 18px;
    color: var(--text-slate);
}

.otp-resend {
    margin-top: 20px;
    font-size: 17px;
    color: var(--text-slate);
}

.otp-resend a {
    color: var(--sky-primary);
    font-weight: 700;
    text-decoration: underline;
}

.forgot-desc {
    font-size: 18px;
    color: var(--text-slate);
    margin-bottom: 25px;
}

/* حقول الإدخال والأزرار الضخمة */
.form-group {
    margin-bottom: 22px;
    text-align: right;
}

.form-group label {
    display: block;
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-charcoal);
}

input[type="text"],
input[type="tel"],
input[type="number"],
textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 19px;
    font-weight: 500;
    border: 2px solid var(--border-soft);
    border-radius: 14px;
    background-color: var(--card-white);
    color: var(--text-charcoal);
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--sky-light);
}

/* صف من حقلين بجانب بعض */
.form-row-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* الأزرار الفاخرة */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

@media (min-width: 600px) {
    .btn {
        gap: 10px;
        padding: 10px 20px;
        font-size: 16px;
        border-radius: 12px;
    }
}

.btn-large {
    width: 100%;
    padding: 10px 18px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sky-primary) 0%, var(--sky-dark) 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(2, 132, 199, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--emerald-primary) 0%, var(--emerald-dark) 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background-color: var(--card-white);
    color: var(--text-slate);
    border: 2px solid var(--border-soft);
}

.btn-outline:hover {
    background-color: var(--pearly-bg);
    border-color: var(--text-light);
}

.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type="file"] {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.btn-emerald {
    background-color: var(--emerald-light);
    color: var(--emerald-dark);
    border: 2px solid var(--emerald-primary);
}

.btn-emerald:hover {
    background-color: var(--emerald-primary);
    color: white;
}

.auth-footer {
    margin-top: 30px;
    font-size: 16px;
    color: var(--text-slate);
    font-weight: 500;
}

.version-lbl {
    font-weight: 800;
    color: var(--sky-primary);
    margin-bottom: 5px;
}

/* ==================== ومضة مزامنة السحابة الحركية (Cloud Sync) ==================== */
.cloud-sync-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cloud-sync-overlay.active {
    display: flex;
    opacity: 1;
}

.cloud-sync-card {
    background: var(--card-white);
    border-radius: 28px;
    padding: 35px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    border: 3px solid var(--pearly-bg);
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

.cloud-sync-overlay.active .cloud-sync-card {
    transform: scale(1);
}

.cloud-animation-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cloud-lightning-icon {
    width: 45px;
    height: 45px;
    color: var(--sky-primary);
    animation: bounceCloud 2s infinite;
}

@keyframes bounceCloud {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.rotating-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px dashed var(--sky-primary);
    border-radius: 50%;
    animation: spinRing 4s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.cloud-sync-card h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 10px;
}

.cloud-sync-card p {
    font-size: 16px;
    color: var(--text-slate);
    line-height: 1.5;
}

/* ==================== هيدر نظيف للغاية (Clean Minimal Header) ==================== */
.dashboard-header-clean {
    background: var(--card-white);
    border-radius: 16px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    margin-bottom: 16px;
    border-bottom: 3px solid var(--sky-light);
    min-height: 56px;
}

.header-logo-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-emblem-wrapper {
    width: 34px !important;
    height: 34px !important;
}

.header-emblem-wrapper svg {
    width: 28px !important;
    height: 28px !important;
}

.logo-names h2 {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-charcoal);
    line-height: 1.2;
}

/* مؤشر اتصال ناعم وصامت في الهيدر */
.connectivity-status-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--pearly-bg);
    padding: 3px 8px;
    border-radius: 50px;
    margin-right: 8px;
}

.connectivity-status-wrapper .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--sky-primary);
}

.connectivity-status-wrapper.offline {
    background-color: #FEF2F2;
}

.connectivity-status-wrapper.offline .status-dot {
    background-color: #EF4444;
}

.status-mini-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-slate);
}

.connectivity-status-wrapper.offline .status-mini-text {
    color: #991B1B;
}

.header-account-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-text-neutral {
    font-size: 12px;
    color: var(--text-slate);
    font-weight: 600;
    text-align: left;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.welcome-text-neutral .teacher-name-span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-charcoal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* إخفاء نص الترحيب على الشاشات الصغيرة جداً */
@media (max-width: 420px) {
    .welcome-text-neutral {
        display: none;
    }
    .connectivity-status-wrapper {
        display: none;
    }
}

/* زر حساب دائرية مع صورة الأفاتار */
.account-profile-dropdown {
    position: relative;
}

.profile-btn-circle-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--sky-light);
    border: 2px solid var(--sky-primary);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.profile-btn-circle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-btn-circle-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.profile-menu {
    position: absolute;
    left: 0;
    top: 65px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-soft);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-radius: 18px;
    width: 270px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 1200;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

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

.profile-menu.show {
    display: flex;
}

.menu-header h4 {
    font-size: 18px;
    font-weight: 800;
}

.menu-header p {
    font-size: 14px;
    color: var(--text-slate);
}

.menu-divider {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 5px 0;
}

.menu-item {
    background: none;
    border: none;
    padding: 10px 14px;
    text-align: right;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-slate);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background-color: var(--pearly-bg);
    color: var(--text-charcoal);
}

.menu-version-text {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 700;
    text-align: center;
    margin-top: 5px;
}

/* ==================== شاشة تعديل الملف الشخصي (Profile Editor Grid) ==================== */
.profile-editor-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .profile-editor-container {
        grid-template-columns: 1fr;
    }
}

.profile-avatar-selector-box {
    background-color: var(--card-white);
    border: 2px solid var(--border-soft);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

.profile-avatar-selector-box h4, .profile-info-fields-box h4 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 15px;
}

.active-avatar-preview-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--sky-primary);
    margin: 0 auto 15px;
    overflow: hidden;
    background-color: var(--sky-light);
}

.active-avatar-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-help {
    font-size: 15px;
    color: var(--text-slate);
    margin-bottom: 15px;
}

.avatar-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.avatar-presets-grid img {
    width: 100%;
    border-radius: 50%;
    border: 2px solid var(--border-soft);
    cursor: pointer;
    background-color: var(--pearly-bg);
    transition: all 0.2s ease;
}

.avatar-presets-grid img:hover {
    border-color: var(--sky-primary);
    transform: scale(1.05);
}

.custom-avatar-file-upload {
    margin-top: 10px;
}

.profile-info-fields-box {
    background-color: var(--card-white);
    border: 2px solid var(--border-soft);
    border-radius: 20px;
    padding: 30px;
}

/* ==================== اللوحة الرئيسية الكبرى (Dashboard) ==================== */
.main-dashboard {
    padding-top: 6px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-intro {
    text-align: center;
    margin-bottom: 18px;
    padding: 0 8px;
}

.dashboard-intro h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 5px;
    line-height: 1.3;
}

.dashboard-intro p {
    font-size: 14px;
    color: var(--text-slate);
    font-weight: 500;
    line-height: 1.4;
}

/* شبكة البطاقات الكبيرة الفاخرة (Cards Grid) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 500px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (min-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.dashboard-card {
    background: var(--card-white);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    min-height: 150px;
    justify-content: center;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, var(--card-white) 0%, #FAFCFC 100%);
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg);
}

.card-icon i {
    width: 26px;
    height: 26px;
}

/* ألوان مميزة لكل بطاقة لتسهيل التمييز البصري */
.card-blue { border-bottom: 4px solid var(--sky-primary); }
.card-blue .card-icon { background-color: var(--sky-light); color: var(--sky-primary); }
.card-blue:hover { border-color: var(--sky-primary); }

.card-emerald { border-bottom: 4px solid var(--emerald-primary); }
.card-emerald .card-icon { background-color: var(--emerald-light); color: var(--emerald-primary); }
.card-emerald:hover { border-color: var(--emerald-primary); }

.card-amber { border-bottom: 4px solid var(--amber-primary); }
.card-amber .card-icon { background-color: var(--amber-light); color: var(--amber-primary); }
.card-amber:hover { border-color: var(--amber-primary); }

.card-rose:hover { border-color: var(--rose-primary); }

.card-purple { border-bottom: 4px solid var(--purple-primary); }
.card-purple .card-icon { background-color: var(--purple-light); color: var(--purple-primary); }
.card-purple:hover { border-color: var(--purple-primary); }

.card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-info h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-info p {
    font-size: 12px;
    color: var(--text-slate);
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-action-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-charcoal);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.dashboard-card:hover .card-action-text {
    gap: 10px;
    color: var(--sky-primary);
}

/* على الشاشات الكبيرة (تابلت وسطح المكتب) نرجع للتصميم الأفقي */
@media (min-width: 768px) {
    .dashboard-card {
        flex-direction: row;
        text-align: right;
        align-items: flex-start;
        padding: 24px;
        gap: 18px;
        min-height: auto;
        justify-content: flex-start;
    }
    .card-info {
        align-items: flex-start;
    }
    .card-icon {
        width: 64px;
        height: 64px;
    }
    .card-icon i {
        width: 32px;
        height: 32px;
    }
    .card-info h3 {
        font-size: 20px;
    }
    .card-info p {
        font-size: 15px;
        -webkit-line-clamp: unset;
        overflow: visible;
    }
    .card-action-text {
        font-size: 15px;
    }
}

.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--border-soft);
    padding-top: 25px;
    font-size: 18px;
    color: var(--text-slate);
    font-weight: 500;
}

.status-saved-badge {
    background-color: var(--emerald-light);
    color: var(--emerald-dark);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==================== النوافذ المنبثقة التفاعلية (Modals) ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1500;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 8px;
}

@media (min-width: 600px) {
    .modal-overlay {
        padding: 16px;
    }
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--pearly-bg);
    border-radius: 16px;
    width: 100%;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transform: scale(0.97);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    border: 2px solid var(--card-white);
}

@media (min-width: 600px) {
    .modal-content {
        border-radius: 22px;
        max-height: 92vh;
    }
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-large { max-width: 1200px; }
.modal-xlarge { max-width: 1400px; }
.modal-full { max-width: 1400px; width: 100%; }

.modal-header {
    background-color: var(--card-white);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    min-height: 52px;
    gap: 8px;
}

@media (min-width: 600px) {
    .modal-header {
        padding: 14px 22px;
        min-height: 60px;
    }
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.title-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .title-icon {
        width: 28px;
        height: 28px;
    }
}

.icon-blue { color: var(--sky-primary); }
.icon-emerald { color: var(--emerald-primary); }
.icon-amber { color: var(--amber-primary); }
.icon-rose { color: var(--rose-primary); }

.modal-header h2 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-charcoal);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .modal-header h2 {
        font-size: 19px;
        white-space: normal;
    }
}

.btn-close {
    background-color: #F1F5F9;
    color: var(--text-slate);
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .btn-close {
        padding: 8px 16px;
        font-size: 15px;
        border-radius: 10px;
    }
}

.btn-close:hover {
    background-color: #FFE4E6;
    color: #BE123C;
}

/* إخفاء نص زر الإغلاق على الجوال والإبقاء على الأيقونة فقط */
.btn-close span {
    display: none;
}

@media (min-width: 480px) {
    .btn-close span {
        display: inline;
    }
}

.btn-close i {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

@media (min-width: 600px) {
    .modal-body {
        padding: 20px;
    }
}

/* ==================== 1. ركن الأوراق الرسمية الذكي ==================== */
.doc-generator-container {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1000px) {
    .doc-generator-container {
        grid-template-columns: 1fr;
    }
}

.doc-controls-panel h3 {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-charcoal);
}

.template-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.template-btn {
    background-color: var(--card-white);
    border: 2px solid var(--border-soft);
    border-radius: 16px;
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-slate);
    transition: all 0.3s ease;
}

.template-btn i {
    width: 24px;
    height: 24px;
    color: var(--text-light);
}

.template-btn.active {
    background-color: var(--sky-light);
    border-color: var(--sky-primary);
    color: var(--sky-dark);
}

.template-btn.active i {
    color: var(--sky-primary);
}

.doc-form {
    background-color: var(--card-white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
}

/* زر إملاء الصوت المتداخل مع حقول النصوص */
.text-area-voice-group {
    position: relative;
}

.input-with-mic {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-with-mic textarea {
    padding-left: 65px; /* مسافة لزر الميكروفون المدمج */
}

.mic-inline-btn {
    position: absolute;
    left: 15px;
    bottom: 15px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--pearly-bg);
    border: 2px solid var(--border-soft);
    color: var(--text-slate);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.mic-inline-btn:hover {
    background-color: var(--rose-light);
    border-color: var(--rose-primary);
    color: var(--rose-primary);
}

.mic-inline-btn.listening {
    background-color: var(--rose-primary);
    color: white;
    border-color: var(--rose-dark);
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); }
    100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* ==================== شريط أزرار الإجراءات السفلي (منشئ الأسئلة والمستندات) ==================== */
.doc-actions-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border-soft);
    margin-top: 10px;
}

.doc-actions-buttons .btn,
.doc-actions-buttons .btn-whatsapp-doc-send {
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    gap: 5px !important;
    height: 38px;
    font-weight: 700;
}

.doc-actions-buttons .btn i,
.doc-actions-buttons .btn-whatsapp-doc-send svg {
    width: 14px !important;
    height: 14px !important;
}

/* ورقة المعاينة الفاخرة للطباعة */
.doc-preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-wrapper-scroll {
    overflow-x: auto;
    background-color: #E2E8F0;
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    align-content: flex-start;
    flex: 1;
    max-height: 700px;
}

/* تصميم الورقة الرسمية للتحميل والطباعة (A4 بنسبة جيدة) */
.official-doc-sheet {
    background-color: white;
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    padding: 20mm 15mm;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    color: #000000;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    position: relative;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.doc-border-inner {
    border: 3px solid #0f766e; /* الزمردي الداكن الفخم */
    padding: 10mm;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

/* الإطار الذهبي الخارجي الإضافي الرائع لـ 2026 */
.doc-border-inner::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1.5px solid #d97706; /* الذهبي اللامع الفاخر */
    pointer-events: none;
    border-radius: 6px;
}

/* خط مائي داخلي منقط بلون ذهبي/زمردي هادئ */
.doc-border-inner::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px dashed rgba(13, 148, 136, 0.35); /* منقط هادئ */
    pointer-events: none;
}

/* زوايا الزخرفة الهندسية المعاصرة والأنيقة لعام 2026 */
.corner-ornament {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 4px solid #d97706; /* ذهبي */
    pointer-events: none;
    z-index: 5;
}

.corner-ornament::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #0f766e; /* زمردي */
    border-radius: 50%;
}

.corner-ornament.top-right {
    top: -3px;
    right: -3px;
    border-bottom: none;
    border-left: none;
}
.corner-ornament.top-right::before {
    top: 2px;
    left: 2px;
}

.corner-ornament.top-left {
    top: -3px;
    left: -3px;
    border-bottom: none;
    border-right: none;
}
.corner-ornament.top-left::before {
    top: 2px;
    right: 2px;
}

.corner-ornament.bottom-right {
    bottom: -3px;
    right: -3px;
    border-top: none;
    border-left: none;
}
.corner-ornament.bottom-right::before {
    bottom: 2px;
    left: 2px;
}

.corner-ornament.bottom-left {
    bottom: -3px;
    left: -3px;
    border-top: none;
    border-right: none;
}
.corner-ornament.bottom-left::before {
    bottom: 2px;
    right: 2px;
}

.doc-header-official {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5mm;
}

.country-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.ministry-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.school-title-preview {
    font-size: 16px;
    font-weight: 700;
}

.header-left p {
    font-size: 15px;
    margin-bottom: 4px;
}

.header-divider {
    border: none;
    border-top: 2px solid #334155;
    margin-bottom: 10mm;
}

.doc-body-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.basmala {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12mm;
}

.doc-recipient-line {
    font-size: 20px;
    margin-bottom: 8mm;
}

.doc-subject-line {
    font-size: 20px;
    text-align: center;
    margin-bottom: 10mm;
}

.underlined-subject {
    text-decoration: underline;
    text-underline-offset: 6px;
    font-weight: 800;
}

.doc-paragraph-text {
    font-size: 19px;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 15mm;
    white-space: pre-line; /* يحافظ على أسطر الإدخال المنسقة */
    flex: 1;
}

.doc-signature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: flex-end; /* يضمن مواءمة كامل الكتلة لليسار في التخطيط العربي */
    margin-top: auto;
    padding-left: 10mm;
    position: relative;
}

.doc-signature-block br {
    display: none; /* إخفاء وسم السطر البرمجي لتمكين محاذاة الفليكس الدقيقة */
}

.sig-title {
    font-size: 18px;
    margin-bottom: 12px; /* مسافة مريحة وجميلة عمودياً بين اللقبين */
}

.sig-name {
    font-size: 19px;
}

.sig-role {
    font-size: 17px;
    color: #475569;
}

.doc-footer-official {
    text-align: center;
    font-size: 13px;
    color: #64748B;
    border-top: 1px dashed #CBD5E1;
    padding-top: 5mm;
    margin-top: 10mm;
}

/* ==================== 2. السجل الرقمي للدرجات والطلاب الموضح ==================== */
.ledger-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* تنسيقات شريط تبويبات السجل الرقمي لتكون مستطيلات متناسقة */
.ledger-tabs-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background-color: var(--pearly-bg);
    padding: 10px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .ledger-tabs-bar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px;
        border-radius: 16px;
    }
    .ledger-tab-btn {
        padding: 10px 14px !important;
        font-size: 14px !important;
        justify-content: flex-start !important;
        border-radius: 12px !important;
        text-align: right;
    }
}

.ledger-tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-slate);
    cursor: pointer;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ledger-tab-btn:hover {
    color: var(--text-charcoal);
    background-color: rgba(255, 255, 255, 0.5);
}

.ledger-tab-btn.active {
    background-color: var(--card-white);
    color: var(--emerald-dark);
    border-color: var(--emerald-primary);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.ledger-tab-btn i,
.ledger-tab-btn svg.lucide {
    width: 22px;
    height: 22px;
}

.ledger-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: var(--card-white);
    border-radius: 20px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
    position: relative;
    overflow: hidden;
}

.stat-icon-bg {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-bg i {
    width: 30px;
    height: 30px;
}

.stat-success { border-right: 6px solid var(--emerald-primary); }
.stat-success .stat-icon-bg { background-color: var(--emerald-light); color: var(--emerald-dark); }

.stat-outstanding { border-right: 6px solid var(--amber-primary); }
.stat-outstanding .stat-icon-bg { background-color: var(--amber-light); color: var(--amber-dark); }

.stat-failed { border-right: 6px solid var(--rose-primary); }
.stat-failed .stat-icon-bg { background-color: var(--rose-light); color: var(--rose-dark); }

.stat-total { border-right: 6px solid var(--sky-primary); }
.stat-total .stat-icon-bg { background-color: var(--sky-light); color: var(--sky-dark); }

.stat-det h4 {
    font-size: 17px;
    color: var(--text-slate);
    font-weight: 700;
}

.stat-number {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-charcoal);
    display: block;
}

/* أزرار عرض الأسماء التفاعلية الواضحة والمباشرة */
.stat-action-btn-faint {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 8px;
    box-shadow: none;
}

.ledger-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: var(--card-white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

@media (max-width: 900px) {
    .ledger-actions-bar {
        grid-template-columns: 1fr;
    }
}

.ledger-actions-bar h4 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 12px;
}

.input-add-group {
    display: flex;
    gap: 12px;
}

.excel-buttons {
    display: flex;
    gap: 15px;
}

/* جدول الطلاب والدرجات */
.table-scroll-container {
    overflow-x: auto;
    background-color: var(--card-white);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
    border: 2px solid var(--border-soft);
}

.students-grades-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 19px;
}

.students-grades-table th,
.students-grades-table td {
    padding: 16px 20px;
    border-bottom: 2px solid var(--border-soft);
}

.students-grades-table th {
    background-color: #F8FAFC;
    color: var(--text-charcoal);
    font-weight: 800;
    font-size: 18px;
    border-bottom: 3px solid var(--border-soft);
}

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

.students-grades-table tbody tr:hover {
    background-color: #F8FAFC;
}

/* ==================== الجدول المبسط: الأسماء فقط ==================== */
.students-slim-table th,
.students-slim-table td {
    padding: 10px 16px !important;
    font-size: 17px !important;
}

.students-slim-table th {
    font-size: 15px !important;
    color: var(--text-light) !important;
    font-weight: 700 !important;
}

.student-slim-row {
    transition: background 0.2s ease;
}

.student-slim-row:hover {
    background-color: var(--sky-light) !important;
}

.student-row-num {
    color: var(--text-light);
    font-size: 14px !important;
    font-weight: 600;
}

/* زر اسم الطالب القابل للضغط */
.student-name-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-charcoal);
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    width: 100%;
    padding: 4px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-name-btn::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--sky-primary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.student-name-btn:hover {
    color: var(--sky-dark);
    padding-right: 8px;
}

.student-name-btn:hover::before {
    transform: scale(1.5);
    background-color: var(--emerald-primary);
}

/* ==================== كارت تفاصيل الطالب المنبثق ==================== */
.student-card-grades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

@media (max-width: 600px) {
    .student-card-grades-grid {
        grid-template-columns: 1fr;
    }
}

.student-card-grade-box {
    background-color: var(--pearly-bg);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    border: 2px solid var(--border-soft);
    transition: border-color 0.2s ease;
}

.student-card-grade-box:hover {
    border-color: var(--sky-primary);
}

.student-card-grade-box label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-slate);
    margin-bottom: 10px;
}

.student-card-grade-box input {
    width: 100%;
    text-align: center;
    font-size: 28px !important;
    font-weight: 900 !important;
    padding: 10px !important;
    border-radius: 12px !important;
    color: var(--text-charcoal) !important;
    border: 2px solid var(--border-soft) !important;
    background-color: var(--card-white) !important;
}

.student-card-grade-box input:focus {
    border-color: var(--sky-primary) !important;
    box-shadow: 0 0 0 3px var(--sky-light) !important;
}

/* معاينة المعدل الحية */
.student-card-avg-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, var(--sky-light), var(--emerald-light));
    border-radius: 18px;
    padding: 18px 24px;
    margin: 20px 0;
    border: 2px solid var(--border-soft);
}

.avg-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-slate);
}







/* ==================== 3. منشئ الأسئلة والورقة المدرسية المسطرة ==================== */
.questions-builder-split-container {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1000px) {
    .questions-builder-split-container {
        grid-template-columns: 1fr;
    }
}

/* واجهة كتابة الأسئلة على شكل ورقة مسطرة حقيقية ممتعة ومحفزة للتخيل */
.lined-paper-editor {
    background-color: #FDFDFD;
    border: 2px solid var(--border-soft);
    box-shadow: 0 10px 25px rgba(0,0,0,0.02);
    border-radius: 20px;
    padding: 30px;
    background-image: linear-gradient(#F1F5F9 1px, transparent 1px);
    background-size: 100% 40px; /* تسطير خفيف خلفي */
    line-height: 40px;
}

.editor-lined-header {
    border-bottom: 3px double var(--amber-primary);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.editor-lined-header h3 {
    font-size: 23px;
    font-weight: 800;
    color: var(--amber-dark);
}

.editor-hint {
    font-size: 16px;
    color: var(--text-slate);
    font-weight: 600;
    display: block;
    line-height: 1.5;
    margin-top: 5px;
}

.exam-header-fields-box {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.01);
}

.exam-header-fields-box h4 {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-charcoal);
    border-right: 4px solid var(--amber-primary);
    padding-right: 10px;
    line-height: 1.2;
}

.fields-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.questions-list-manager-box {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.q-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 10px;
}

.q-manager-header h4 {
    font-size: 19px;
    font-weight: 800;
    border-right: 4px solid var(--amber-primary);
    padding-right: 10px;
}

.questions-inputs-wrapper-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-left: 5px;
}

/* كارد السؤال الفردي داخل محرر التعبئة */
.q-editor-card {
    background-color: var(--pearly-bg);
    border: 2px solid var(--border-soft);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 20px;
}

.q-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.q-card-header h5 {
    font-size: 17px;
    font-weight: 800;
}

.btn-remove-q {
    background: none;
    border: none;
    color: var(--rose-primary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.q-subs-manager {
    margin-top: 15px;
    border-top: 1px dashed var(--border-soft);
    padding-top: 15px;
}

.q-subs-manager h6 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
}

.sub-q-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-remove-sub-q {
    background: none;
    border: none;
    color: var(--text-slate);
    cursor: pointer;
}

.btn-remove-sub-q:hover {
    color: var(--rose-primary);
}

.exam-preview-panel {
    display: flex;
    flex-direction: column;
}

/* ترويسة ورقة الأسئلة */
.qdoc-header {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    align-items: center;
    text-align: center;
    margin-bottom: 8mm;
}

.qh-right { text-align: right; font-size: 15px; }
.qh-left { text-align: left; font-size: 15px; }

.qh-center h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.qh-center p {
    font-size: 17px;
    font-weight: 700;
}

.question-sheet-view {
    min-height: auto;
    padding-bottom: 30mm;
}

.qdoc-questions-list {
    font-size: 18px;
    line-height: 1.8;
}

.qdoc-single-item {
    margin-bottom: 8mm;
}

.q-main-title {
    font-weight: 800;
    font-size: 19px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.q-sub-list {
    padding-right: 25px;
    list-style-type: arabic-indic;
}

.q-sub-list li {
    margin-bottom: 3px;
}

.qdoc-footer {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin-top: 15mm;
    border-top: 2px dashed #334155;
    padding-top: 5mm;
}

/* ==================== 4. المساعد الصوتي والإملاء ==================== */
.voice-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 35px;
    align-items: start;
}

@media (max-width: 950px) {
    .voice-layout-grid {
        grid-template-columns: 1fr;
    }
}

.voice-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: var(--card-white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.voice-help-desc {
    font-size: 19px;
    color: var(--text-slate);
    line-height: 1.6;
}

.big-mic-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.big-mic-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-primary) 0%, var(--rose-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(225, 29, 72, 0.35);
    position: relative;
    outline: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.big-mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(225, 29, 72, 0.45);
}

.mic-big-icon {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.big-mic-btn:active .mic-big-icon {
    transform: scale(0.9);
}

.mic-status-label {
    font-size: 21px;
    font-weight: 800;
    color: var(--rose-dark);
}

/* تأثير الرسوم النبضية (Voice Pulsing Waves) للميكروفون الكبير */
.pulse-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--rose-primary);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}

.big-mic-btn.recording .pulse-wave {
    animation: pulseWave 2s cubic-bezier(0.25, 0, 0, 1) infinite;
}

.big-mic-btn.recording .wave-1 { animation-delay: 0s; }
.big-mic-btn.recording .wave-2 { animation-delay: 0.6s; }
.big-mic-btn.recording .wave-3 { animation-delay: 1.2s; }

@keyframes pulseWave {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.2); opacity: 0; }
}

.recording-tip {
    background-color: var(--amber-light);
    border: 2px solid var(--amber-primary);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.tip-icon {
    width: 30px;
    height: 30px;
    color: var(--amber-primary);
    flex-shrink: 0;
}

.recording-tip p {
    font-size: 17px;
    color: var(--amber-dark);
    line-height: 1.5;
}

/* الدفتر المدرسي المسطر الفاخر */
.voice-notebook {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notebook-header {
    background-color: #334155;
    color: white;
    padding: 15px 25px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.notebook-binder {
    position: absolute;
    bottom: -10px;
    left: 5%;
    width: 90%;
    height: 15px;
    background-image: radial-gradient(circle, #E2E8F0 40%, transparent 45%);
    background-size: 25px 15px;
}

.notebook-header h4 {
    font-size: 20px;
    font-weight: 800;
}

.notebook-sheet {
    background-color: #FCFDFD;
    border: 2px solid var(--border-soft);
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.02);
    height: 480px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* التسطير المدرسي الفخم المريح للعين */
.notebook-sheet textarea {
    width: 100%;
    height: 100%;
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    background-image: linear-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 100% 36px; /* المسافة بين السطور */
    line-height: 36px !important;
    font-size: 21px !important;
    font-weight: 600;
    color: #334155;
    resize: none;
    padding: 0;
}

.notebook-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}



/* ==================== 4. ركن الخطط الدراسية الذكي (Lesson Plan Styles) ==================== */
.plan-modal-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    background-color: #f1f5f9;
}

@media (max-width: 1100px) {
    .plan-modal-body {
        grid-template-columns: 1fr;
    }
}

.plan-controls-panel .control-card {
    background: var(--card-white);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.plan-controls-panel h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

.plan-controls-panel p {
    font-size: 15px;
    color: var(--text-slate);
    line-height: 1.6;
    margin-bottom: 25px;
}

.plan-actions-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* مبدل اللغة والسياق */
.context-language-selector {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-language-selector label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-slate);
}

.segmented-control {
    display: flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.segment-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-slate);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-btn.active {
    background: var(--card-white);
    color: var(--purple-dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.theme-switcher {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 50px;
    margin-left: 15px;
}

.theme-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { box-shadow: 0 0 0 2px var(--sky-primary); transform: scale(1.1); }

.dot-blue { background-color: #0284c7; }
.dot-green { background-color: #059669; }
.dot-red { background-color: #dc2626; }
.dot-purple { background-color: #8b5cf6; }

/* تصميم ورقة الخطة (The Sheet) */
.plan-preview-container {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.plan-sheet {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 15mm;
    display: flex;
    flex-direction: column;
    gap: 10mm;
    direction: ltr; /* English template usually ltr, but user can type Arabic */
    font-family: 'Cairo', sans-serif;
}

.plan-header-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.capsule-row {
    display: flex;
    gap: 8px;
}

.header-capsule {
    flex: 1;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-capsule.main-info {
    border-width: 2px;
    background: #f1f5f9;
}

.header-capsule.highlight {
    background: #0284c7;
    color: white;
    justify-content: center;
    font-weight: 800;
    border: none;
}

.header-capsule label {
    font-weight: 800;
    font-size: 14px;
    color: var(--text-slate);
    white-space: nowrap;
}

.header-capsule input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-charcoal);
    padding: 0;
}

.header-capsule input:focus { box-shadow: none; }

.plan-teacher-bar {
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 20px;
}

.plan-teacher-bar input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

/* جدول جسم الخطة */
.plan-content-grid {
    display: flex;
    flex-direction: column;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}

.plan-row {
    display: flex;
    border-bottom: 1.5px solid #cbd5e1;
}

.plan-row:last-child { border-bottom: none; }

.plan-label {
    width: 160px;
    background: #f8fafc;
    padding: 15px;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-charcoal);
    border-right: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.plan-input {
    flex: 1;
    padding: 10px;
}

.plan-input textarea {
    width: 100%;
    height: 100px;
    border: none;
    resize: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    padding: 5px;
}

.plan-footer-watermark {
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
}

/* سمات الألوان (Themes) */
.plan-theme-blue .header-capsule.highlight { background: #0284c7; }
.plan-theme-blue .plan-label { background: #f0f9ff; color: #0369a1; }
.plan-theme-blue .header-capsule.main-info { background: #f0f9ff; border-color: #bae6fd; }

.plan-theme-green .header-capsule.highlight { background: #059669; }
.plan-theme-green .plan-label { background: #f0fdf4; color: #047857; }
.plan-theme-green .header-capsule.main-info { background: #f0fdf4; border-color: #bbf7d0; }

.plan-theme-red .header-capsule.highlight { background: #dc2626; }
.plan-theme-red .plan-label { background: #fef2f2; color: #b91c1c; }
.plan-theme-red .header-capsule.main-info { background: #fef2f2; border-color: #fecaca; }

.plan-theme-purple .header-capsule.highlight { background: #8b5cf6; }
.plan-theme-purple .plan-label { background: #f5f3ff; color: #6d28d9; }
.plan-theme-purple .header-capsule.main-info { background: #f5f3ff; border-color: #ddd6fe; }

/* استجابة الهواتف الذكية: تثبيت الحجم ومنع التمرير العرضي */
@media (max-width: 800px) {
    .plan-modal-body {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }

    .plan-sheet {
        width: 100% !important;
        min-height: auto !important;
        padding: 12px !important;
        gap: 12px !important;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }

    .capsule-row {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .header-capsule {
        width: 100% !important;
        padding: 6px 12px !important;
    }

    .header-capsule label {
        font-size: 13px !important;
    }

    .header-capsule input {
        font-size: 14px !important;
    }

    .plan-teacher-bar {
        padding: 8px 12px !important;
    }

    .plan-teacher-bar input {
        font-size: 14px !important;
    }

    /* تحويل الجدول إلى صفوف عمودية سهلة القراءة */
    .plan-row {
        flex-direction: column !important;
    }

    .plan-label {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #cbd5e1 !important;
        padding: 8px 12px !important;
        justify-content: flex-start !important;
        font-size: 13px !important;
        background: #f8fafc !important;
    }

    .plan-input {
        padding: 5px !important;
    }

    .plan-input textarea {
        height: 100px !important;
        font-size: 14px !important;
    }

    .plan-controls-panel .control-card {
        padding: 15px !important;
        position: static !important;
    }

    .plan-controls-panel h3 {
        font-size: 18px !important;
    }

    .plan-controls-panel p {
        font-size: 13px !important;
        margin-bottom: 15px !important;
    }
}

/* ==================== 5. منظم جدول المراجعة (Revision Schedule Styles) ==================== */
.revision-modal-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    background-color: #fffbeb; /* خلفية صفراء فاتحة جداً مريحة */
}

@media (max-width: 1100px) {
    .revision-modal-body {
        grid-template-columns: 1fr;
    }
}

.revision-controls-panel .control-card {
    background: var(--card-white);
    border-radius: 20px;
    padding: 25px;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.1);
}

.revision-actions-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.revision-sheet {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 10px 40px rgba(217, 119, 6, 0.15);
    padding: 15mm;
    display: flex;
    flex-direction: column;
    gap: 10mm;
    font-family: 'Cairo', sans-serif;
}

.revision-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 3px solid var(--amber-primary);
    padding-bottom: 15px;
}

.rev-brand {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rev-icon {
    width: 50px;
    height: 50px;
    color: var(--amber-primary);
}

.rev-brand h1 {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-charcoal);
}

.rev-brand p {
    font-size: 16px;
    color: var(--amber-dark);
    font-weight: 700;
}

.rev-student-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.rev-student-info input {
    border: none;
    border-bottom: 2px dashed #d1d5db;
    padding: 5px;
    font-size: 16px;
    font-weight: 700;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title span {
    background: var(--amber-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.rev-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.rev-table th, .rev-table td {
    border: 2px solid #fde68a;
    padding: 12px;
    text-align: center;
}

.rev-table th {
    background-color: #fef3c7;
    color: var(--amber-dark);
    font-weight: 800;
}

.rev-table input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

/* ==================== 6. نظام الطباعة الاحترافي عالي الوضوح (Universal Print System 2026) ==================== */
@media print {
    /* تفعيل الألوان والخلفيات بدقة عالية في الطباعة */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* إخفاء كل شيء بشكل افتراضي عند تفعيل وضع الطباعة البرمجي */
    body.printing-active * {
        visibility: hidden !important;
    }

    /* إظهار العنصر المستهدف فقط وجميع أبنائه */
    body.printing-active .print-target,
    body.printing-active .print-target * {
        visibility: visible !important;
    }

    /* تموضع العنصر المستهدف في أعلى يسار الصفحة وملء العرض */
    body.printing-active .print-target {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        z-index: 9999 !important;
    }


    /* تهيئة الحاويات لضمان عدم وجود خلفيات داكنة أو هوامش تعيق الطباعة */
    .modal-overlay, .modal-content, .modal-body, .preview-wrapper-scroll, 
    .doc-generator-container, .doc-preview-panel, .questions-builder-split-container, 
    .exam-preview-panel, .plan-modal-body, .plan-preview-container, .revision-modal-body, 
    .revision-preview-container {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    /* تحسين هيكلية أوراق العمل (A4) للطباعة */
    .official-doc-sheet, .revision-sheet, .plan-sheet {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 10mm !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
    }

    /* إخفاء العناصر غير الضرورية في الورقة المطبوعة */
    .no-print, .btn, .btn-close, .doc-actions-buttons, .theme-switcher, .notebook-actions, .revision-actions-row, .plan-actions-row {
        display: none !important;
    }

    /* منع تكسر الصفحات داخل العناوين والفقرات الهامة */
    h1, h2, h3, h4, .doc-header-official, .qdoc-header {
        page-break-after: avoid !important;
    }

    /* إخفاء السكرول بار */
    ::-webkit-scrollbar {
        display: none !important;
    }
}

/* تنسيقات إضافية لدعم الطباعة التقليدية (بدون كلاسات برمجية) */
@media print {
    .no-print { display: none !important; }
}

.daily-routine-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.routine-item {
    background: #fffcf2;
    border: 2px solid #fde68a;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.routine-label {
    font-weight: 800;
    font-size: 15px;
    color: var(--amber-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.routine-label i {
    width: 18px;
    height: 18px;
}

.routine-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-charcoal);
}

.rev-notes {
    width: 100%;
    height: 120px;
    border: 3px solid #fde68a;
    border-radius: 16px;
    padding: 20px;
    font-size: 17px;
    line-height: 1.6;
    resize: none;
    background: #fffdf5;
    font-style: italic;
    font-weight: 600;
}

.rev-footer-watermark {
    margin-top: auto;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    border-top: 2px solid #fde68a;
    padding-top: 15px;
    font-weight: 700;
}

.btn-remove-row {
    background: none;
    border: none;
    color: var(--rose-primary);
    cursor: pointer;
    padding: 5px;
}

/* استجابة الجوال لمنظم المراجعة */
@media (max-width: 800px) {
    .revision-sheet {
        width: 100% !important;
        padding: 10mm 5mm !important;
    }
    
    .revision-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .rev-student-info {
        width: 100%;
    }
    
    .daily-routine-grid {
        grid-template-columns: 1fr;
    }
    
    .routine-item {
        padding: 10px;
    }
}

/* تنسيقات الطباعة الخاصة بجدول المراجعة */
@media print {
    .no-print { display: none !important; }
    #revisionPrintArea, #revisionPrintArea * { visibility: visible; }
    #revisionPrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .revision-sheet {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

/* تنسيقات الطباعة العامة */
@media print {
    body * { visibility: hidden; }
    /* نحدد هنا المناطق التي نريد ظهورها بناءً على المودال النشط */
    /* هذا سيتم التحكم به برمجياً أو عبر كلاسات إضافية */
}


/* تنسيقات الطباعة */
@media print {
    body * { visibility: hidden; }
    #lessonPlanPrintArea, #lessonPlanPrintArea * { visibility: visible; }
    #lessonPlanPrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .plan-sheet {
        box-shadow: none;
        border: none;
        padding: 0;
        width: 100%;
    }
    .plan-modal-body, .modal-overlay, .modal-content {
        background: white !important;
        padding: 0 !important;
    }
}


/* --- Admin Mode Active Styles --- */
body.admin-mode-active .dashboard-card {
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.admin-mode-active .dashboard-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 35px rgba(245, 158, 11, 0.25);
}

/* Admin Only Elements */
.admin-only {
    display: none;
}

/* Sidebar Team Management Tab Fix */
#adminDashboardSection .menu-link.active {
    background-color: #374151;
    color: #fff;
}

#adminDashboardSection .btn-emerald {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.3s;
}

#adminDashboardSection .btn-emerald:hover {
    background-color: #059669;
}

/* ==================== لوحة تحكم الإدارة الفائقة المدمجة (Dark Premium Scoped Styles) ==================== */
#adminDashboardSection {
    background-color: #0b0f19 !important;
    color: #f9fafb !important;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}


#adminDashboardSection * {
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

#adminDashboardSection .admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

#adminDashboardSection .admin-sidebar {
    background-color: #161e2e;
    border-left: 1px solid #374151;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#adminDashboardSection .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #374151;
}

#adminDashboardSection .sidebar-brand h2 {
    font-size: 22px;
    font-weight: 800;
    color: #f9fafb;
    margin: 0;
}

#adminDashboardSection .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

#adminDashboardSection .menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #9ca3af;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

#adminDashboardSection .menu-link:hover, 
#adminDashboardSection .menu-link.active {
    background-color: #1f2937;
    color: #f9fafb;
}

#adminDashboardSection .menu-link.active {
    border-right: 4px solid #10b981;
}

#adminDashboardSection .sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

#adminDashboardSection .admin-content {
    padding: 40px;
    overflow-y: auto;
    max-height: 100vh;
    background-color: #0b0f19;
}

#adminDashboardSection .admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #374151;
}

#adminDashboardSection .admin-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #f9fafb;
    margin: 0;
}

#adminDashboardSection .admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

#adminDashboardSection .admin-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #10b981;
}

#adminDashboardSection .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#adminDashboardSection .stat-card {
    background-color: #161e2e;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#adminDashboardSection .stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

#adminDashboardSection .stat-card.blue .stat-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

#adminDashboardSection .stat-card.orange .stat-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

#adminDashboardSection .stat-info h3 {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 5px 0;
}

#adminDashboardSection .stat-info p {
    font-size: 26px;
    font-weight: 800;
    color: #f9fafb;
    margin: 0;
}

#adminDashboardSection .admin-panel {
    background-color: #161e2e;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

#adminDashboardSection .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#adminDashboardSection .panel-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #f9fafb;
    margin: 0;
}

#adminDashboardSection .search-filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#adminDashboardSection .search-input-wrapper {
    flex: 1;
    position: relative;
}

#adminDashboardSection .search-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 14px;
}

#adminDashboardSection .search-input-wrapper i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

#adminDashboardSection .filter-select {
    padding: 12px 24px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 14px;
    cursor: pointer;
}

#adminDashboardSection .table-responsive {
    width: 100%;
    overflow-x: auto;
}

#adminDashboardSection .admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

#adminDashboardSection .admin-table th, 
#adminDashboardSection .admin-table td {
    padding: 16px;
    border-bottom: 1px solid #374151;
    font-size: 15px;
    color: #e5e7eb;
}

#adminDashboardSection .admin-table th {
    background-color: #1f2937;
    color: #9ca3af;
    font-weight: 700;
}

#adminDashboardSection .admin-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

#adminDashboardSection .badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

#adminDashboardSection .badge-active {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

#adminDashboardSection .badge-frozen {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

#adminDashboardSection .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 14px;
}

#adminDashboardSection .btn-primary {
    background-color: #10b981;
    color: #fff;
}

#adminDashboardSection .btn-primary:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

#adminDashboardSection .btn-danger {
    background-color: #ef4444;
    color: #fff;
}

#adminDashboardSection .btn-danger:hover {
    background-color: #dc2626;
}

#adminDashboardSection .btn-outline {
    background-color: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
}

#adminDashboardSection .btn-outline:hover {
    background-color: #1f2937;
    color: #f9fafb;
}

/* Modals Scoped */
.admin-custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-custom-modal.active {
    display: flex;
    opacity: 1;
}

.admin-custom-modal .modal-content {
    background-color: #161e2e;
    border: 1px solid #374151;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.admin-custom-modal.active .modal-content {
    transform: scale(1);
}

.admin-custom-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #374151;
    color: #f9fafb;
}

.admin-custom-modal .modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.admin-custom-modal .modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 24px;
}

.admin-custom-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #374151;
}

/* Triangle icon style */
.admin-toggle-triangle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-slate);
    transition: all 0.3s ease;
}

.admin-toggle-triangle:hover {
    background-color: var(--pearly-bg);
    color: var(--sky-primary);
    transform: rotate(180deg);
}

/* Glassmorphism prompt modal for Admin Lock */
.admin-lock-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.admin-lock-modal.active {
    display: flex;
}

.admin-lock-card {
    background-color: rgba(22, 30, 46, 0.9);
    border: 2px solid #374151;
    border-radius: 20px;
    padding: 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: #f9fafb;
    animation: adminZoomIn 0.3s ease;
}

@keyframes adminZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.admin-lock-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.admin-lock-card p {
    color: #9ca3af;
    font-size: 15px;
    margin-bottom: 25px;
}

.admin-lock-card .form-group {
    margin-bottom: 20px;
    text-align: right;
}

.admin-lock-card .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #f9fafb;
}

.admin-lock-card .form-group input {
    width: 100%;
    padding: 12px 16px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
    font-size: 15px;
    transition: all 0.3s;
}

.admin-lock-card .form-group input:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* switch styles inside modal */
.admin-lock-card .switch-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #1f2937;
    border-radius: 8px;
}

.admin-lock-card .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.admin-lock-card .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.admin-lock-card .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
    border-radius: 34px;
}

.admin-lock-card .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.admin-lock-card input:checked + .slider {
    background-color: #10b981;
}

.admin-lock-card input:checked + .slider:before {
    transform: translateX(24px);
}

.admin-lock-card .otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.admin-lock-card .otp-digit {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    background-color: #1f2937;
    border: 2px solid #374151;
    border-radius: 8px;
    color: #f9fafb;
}

.admin-lock-card .otp-digit:focus {
    border-color: #10b981;
    outline: none;
}

.admin-lock-card .auth-alert {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    text-align: center;
}


/* ==================== WhatsApp Integration Styles 2026 ==================== */

/* ?????? ?????? ????? ?? ???? ?? ?????? */
.btn-whatsapp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.55);
}

/* ????? ??? ??????? ??? ????? */
.whatsapp-summons-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #4ade80;
    border-radius: 20px;
    padding: 24px 28px;
    margin-top: 24px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.12);
}

.whatsapp-summons-box h4 {
    font-size: 18px;
    font-weight: 800;
    color: #15803d;
    margin-bottom: 18px;
}

.whatsapp-summons-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ?? ????? ????????? ??? ?????? */
.btn-whatsapp-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    align-self: flex-start;
    margin-top: 4px;
}

.btn-whatsapp-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55);
    background: linear-gradient(135deg, #22c55e 0%, #0f766e 100%);
}

.btn-whatsapp-send:active {
    transform: translateY(0);
}

/* ?? ????? ?????? ??????? ??? ?????? - ??? ???? doc-actions-buttons */
.btn-whatsapp-doc-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    padding: 0 18px;
    height: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.4);
    white-space: nowrap;
}

.btn-whatsapp-doc-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55);
    background: linear-gradient(135deg, #22c55e 0%, #0f766e 100%);
}

.btn-whatsapp-doc-send:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* ==================== ?????? ?????? ????????? ?????? ???? 2026 ==================== */
.site-footer-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 25px;
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(15, 118, 110, 0.15);
    border-radius: 12px;
    font-family: inherit;
    direction: rtl;
    transition: all 0.3s ease;
}

/* ??? ?????? - ??????? */
.footer-right-side {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-slate, #475569);
}

/* ??? ????? - ??????? */
.footer-center-side {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-center-side a {
    color: #0f766e;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.25s ease;
    padding: 3px 6px;
    border-radius: 6px;
}

.footer-center-side a:hover {
    color: #0d9488;
    background-color: rgba(15, 118, 110, 0.08);
}

.footer-separator {
    color: #cbd5e1;
    font-weight: 300;
}

/* ?? ???????? ????? */
.btn-footer-support {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: #ffffff !important;
    padding: 5px 12px !important;
    border-radius: 15px !important;
    font-size: 12px !important;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
    transition: all 0.3s ease !important;
}

.btn-footer-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(15, 118, 110, 0.4);
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

/* ??? ?????? - ???? ?????? */
.footer-left-side {
    display: flex;
    align-items: center;
}

.security-indicator {
    display: flex;
    align-items: center;
    background: #f0fdf4;
    color: #16a34a;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.security-icon {
    color: #16a34a;
}

/* ????????? ??????? ???????? */
@media (max-width: 768px) {
    .site-footer-modern {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
        gap: 12px;
        margin-top: 15px;
    }
    .footer-center-side {
        flex-direction: column;
        gap: 5px;
    }
    .footer-separator {
        display: none;
    }
    .footer-right-side {
        font-size: 11px;
    }
    .footer-center-side a {
        font-size: 11px;
    }
}


/* ==================== الشريط السفلي الموحد الناعم (Universal Slim Footer) ==================== */
.app-universal-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-soft);
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.version-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.footer-links a {
    color: var(--text-slate);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.footer-links a:hover {
    color: var(--sky-primary);
}

.footer-links .sep {
    color: var(--border-soft);
    font-weight: 300;
    font-size: 13px;
}

.security-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: var(--emerald-dark);
    font-weight: 700;
    font-size: 12px;
    background-color: var(--emerald-light);
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--emerald-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.security-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* تحسينات إضافية للنوافذ المنبثقة الاحترافية */
.modal-medium {
    max-width: 600px !important;
}

.text-center {
    text-align: center;
}

.modal-hero-icon {
    margin-bottom: 25px;
}

.professional-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-charcoal);
    margin-bottom: 20px;
}

.security-highlight-box {
    background-color: var(--sky-light);
    border: 1.5px dashed var(--sky-primary);
    padding: 15px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--sky-dark);
    font-weight: 800;
    margin: 20px 0;
}

.professional-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.professional-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 18px;
    font-size: 17px;
    color: var(--text-slate);
    font-weight: 600;
    line-height: 1.6;
}

.professional-list li i {
    color: var(--emerald-primary);
    flex-shrink: 0;
    margin-top: 4px;
}

.privacy-security-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.security-item {
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.security-item:hover {
    border-color: var(--sky-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateX(-5px);
}

.security-item i {
    font-size: 24px;
    color: var(--sky-primary);
}

.security-item h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-charcoal);
    margin-bottom: 5px;
}

.security-item p {
    font-size: 15px;
    color: var(--text-slate);
    line-height: 1.6;
}

/* استجابة الشاشة الصغيرة للهواتف */
@media (max-width: 768px) {
    /* غلاف التطبيق وحاوياته */
    .app-container {
        padding: 10px !important;
    }

    /* ==================== الهيدر: أصغر وأنعم على الجوال ==================== */
    .dashboard-header-clean {
        padding: 8px 14px !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
        border-bottom-width: 2px !important;
    }

    .header-logo-side {
        gap: 8px !important;
    }

    .header-account-side {
        gap: 10px !important;
    }

    .welcome-text-neutral {
        display: none !important;
    }

    /* ==================== عنوان اللوحة الرئيسية: أصغر على الجوال ==================== */
    .dashboard-intro {
        margin-bottom: 18px !important;
    }

    .dashboard-intro h1 {
        font-size: 17px !important;
        margin-bottom: 4px !important;
        line-height: 1.4 !important;
    }

    .dashboard-intro p {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* ==================== شبكة البطاقات على الجوال ==================== */
    .cards-grid {
        gap: 14px !important;
        margin-bottom: 20px !important;
    }

    /* ==================== تصغير الأيقونات على الهاتف ==================== */


    /* أيقونات بطاقات اللوحة الرئيسية */
    .card-icon {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        flex-shrink: 0;
    }

    .card-icon i,
    .card-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* بطاقات اللوحة: تقليص الحشو وحجم النص */
    .dashboard-card {
        padding: 18px !important;
        gap: 14px !important;
    }

    .card-info h3 {
        font-size: 17px !important;
        margin-bottom: 6px !important;
    }

    .card-info p {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }

    .card-action-text {
        font-size: 13px !important;
    }

    /* أيقونة الهيدر (الكتاب المفتوح SVG) */
    .header-emblem-wrapper {
        width: 32px !important;
        height: 32px !important;
    }











































    /* ==================== أيقونات داخل أقسام النوافذ (السجل، الأسئلة، الصوتي) ==================== */

























    






    /* الورقة الرسمية: احتواء المحتوى بنسبة 100% بدون بروز */
    .official-doc-sheet {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10mm 6mm !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }

    .doc-border-inner {
        padding: 6mm !important;
        box-sizing: border-box !important;
    }

    /* تكييف زوايا الإطار الفاخر على الجوال */
    .doc-border-inner::before {
        top: -4px !important;
        left: -4px !important;
        right: -4px !important;
        bottom: -4px !important;
    }

    .doc-border-inner::after {
        top: 3px !important;
        left: 3px !important;
        right: 3px !important;
        bottom: 3px !important;
    }

    .corner-ornament {
        width: 18px !important;
        height: 18px !important;
    }

    .corner-ornament::before {
        width: 6px !important;
        height: 6px !important;
    }

    .doc-body-content .basmala {
        font-size: 18px !important;
        margin-bottom: 6mm !important;
    }

    .doc-recipient-line, .doc-subject-line {
        font-size: 16px !important;
        margin-bottom: 5mm !important;
    }

    .doc-paragraph-text {
        font-size: 15px !important;
        line-height: 1.6 !important;
        margin-bottom: 8mm !important;
    }

    /* الترتيب العمودي لعناصر الإدخال */
    .form-row-two-columns {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .template-selector {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .doc-actions-buttons {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .doc-actions-buttons button,
    .doc-actions-buttons .btn-whatsapp-doc-send {
        grid-column: span 1 !important;
    }

    /* الشريط السفلي على الهواتف: يصبح عمودياً وناعماً جداً */
    /* الشريط السفلي على الهواتف: نحيف جداً (Slim) وبحجم بادج الأمان */
    .app-universal-footer {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        padding: 4px 12px !important;
        gap: 8px !important;
        min-height: 26px !important;
        justify-content: space-between !important;
        border-radius: 0 !important;
    }

    .footer-links {
        flex-direction: row !important;
        gap: 6px !important;
        flex: 1;
        justify-content: center;
    }

    .footer-links .sep {
        display: inline !important;
        font-size: 9px !important;
        opacity: 0.5;
    }

    .footer-links a {
        font-size: 9px !important;
        font-weight: 600 !important;
    }

    .version-tag {
        font-size: 9px !important;
        display: none !important; /* إخفاء النص الطويل في الشاشات الصغيرة جداً لضمان النحافة */
    }

    .security-indicator {
        font-size: 9px !important;
        padding: 2px 8px !important;
        gap: 3px !important;
        border: none !important;
        background: transparent !important;
        color: var(--emerald-dark) !important;
    }

    .security-icon {
        width: 10px !important;
        height: 10px !important;
    }

    .security-icon {
        width: 11px !important;
        height: 11px !important;
    }


}

/* ==================== الشريط السفلي الحديث (Site Footer Modern) ==================== */
/* جعله بحجم صغير جداً يشبه أيقونة تواصل معنا ولا يحجب الرؤية وبجميع الأقسام واضحة بنفس الحجم */
.site-footer-modern {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    padding: 6px 16px !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    height: auto !important;
    min-height: 38px !important;
    border-top: 1px solid var(--border-soft) !important;
    border-radius: 0 0 16px 16px !important;
    gap: 15px !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03) !important;
}

.site-footer-modern .footer-right-side,
.site-footer-modern .footer-center-side,
.site-footer-modern .footer-left-side {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-footer-modern span,
.site-footer-modern a {
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    color: var(--text-slate) !important;
    text-decoration: none !important;
}

.site-footer-modern .btn-footer-support {
    padding: 0 !important;
    font-size: 11px !important;
    background: none !important;
    color: var(--emerald-dark) !important;
    font-weight: 800 !important;
    border-radius: 0 !important;
    text-decoration: underline !important;
}

.site-footer-modern .footer-separator {
    font-size: 11px !important;
    opacity: 0.5 !important;
}

.site-footer-modern .security-indicator {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 11px !important;
    color: var(--emerald-dark) !important;
}

.modal-body {
    padding-bottom: 55px !important; /* لضمان عدم تغطية الشريط السفلي للمحتوى */
}

@media (max-width: 768px) {
    .site-footer-modern {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        gap: 6px !important;
        height: auto !important;
    }
    
    .site-footer-modern .footer-center-side {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px 10px !important;
        width: 100% !important;
    }
    
    .site-footer-modern .footer-right-side,
    .site-footer-modern .footer-left-side {
        justify-content: center !important;
        width: 100% !important;
        gap: 4px !important;
    }

    .site-footer-modern span,
    .site-footer-modern a {
        font-size: 10px !important; /* حجم صغير جداً وواضح على الجوال */
    }

    .site-footer-modern .btn-footer-support {
        font-size: 10px !important;
    }

    /* المعاينة الحية لورقة الاختبار على الجوال: جعلها بحجم متناسق وصغير وتلائم الشاشة بالكامل */
    .preview-wrapper-scroll {
        padding: 10px !important;
        background-color: #f1f5f9 !important;
        border-radius: 12px !important;
        max-height: 500px !important;
    }

    .question-sheet-view.official-doc-sheet {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 12px 10px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
        border-radius: 8px !important;
    }

    .question-sheet-view .doc-border-inner {
        padding: 8px !important;
        border-width: 1.5px !important;
    }

    .question-sheet-view .doc-border-inner::before {
        top: -4px !important;
        left: -4px !important;
        right: -4px !important;
        bottom: -4px !important;
        border-width: 1px !important;
    }

    .question-sheet-view .qdoc-header {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .question-sheet-view .qh-right,
    .question-sheet-view .qh-left,
    .question-sheet-view .qh-center {
        text-align: center !important;
        font-size: 11px !important;
    }

    .question-sheet-view .qh-center h4 {
        font-size: 13px !important;
    }

    .question-sheet-view .qh-center p {
        font-size: 11px !important;
    }

    .question-sheet-view .daftarna-book-light-icon {
        width: 28px !important;
        height: 28px !important;
        margin-bottom: 2px !important;
    }

    .question-sheet-view h4.basmala {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }

    .question-sheet-view .qdoc-questions-list {
        font-size: 12px !important;
        line-height: 1.6 !important;
    }

    .question-sheet-view .q-main-title {
        font-size: 12px !important;
    }

    .question-sheet-view .q-sub-list {
        padding-right: 15px !important;
    }

    /* تصغير لوحة صياغة الأسئلة وفروعها لتناسب شاشات الجوال */
    .questions-list-manager-box {
        padding: 12px !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }

    .q-manager-header {
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
    }

    .q-manager-header h4 {
        font-size: 15px !important;
        padding-right: 8px !important;
        border-right-width: 3px !important;
    }

    .q-manager-header .btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    .questions-inputs-wrapper-scroll {
        max-height: 350px !important;
    }

    .q-editor-card {
        padding: 10px !important;
        border-radius: 10px !important;
        margin-bottom: 12px !important;
    }

    .q-card-header {
        margin-bottom: 10px !important;
    }

    .q-card-header h5 {
        font-size: 14px !important;
    }

    .btn-remove-q {
        font-size: 12px !important;
    }

    .q-editor-card .form-group label {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    .q-editor-card input,
    .q-editor-card select,
    .q-editor-card textarea {
        padding: 8px 10px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    .q-subs-manager {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }

    .q-subs-manager h6 {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }

    .sub-q-input-row {
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    .sub-q-input-row input {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    .q-subs-manager .btn-add-sub-q {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    /* إخفاء مؤشرات التفاصيل الافتراضية لترويسة الاختبار */
    .exam-header-fields-box summary::-webkit-details-marker {
        display: none !important;
    }
    .exam-header-fields-box summary {
        list-style: none !important;
        outline: none !important;
    }
    .exam-header-fields-box {
        padding: 12px !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }
    .exam-header-fields-box h4 {
        font-size: 14px !important;
        border-right-width: 3px !important;
        padding-right: 8px !important;
    }
    .exam-header-fields-box .fields-row-grid {
        gap: 10px !important;
        margin-top: 12px !important;
    }

    /* إخفاء مؤشرات التفاصيل الافتراضية للوحة صياغة الأسئلة */
    .questions-list-manager-box summary::-webkit-details-marker {
        display: none !important;
    }
    .questions-list-manager-box summary {
        list-style: none !important;
        outline: none !important;
    }

    /* ==================== المساعد الصوتي والإملاء على الجوال ==================== */
    #voiceModal .modal-header h2 {
        font-size: 12px !important;
    }
    
    #voiceModal .modal-header .title-icon {
        width: 14px !important;
        height: 14px !important;
    }

    #voiceModal .voice-layout-grid {
        gap: 15px !important;
    }

    #voiceModal .voice-controls {
        padding: 12px !important;
        border-radius: 12px !important;
        gap: 10px !important;
    }

    #voiceModal .voice-controls h3 {
        font-size: 13px !important;
    }

    #voiceModal .voice-help-desc {
        font-size: 11px !important;
        line-height: 1.5 !important;
    }

    #voiceModal .big-mic-button-wrapper {
        margin: 12px 0 !important;
        gap: 8px !important;
    }

    #voiceModal .big-mic-btn {
        width: 90px !important;
        height: 90px !important;
        box-shadow: 0 6px 15px rgba(225, 29, 72, 0.25) !important;
    }

    #voiceModal .mic-big-icon {
        width: 36px !important;
        height: 36px !important;
    }

    #voiceModal .mic-status-label {
        font-size: 13px !important;
    }

    #voiceModal .recording-tip {
        padding: 8px 12px !important;
        border-radius: 10px !important;
        gap: 8px !important;
    }

    #voiceModal .tip-icon {
        width: 15px !important;
        height: 15px !important;
    }

    #voiceModal .recording-tip p {
        font-size: 11px !important;
        line-height: 1.4 !important;
    }

    /* الدفتر المدرسي المسطر على الجوال */
    #voiceModal .notebook-header {
        padding: 8px 15px !important;
        border-radius: 12px 12px 0 0 !important;
        gap: 10px !important;
    }

    #voiceModal .notebook-header h4 {
        font-size: 13px !important;
    }

    #voiceModal .notebook-sheet {
        height: 250px !important; /* ارتفاع مدمج ومريح جداً على الهواتف */
        padding: 12px !important;
        border-radius: 0 0 12px 12px !important;
    }

    #voiceModal .notebook-sheet textarea {
        background-size: 100% 24px !important;
        line-height: 24px !important;
        font-size: 14px !important;
    }

    #voiceModal .notebook-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    #voiceModal .notebook-actions .btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
        height: auto !important;
    }

    #voiceModal .notebook-actions .btn i,
    #voiceModal .notebook-actions .btn svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* إخفاء مؤشرات تفاصيل القوائم المطوية عالمياً لضمان الجمالية */
.exam-header-fields-box summary::-webkit-details-marker,
.questions-list-manager-box summary::-webkit-details-marker {
    display: none !important;
}
.exam-header-fields-box summary,
.questions-list-manager-box summary {
    list-style: none !important;
    outline: none !important;
}



