@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* --- كودك القديم كما هو --- */
body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    margin: 0;
    background-color: #f8f9fa; 
    /* تعديل بسيط: السماح بالسكرول للصفحة */
    overflow-x: hidden; 
}

.login-card {
    background-color: #ffffff;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 450px; 
    margin: 20px;
}

.logo-area {
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #000;
}

.login-title {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
}

.custom-input-group {
    background-color: #f3f4f6;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.custom-input-group:focus-within {
    background-color: #fff;
    border: 1px solid #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.input-icon {
    padding: 0 15px;
    color: #9ca3af;
    font-size: 1.1rem;
}

.form-control-custom {
    border: none;
    background: transparent;
    width: 100%;
    padding: 10px 0;
    outline: none;
    color: #333;
    font-weight: 500;
}

.toggle-password {
    cursor: pointer;
    padding-right: 15px;
    transition: color 0.3s;
}
.toggle-password:hover { color: #333; }

.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-bottom: 25px;
    text-decoration: none;
    font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

/* الأزرار */
.btn-black {
    background-color: #000;
    color: white;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.2s, background-color 0.3s;
}

.btn-black:hover {
    background-color: #333;
    transform: translateY(-2px);
}

.divider {
    text-align: center;
    margin: 25px 0;
    font-size: 13px;
    color: #999;
    position: relative;
}
.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background-color: #eee;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.btn-white {
    background-color: white;
    color: #1a1a1a;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-white:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.main-logo {
    max-width: 120px;
    height: auto;
    object-fit: contain;
}

/* =======================================================
   التعديلات الجديدة (الهيدر الثابت + السايدبار المصغر)
   ======================================================= */

:root {
    --primary-color: #801313;
    --sidebar-width: 260px;
    --sidebar-mini-width: 80px; /* حجم السايدبار وهو صغير */
    --header-height: 70px;
}

/* 1. السايدبار (Sidebar) */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #ffffff;
    color: #555;
    border-right: 1px solid #eee;
    z-index: 1001; /* فوق الهيدر */
    position: fixed; /* تثبيت السايدبار */
    top: 0;
    left: 0;
    height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* القائمة داخل السايدبار */
#sidebar ul.components {
    padding: 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}

#sidebar ul li a {
    padding: 12px 20px; /* تقليل الحواف قليلاً */
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    transition: 0.3s;
    border-left: 4px solid transparent;
    white-space: nowrap; /* يمنع نزول النص لسطر ثاني */
}

#sidebar ul li a i {
    margin-right: 15px;
    font-size: 1.2rem;
    min-width: 30px; /* حجز مكان ثابت للأيقونة */
    text-align: center;
}

/* Active State */
#sidebar ul li.active > a, 
#sidebar ul li a:hover {
    color: var(--primary-color);
    background: #fff5f5;
    border-left-color: var(--primary-color);
}

/* 2. الهيدر الثابت (Top Fixed Header) */
.top-header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width); /* يبدأ بعد السايدبار */
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* 3. منطقة المحتوى (Content) */
#content {
    margin-top: var(--header-height); /* عشان ما يختفي تحت الهيدر */
    margin-left: var(--sidebar-width); /* عشان ما يختفي تحت السايدبار */
    padding: 30px;
    width: auto;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* --- وضعية التصغير (Mini Sidebar Mode) --- */
/* الكلاس 'mini-sidebar' ينضاف للـ body بالجافاسكريبت */

body.mini-sidebar #sidebar {
    min-width: var(--sidebar-mini-width);
    max-width: var(--sidebar-mini-width);
}

body.mini-sidebar .top-header {
    left: var(--sidebar-mini-width);
}

body.mini-sidebar #content {
    margin-left: var(--sidebar-mini-width);
}

/* إخفاء النصوص واللوجو الكبير والسهم */
body.mini-sidebar #sidebar .sidebar-header h5,
body.mini-sidebar #sidebar ul li a span, 
body.mini-sidebar #sidebar .dropdown-toggle::after,
body.mini-sidebar #sidebar .sidebar-footer span {
    display: none !important;
    opacity: 0;
}

