:root {
    --primary: #2f6f4e;
    --primary-dark: #1f4d36;
    --primary-light: #e8f3ee;
    --primary-lighter: #f2f8f5;
    --accent: #d9a441;
    --text: #1e2a24;
    --muted: #64766e;
    --border: #e2e8e4;
    --bg: #f5f8f6;
    --white: #ffffff;
    --error: #b3261e;
    --error-bg: #fbeceb;
    --success: #1f7a4d;
    --success-bg: #e6f4ec;
    --info-bg: #eaf1fb;
    --info: #1a4d8f;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(20, 40, 30, 0.06), 0 1px 2px rgba(20, 40, 30, 0.04);
    --shadow-md: 0 8px 24px rgba(20, 50, 35, 0.08), 0 2px 6px rgba(20, 50, 35, 0.05);
    --shadow-lg: 0 20px 50px rgba(20, 50, 35, 0.14), 0 6px 16px rgba(20, 50, 35, 0.08);
    --gradient-brand: linear-gradient(135deg, #2f6f4e 0%, #1f4d36 100%);
    --gradient-hero: radial-gradient(circle at 15% 20%, rgba(217, 164, 65, 0.16), transparent 45%),
                      radial-gradient(circle at 85% 15%, rgba(47, 111, 78, 0.16), transparent 40%),
                      linear-gradient(180deg, #eef6f1 0%, #f5f8f6 60%);
}

* { box-sizing: border-box; }

/* راحة الاستخدام العامة */
html { scroll-behavior: smooth; }

::selection { background: var(--primary); color: var(--white); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #b7c4bd; }

::placeholder { color: #9aa8a2; opacity: 1; }

a:focus-visible, button:focus-visible, .btn:focus-visible, .btn-outline:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

button, .btn, .btn-outline, .btn-link {
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background-color .15s ease, color .15s ease;
}
.btn:active, .btn-outline:active { transform: scale(.97); }
.btn-link:active { transform: scale(.96); }

.feature-card, .dash-card { transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s cubic-bezier(.4,0,.2,1), border-color .22s ease; }
.feature-card .feature-icon, .dash-card .feature-icon { transition: transform .28s cubic-bezier(.4,0,.2,1); }
.feature-card:hover .feature-icon, .dash-card:hover .feature-icon { transform: scale(1.1) rotate(-4deg); }

.badge { transition: transform .15s ease; }

.auth-form input, .auth-form select, .auth-form textarea { transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease; }

/* انتقالات سلسة بين الصفحات (بدون أي تأخير مصطنع) — تعتمد على قدرة المتصفح
   الأصلية (View Transitions)، تعمل تلقائيًا بمتصفحات Chrome/Edge الحديثة
   وتتجاهَل بأمان بالمتصفحات الأخرى (تنتقل بشكل عادي فوري بدون أي مشكلة) */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
    ::view-transition-old(root) {
        animation: baheth-fade-out .22s cubic-bezier(.4,0,.2,1) both;
    }
    ::view-transition-new(root) {
        animation: baheth-fade-in .28s cubic-bezier(.4,0,.2,1) both;
    }
    @keyframes baheth-fade-out {
        to { opacity: 0; transform: translateY(-8px); }
    }
    @keyframes baheth-fade-in {
        from { opacity: 0; transform: translateY(8px); }
    }
}

body {
    margin: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Topbar */
.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--primary-dark);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: var(--white);
    font-weight: 900;
    box-shadow: var(--shadow-sm);
}
.brand-logo {
    height: 46px;
    width: auto;
    display: block;
}
.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
    position: relative;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color .18s ease;
}
.main-nav a::after {
    content: '';
    position: absolute;
    right: 14px;
    left: 14px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
    transform: scaleX(0);
    opacity: 0;
    transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.main-nav a:hover { color: var(--primary-dark); text-decoration: none; }
.main-nav a:hover::after { transform: scaleX(1); opacity: 1; }
.main-nav a.active::after { transform: scaleX(1); opacity: 1; }
.main-nav a.nav-logout { color: var(--white); background: var(--gradient-brand); box-shadow: var(--shadow-sm); }
.main-nav a.nav-logout::after { display: none; }
.main-nav a.nav-logout:hover { filter: brightness(1.08); color: var(--white); }

/* Hero */
.hero {
    text-align: center;
    padding: 90px 20px 70px;
    background: var(--gradient-hero);
    border-radius: 0 0 40px 40px;
    margin-bottom: 10px;
}
.hero-logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.hero-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -36px;
    background: radial-gradient(circle, rgba(47, 111, 78, 0.32) 0%, rgba(217, 164, 65, 0.2) 55%, transparent 75%);
    filter: blur(28px);
    z-index: 0;
    border-radius: 50%;
}
.hero-logo {
    position: relative;
    z-index: 1;
    height: 108px;
    width: auto;
    background: var(--white);
    padding: 16px;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}
.hero-eyebrow {
    display: inline-block;
    background: var(--white);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.hero h1 {
    font-size: clamp(2.1rem, 4vw, 3rem);
    margin: 0 0 16px;
    color: var(--primary-dark);
    font-weight: 900;
    line-height: 1.3;
}
.hero-sub { color: var(--muted); max-width: 620px; margin: 0 auto 32px; font-size: 1.15rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    background: var(--gradient-brand);
    color: var(--white);
    border: none;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.05); text-decoration: none; color: var(--white); }
.btn:active { transform: translateY(0); }
.btn-outline { background: var(--white); border: 2px solid var(--primary); color: var(--primary); padding: 11px 24px; box-shadow: none; }
.btn-outline:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-block { display: block; text-align: center; margin-bottom: 16px; }
.btn-link {
    display: inline-block;
    background: var(--primary-lighter);
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.btn-link:hover { background: var(--primary-light); text-decoration: none; }

/* Features */
.features { padding: 40px 0 70px; }
.features h2 { text-align: center; margin-bottom: 8px; color: var(--primary-dark); font-size: 1.7rem; }
.features-sub { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 500px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }

.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.type-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    color: var(--text);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.type-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; }
.type-card h3 { margin: 0 0 8px; color: var(--primary-dark); font-size: 1.05rem; }
.type-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-light);
    font-size: 1.7rem;
    margin-bottom: 14px;
}
.feature-card h3 { margin: 8px 0; color: var(--primary-dark); font-size: 1.1rem; }
.feature-card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.features-note { text-align: center; color: var(--muted); margin-top: 34px; font-size: 0.9rem; background: var(--primary-lighter); display: inline-block; padding: 10px 20px; border-radius: 999px; }
.features-note-wrap { text-align: center; }

