/* تنسيق احترافي لصفحة الموزع */
:root { --aqua: #2FB7B3; --navy: #0E1C2A; --card-bg: #1C2B36; }

body { background: var(--navy); color: white; margin: 0; font-family: 'Cairo', sans-serif; }

/* تنسيق شاشة الدخول */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-container { background: var(--card-bg); padding: 40px; border-radius: 20px; width: 100%; max-width: 400px; border-top: 5px solid var(--aqua); }
.form-group { margin-bottom: 20px; text-align: right; }
.form-group label { display: block; margin-bottom: 8px; color: var(--aqua); font-weight: 700; }
.form-group input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #2d3e4d; background: #0e1c2a; color: white; box-sizing: border-box; }

/* تنسيق الإحصائيات */
.stats-grid { display: flex; gap: 20px; padding: 20px; flex-wrap: wrap; }
.stat-card { background: var(--card-bg); flex: 1; min-width: 150px; padding: 25px; border-radius: 15px; text-align: center; border-bottom: 3px solid var(--aqua); }
.stat-card.urgent { border-bottom-color: #ef4444; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--aqua); margin: 10px 0; }

.btn-primary { background: var(--aqua); color: var(--navy); border: none; padding: 15px; width: 100%; border-radius: 10px; font-weight: 800; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { opacity: 0.9; transform: scale(1.02); }
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* بيعمل مسافات بين الحقول والزرار */
}
.btn-block {
    width: 100%;
    margin-top: 10px;
}
/* css/distributor.css - تحسين المظهر */

.stats-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    padding: 20px; 
}

.stat-card { 
    background: #1C2B36; 
    border-radius: 15px; 
    padding: 20px; 
    text-align: center; 
    border-bottom: 4px solid #2FB7B3; 
}

.stat-card.urgent { border-bottom-color: #ef4444; }

/* تعديل الكارت عشان يسمح بالتوسيط */
.customer-card {
    background: linear-gradient(145deg, #1C2B36 0%, #16222b 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(47, 183, 179, 0.1);
    margin: 10px 0; /* مسافة فوق وتحت */
    padding: 15px 20px; /* زودنا الـ Padding شوية */
    border-radius: 12px;
    
    display: flex; /* خلى العناصر جنب بعض */
    align-items: center;
    gap: 15px; /* مسافة بين أيقونة الحالة والاسم */
    cursor: pointer;
    transition: 0.3s;
}

/* الكود السحري للتوسيط */
.cust-info {
    flex: 1; 
    text-align: center; /* يوسطن الاسم والرقم */
}

/* عشان نضمن ان الاسم يبان بخط واضح */
.cust-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: white;
}

.cust-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #aaa; /* لون رمادي خفيف للرقم */
    direction: ltr; /* عشان الرقم يظهر مظبوط */
}
.cust-status { 
    font-size: 12px; 
    padding: 4px 10px; 
    border-radius: 20px; 
}
.status-ok { background: rgba(47, 183, 179, 0.2); color: #2FB7B3; }
/* css/distributor.css */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* تعتيم الخلفية */
    backdrop-filter: blur(5px); /* تأثير ضبابي */
    display: none;
    z-index: 9999;
    
    /* التغيير هنا: center بدلاً من flex-end */
    justify-content: center; 
    align-items: center; 
    padding: 20px; /* مسافة عشان ميبقاش لازق في الحواف في الموبايل */
}

.modal.active {
    display: flex;
}
/* 2. تحسين رأس المودال وزر الإغلاق */
.modal-header {
    display: flex;
    justify-content: space-between; /* يفصل العنوان عن زر الإغلاق */
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--aqua);
    font-size: 1.2rem;
}

/* تنسيق زر الـ X */
.close-btn {
    background: rgba(255,255,255,0.1); /* خلفية شفافة خفيفة */
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%; /* يخليه دائري */
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ef4444; /* لون أحمر عند الوقوف عليه */
    transform: rotate(90deg); /* حركة دوران لطيفة */
}
/* تحسينات عامة */
:root {
    --aqua: #2FB7B3;
    --navy: #0E1C2A;
    --card-bg: #1C2B36;
    --glass-bg: rgba(28, 43, 54, 0.7); /* خلفية زجاجية */
}

