/**
 * نظام التصميم الموحد - نظام إدارة التاكسي
 * Unified Design System - Taxi Management System
 * 
 * هذا الملف يحتوي على جميع التنسيقات المشتركة بين الصفحات
 */

/* ==================== المتغيرات الأساسية ==================== */
:root {
    /* الألوان الأساسية */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ef0;
    --secondary-color: #764ba2;
    
    /* ألوان الحالة */
    --success-color: #28a745;
    --success-light: #d4edda;
    --danger-color: #dc3545;
    --danger-light: #f8d7da;
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --info-color: #17a2b8;
    --info-light: #d1ecf1;
    
    /* ألوان النص */
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --text-white: #ffffff;
    
    /* ألوان الخلفية */
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #e9ecef;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* الحدود */
    --border-color: #e0e0e0;
    --border-color-dark: #d1d5db;
    
    /* الظلال */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* الخطوط */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    
    /* المسافات */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    
    /* الزوايا */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* الانتقالات */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== إعادة تعيين أساسية ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-gradient);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* ==================== الحاويات ==================== */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }
}

/* ==================== الرأس ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    text-align: center;
    color: white;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerPulse 15s ease-in-out infinite;
}

@keyframes headerPulse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -30px); }
}

.header h1 {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.header p {
    position: relative;
    z-index: 1;
    font-size: 16px;
    opacity: 0.95;
}

/* ==================== أزرار التنقل ==================== */
.nav-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==================== البطاقات ==================== */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: var(--spacing-lg);
    transition: var(--transition-base);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== الأزرار ==================== */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: var(--font-size-base);
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-family: var(--font-family);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--success-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.refresh-btn {
    background: var(--primary-color);
    color: white;
}

.refresh-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

/* ==================== حقول الإدخال ==================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: var(--transition-base);
    direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== النوافذ المنبثقة ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn var(--transition-base);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp var(--transition-base);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    font-weight: 600;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-base);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.close:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.modal-body {
    padding: var(--spacing-md) 0;
}

.modal-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
}

/* ==================== الجداول ==================== */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    overflow-x: auto;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    margin-bottom: var(--spacing-lg);
    position: relative;
    /* تحسين التمرير على الأجهزة المحمولة */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* مؤشر التمرير الأفقي على الشاشات الصغيرة */