/* Page */
.page { padding: 36px 20px 60px; }
.page-title { color: var(--primary-dark); margin-bottom: 22px; font-size: 1.6rem; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert ul { margin: 0; padding-inline-start: 20px; }

/* Auth forms */
.auth-box {
    max-width: 430px;
    margin: 30px auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow-md);
}
.auth-box-wide { max-width: 580px; }
.auth-form label { display: block; margin-bottom: 16px; font-weight: 700; color: var(--text); font-size: 0.92rem; }
.auth-form input, .auth-form select, .auth-form textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--text);
    font-weight: 400;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.auth-form textarea { resize: vertical; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); }
.hidden { display: none !important; }
.other-field { animation: baheth-field-in .18s ease; }
@keyframes baheth-field-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Panels */
.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.panel h2 { margin-top: 0; color: var(--primary-dark); font-size: 1.2rem; }
.hint { color: var(--muted); font-size: 0.92rem; }

/* Dashboard */
.usage-banner {
    background: var(--gradient-brand);
    color: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 26px;
    box-shadow: var(--shadow-md);
}
.usage-banner strong { color: var(--white); }
.usage-banner a { color: var(--white); text-decoration: underline; }
.usage-warning { color: #ffe1b8; font-weight: 700; margin-inline-start: 8px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.dash-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dash-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dash-card h3 { font-size: 1.9rem; color: var(--primary-dark); margin: 6px 0; font-weight: 800; }
.dash-card p { color: var(--muted); margin: 0; font-size: 0.92rem; }
.dash-card-static:hover { border-color: var(--border); transform: none; box-shadow: var(--shadow-sm); }

/* Payment methods */
.payment-methods { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.payment-method-card {
    background: var(--primary-lighter);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    min-width: 200px;
}
.payment-method-number { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); margin: 8px 0 0; letter-spacing: .5px; direction: ltr; text-align: right; }

.plan-price-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    background: var(--gradient-brand);
    border-radius: var(--radius);
    padding: 28px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}
