/* ============================================================
   نظام تحفيظ القرآن - ثيم إسلامي عصري RTL
   ============================================================ */

:root {
    /* لوحة الألوان: أخضر زمردي + ذهبي */
    --primary: #0d7c66;
    --primary-dark: #095a4a;
    --primary-light: #14a085;
    --gold: #c9a44c;
    --gold-light: #e0bc6f;
    --bg-page: #f5f7f6;
    --bg-card: #ffffff;
    --text-main: #1f2d2a;
    --text-muted: #6b7a76;
    --border: #e3e8e6;
    --sidebar-bg: #0e2a26;
    --sidebar-text: #cfe5df;
    --sidebar-active: #14a085;
    --shadow-sm: 0 2px 8px rgba(13, 124, 102, 0.06);
    --shadow-md: 0 6px 24px rgba(13, 124, 102, 0.10);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Cairo', system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    color: var(--text-main);
    background: var(--bg-page);
    margin: 0;
    line-height: 1.7;
}

.bg-app { background: var(--bg-page); min-height: 100vh; }

/* ===== صفحات المصادقة ===== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d7c66 0%, #14a085 50%, #0e2a26 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

.auth-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(201,164,76,0.12) 0, transparent 40%);
    pointer-events: none;
}

.auth-container { position: relative; width: 100%; max-width: 480px; z-index: 2; }

.auth-card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.4);
}

.auth-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f1faf6 100%);
    border-bottom: 1px solid var(--border);
}

.auth-logo {
    width: 86px; height: 86px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 10px 25px rgba(13,124,102,0.3);
    border: 4px solid #fff;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0.5rem 0 0.75rem;
}

.auth-quran {
    font-family: 'Amiri', serif;
    font-size: 1.05rem;
    color: var(--gold);
    margin: 0;
}

.auth-body-card { padding: 2rem; }

.form-title { font-size: 1.25rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 0.25rem; }
.form-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.auth-footer { padding: 1rem; text-align: center; background: #fafbfa; color: var(--text-muted); font-size: 0.8rem; border-top: 1px solid var(--border); }

/* ===== أزرار ===== */
.btn-primary-islamic {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 6px 18px rgba(13,124,102,0.25);
    transition: all 0.2s ease;
}
.btn-primary-islamic:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(13,124,102,0.35); color: #fff; }

.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(20,160,133,0.15); }

/* ===== لوحة الإدارة ===== */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0a1f1c 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: -2px 0 20px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.brand-title { font-weight: 700; color: #fff; font-size: 1.05rem; }
.brand-subtitle { font-size: 0.75rem; opacity: 0.7; }

.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; overflow-y: auto; }
.nav-section {
    padding: 1rem 0.85rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.93rem;
    margin-bottom: 0.15rem;
    transition: all 0.15s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13,124,102,0.4);
}
.nav-item i { width: 22px; text-align: center; }

.sidebar-footer { padding: 1rem; text-align: center; font-family: 'Amiri', serif; color: var(--gold-light); border-top: 1px solid rgba(255,255,255,0.06); }

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

.app-topbar {
    background: #fff;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 10;
    box-shadow: var(--shadow-sm);
}
.topbar-title { font-weight: 600; color: var(--text-main); font-size: 1.05rem; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.user-menu {
    display: inline-flex; align-items: center; gap: 0.6rem;
    border-radius: 30px;
    padding: 0.35rem 0.85rem;
    background: var(--bg-page);
    border: 1px solid var(--border);
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
.user-name { font-weight: 600; font-size: 0.9rem; }

.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; background: #fff; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ===== البطاقات والجداول ===== */
.card-islamic {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; color: var(--primary-dark); }
.page-header .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fbfa 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}
.stat-card .icon.bg-primary-i { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.stat-card .icon.bg-gold-i    { background: linear-gradient(135deg, var(--gold), var(--gold-light)); }
.stat-card .icon.bg-info-i    { background: linear-gradient(135deg, #2b8aef, #5fa9ff); }
.stat-card .icon.bg-warn-i    { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: var(--text-main); }

.table-islamic { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.table-islamic table { margin: 0; }
.table-islamic thead th {
    background: #f4f8f7;
    color: var(--primary-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    padding: 1rem 0.85rem;
    font-size: 0.88rem;
}
.table-islamic tbody td { padding: 0.9rem 0.85rem; vertical-align: middle; border-bottom: 1px solid #f0f3f2; }
.table-islamic tbody tr:hover { background: #fafcfb; }

.badge-status {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-active    { background: #e6f7f1; color: #0d7c66; }
.badge-pending   { background: #fff3e0; color: #c97a00; }
.badge-suspended { background: #fde8e8; color: #c81e1e; }
.badge-expired   { background: #ececec; color: #5a5a5a; }
.badge-trial     { background: #fef6e0; color: #a17800; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: 0.4; margin-bottom: 1rem; }

.btn-action { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

@media (max-width: 768px) {
    .app-sidebar { position: fixed; right: -260px; transition: right 0.25s ease; z-index: 1050; }
    .app-sidebar.open { right: 0; }
}
