/**
 * منظومة شؤون الموظفين - ملف الأنماط
 * HR Management System - Stylesheet
 */

/* =============================================
   متغيرات CSS
   CSS Variables
   ============================================= */
:root {
    /* الألوان الأساسية */
    --primary-color: #1a5f7a;
    --primary-dark: #145373;
    --primary-light: #2d8fb0;
    --secondary-color: #159895;
    --secondary-dark: #0f6b68;
    --secondary-light: #1fc5ba;
    
    /* ألوان الخلفية */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: #2c3e50;
    --bg-card: #ffffff;
    
    /* ألوان النصوص */
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --text-muted: #95a5a6;
    
    /* ألوان الحالات */
    --success-color: #27ae60;
    --success-bg: #d4edda;
    --warning-color: #f39c12;
    --warning-bg: #fff3cd;
    --danger-color: #e74c3c;
    --danger-bg: #f8d7da;
    --info-color: #3498db;
    --info-bg: #d1ecf1;
    
    /* الألوان الإضافية */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.125);
    
    /* الأبعاد */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    --content-padding: 20px;
    
    /* الانتقالات */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    
    /* الزوايا الدائرية */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
}

/* =============================================
   إعادة التعيين
   CSS Reset
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

/* =============================================
   التصميم المتجاوب
   Responsive Design
   ============================================= */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 250px;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }
    
    .sidebar {
        transform: translateX(100%);
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0 !important;
    }
    
    .toggle-sidebar {
        display: block !important;
    }
}

/* =============================================
   الشريط العلوي
   Header
   ============================================= */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--content-padding);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 999;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
}

.toggle-sidebar {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    transition: var(--transition-fast);
}

.toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-search {
    position: relative;
}

.header-search input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 10px 40px 10px 15px;
    border-radius: var(--radius-xl);
    width: 300px;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
}

.header-notifications {
    position: relative;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-light);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    transition: var(--transition-fast);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* =============================================
   القائمة الجانبية
   Sidebar
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    right: 0;
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    transition: var(--transition-normal);
    z-index: 998;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li {
    margin: 5px 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    gap: 12px;
}

.sidebar-menu a:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.sidebar-menu a i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-menu .menu-title {
    flex: 1;
    font-weight: 500;
}

.sidebar-menu .badge {
    background: var(--danger-color);
    color: var(--text-light);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 15px;
}

.sidebar-title {
    padding: 10px 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   المحتوى الرئيسي
   Main Content
   ============================================= */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: var(--content-padding);
    transition: var(--transition-normal);
}

.content-wrapper {
    max-width: 1600px;
    margin: 0 auto;
}

/* =============================================
   البطاقات
   Cards
   ============================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    font-size: 1.3rem;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.card-tools {
    display: flex;
    gap: 8px;
}

.card-tools .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* =============================================
   الأزرار
   Buttons
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: var(--text-light);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #219a52);
    color: var(--text-light);
}

.btn-success:hover {
    background: linear-gradient(135deg, #2ecc71, var(--success-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: var(--text-light);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e74c3c, var(--danger-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: var(--text-primary);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f1c40f, var(--warning-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: var(--text-light);
}

.btn-info:hover {
    background: linear-gradient(135deg, #5dade2, var(--info-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: var(--text-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =============================================
   النماذج
   Forms
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-control:disabled {
    background: var(--bg-primary);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.invalid-feedback {
    font-size: 0.85rem;
    color: var(--danger-color);
    margin-top: 5px;
}

.valid-feedback {
    font-size: 0.85rem;
    color: var(--success-color);
    margin-top: 5px;
}

/* حقول الاختيار */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
}

/* حقول الاختيار المتعدد */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 20px;
    padding-left: 45px;
    cursor: pointer;
}

/* textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* =============================================
   الجداول
   Tables
   ============================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    padding: 15px;
    font-weight: 600;
    text-align: right;
    border-bottom: 2px solid var(--primary-dark);
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.table-actions .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* جدول مدمج */
.table-sm thead th,
.table-sm tbody td {
    padding: 10px;
    font-size: 0.9rem;
}

/* =============================================
   صناديق البحث والفلترة
   Search & Filter Boxes
   ============================================= */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    padding-right: 45px;
    width: 100%;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-bar {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

/* =============================================
   صناديق الإحصائيات
   Stats Boxes
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-color), #219a52);
    color: var(--text-light);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: var(--text-primary);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: var(--text-light);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: var(--text-light);
}

.stat-content h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.stat-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* =============================================
   الرسائل والتنبيهات
   Alerts & Messages
   ============================================= */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background: var(--success-bg);
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background: var(--danger-bg);
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: var(--warning-bg);
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background: var(--info-bg);
    color: #0c5460;
    border-color: #bee5eb;
}

.alert-dismissible {
    padding-left: 40px;
    position: relative;
}

.alert-dismissible .close {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition-fast);
}

.alert-dismissible .close:hover {
    opacity: 1;
}

/* =============================================
   الترقيم
   Pagination
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 25px;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   النافذة المنبثقة
   Modal
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition-fast);
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
}

.modal-footer {
    padding: 15px 25px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   خطوات النموذج
   Form Steps
   ============================================= */
.form-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: var(--transition-fast);
}

.step.active .step-number {
    background: var(--primary-color);
    color: var(--text-light);
}

.step.completed .step-number {
    background: var(--success-color);
    color: var(--text-light);
}

.step-title {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.step.active .step-title {
    color: var(--primary-color);
    font-weight: 600;
}

.step.completed .step-title {
    color: var(--success-color);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 10px;
}

.step-line.active {
    background: var(--primary-color);
}

/* =============================================
   حقول الملف
   File Upload Fields
   ============================================= */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--bg-primary);
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(26, 95, 122, 0.05);
}