.plan-price-card-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: .3px;
}
.plan-price-card-value {
    color: var(--white);
    font-weight: 900;
    font-size: 1.9rem;
    line-height: 1.3;
}

/* Sources / references */
.source-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 14px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
.source-card h3 { margin: 8px 0; font-size: 1.05rem; color: var(--primary-dark); }
.citation-text { line-height: 1.8; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.data-table th, .data-table td { text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--primary-lighter); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.inline-form { display: contents; }

.btn-xs { padding: 6px 15px; font-size: 0.82rem; border-radius: 999px; box-shadow: none; }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #96201a; filter: none; }
.btn-danger-outline { background: var(--white); border: 1.5px solid var(--error); color: var(--error); padding: 5px 14px; }
.btn-danger-outline:hover { background: var(--error-bg); color: var(--error); }

/* قائمة إجراءات منسدلة (⋮) لصفوف الجداول ذات الإجراءات الثانوية المتعددة */
.row-menu { position: relative; display: inline-flex; }
.row-menu-toggle {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--muted);
    font-size: 1.15rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.row-menu-toggle:hover, .row-menu.open .row-menu-toggle {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
}
.row-menu-dropdown {
    position: fixed;
    min-width: 195px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.row-menu.open .row-menu-dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.row-menu-dropdown form { margin: 0; }
.row-menu-dropdown button, .row-menu-dropdown a {
    display: block;
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-sizing: border-box;
}
.row-menu-dropdown button:hover, .row-menu-dropdown a:hover { background: var(--primary-lighter); color: var(--primary-dark); text-decoration: none; }
.row-menu-dropdown button.danger { color: var(--error); }
.row-menu-dropdown button.danger:hover { background: var(--error-bg); }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* AI output */
.ai-output { white-space: pre-wrap; line-height: 1.9; }

/* منشئ التقارير والأوراق البحثية */
.report-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.report-toolbar h2 { margin: 0; }
.report-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.generate-progress { margin-top: 12px; font-size: 0.9rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

.report-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.report-sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.report-section-list { list-style: none; margin: 0; padding: 0; }
.report-section-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
}
.report-section-list li a:hover, .report-section-list li a.active { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.report-status-icon { display: inline-flex; width: 20px; justify-content: center; color: var(--muted); font-weight: 700; }
.report-status-icon.status-generated, .report-status-icon.status-edited { color: var(--success); }
.report-status-icon.status-failed { color: var(--error); }
.report-status-icon.status-generating { color: var(--info); }

.report-editor-main {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.report-editor-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.report-editor-header h3 { margin: 0; color: var(--primary-dark); }

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--primary-lighter);
}
.editor-toolbar button {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
}
.editor-toolbar button:hover { background: var(--primary-light); }
.editor-toolbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.editor-toolbar select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font: inherit; font-size: 0.9rem; background: var(--white); }

.section-editor {
    min-height: 420px;
    padding: 20px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    line-height: 1.9;
    font-size: 1.02rem;
    outline: none;
}
.section-editor:focus { box-shadow: inset 0 0 0 2px var(--primary-light); }
.section-editor p { margin: 0 0 14px; }
.section-editor ul, .section-editor ol { margin: 0 0 14px; padding-inline-start: 28px; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.chat-sidebar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.conversation-list { list-style: none; margin: 0; padding: 0; }
.conversation-list li a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-list li a:hover, .conversation-list li a.active { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.conversation-list li.empty { color: var(--muted); padding: 8px 10px; font-size: 0.9rem; }

.chat-main {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 65vh;
    min-height: 420px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.chat-main-embedded { height: 40vh; min-height: 300px; border: none; box-shadow: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { color: var(--muted); text-align: center; margin-top: 40px; }
.chat-msg { max-width: 80%; padding: 12px 18px; border-radius: 16px; white-space: pre-wrap; line-height: 1.7; box-shadow: var(--shadow-sm); }
.chat-msg-user { align-self: flex-end; background: var(--gradient-brand); color: var(--white); border-bottom-left-radius: 4px; }
.chat-msg-assistant { align-self: flex-start; background: var(--primary-lighter); color: var(--text); border-bottom-right-radius: 4px; box-shadow: none; border: 1px solid var(--border); }
.chat-form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--border); background: var(--white); }
.chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 48px;
    max-height: 140px;
    padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color .15s ease;
}
.chat-form textarea:focus { outline: none; border-color: var(--primary); }

/* Install page */
.install-page { max-width: 640px; margin: 40px auto; }
.install-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow-lg);
}
.install-form h2 { font-size: 1.05rem; margin: 26px 0 12px; color: var(--primary-dark); padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.install-form h2:first-of-type { margin-top: 12px; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 28px 0;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 50px;
    font-size: 0.88rem;
}

/* ===== المكتبات: القرآن الكريم + الكتب الإسلامية ===== */

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

/* بانر علوي مزخرف لصفحات المكتبات */
.lib-hero {
    position: relative;
    overflow: hidden;
    background: var(--gradient-hero);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    margin-bottom: 24px;
}
.lib-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(217, 164, 65, 0.22) 0%, transparent 70%);
    opacity: .8;
    pointer-events: none;
}
.lib-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: var(--white);
    font-size: 1.6rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
}
.lib-hero h1, .lib-hero h2 {
    margin: 0 0 6px;
    color: var(--primary-dark);
    position: relative;
}
.lib-hero p {
    margin: 0;
    color: var(--muted);
    position: relative;
    max-width: 560px;
    margin-inline: auto;
}
.lib-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 14px;
    position: relative;
}
.lib-breadcrumb a { font-weight: 700; }

