* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Cairo', sans-serif; 
    background: #f5f7fa; 
}

/* ===== شريط التنقل ===== */
.navbar {
    background: linear-gradient(135deg, #002b5c, #004481);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 900; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span { 
    color: #ffd700; 
}

.nav-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
}

.nav-links a i {
    color: #ffd700;
}

.nav-search {
    position: relative;
    margin: 0 20px;
    flex: 1;
    max-width: 300px;
}

.nav-search input {
    width: 100%;
    padding: 8px 35px 8px 15px;
    border-radius: 50px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    font-family: 'Cairo', sans-serif;
}

.nav-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.nav-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffd700;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    margin-top: 5px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
}

.search-result-item:hover {
    background: #f0f2f5;
}

.user-menu { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 700;
    color: #ffd700;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.9;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #002b5c;
    font-weight: 900;
    cursor: pointer;
}

.logout-btn {
    background: transparent;
    border: 1px solid #ffd700;
    color: #ffd700;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ffd700;
    color: #002b5c;
}

/* ===== المحتوى الرئيسي ===== */
.main-content { 
    max-width: 1400px; 
    margin: 30px auto; 
    padding: 0 20px; 
}

/* ===== بطاقة الترحيب ===== */
.welcome-card {
    background: linear-gradient(135deg, #002b5c, #004481);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.2), transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.welcome-text {
    position: relative;
    z-index: 1;
}

.welcome-text h2 { 
    font-size: 2rem; 
    margin-bottom: 10px;
}

.date-badge {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 50px;
    position: relative;
    z-index: 1;
}

/* ===== شبكة الإحصائيات ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,43,92,0.15);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #002b5c);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,215,0,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffd700;
}

.stat-info {
    flex: 1;
}

.stat-value { 
    font-size: 1.8rem; 
    font-weight: 700; 
    color: #002b5c; 
    line-height: 1.2;
}

.stat-label { 
    color: #6c757d; 
    font-size: 0.9rem; 
}

.stat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

.stat-trend {
    font-size: 0.8rem;
    margin-top: 5px;
}

.trend-up {
    color: #28a745;
}

.trend-down {
    color: #dc3545;
}

/* ===== الرسوم البيانية ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

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

.chart-header h3 { 
    color: #002b5c; 
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 i {
    color: #ffd700;
}

.chart-period {
    background: #f0f2f5;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #6c757d;
}

.chart-container { 
    height: 300px; 
}

/* ===== الإجراءات السريعة ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.action-card:hover {
    border-color: #ffd700;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255,215,0,0.2);
}

.action-icon {
    width: 60px;
    height: 60px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: #002b5c;
}

.action-card h4 {
    color: #002b5c;
    margin-bottom: 5px;
}

.action-card p {
    color: #6c757d;
    font-size: 0.8rem;
}

.action-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ===== قسم الطلبات الجديدة ===== */
.requests-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    color: #002b5c;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.section-header h3 i {
    color: #ffd700;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #ffd700;
    color: #002b5c;
}

.btn-primary:hover {
    background: #002b5c;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid #002b5c;
    color: #002b5c;
}

.btn-outline:hover {
    background: #002b5c;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.view-all {
    background: #ffd700;
    color: #002b5c;
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.view-all:hover {
    background: #002b5c;
    color: white;
}

/* ===== جداول البيانات ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #002b5c;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e1e5e9;
}

tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-progress {
    background: #cce5ff;
    color: #004085;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-review {
    background: #e2e3e5;
    color: #383d41;
}

.role-badge {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

.role-inspector {
    background: #ffd700;
    color: #002b5c;
}

.role-supervisor {
    background: #17a2b8;
    color: white;
}

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-sm {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    margin: 0 2px;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-edit {
    background: #ffd700;
    color: #002b5c;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-download {
    background: #6c757d;
    color: white;
}

.btn-sm:hover {
    transform: scale(1.05);
}

/* ===== حالة عدم وجود بيانات ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state h4 {
    color: #002b5c;
    margin-bottom: 10px;
}

/* ===== شاشة التحميل ===== */
.loading {
    text-align: center;
    padding: 30px;
}

.loading i {
    font-size: 2rem;
    color: #ffd700;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    text-align: center;
}

.loader i {
    font-size: 3rem;
    color: #ffd700;
    animation: spin 1s linear infinite;
}

/* ===== مركز التنبيهات ===== */
.notification-center {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.notification-btn {
    width: 60px;
    height: 60px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #002b5c;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255,215,0,0.4);
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.notification-panel {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 350px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
}

.notification-panel.show {
    display: block;
}

.notification-header {
    background: #002b5c;
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #fff3cd;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.notification-icon.info {
    background: #cce5ff;
    color: #004085;
}

.notification-icon.success {
    background: #d4edda;
    color: #155724;
}

.notification-icon.warning {
    background: #fff3cd;
    color: #856404;
}

.notification-icon.danger {
    background: #f8d7da;
    color: #721c24;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 3px;
}

.notification-time {
    font-size: 0.7rem;
    color: #6c757d;
}

/* ===== التجاوب مع الشاشات ===== */
@media (max-width: 1200px) {
    .stats-grid, .charts-grid, .quick-actions { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 992px) {
    .nav-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-grid, .charts-grid, .quick-actions { 
        grid-template-columns: 1fr; 
    }
    
    .welcome-card { 
        flex-direction: column; 
        text-align: center; 
        gap: 15px; 
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .section-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .notification-panel {
        width: 300px;
        left: -120px;
    }
}