.file-upload i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.file-upload p {
    margin: 0;
    color: var(--text-secondary);
}

.file-upload small {
    color: var(--text-muted);
}

.file-upload input[type="file"] {
    display: none;
}

.file-preview {
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-preview i {
    font-size: 2rem;
    color: var(--danger-color);
}

.file-preview .file-name {
    flex: 1;
    font-weight: 500;
}

.file-preview .file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =============================================
   شريط التحميل
   Loading Bar
   ============================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =============================================
   تصميم الطباعة
   Print Styles
   ============================================= */
@media print {
    body {
        background: white;
        color: black;
        direction: rtl;
    }
    
    .header,
    .sidebar,
    .btn,
    .card-tools,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
    }
    
    .card-header {
        background: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table thead th {
        background: #e0e0e0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 2px solid black;
    }
    
    .print-footer {
        display: block !important;
        margin-top: 50px;
        padding-top: 20px;
        border-top: 1px solid #ccc;
    }
}

/* =============================================
   التصميم المتجاوب الإضافي
   Additional Responsive Styles
   ============================================= */
@media (max-width: 768px) {
    html {
        font-size: 13px;
    }
    
    .header-search {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .step-line {
        display: none;
    }
    
    .modal {
        max-width: 100%;
        margin: 10px;
    }
}

/* =============================================
   تأثيرات إضافية
   Additional Effects
   ============================================= */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hover-scale {
    transition: var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* =============================================
   صفحة تسجيل الدخول
   Login Page
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark), var(--secondary-color));
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--text-light);
    font-size: 2.5rem;
}

.login-header h1 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
}

/* =============================================
   شريط التقدم
   Progress Bar
   ============================================= */
.progress {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s ease;
}

/* =============================================
   علامات التبويب
   Tabs
   ============================================= */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    gap: 5px;
}

.tab {
    padding: 12px 25px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =============================================
   شارات الحالة
   Status Badges
   ============================================= */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-bg);
    color: #155724;
}

.badge-danger {
    background: var(--danger-bg);
    color: #721c24;
}

.badge-warning {
    background: var(--warning-bg);
    color: #856404;
}

.badge-info {
    background: var(--info-bg);
    color: #0c5460;
}

.badge-primary {
    background: rgba(26, 95, 122, 0.1);
    color: var(--primary-color);
}

.badge-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-secondary);
}

/* =============================================
   تقسيم الصفحة
   Page Sections
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* =============================================
   معلومات الموظف
   Employee Info
   ============================================= */
.employee-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.employee-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    overflow: hidden;
}

.employee-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.employee-info p {
    color: var(--text-secondary);
    margin: 0;
}

.employee-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.employee-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =============================================
   الرسم البياني
   Charts
   ============================================= */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* =============================================
   قائمة المهام
   Task List
   ============================================= */
.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.task-content {
    flex: 1;
}

.task-title {
    font-weight: 500;
    margin-bottom: 3px;
}

.task-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.task-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================
   الأدوات
   Utilities
   ============================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-light { background-color: var(--bg-primary) !important; }

.font-weight-bold { font-weight: 700; }
.font-weight-medium { font-weight: 600; }
.font-weight-normal { font-weight: 400; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }
.mt-5 { margin-top: 25px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 25px !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 5px !important; }
.pt-2 { padding-top: 10px !important; }
.pt-3 { padding-top: 15px !important; }
.pt-4 { padding-top: 20px !important; }
.pt-5 { padding-top: 25px !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 5px !important; }
.pb-2 { padding-bottom: 10px !important; }
.pb-3 { padding-bottom: 15px !important; }
.pb-4 { padding-bottom: 20px !important; }
.pb-5 { padding-bottom: 25px !important; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.flex-1 { flex: 1; }

.gap-1 { gap: 5px !important; }
.gap-2 { gap: 10px !important; }
.gap-3 { gap: 15px !important; }
.gap-4 { gap: 20px !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-circle { border-radius: 50% !important; }

.shadow { box-shadow: var(--shadow-md); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }

.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block !important;
    }
}

/* =============================================
   تصميم RTL للطباعة
   Print RTL Support
   ============================================= */
@media print {
    .print-header,
    .print-footer {
        text-align: right;
    }
    
    .table thead th,
    .table tbody td {
        text-align: right;
    }
}

/* =============================================
   تأثير الظل عند التحويم
   Hover Shadow Effect
   ============================================= */
.hover-shadow:hover {
    box-shadow: var(--shadow-lg);
}

/* =============================================
   الخلفية الشفافة
   Transparent Background
   ============================================= */
.bg-transparent {
    background: transparent !important;
}

/* =============================================
   حدود مخصصة
   Custom Borders
   ============================================= */
.border { border: 1px solid var(--border-color) !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.border-right { border-right: 1px solid var(--border-color) !important; }
.border-left { border-left: 1px solid var(--border-color) !important; }

/* =============================================
   تصميم التحقق
   Validation Styles
   ============================================= */
.was-validated .form-control:invalid {
    border-color: var(--danger-color);
}

.was-validated .form-control:valid {
    border-color: var(--success-color);
}

/* =============================================
   نافذة التأكيد
   Confirmation Modal
   ============================================= */
.confirm-modal .modal {
    max-width: 400px;
    text-align: center;
}

.confirm-modal .modal-body {
    padding: 30px;
}

.confirm-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--warning-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--warning-color);
}

.confirm-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.confirm-message {
    color: var(--text-secondary);
}