/* بطاقات مكتبة الهب */
.lib-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.lib-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
    overflow: hidden;
}
.lib-card::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 5px;
    background: var(--gradient-brand);
}
.lib-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    text-decoration: none;
}
.lib-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary-light);
    font-size: 1.6rem;
    margin-bottom: 4px;
}
.lib-card h3 { margin: 0; color: var(--primary-dark); font-size: 1.15rem; }
.lib-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.lib-card-arrow { margin-top: auto; color: var(--primary); font-weight: 700; font-size: 0.9rem; }

/* شبكة سور القرآن */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.surah-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.surah-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    text-decoration: none;
}
.surah-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #b9812b 100%);
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
}
.surah-info { min-width: 0; }
.surah-name-ar { display: block; font-weight: 700; color: var(--primary-dark); font-size: 1.08rem; }
.surah-name-en { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 4px; }
.surah-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.surah-pill {
    font-size: 0.72rem;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 700;
}
.surah-pill.medinan { background: var(--info-bg); color: var(--info); }

/* قارئ القرآن */
.quran-select-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.quran-select-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
}
.quran-select-bar select {
    min-width: 260px;
}
.quran-reader {
    background: linear-gradient(180deg, #fffdf8 0%, #fff 100%);
    border: 1px solid #ecdfc4;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px 36px;
    position: relative;
}
.quran-reader::before {
    content: '۞';
    position: absolute;
    top: 12px;
    inset-inline: 0;
    text-align: center;
    color: var(--accent);
    font-size: 1.4rem;
    opacity: .6;
}
.quran-bismillah {
    text-align: center;
    font-family: 'Amiri Quran', 'Amiri', 'Cairo', serif;
    font-size: 1.7rem;
    color: var(--primary-dark);
    margin: 22px 0 30px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #ecdfc4;
}
.quran-ayat {
    font-family: 'Amiri Quran', 'Amiri', 'Cairo', 'Segoe UI', Tahoma, serif;
    line-height: 2.6;
}
.quran-ayah-block { margin-bottom: 26px; }
.quran-ayah {
    margin: 0;
    font-size: 1.65rem;
    text-align: justify;
    color: #241f14;
}
.quran-ayah-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    margin: 0 6px;
    vertical-align: middle;
}
.quran-ayah-translation {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--primary-lighter);
    border-inline-start: 3px solid var(--accent);
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}
.quran-ayah-block { scroll-margin-top: 90px; border-radius: var(--radius-sm); transition: background-color .6s ease; }
.quran-ayah-block.quran-ayah-highlight { background-color: rgba(217, 164, 65, 0.18); animation: quran-flash 2.2s ease; }
@keyframes quran-flash {
    0%, 100% { background-color: rgba(217, 164, 65, 0.18); }
    50% { background-color: rgba(217, 164, 65, 0.4); }
}
.surah-pill.place { background: var(--primary-light); }