/* تعديل اللوجو وهو صغير */
body.mini-sidebar #sidebar .sidebar-header {
    padding: 10px;
    justify-content: center;
}
body.mini-sidebar #sidebar .sidebar-header img {
    width: 30px;
}

/* توسيط الأيقونات لما يكون صغير */
body.mini-sidebar #sidebar ul li a {
    padding: 15px 10px;
    justify-content: center;
}
body.mini-sidebar #sidebar ul li a i {
    margin-right: 0;
    font-size: 1.4rem;
}

/* 4. تنسيقات عامة من كودك */
.navbar-custom { display: none; } /* إخفاء النافبار القديمة لأن عملنا هيدر جديد */

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid #f1f1f1;
    margin-bottom: 20px;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute; left: 0; top: 0; height: 100%; width: 4px; background: var(--primary-color);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px rgba(0,0,0,0.05); }
.stat-value { font-size: 2rem; font-weight: 700; color: #333; }
.stat-title { font-size: 0.9rem; color: #888; margin-bottom: 5px; }
.icon-box { width: 50px; height: 50px; background: #fff5f5; color: var(--primary-color); display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 1.5rem; }

/* زر التبديل (Toggle Button) في الهيدر */
.btn-toggle-sidebar {
    background: #f8f9fa;
    border: 1px solid #eee;
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s;
    color: #333;
}
.btn-toggle-sidebar:hover { background: #e2e2e2; color: var(--primary-color); }

/* إخفاء سهم البوتستراب */
.hide-arrow::after { display: none !important; }

/* =========================================
   CUSTOMERS PAGE STYLES (New Design)
   ========================================= */

/* 1. Page Header & Actions */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
}

/* 2. Filter Section */
.filter-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 25px;
    border: 1px solid #f1f1f1;
}

.form-label-custom {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.form-control-custom, .form-select-custom {
    border: 1px solid #eee;
    background-color: #fcfcfc;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    width: 100%;
    transition: 0.3s;
}
.form-control-custom:focus, .form-select-custom:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(128, 19, 19, 0.05);
    outline: none;
}

/* 3. Buttons */
.btn-custom-primary {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    text-decoration: none;
}
.btn-custom-primary:hover {
    background-color: #5e0e0e;
    color: #fff;
    transform: translateY(-2px);
}

.btn-custom-outline {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    text-decoration: none;
}
.btn-custom-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff5f5;
}

/* 4. Table Styles */
.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: none;
    overflow: hidden;
}

.table-header {
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.table-header th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 700;
    padding: 15px;
    border: none;
}

.table tbody td {
    vertical-align: middle;
    padding: 15px;
    border-bottom: 1px solid #fcfcfc;
    color: #333;
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background-color: #fffbfb;
}

/* Avatar Circle */
.client-avatar {
    width: 40px; height: 40px;
    background-color: #fff5f5;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Action Icons */
.action-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #777;
    background: #f4f6f9;
    transition: 0.2s;
    margin-left: 5px;
    text-decoration: none;
}
.action-icon:hover { background: var(--primary-color); color: #fff; }
.action-icon.delete:hover { background: #dc3545; color: #fff; }

/* 5. Pagination Custom */
.pagination .page-link {
    border: none;
    color: #666;
    margin: 0 3px;
    border-radius: 6px;
    font-weight: 500;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}
.pagination .page-item.disabled .page-link {
    background-color: transparent;
    color: #ccc;
}
.pagination .page-link:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}
.pagination .page-item.active .page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Active State for Child Links (القوائم الفرعية) --- */
.sidebar-menu ul .collapse li a.active-link {
    color: var(--primary-color) !important;
    font-weight: 700;
    background-color: transparent; /* خلفية شفافة ليبقى نظيفاً */
}

.sidebar-menu ul .collapse li a.active-link i {
    color: var(--primary-color) !important;
}

/* تعديل بسيط: عند فتح القائمة، الأب لا يتلون بالأحمر، فقط السهم يلف */
.sidebar-menu li a[aria-expanded="true"] {
    color: #555; /* يبقى اللون رمادي */
    background-color: transparent;
    border-left-color: transparent;
}

