/* ===== منظومة النادر - التصميم العصري الشامل (Modern Glassmorphic UI System) ===== */
@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* لوحة الألوان الرئيسية */
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --brand-indigo: #4f46e5;
    --brand-indigo-light: #6366f1;
    --brand-indigo-glow: rgba(79, 70, 229, 0.25);
    --secondary-color: #d97706;
    --accent-gold: #f59e0b;
    
    /* خلفيات الخامات الشفافة */
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(226, 232, 240, 0.8);
    
    /* الخطوط والنصوص */
    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-muted: #64748b;
    
    /* التدرجات البصرية الفاخرة */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
    --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    --gradient-gold: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-info: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);

    /* الظلال متعددة الطبقات */
    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.1), 0 8px 16px -6px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 25px 50px -12px rgba(79, 70, 229, 0.18), 0 10px 20px -5px rgba(15, 23, 42, 0.08);

    /* الحواف المتناسقة */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
}

* {
    font-family: 'Readex Pro', 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* ===== شريط الملاحة الشفاف الفاخر (Glassmorphic Navbar) ===== */
.navbar {
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 10px 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff !important;
}

.brand-icon-box {
    width: 36px;
    height: 36px;
    background: var(--gradient-brand);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 4px 14px var(--brand-indigo-glow);
}

.navbar .nav-link {
    color: rgba(241, 245, 249, 0.88) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 7px 14px !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar .nav-link:hover, .navbar .nav-link.active, .navbar .show > .nav-link {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

/* Page Tabs & Nav Pills inside Cards (Settings & Roles) */
.nav-pills .nav-link, .nav-tabs .nav-link {
    color: #334155 !important;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: var(--radius-pill);
    padding: 8px 18px !important;
    transition: all 0.2s ease;
    background: transparent;
}

.nav-pills .nav-link:hover, .nav-tabs .nav-link:hover {
    color: var(--brand-indigo) !important;
    background: #e2e8f0;
}

.nav-pills .nav-link.active, .nav-tabs .nav-link.active {
    color: #ffffff !important;
    background: var(--gradient-brand) !important;
    box-shadow: 0 4px 12px var(--brand-indigo-glow);
}

.user-profile-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.user-profile-badge:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    margin-top: 8px !important;
    animation: fadeInDown 0.2s ease-out;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-medium);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--brand-indigo);
    transform: translateX(-3px);
}

.dropdown-divider {
    border-color: #e2e8f0;
    margin: 6px 0;
}

/* ===== البطاقات الكارتية الفاخرة (Cards) ===== */
.card {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    background: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, 0.3);
}

.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid #f1f5f9;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-color);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 24px;
}

/* كروت الإحصائيات (Stat Cards) */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card-primary { background: var(--gradient-primary); }
.stat-card-brand   { background: var(--gradient-brand); }
.stat-card-success { background: var(--gradient-success); }
.stat-card-warning { background: var(--gradient-gold); }
.stat-card-danger  { background: var(--gradient-danger); }
.stat-card-info    { background: var(--gradient-info); }

