/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background: #F5F7FA;
    color: #333;
    direction: rtl;
}

/* ===== صفحة الدخول ===== */
.login-page {
    background: linear-gradient(135deg, #2A5C8A, #1E4A70);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.login-header h1 {
    color: #2A5C8A;
    font-size: 24px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #2A5C8A;
    box-shadow: 0 0 0 3px rgba(42,92,138,0.1);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

/* ===== أزرار ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #2A5C8A;
    color: white;
}

.btn-primary:hover {
    background: #1E4A70;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== تنبيهات ===== */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #F8D7DA;
    color: #721C24;
    border-right: 4px solid #DC3545;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border-right: 4px solid #28A745;
}

/* ===== الشريط الجانبي ===== */
.sidebar {
    width: 260px;
    background: #2A5C8A;
    color: white;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    max-width: 150px;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-section {
    padding: 10px 20px 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 2px 10px;
    border-radius: 8px;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-right: 25px;
}

.sidebar-menu a.active {
    background: #1E4A70;
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.logout-btn {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ===== المحتوى الرئيسي ===== */
.main-content {
    margin-right: 260px;
    padding: 20px;
    min-height: 100vh;
    background: #F5F7FA;
}

/* ===== لوحة التحكم ===== */
.dashboard {
    padding: 20px;
}

/* شبكة الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.blue .stat-icon { background: #E3F2FD; color: #1976D2; }
.stat-card.green .stat-icon { background: #E8F5E9; color: #388E3C; }
.stat-card.purple .stat-icon { background: #F3E5F5; color: #7B1FA2; }
.stat-card.orange .stat-icon { background: #FFF3E0; color: #F57C00; }
.stat-card.red .stat-icon { background: #FFEBEE; color: #D32F2F; }
.stat-card.cyan .stat-icon { background: #E0F7FA; color: #0097A7; }

.stat-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

/* صفوف لوحة التحكم */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* البطاقات */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* الجداول */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: right;
    padding: 10px;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    border-bottom: 1px solid #F0F0F0;
}

.table td {
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid #F9F9F9;
}

.table tr:hover td {
    background: #F5F7FA;
}

/* شارات الحالة */
.badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background: #F8D7DA;
    color: #721C24;
}

.badge-success {
    background: #D4EDDA;
    color: #155724;
}

/* إجراءات سريعة */
.quick-actions {
    margin-top: 30px;
}

.quick-actions h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    background: #2A5C8A;
    color: white;
}

.action-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* أزرار صغيرة */
.btn-sm {
    padding: 5px 12px;
    background: #F0F0F0;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-sm:hover {
    background: #2A5C8A;
    color: white;
}

/* تنسيقات عامة */
.text-center { text-align: center; }
.text-success { color: #28A745; }

/* ===== للشاشات الصغيرة ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        right: -260px;
        transition: all 0.3s ease;
    }
    
    .sidebar.open {
        width: 260px;
        right: 0;
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}