/* 1. جعل الكروت عائمة ومريحة للعين */
.customer-card {
    background: linear-gradient(145deg, #1C2B36 0%, #16222b 100%); /* تدرج لوني */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); /* ظل ناعم */
    border: 1px solid rgba(47, 183, 179, 0.1); /* حدود مضيئة خفيفة */
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.customer-card:hover {
    transform: translateY(-3px); /* يرتفع الكارت عند الوقوف عليه */
    box-shadow: 0 8px 25px rgba(47, 183, 179, 0.15);
    border-color: var(--aqua);
}

/* 2. تحسين شكل المودال (Popup) */
.modal {
    backdrop-filter: blur(8px); /* تشويش الخلفية وراء المودال */
    transition: opacity 0.3s ease;
}

.modal-content {
    background: #1C2B36;
    border-radius: 20px 20px 0 0; /* تدوير الحواف من الأعلى فقط للموبايل */
    box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
    border-top: 4px solid var(--aqua);
    animation: slideUp 0.3s ease-out; /* حركة دخول */
    width: 100%;
    max-width: 500px; /* لعدم التمدد في الشاشات الكبيرة */
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* 3. تحسين شريط البحث */
.search-bar input {
    background: rgba(255,255,255,0.05);
    border: 1px solid #2d3e4d;
    border-radius: 50px; /* شكل كبسولة */
    padding: 15px 25px;
    font-size: 16px;
    color: white;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box; /* مهم عشان الحواف */
}

.search-bar input:focus {
    outline: none;
    border-color: var(--aqua);
    box-shadow: 0 0 10px rgba(47, 183, 179, 0.3);
    background: rgba(255,255,255,0.1);
}
.btn-whatsapp {
    background: #25D366; /* لون واتساب الرسمي */
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-whatsapp:active {
    transform: scale(0.96);
}
/* css/distributor.css */

.header {
    background: var(--card-bg);
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.header-content {
    display: flex; /* رص العناصر جنب بعض */
    justify-content: space-between; /* مسافة بين اللوجو والجزء الأيسر */
    align-items: center; /* محاذاة رأسية في المنتصف */
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px; /* مسافة بين بيانات المستخدم وزر الخروج */
}

/* تحسين شكل بيانات المستخدم عشان متبقاش سطور كتير */
.user-info {
    text-align: left; /* عشان الاسم يكون جنب الوظيفة */
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* محاذاة لليمين أو اليسار حسب لغة الموقع */
}

.user-info p {
    margin: 0;
    line-height: 1.4;
}

#distributorName {
    font-weight: bold;
    font-size: 1.1rem;
    color: #fff;
}

#distributorArea {
    font-size: 0.9rem;
    color: var(--aqua);
}

/* زر الخروج */
.btn-logout {
    background: rgba(239, 68, 68, 0.15); /* أحمر شفاف */
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Cairo', sans-serif;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}
/* تنسيق اللوجو والنص جنبه */
.logo {
    display: flex;
    align-items: center; /* محاذاة رأسية */
    gap: 10px; /* مسافة بين الصورة والكلمة */
    font-size: 1.5rem; /* حجم الخط */
}

/* التحكم في حجم صورة اللوجو */
.header-logo {
    height: 45px; /* ارتفاع مناسب للهيدر */
    width: auto; /* العرض يتظبط أوتوماتيك */
    object-fit: contain;
}
/* css/distributor.css */

/* 1. تنسيق رأس المودال عشان يوسطن الاسم */
.modal-header {
    position: relative; /* ضروري عشان نقدر نتحكم في مكان الزرار بحرية */
    display: flex;
    justify-content: center; /* ده اللي هيخلي الاسم ييجي في النص بالظبط */
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--aqua);
    font-size: 1.4rem;
    text-align: center;
}

/* 2. تنسيق زر الإغلاق (X) ووضعه في أقصى اليسار */
.close-btn {
    position: absolute; /* يخرج برة الحسابات ويتحرك براحته */
    left: 15px; /* يلزق في الشمال */
    top: 50%; /* ينزل لنص الهيدر */
    transform: translateY(-50%); /* يظبط نفسه في المنتصف تماماً */
    
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.close-btn:hover {
    background: #ef4444;
    transform: translateY(-50%) rotate(90deg); /* يلف لما تقف عليه */
}
/* تنسيق اللوجو */
.logo {
    display: flex;
    align-items: center;
    justify-content: center; /* يوسطن اللوجو مع الكلمة في الموبايل */
    gap: 12px; /* مسافة بين الصورة والاسم */
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.logo-img {
    height: 50px; /* ارتفاع مناسب */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); /* ظل خفيف للوجو */
}