





/* css/style.css */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* الهيدر */
.header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav a:hover, .nav a.active {
    background: var(--secondary);
    transform: translateY(-2px);
}

.user-info {
    background: var(--dark);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* المحتوى الرئيسي */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: none;
}

/* النماذج */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.25rem;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* الجداول */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}


@media (max-width: 500px) {
    .responsive-table {
        border: 1px solid #ddd;
        border-radius: 8px;
    }
    
    .table {
        min-width: 100%;
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .table th {
        background: #3498db;
        color: white;
        font-weight: 600;
    }
} */



.table th,
.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.table tr:hover {
    background: #f8f9fa;
}

/* البطاقات الإحصائية */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}*/

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

/* صفحة تسجيل الدخول */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 2rem;
}

/* الرسائل */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border-left: 5px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

/* حالة التذاكر */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-open { background: #d4edda; color: #155724; }
.status-in_progress { background: #fff3cd; color: #856404; }
.status-resolved { background: #cce7ff; color: #004085; }
.status-closed { background: #e2e3e5; color: #383d41; }

/* الفوتر */
.footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .login-container {
        padding: 2rem 1.5rem;
    }
}

/* تأثيرات إضافية */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.6s ease;
}

/* شريط التقدم */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--success));
    transition: width 0.3s ease;
}

/* زر تسجيل الخروج في الشريط الجانبي */
.sidebar-nav .logout-btn {
    margin-top: auto;
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid #e74c3c;
}

.sidebar-nav .logout-btn:hover {
    background: #e74c3c;
    color: white;
}



/* progress bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #27ae60);
    transition: width 0.3s ease;
}



/* styles.css - إضافة هذه الأنماط */

/* أساسيات الجوال */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo {
        font-size: 18px !important;
    }
    
    /* إخفاء القائمة العادية في الجوال */
    .nav {
        display: none;
    }
    
    /* زر القائمة للجوال */
    .mobile-menu-btn {
        display: block !important;
        background: #3498db;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        font-size: 18px;
        cursor: pointer;
    }
}

/* القائمة الجانبية للجوال */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: #2c3e50;
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    padding: 20px;
    background: #34495e;
    display: flex;
    justify-content: between;
    align-items: center;
    border-bottom: 1px solid #4a6278;
}

.mobile-nav-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.mobile-nav-links {
    padding: 20px;
}

.mobile-nav-links a {
    display: block;
    color: white;
    padding: 12px 15px;
    margin-bottom: 8px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: #3498db;
}

/* للشاشات الكبيرة */
@media (min-width: 769px) {
    .mobile-menu-btn,
    .mobile-nav-overlay,
    .mobile-nav {
        display: none;
    }
    
    .nav {
        display: flex !important;
        align-items: center;
        gap: 15px;
    }
}

/* تحسينات عامة للجوال */
@media (max-width: 480px) {
    .logo {
        font-size: 16px !important;
    }
    
    .mobile-nav {
        width: 100%;
        right: -100%;
    }
    
    .user-info {
        font-size: 14px;
    }
}







/* إضافة هذه الأنماط للجوال */
.mobile-user-info {
    color: white;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    margin: 1rem 0;
    text-align: center;
}

.mobile-user-info small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

.mobile-logout-btn {
    background: #e74c3c !important;
    color: white !important;
    text-align: center;
    margin-top: 10px !important;
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 360px) {
    .logo {
        font-size: 14px !important;
    }
    
    .mobile-nav-links a {
        padding: 10px 12px;
        font-size: 14px;
    }
}




/* ===== تحسين الجداول للجوال ===== */

/* حاوية الجدول المتجاوبة */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* scroll سلس للايفون */
    margin: 1rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* الجدول الأساسي */
.table {
    width: 100%;
    min-width: 600px; /* أدنى عرض للجدول */
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.8rem;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap; /* منع تكرار النص */
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #3498db;
}

.table tr:hover {
    background: #f8f9fa;
}

/* تحسينات للهواتف الصغيرة */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        margin: 0.8rem 0;
        border: 1px solid #ddd;
    }
    
    .table {
        min-width: 500px;
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.8rem;
    }
    
    /* إخفاء الأعمدة غير الأساسية في الجوال */
    .table th.mobile-hide,
    .table td.mobile-hide {
        display: none;
    }
}

@media (max-width: 480px) {
    .table-responsive {
        margin: 0.5rem 0;
        border-radius: 6px;
    }
    
    .table {
        min-width: 400px;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.6rem;
    }
    
    /* جعل أعمدة الإجراءات ثابتة */
    .table .actions-cell {
        position: sticky;
        right: 0;
        background: white;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        z-index: 5;
    }
}

/* شريط التمرير المخصص */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* تخصيص للأعمدة المهمة */
.table-col-important {
    min-width: 150px;
    font-weight: 500;
}

.table-col-compact {
    min-width: 100px;
}

.table-col-actions {
    min-width: 120px;
    position: sticky;
    right: 0;
    background: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

/* حالة التذاكر في الجداول */
.status-cell {
    min-width: 100px;
}

.priority-cell {
    min-width: 80px;
}

/* تحسينات للعرض العمودي في الجوال جداً */
@media (max-width: 360px) {
    .table {
        min-width: 350px;
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.5rem;
    }
}

/* مؤشر أن الجدول قابل للتمرير */
.table-responsive::after {
    content: "← اسحب لرؤية المزيد →";
    display: none;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .table-responsive::after {
        display: block;
    }
}

/* تحسينات للأزرار داخل الجداول في الجوال */
@media (max-width: 768px) {
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        margin: 0.1rem;
    }
    
    .table .btn {
        min-width: 60px;
        text-align: center;
    }
}

/* تناوب ألوان الصفوف للقراءة الأسهل */
.table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.table tbody tr:hover {
    background-color: #f0f7ff;
}




.card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: none;
    animation: fadeIn 0.6s ease;
}

/* ===== النماذج ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* ===== الجداول ===== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0;
}

.table th,
.table td {
    padding: 0.8rem;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #3498db;
}

.table tr:hover {
    background: #f0f7ff;
}

/* أعمدة ثابتة وإخفاء أعمدة الجوال */
.table .actions-cell {
    position: sticky;
    right: 0;
    background: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 5;
}

.mobile-hide { display: table-cell; }

/* ===== الرسائل ===== */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border-left: 5px solid;
}

.alert-success { background: #d4edda; border-color: var(--success); color: #155724; }
.alert-danger { background: #f8d7da; border-color: var(--danger); color: #721c24; }
.alert-warning { background: #fff3cd; border-color: var(--warning); color: #856404; }

/* ===== الفوتر ===== */
.footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* ===== التجاوب ===== */
@media (max-width: 768px) {
    .header .container { flex-direction: column; gap: 1rem; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr; }
    
    .table {
        min-width: 500px;
        font-size: 0.85rem;
    }
    .table th, .table td { padding: 0.6rem 0.8rem; }
    .mobile-hide { display: none; }
    .btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; margin: 0.1rem; }
}

@media (max-width: 480px) {
    .table {
        min-width: 400px;
        font-size: 0.8rem;
    }
    .table th, .table td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 360px) {
    .table {
        min-width: 350px;
        font-size: 0.75rem;
    }
    .table th, .table td { padding: 0.4rem 0.5rem; }
}

/* شريط التمرير المخصص */
.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.table-responsive::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.table-responsive::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* مؤشر التمرير للجوال */
.table-responsive::after {
    content: "← اسحب لرؤية المزيد →";
    display: none;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    .table-responsive::after { display: block; }
}

/* ===== تأثيرات إضافية ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