/* خانة بحث موحّدة لصفحات المكتبات */
.lib-search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.02rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lib-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* شبكة الكتب الإسلامية */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.book-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
    overflow: hidden;
}
.book-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--gradient-brand);
}
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.book-card-title { display: flex; align-items: flex-start; gap: 10px; }
.book-card-title .icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary-light);
    font-size: 1.05rem;
}
.book-card h3 { margin: 0; color: var(--primary-dark); font-size: 1.02rem; line-height: 1.4; }
.book-card-author { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.book-card-desc {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card-downloads {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
    .topbar-inner { padding: 8px 14px; }
    .brand { font-size: 1.05rem; gap: 6px; }
    .brand-mark { width: 30px; height: 30px; font-size: 0.9rem; }
    .brand-logo { height: 34px; }
    .main-nav { width: 100%; justify-content: center; gap: 4px; padding-top: 6px; }
    .main-nav a { font-size: 0.78rem; padding: 5px 9px; }
    .topbar { position: static; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-sidebar { order: 2; }
    .hero { padding: 60px 20px 44px; border-radius: 0 0 28px 28px; }
}

/* ============================================================
   تخطيط الشريط الجانبي (كل صفحات المستخدم المسجّل عدا الرئيسية)
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 252px;
    flex-shrink: 0;
    background: var(--white);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 14px;
    gap: 6px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0 20px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-logo { width: 74px; height: auto; }
.sidebar-brand-name {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: .5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link:hover {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    text-decoration: none;
}
.sidebar-link.is-active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 800;
}
.sidebar-icon {
    width: 22px;
    text-align: center;
    font-size: 1.02rem;
    flex-shrink: 0;
}
.sidebar-label { white-space: nowrap; }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-link-upgrade {
    background: var(--gradient-brand);
    color: var(--white);
    font-weight: 800;
}
/* لازم نعيد تثبيت الخلفية هنا: قاعدة .sidebar-link:hover العامة تجعلها فاتحة،
   فيصير النص الأبيض غير مرئي على خلفية فاتحة */
.sidebar-link-upgrade:hover {
    background: var(--gradient-brand);
    color: var(--white);
    filter: brightness(1.1);
}
.sidebar-link-upgrade.is-active { background: var(--gradient-brand); color: var(--white); }
.sidebar-link-logout:hover { background: var(--error-bg); color: var(--error); }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* الشريط العلوي داخل التخطيط: يحمل عنوان الصفحة وزر الاشتراك بكل الصفحات،
   وبالجوال يحمل أيضًا زر فتح القائمة الجانبية */
.app-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}
.app-topbar-title { flex: 1; }

/* زر اشتراك هادئ: حدود ملوّنة بدل تعبئة صارخة حتى لا يزاحم محتوى الصفحة،
   ويمتلئ بالتدرّج عند التمرير فقط */
.topbar-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--white);
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.topbar-upgrade:hover {
    background: var(--gradient-brand);
    color: var(--white);
    text-decoration: none;
}
.topbar-upgrade-icon { font-size: 0.95rem; }
/* زر القائمة للجوال فقط — بالحاسبة الشريط الجانبي ظاهر دائمًا فلا داعي له */
.sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
}
.app-topbar-title { font-weight: 800; color: var(--primary-dark); }