.table-container::after {
    content: '← اسحب لليسار لرؤية المزيد';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

@media (max-width: 768px) {
    .table-container::after {
        opacity: 1;
        animation: fadeInOut 3s ease-in-out infinite;
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    color: white;
    padding: 18px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    border-bottom: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.table td {
    padding: 16px 14px;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
    transition: all 0.25s ease;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.25s ease;
    background-color: white;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e8f0fe;
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    cursor: pointer;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* تحسين عرض الأسماء */
.table td:first-child {
    font-weight: 600;
    color: #667eea;
    text-align: right;
    padding-right: 20px;
}

/* تحسين عرض المبالغ */
.table td.amount {
    font-weight: 700;
    font-size: 15px;
}

/* ألوان المبالغ في الجدول */
.table td.amount.positive {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.15);
    font-weight: 700;
}

.table td.amount.negative {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.15);
    font-weight: 700;
}

.table td.amount.zero {
    color: #6c757d;
    opacity: 0.7;
    font-weight: 600;
}

/* ==================== الإحصائيات ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-base);
    overflow: hidden;
}

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

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
    word-break: break-word;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

/* ألوان الإحصائيات */
.regular { color: var(--success-color); }
.late { color: var(--warning-color); }
.very-late { color: var(--danger-color); }
.debt { color: var(--info-color); }
.positive { color: var(--success-color); }
.negative { color: var(--danger-color); }
.zero { color: var(--text-secondary); }

/* ==================== عناصر الديون ==================== */
.debt-item {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-right: 4px solid var(--danger-color);
}

.debt-driver {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.debt-details {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

.debt-amount {
    color: var(--danger-color);
    font-weight: bold;
    float: left;
}

/* ==================== الأرصدة ==================== */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 1024px) {
    .balance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .balance-grid {
        grid-template-columns: 1fr;
    }
}

.balance-card {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: var(--transition-base);
}

.balance-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.balance-card.clickable {
    cursor: pointer;
}

.balance-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.balance-amount {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    color: var(--text-primary);
}

/* ==================== رسائل الحالة ==================== */
.loading,
.no-data {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
}

.error-message {
    background: var(--danger-light);
    color: var(--danger-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-right: 4px solid var(--danger-color);
}

.success-message {
    background: var(--success-light);
    color: var(--success-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-right: 4px solid var(--success-color);
}

/* ==================== الرسوم المتحركة ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==================== الاستجابة للأجهزة ==================== */

/* الأجهزة اللوحية */
@media (max-width: 1024px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .header {
        padding: var(--spacing-md);
    }
    
    .header h1 {
        font-size: var(--font-size-2xl);
    }
}

/* الهواتف */
@media (max-width: 768px) {
    :root {
        --font-size-base: 0.9375rem;
        --font-size-lg: 1.0625rem;
        --font-size-xl: 1.125rem;
        --font-size-2xl: 1.375rem;
        --font-size-3xl: 1.625rem;
    }
    
    body {
        padding: var(--spacing-sm);
    }
    
    .container {
        padding: var(--spacing-sm);
    }
    
    .header {
        padding: var(--spacing-md);
    }
    
    .header h1 {
        font-size: var(--font-size-xl);
        flex-direction: column;
    }
    
    .nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .card-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: var(--spacing-md);
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .modal-buttons .btn {
        width: 100%;
    }
    
    /* تحسين عرض الجدول على الهواتف */
    .table-container {
        border-radius: var(--radius-md);
        margin-bottom: var(--spacing-md);
        /* إضافة padding للسماح برؤية المؤشر */
        padding-bottom: 50px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .table {
        min-width: 1400px; /* عرض أكبر للجداول الكبيرة */
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 12px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* تحسين عرض الأسماء والنصوص الطويلة */
    .table td:first-child {
        position: sticky;
        right: 0;
        background: white;
        z-index: 5;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
        font-weight: 600;
        color: #667eea;
        min-width: 120px;
    }
    
    .table thead th:first-child {
        position: sticky;
        right: 0;
        z-index: 15;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .table tbody tr:nth-child(even) td:first-child {
        background-color: #f8f9fa;
    }
    
    .table tbody tr:hover td:first-child {
        background-color: #e8f0fe;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
}

/* الهواتف الصغيرة */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        max-height: 90vh;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== دعم PWA ==================== */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .header {
        padding-top: calc(var(--spacing-md) + env(safe-area-inset-top));
    }
}

/* ==================== أدوات مساعدة ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

.hidden { display: none; }
.visible { display: block; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }
.gap-4 { gap: var(--spacing-lg); }


/* ==================== تنسيقات خاصة بصفحات محددة ==================== */

/* صفحة الإيرادات والمصروفات */
.balance-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.balance-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.balance-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.balance-item.clickable {
    cursor: pointer;
    border-color: #667eea;
}

.balance-item.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.form-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.form-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.revenue-history,
.expense-history {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.revenue-history h3,
.expense-history h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.revenue-table,
.expense-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.revenue-table th,
.revenue-table td,
.expense-table th,
.expense-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.revenue-table th,
.expense-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.revenue-table tr:hover,
.expense-table tr:hover {
    background-color: #f8f9fa;
}

.amount {
    font-weight: bold;
    color: #28a745;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.type-badge.driver-payment {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.type-badge.direct-revenue {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.type-badge.company-expense {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.type-badge.driver-expense {
    background: #fce4ec;
    color: #c2185b;
    border: 1px solid #f8bbd0;
}

.detailed-desc {
    font-size: 13px;
    color: #555;
    max-width: 250px;
    word-wrap: break-word;
}

.filter-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.filter-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: #e9ecef;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.filter-btn:hover {
    background: #667eea;
    color: white;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

#debtsContent {
    padding: 20px;
}

/* Pagination */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-controls label {
    font-weight: bold;
    color: #333;
}

.pagination-controls select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-buttons button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-buttons button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #007bff;
}

.pagination-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-number {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-number:hover:not(.active) {
    background: #f8f9fa;
    border-color: #007bff;
}

/* صفحة السائقين */
.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* استجابة إضافية للصفحات الخاصة */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .pagination-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .action-buttons,
    .header-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn,
    .header-buttons .btn {
        width: 100%;
    }
}

/* ==================== عرض البطاقات للجداول على الهاتف ==================== */

/* إخفاء الجدول على الشاشات الصغيرة */
@media (max-width: 768px) {
    .table-container {
        overflow-x: visible;
    }
    
    /* إخفاء الجدول التقليدي */
    .revenue-table,
    .expense-table,
    .table {
        display: none;
    }
    
    /* عرض البطاقات بدلاً من الجدول */
    .mobile-cards {
        display: block !important;
    }
}

/* تصميم البطاقات للهاتف */
.mobile-cards {
    display: none; /* مخفي على الكمبيوتر */
}

.mobile-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-right: 4px solid var(--primary-color);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-date {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-card-amount {
    font-size: 20px;
    font-weight: bold;
    color: var(--success-color);
}

.mobile-card-body {
    margin-bottom: 12px;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-gray);
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-card-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
    max-width: 60%;
    word-wrap: break-word;
}

.mobile-card-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.mobile-card-footer .btn,
.mobile-card-footer .delete-btn {
    padding: 8px 16px;
    font-size: 13px;
    flex: 1;
    max-width: 120px;
}

/* ألوان خاصة للبطاقات */
.mobile-card.revenue {
    border-right-color: var(--success-color);
}

.mobile-card.expense {
    border-right-color: var(--danger-color);
}

.mobile-card.expense .mobile-card-amount {
    color: var(--danger-color);
}

/* تحسين عرض الشارات في البطاقات */
.mobile-card .type-badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* رسالة "لا توجد بيانات" للبطاقات */
.mobile-cards .no-data {
    background: white;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
}

/* تحسين pagination على الهاتف */
@media (max-width: 768px) {
    .pagination-buttons {
        flex-wrap: wrap;
    }
    
    .page-number {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ==================== زر الحذف في الجداول ==================== */
.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.delete-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}


/* ==================== تحسينات جمالية شاملة ==================== */

/* تحسين البطاقات الإحصائية */
.balance-item,
.stat-card,
.stats-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.balance-item::before,
.stat-card::before,
.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.balance-item:hover,
.stat-card:hover,
.stats-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

/* تحسين عناوين البطاقات */
.balance-item h3,
.stat-card h3,
.stats-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* تحسين الأرقام في البطاقات */
.balance-item .amount,
.stat-card .number,
.stats-card .number {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}

/* ألوان خاصة للبطاقات المختلفة */
.balance-item.positive .amount {
    background: linear-gradient(135deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.balance-item.negative .amount {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.balance-item.warning .amount {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* تحسين الأيقونات في البطاقات */
.balance-item .icon,
.stat-card .icon,
.stats-card .icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* تحسين الأزرار */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

/* تحسين الجداول */
.table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.table thead th {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    padding: 16px;
    border: none;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    color: var(--text-primary);
    font-size: 14px;
}

/* تحسين الشارات */
.type-badge,
.badge,
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.type-badge:hover,
.badge:hover,
.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.type-badge.driver-payment {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.type-badge.direct-revenue {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.type-badge.company-expense {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.type-badge.driver-expense {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
}

/* تحسين النوافذ المنبثقة */
.modal {
    backdrop-filter: blur(8px);
}

.modal-content {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 24px;
    border: none;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* تحسين حقول الإدخال */
.form-control,
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
}

/* تحسين البطاقات على الهاتف */
.mobile-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.mobile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.mobile-card.revenue {
    border-left-color: #28a745;
}

.mobile-card.expense {
    border-left-color: #dc3545;
}

.mobile-card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-card-date {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.mobile-card-amount {
    font-size: 20px;
    font-weight: 700;
}

.mobile-card.revenue .mobile-card-amount {
    color: #28a745;
}

.mobile-card.expense .mobile-card-amount {
    color: #dc3545;
}

.mobile-card-body {
    padding: 16px;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.mobile-card-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: left;
}

.mobile-card-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
}

/* تنسيقات مكررة تم حذفها - الآن موحدة في الأعلى */

/* تحسين الـ Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* رسوم متحركة للعناصر */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.balance-item,
.stat-card,
.stats-card,
.card {
    animation: fadeInUp 0.6s ease;
}

/* تحسين الـ Pagination */
.pagination-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-number {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.page-number:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-number.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* تحسين البحث والفلاتر */
.search-box,
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

/* تأثيرات الـ Loading */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* تحسين الـ Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* تحسينات للطباعة */
@media print {
    .nav-buttons,
    .btn,
    .delete-btn {
        display: none;
    }
    
    .table {
        box-shadow: none;
    }
}


/* ==================== صفحة تسجيل الدخول ==================== */

/* الخلفية */
body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

/* تأثير الخلفية المتحركة */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* الحاوية الرئيسية */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* البطاقة */
.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cardSlideIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* تأثير الضوء في البطاقة */
.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    animation: lightMove 10s ease-in-out infinite;
}

@keyframes lightMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* رأس البطاقة */
.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

/* أيقونة التاكسي */
.login-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: iconBounce 2s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* النموذج */
.login-form {
    position: relative;
    z-index: 1;
}

/* مجموعة الإدخال */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

/* أيقونة الإدخال */
.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    z-index: 2;
    pointer-events: none;
}

/* حقل الإدخال */
.input-group input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: var(--text-primary);
    font-weight: 500;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: #adb5bd;
}

/* زر تسجيل الدخول */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.login-btn:active {
    transform: translateY(-1px);
}

.btn-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(-5px);
}

/* تذييل البطاقة */
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* رابط دخول السائقين */
.driver-login-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.driver-login-link:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* رسالة الخطأ */
.error-message {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    display: none;
    animation: errorShake 0.5s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.error-message.show {
    display: block;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* شاشة التحميل */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading p {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

/* استجابة للهاتف */
@media (max-width: 768px) {
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .login-icon {
        font-size: 52px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .input-group input {
        padding: 14px 14px 14px 48px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* تأثير PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.install-prompt.show {
    display: flex;
}

.install-prompt button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-prompt button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}


/* ==================== منع السكرول الأفقي ==================== */
html {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    max-width: 100%;
}

.container, .login-container, .login-card {
    max-width: 100%;
    overflow-x: hidden;
}

/* التأكد من أن الجداول لا تسبب سكرول أفقي */
.table-container {
    overflow-x: auto;
    max-width: 100%;
}

table {
    max-width: 100%;
}

/* ==================== لوحة التحكم - Dashboard ==================== */

/* الرأس */
/* تنسيق header مكرر - تم حذفه لصالح التنسيق الموحد */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span {
    font-size: 16px;
    font-weight: 600;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

/* شبكة الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* بطاقة الإحصائيات */
.stat-card {
    background: white;
    padding: 32px 24px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-top: 4px solid transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
}

/* أيقونة الإحصائية */
.stat-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* رقم الإحصائية */
.stat-number {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* تسمية الإحصائية */
.stat-label {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* الإجراءات السريعة */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    justify-items: center;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* زر الإجراء */
.action-btn {
    background: white;
    padding: 32px 24px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    width: 100%;
    max-width: 250px;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.2);
}

/* أيقونة الإجراء */
.action-icon {
    font-size: 48px;
    transition: transform 0.3s ease;
}

.action-btn:hover .action-icon {
    transform: scale(1.15);
}

.action-btn span {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* قسم التنبيهات */
.alerts-section {
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.alerts-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.alerts-header span {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* قائمة التنبيهات */
#alertsList {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* بطاقة التنبيه */
.alert-item {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05), rgba(255, 152, 0, 0.05));
    border-right: 4px solid var(--warning-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.alert-item.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05), rgba(200, 35, 51, 0.05));
    border-right-color: var(--danger-color);
}

.alert-item.alert-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.alert-item.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.05), rgba(13, 110, 253, 0.05));
    border-right-color: var(--info-color);
}

.alert-item.alert-info:hover {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.2);
}

.alert-item.alert-urgent {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
    border-right-color: var(--danger-color);
}

.alert-item.alert-urgent:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.alert-item.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    border-right-color: var(--warning-color);
}

.alert-item.alert-warning:hover {
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.alert-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.alert-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.alert-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* رسالة فارغة */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
}

/* استجابة للهاتف */
@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 24px 20px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    

    
    .action-btn {
        padding: 20px 16px;
    }
    
    .action-icon {
        font-size: 32px;
    }
    
    .action-btn span {
        font-size: 13px;
    }
    
    .alerts-section {
        padding: 20px;
    }
    
    .alerts-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .alert-item {
        flex-direction: column;
        gap: 12px;
    }
}



/* ==================== أنماط جدول الدفعات ==================== */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.payments-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.payments-table th {
    color: white;
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    border-bottom: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.payments-table td {
    padding: 14px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
}

.payments-table tbody tr {
    transition: all 0.2s ease;
}

.payments-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.payments-table tbody tr:hover {
    background-color: #e8f0fe;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.payments-table tbody tr:last-child td {
    border-bottom: none;
}

/* تحسينات responsive لجدول الدفعات على الهواتف */
@media (max-width: 768px) {
    .payments-table {
        min-width: 900px;
        font-size: var(--font-size-xs);
    }
    
    .payments-table th,
    .payments-table td {
        padding: 10px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* تثبيت عمود التاريخ */
    .payments-table td:first-child,
    .payments-table th:first-child {
        position: sticky;
        right: 0;
        background: white;
        z-index: 1;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        font-weight: 600;
    }
    
    .payments-table thead th:first-child {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .payments-table tbody tr:nth-child(even) td:first-child {
        background-color: #f8f9fa;
    }
    
    .payments-table tbody tr:hover td:first-child {
        background-color: #e8f0fe;
    }
}



/* ==================== تحسينات صفحة جدول السائقين ==================== */

/* أدوات الفلترة والبحث */
.controls {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 2;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: var(--transition-base);
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select {
    flex: 1;
    min-width: 180px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: var(--transition-base);
    background: white;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-refresh {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* تحسين البطاقات الإحصائية على الكمبيوتر */
@media (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
        max-width: 900px;
    }
    
    .stat-card {
        padding: var(--spacing-lg);
        min-height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: var(--font-size-sm);
    }
}

/* تحسين البطاقات الإحصائية على الهاتف */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
    
    .stat-card {
        padding: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: var(--font-size-xs);
    }
    
    .controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .search-input,
    .filter-select {
        width: 100%;
        min-width: unset;
    }
    
    .btn-refresh {
        width: 100%;
    }
}

/* تحسين الجدول على الكمبيوتر */
@media (min-width: 769px) {
    .table-container {
        overflow-x: auto;
        margin-bottom: var(--spacing-lg);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-md);
    }
    
    .table {
        width: 100%;
        min-width: 1200px;
    }
    
    .table th {
        font-size: var(--font-size-sm);
        padding: 12px 10px;
    }
    
    .table td {
        font-size: var(--font-size-sm);
        padding: 10px;
    }
}



/* تحسين الأزرار الجانبية على الكمبيوتر */
@media (min-width: 769px) {
    .action-btn {
        padding: 16px 12px;
        min-width: 120px;
        max-width: 140px;
    }
    
    .action-icon {
        font-size: 32px;
    }
    
    .action-btn span {
        font-size: 13px;
    }
}

/* تحسين عرض المحتوى الرئيسي على الكمبيوتر */
@media (min-width: 769px) {
    .main-content {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .content-wrapper {
        display: flex;
        gap: var(--spacing-lg);
    }
    
    .primary-content {
        flex: 1;
    }
    
    .sidebar-actions {
        flex-shrink: 0;
        width: 160px;
    }
}




/* ==================== صفحة إدارة السائقين ==================== */

/* Controls Section */
.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    width: 300px;
    direction: rtl;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.add-btn:hover {
    transform: translateY(-2px);
}

/* Drivers Grid */
.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Driver Card */
.driver-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.driver-card:hover {
    transform: translateY(-5px);
}

.driver-header {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.driver-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.driver-phone {
    opacity: 0.9;
    font-size: 1.1rem;
}

.driver-body {
    padding: 1.5rem;
}

.driver-info {
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-label {
    color: #6b7280;
}

.info-value {
    font-weight: 600;
    color: #1f2937;
}

.alerts {
    margin-bottom: 1rem;
}

.driver-actions {
    display: flex;
    gap: 0.5rem;
}

.driver-actions .action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    min-height: auto;
    max-width: none;
    width: auto;
}

.edit-btn {
    background: #f59e0b;
    color: white;
}

.edit-btn:hover {
    background: #d97706;
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Responsive للسائقين */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .drivers-grid {
        grid-template-columns: 1fr;
    }
}



/* ==================== أنماط تفاصيل السائق ==================== */
.details-section {
    margin-bottom: 25px;
    background: rgba(248, 249, 250, 0.5);
    padding: 20px;
    border-radius: 12px;
}

.details-section-title {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.detail-item strong {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 4px;
}

.detail-item span {
    display: block;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-item small {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 600;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

/* حالات انتهاء الوثائق */
.detail-item.status-ok {
    background: var(--success-light);
    border-color: var(--success-color);
}

.detail-item.status-ok small {
    color: var(--success-color);
}

.detail-item.status-warning {
    background: var(--warning-light);
    border-color: var(--warning-color);
}

.detail-item.status-warning small {
    color: #d97706;
}

.detail-item.status-danger {
    background: var(--danger-light);
    border-color: var(--danger-color);
}

.detail-item.status-danger small {
    color: var(--danger-color);
}

.detail-item.status-expired {
    background: #f8d7da;
    border-color: #dc3545;
}

.detail-item.status-expired small {
    color: #dc3545;
    font-weight: 700;
}

.detail-item.status-unknown {
    background: #f8f9fa;
    border-color: #6c757d;
}

.detail-item.status-unknown small {
    color: #6c757d;
}

/* الألوان للقيم المالية */
.detail-item .positive {
    color: var(--success-color);
    font-weight: 700;
}

.detail-item .negative {
    color: var(--danger-color);
    font-weight: 700;
}

.detail-item .zero {
    color: var(--text-secondary);
}

/* تحسين النوافذ المنبثقة على الشاشات الصغيرة */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .details-section {
        padding: 15px;
    }
    
    .details-section-title {
        font-size: 16px;
    }
}


/* ==================== Cars Page Styles ==================== */

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.car-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.car-header {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.car-plate {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.car-model {
    opacity: 0.9;
    font-size: 1.1rem;
}

.car-body {
    padding: 1.5rem;
}

.car-info {
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-label {
    color: #6b7280;
}

.info-value {
    font-weight: 600;
    color: #1f2937;
}

.alerts {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.alert-urgent {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.car-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state p {
    font-size: 1rem;
}

.loading-container {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .cars-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .car-card {
        margin-bottom: 1rem;
    }
    
    .car-header {
        padding: 1rem;
    }
    
    .car-plate {
        font-size: 1.2rem;
    }
    
    .car-model {
        font-size: 1rem;
    }
    
    .car-body {
        padding: 1rem;
    }
}



/* ====================================
   تنسيقات صفحة إدارة المستخدمين
   ==================================== */

/* جدول المستخدمين */
.users-table {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.users-table h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* الجدول للكمبيوتر */
.desktop-table {
    width: 100%;
    border-collapse: collapse;
}

.desktop-table th,
.desktop-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.desktop-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.desktop-table tr:hover {
    background: var(--bg-gray);
}

/* شارات الأدوار */
.role-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin {
    background: var(--danger-color);
    color: white;
}

.role-accountant {
    background: var(--primary-color);
    color: white;
}

.role-driver {
    background: #6c757d;
    color: white;
}

/* شارات الحالة */
.status-active {
    background: var(--success-color);
    color: white;
}

.status-inactive {
    background: #6c757d;
    color: white;
}

/* أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

/* وضع الموبايل */
@media (max-width: 768px) {
    /* إخفاء الجدول على الموبايل */
    .desktop-table {
        display: none !important;
    }
    
    /* إظهار البطاقات على الموبايل */
    .mobile-cards {
        display: block !important;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .users-table {
        padding: 15px;
    }
}


/* ==================== Filter Statistics ==================== */
.filter-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .filter-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
