/**
 * طبقة بصرية — تُحمَّل بعد style.css و theme-presets.css
 * الخطوط تُحمَّل من base.html (IBM Plex Sans Arabic + Almarai)
 */
:root {
    --lux-ink: #1a1512;
    --lux-ink-soft: #2d2620;
    --lux-parchment: #f7f0e4;
    --lux-parchment-deep: #ebe2d3;
    --lux-gold: #b8860b;
    --lux-gold-light: #d4af37;
    --lux-gold-dim: rgba(184, 134, 11, 0.35);
    --lux-sidebar-deep: #14110e;
    --lux-sidebar-border: rgba(212, 175, 55, 0.22);
    --lux-shadow-soft: 0 24px 48px rgba(26, 21, 18, 0.12);
    --lux-radius-frame: 20px;
    --lux-page-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Almarai', 'Tajawal', sans-serif;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, var(--topbar-tint, rgba(13, 148, 136, 0.06)), transparent 55%),
        linear-gradient(165deg, var(--lux-parchment, #f8fafc) 0%, var(--lux-parchment-deep, #f1f5f9) 50%, var(--bg-main, #f1f5f9) 100%);
    color: var(--lux-ink, #0f172a);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sidebar {
    background: linear-gradient(180deg, var(--lux-sidebar-deep) 0%, #1c1714 48%, var(--lux-sidebar-deep) 100%);
    box-shadow:
        -8px 0 32px rgba(0, 0, 0, 0.35),
        inset -1px 0 0 var(--lux-sidebar-border);
    border-left: 1px solid var(--lux-sidebar-border);
}

.sidebar-header {
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 12px 8px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
}

.sidebar-menu a {
    border-radius: 10px;
    transition: transform 0.35s var(--lux-page-ease), background 0.3s ease, box-shadow 0.35s ease, color 0.25s ease;
}

.sidebar-menu a:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-menu a.active::before {
    background: var(--primary, #0d9488);
    width: 3px;
    height: 70%;
    box-shadow: none;
}

.main-content {
    position: relative;
    z-index: 1;
    animation: luxMainIn 0.42s var(--lux-page-ease) both;
}

@keyframes luxMainIn {
    from {
        opacity: 0.92;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar {
    background: linear-gradient(180deg, #ffffff 0%, var(--bg-main, #f1f5f9) 100%);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.topbar h4 {
    font-family: 'IBM Plex Sans Arabic', 'Almarai', sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--lux-ink, #0f172a);
}

.topbar-breadcrumb span {
    font-weight: 500;
    color: var(--text-muted, #64748b);
}

.page-content {
    position: relative;
    padding: 28px 32px 40px;
    animation: luxPageReveal 0.4s ease-out 0.04s both;
}

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

@media (max-width: 576px) {
    .page-content {
        padding: 18px 14px 28px;
    }
    .page-content::before {
        inset: 6px 4px 4px !important;
        border-radius: 14px !important;
    }
}

.page-content::before {
    content: '';
    position: absolute;
    inset: 10px 6px 6px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.page-content > * {
    position: relative;
    z-index: 1;
}

.stat-card,
.content-card {
    border-radius: 16px;
    border: 1px solid rgba(184, 134, 11, 0.12);
    box-shadow: var(--lux-shadow-soft);
    transition: transform 0.45s var(--lux-page-ease), box-shadow 0.45s ease;
}

.stat-card:hover,
.content-card:hover {
    box-shadow: 0 28px 56px rgba(26, 21, 18, 0.14);
}

.stat-card {
    animation: luxCardRise 0.45s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-card:nth-child(5) { animation-delay: 0.15s; }
.stat-card:nth-child(6) { animation-delay: 0.18s; }

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

.data-table thead th {
    background: linear-gradient(180deg, var(--primary-bg, #f0fdfa), var(--bg-main, #f1f5f9));
    border-bottom: 2px solid var(--primary-lighter, #e2e8f0);
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, var(--primary, #0d9488) 50%, #115e59 100%);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
    transform: translateY(-1px);
}

.btn-logout {
    border-color: rgba(185, 28, 28, 0.45);
}

.alert {
    border-radius: 12px;
    border: 1px solid rgba(184, 134, 11, 0.15);
    animation: luxAlertIn 0.5s var(--lux-page-ease) both;
}

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

/* صفحات الدخول — تفاصيل الحقول في auth-modern.css */
.lux-auth-body {
    font-family: 'IBM Plex Sans Arabic', 'Almarai', sans-serif;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(255, 255, 255, 0.08), transparent 50%),
        linear-gradient(165deg, var(--lux-sidebar-deep, #0f172a) 0%, #1e293b 45%, #0f172a 100%);
    position: relative;
}

.lux-auth-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 80% 20%, var(--topbar-tint, rgba(13, 148, 136, 0.12)), transparent 55%);
    pointer-events: none;
    opacity: 0.9;
}

.lux-auth-card {
    position: relative;
    z-index: 2;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.lux-auth-card h2 {
    font-family: 'IBM Plex Sans Arabic', 'Almarai', sans-serif;
    font-weight: 700;
    color: var(--lux-ink, #0f172a);
}

.lux-auth-ornament {
    margin-right: auto;
    margin-left: auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #0d9488), var(--primary-dark, #0f766e));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