.page-in-shell {
    flex: 1;
    padding: 26px 30px 40px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}
.site-footer-in-shell {
    padding: 18px 30px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    border-top: 1px solid var(--border);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 25, 0.45);
    z-index: 45;
}

@media (max-width: 900px) {
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .app-topbar { padding: 10px 14px; }
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 50;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop.is-visible { display: block; }
    .page-in-shell { padding: 18px 16px 32px; }
    .site-footer-in-shell { padding: 16px; }
}

/* حقل البحث والاختيار (combobox) — بديل نمط القائمة المنسدلة + حقل "غير موجود" */
.combo-field { position: relative; }
.combo-input { width: 100%; }
.combo-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 60;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    margin-top: 4px;
}
.combo-menu.is-open { display: block; }
.combo-item {
    display: block;
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 0.93rem;
    color: var(--text);
    cursor: pointer;
}
.combo-item:hover, .combo-item.is-active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}
.combo-item-add {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 11px;
    color: var(--primary-dark);
    font-weight: 700;
}
.combo-add-tag { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

/* نداء الاشتراك عند نفاد الرصيد — بديل رسالة الخطأ المسدودة */
.limit-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--primary-lighter);
    border: 1.5px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.limit-cta-icon { font-size: 1.7rem; }
.limit-cta-body { flex: 1; min-width: 200px; }
.limit-cta-body strong { display: block; color: var(--primary-dark); font-size: 1.05rem; margin-bottom: 3px; }
.limit-cta-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.btn-upgrade {
    background: var(--gradient-brand);
    color: var(--white);
    font-weight: 800;
    box-shadow: var(--shadow-md);
}
.btn-upgrade:hover { filter: brightness(1.08); color: var(--white); }
.btn-lg { padding: 14px 38px; font-size: 1.06rem; }

.usage-warning-link {
    display: inline-block;
    background: var(--accent);
    color: #3a2a06;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 999px;
    text-decoration: none;
}
.usage-warning-link:hover { filter: brightness(1.06); text-decoration: none; }

/* صفحة الترقية */
.upgrade-hero {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 34px 30px;
    margin-bottom: 22px;
    text-align: center;
}
.upgrade-hero-badge {
    display: inline-block;
    background: var(--gradient-brand);
    color: var(--white);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 5px 16px;
    border-radius: 999px;
    letter-spacing: .4px;
}
.upgrade-hero h2 { margin: 14px 0 8px; font-size: 1.6rem; color: var(--text); }
.upgrade-hero-sub { color: var(--muted); margin: 0 auto 22px; max-width: 560px; }

.upgrade-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 22px;
}
.upgrade-price-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1.05;
}
.upgrade-price-unit { color: var(--muted); font-size: 0.95rem; font-weight: 600; }

