/* assets/style.css */

/* 1. الخطوط والمتغيرات */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* الألوان الأساسية */
    --primary-color: #2c3e50;    /* كحلي غامق */
    --accent-color: #3498db;     /* أزرق أساسي */
    --accent-hover: #2980b9;     /* أزرق غامق (عند التحويم) */
    --bg-body: #f4f6f9;          /* رمادي فاتح للخلفية العامة */
    --bg-white: #ffffff;         /* أبيض للبطاقات والقوائم */
    
    /* ألوان الحالة (Status Colors) */
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #c0392b;
    --gray: #95a5a6;

    /* النصوص والحدود */
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    
    /* قياسات */
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
}

/* 2. أساسيات الصفحة (Reset & Layout) */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }

/* الحاويات */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    margin-right: var(--sidebar-width); /* إزاحة المحتوى لليسار لترك مكان للقائمة */
    padding: 30px;
    min-height: 100vh;
    transition: 0.3s;
}

/* 3. القائمة الجانبية (Sidebar) - تصميم عصري */
.admin-sidebar {
    background-color: var(--bg-white);
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    color: var(--primary-color);
    margin: 0 0 5px;
    font-size: 1.3rem;
}

.role-badge {
    background-color: #e8f0fe;
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

/* روابط القائمة */
.sidebar-menu li { margin-bottom: 8px; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-main);
    border-radius: var(--radius);
    font-weight: 500;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
    transform: translateX(-5px);
}

.menu-divider {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 20px 0 10px;
    font-weight: bold;
    opacity: 0.8;
}

/* 4. الجداول (Tables) */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 15px;
}

th {
    background-color: #f8f9fa;
    color: var(--primary-color);
    font-weight: bold;
    padding: 15px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:hover { background-color: #fafafa; }

/* 5. النماذج والأزرار (Forms & Buttons) */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
    font-family: inherit;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button, .btn-primary, .btn-action, .btn-update {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-align: center;
    transition: 0.3s;
    text-decoration: none;
}

.btn-primary { background-color: var(--accent-color); color: white; width: 100%; }
.btn-primary:hover { background-color: var(--accent-hover); }

/* أزرار الإجراءات الصغيرة */
.btn-action { padding: 6px 12px; font-size: 0.85rem; color: white; margin-left: 5px; }
.btn-approve, .status-active { background-color: var(--success); }
.btn-reject, .status-rejected { background-color: var(--danger); }
.btn-view { background-color: var(--gray); }
.btn-update { background-color: var(--accent-color); color: white; padding: 6px 12px; font-size: 0.85rem; }

/* 6. البطاقات (Cards) */
.card, .ai-report-card, .add-user-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.add-user-card {
    border-right: 4px solid var(--accent-color); /* تمييز بطاقة الإضافة */
}

/* 7. شريط العنوان (Navbar) في الصفحات الداخلية */
.navbar {
    background: var(--bg-white);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* شارات الرتب والحالات */
.role-user { background: #eee; color: #555; }
.role-admin { background: #d1ecf1; color: #0c5460; }
.role-super_admin { background: #d4edda; color: #155724; }
.status-badge { padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; display: inline-block;}