.stat-card::after {
    content: '';
    position: absolute;
    left: -20px;
    bottom: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.stat-card .stat-icon {
    font-size: 2.8rem;
    opacity: 0.35;
    position: absolute;
    left: 20px;
    top: 20px;
}

.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.92rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ===== الجداول العصرية (Tables) ===== */
.table-responsive {
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: #f8fafc;
    color: var(--text-muted);
    border-bottom: 2px solid #e2e8f0;
    padding: 14px 18px;
}

.table td {
    padding: 14px 18px;
    color: var(--text-dark);
    font-size: 0.92rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* شارات الحالة (Badges) */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.01em;
}

.bg-success { background-color: #dcfce7 !important; color: #15803d !important; }
.bg-warning { background-color: #fef3c7 !important; color: #b45309 !important; }
.bg-danger  { background-color: #fee2e2 !important; color: #b91c1c !important; }
.bg-primary { background-color: #e0e7ff !important; color: #3730a3 !important; }
.bg-info    { background-color: #e0f2fe !important; color: #0369a1 !important; }

/* ===== الأزرار الفاخرة (Buttons) ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 10px 20px;
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 4px 14px var(--brand-indigo-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
    background: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background: #475569;
    color: #fff;
}

.btn-outline-primary {
    border: 1.5px solid var(--brand-indigo);
    color: var(--brand-indigo);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--brand-indigo);
    color: #fff;
    transform: translateY(-2px);
}

/* ===== تحسين حقول الإدخال والنماذج (Forms & Inputs) ===== */
.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-medium);
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #e2e8f0;
    padding: 11px 16px;
    font-size: 0.93rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    background-color: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-indigo);
    box-shadow: 0 0 0 4px var(--brand-indigo-glow);
    outline: none;
}

.input-group-text {
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 0 16px;
}

/* ===== نقطة البيع المحسّنة والمضغوطة (Compact High-Density POS Interface) ===== */
.pos-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.pos-products {
    max-height: 520px;
    overflow-y: auto;
    padding: 10px;
}

.product-card {
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    border-color: var(--brand-indigo);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.15);
}

.product-card .product-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-top: 4px;
    line-height: 1.25;
}

.product-card .product-price {
    color: var(--brand-indigo);
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 4px;
}

.pos-cart {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-cart-header {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-cart-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.pos-cart-items .table th {
    padding: 8px 10px;
    font-size: 0.8rem;
}

.pos-cart-items .table td {
    padding: 6px 10px;
    font-size: 0.86rem;
}

.pos-total {
    background: var(--gradient-brand);
    color: #fff;
    padding: 14px 18px;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 -4px 16px rgba(79, 70, 229, 0.2);
}

/* ===== صفحة تسجيل الدخول العصرية (Modern Glassmorphic Login Page) ===== */
.login-page {
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 60%, #020617 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.45;
    animation: pulseGlow 8s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.login-bg-glow.glow-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.login-bg-glow.glow-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #d97706 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -4s;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translateY(0); opacity: 0.35; }
    100% { transform: scale(1.15) translateY(20px); opacity: 0.55; }
}

.login-card {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    text-align: center;
    padding: 36px 24px;
    position: relative;
    border-bottom: 3px solid var(--brand-indigo);
}

.login-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    max-height: 70px;
    width: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.login-logo-icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: var(--gradient-brand);
    color: #fff;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

.login-brand-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 400;
}

.text-indigo {
    color: var(--brand-indigo) !important;
}

.btn-login-submit {
    background: var(--gradient-brand);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-login-submit:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(79, 70, 229, 0.4) !important;
}

.hover-indigo {
    transition: color 0.2s ease;
}

.hover-indigo:hover {
    color: var(--brand-indigo) !important;
}

/* ===== التنبيهات والحركة (Alerts & Animations) ===== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 16px 20px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    animation: slideInUp 0.35s ease-out;
}

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

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

/* ===== التذييل (Footer) ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 40px;
}

/* ===== استجابة الشاشات (Responsive) ===== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(15, 23, 42, 0.98);
        padding: 20px;
        border-radius: var(--radius-md);
        margin-top: 12px;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 18px;
    }
    .stat-card .stat-number {
        font-size: 1.7rem;
    }
}

/* ===== طباعة الفاتورة ===== */
.invoice-print {
    max-width: 350px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    font-size: 13px;
}

@media print {
    nav.navbar { display: none !important; }
    .btn, .d-print-none, .no-print { display: none !important; }
    body { background: #fff !important; }
}

/* ===== إصلاح التباين ووضوح النصوص والتحكم في ألوان الخطوط (High-Contrast & Visibility Fixes) ===== */
body {
    color: #0f172a !important;
}

p, span:not(.badge):not(.btn *):not(.nav-link *):not(.bg-primary *):not(.stat-card *), 
div:not(.bg-primary):not(.bg-dark):not(.stat-card *):not(.navbar *), 
label, td, th {
    color: #0f172a;
}

.text-dark, .table td, .table th, .card-title, .card-body, .modal-body, .modal-title, .form-label {
    color: #0f172a !important;
}

.text-muted, small.text-muted {
    color: #475569 !important;
}

/* إصلاح ألوان حقول الإدخال والقوائم المنسدلة */
input.form-control, select.form-select, textarea.form-control {
    color: #0f172a !important;
    background-color: #ffffff !important;
}

select.form-select option, select option {
    color: #0f172a !important;
    background-color: #ffffff !important;
}

/* إصلاح نصوص الـ Placeholder لتصبح واضحة وقابلة للقراءة */
::placeholder, .form-control::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

/* الحفاظ على النص الأبيض داخل الأزرار والشريط العلوي الداكن فقط */
.navbar-dark .navbar-brand, 
.navbar-dark .nav-link, 
.btn-primary, 
.btn-success, 
.btn-danger, 
.btn-dark, 
.bg-dark,
.stat-card * {
    color: #ffffff !important;
}

.btn-primary *, .btn-success *, .btn-danger * {
    color: #ffffff !important;
}

/* إصلاح حقول المبيعات ومحرك البحث وشاشات القوائم */
.list-group-item {
    color: #0f172a !important;
    background-color: #ffffff;
}

.list-group-item:hover {
    background-color: #f1f5f9;
}