.upgrade-benefits {
    list-style: none;
    padding: 0;
    margin: 0 auto 26px;
    max-width: 460px;
    text-align: right;
    display: grid;
    gap: 10px;
}
.upgrade-benefits li {
    position: relative;
    padding: 10px 38px 10px 14px;
    background: var(--primary-lighter);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
}
.upgrade-benefits li::before {
    content: '✓';
    position: absolute;
    right: 13px;
    color: var(--primary);
    font-weight: 900;
}
.upgrade-trust { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }
.pay-phone-label { max-width: 340px; margin: 0 auto 16px; text-align: right; display: block; }

.plan-active-panel { text-align: center; }
.plan-active-panel h2 { margin: 12px 0 8px; }

/* قسم الأسعار بالصفحة الرئيسية */
.pricing { padding: 60px 0 70px; }
.section-title { text-align: center; font-size: 1.9rem; margin-bottom: 6px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 36px; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    max-width: 820px;
    margin: 0 auto;
    align-items: start;
}
.pricing-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.pricing-card h3 { margin: 0 0 10px; font-size: 1.2rem; color: var(--text); }
.pricing-card-featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
.pricing-tag {
    position: absolute;
    top: -13px;
    right: 24px;
    background: var(--accent);
    color: #3a2a06;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 999px;
}
.pricing-amount { display: flex; align-items: baseline; gap: 7px; margin-bottom: 4px; }
.pricing-value { font-size: 2.5rem; font-weight: 900; color: var(--primary); line-height: 1.1; }
.pricing-unit { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.pricing-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; }
.pricing-features li {
    position: relative;
    padding-right: 25px;
    font-size: 0.93rem;
    color: var(--text);
}
.pricing-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--primary);
    font-weight: 900;
}
.btn-block { display: block; width: 100%; text-align: center; }
.pricing-trust { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; }

/* تلميح أسفل حقول النماذج */
.field-hint {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 5px;
}

/* صفحة إكمال البيانات (رقم الهاتف الإلزامي) */
.complete-profile {
    max-width: 520px;
    margin: 30px auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 36px 30px;
    text-align: center;
}
.complete-profile-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.complete-profile h2 { margin: 0 0 10px; font-size: 1.4rem; }
.complete-profile-sub { color: var(--muted); margin: 0 auto 24px; max-width: 420px; line-height: 1.8; }
.complete-profile-form { text-align: right; }
.complete-profile-form .btn { width: 100%; margin-top: 6px; }

/* ===== تواصل معنا ===== */
.footer-contact { padding: 34px 0 26px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.footer-contact-title { text-align: center; margin: 0 0 6px; font-size: 1.35rem; color: var(--primary-dark); }
.footer-contact-sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }
.footer-contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 18px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.contact-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.contact-card-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-lighter);
}
.contact-card-body { display: flex; flex-direction: column; line-height: 1.5; min-width: 0; }
.contact-card-body strong { color: var(--primary-dark); font-size: 0.98rem; }
.contact-card-body span { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; }
.contact-whatsapp:hover  { border-color: #25d366; }
.contact-instagram:hover { border-color: #c13584; }
.contact-facebook:hover  { border-color: #1877f2; }
.footer-copy { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 0; }

/* نسخة مصغّرة داخل صفحات المستخدم المسجّل */
.footer-contact-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 0 14px;
    margin-bottom: 12px;
}
.footer-contact-label { color: var(--muted); font-size: 0.86rem; font-weight: 700; }
.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    background: var(--white);
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
.contact-chip:hover { text-decoration: none; color: var(--primary-dark); }
.contact-chip.contact-whatsapp:hover  { border-color: #25d366; }
.contact-chip.contact-instagram:hover { border-color: #c13584; }
.contact-chip.contact-facebook:hover  { border-color: #1877f2; }

/* عمود رقم الهاتف بجدول المستخدمين */
.phone-cell {
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    text-decoration: none;
}
.phone-cell:hover { color: #1a9c4d; text-decoration: underline; }

/* شريط تقدّم جمع الأرقام */
.phone-progress {
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}
.phone-progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 999px;
    transition: width .4s ease;
}
