* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --dark-bg: #121212; --sidebar-bg: #1A1A1A; --light-bg: #F4F7FA;
    --accent-color: #D4AF37; --text-main: #1C1C1C;
    --text-muted: #6B6B6B; --border-color: #EAEAEA;
    --success: #10B981; --warning: #F59E0B; --danger: #EF4444;
}

/* Gövdə sığortası: Sağa sürüşməni tam qadağan edirik */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    height: 100%;
}

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--light-bg); 
    color: var(--text-main); 
    display: flex; 
    min-height: 100vh; 
}

a { text-decoration: none; color: inherit; }

/* ========================================= */
/* MAIN CONTENT (Əsas Məzmun)                */
/* ========================================= */
.main-content { 
    flex: 1; 
    margin-left: 280px; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    width: calc(100% - 280px); /* Desktop üçün dəqiq ölçü */
}

/* Top Header */
.top-header { 
    background: #fff; 
    padding: 20px 40px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 50; 
}

.search-bar { 
    display: flex; 
    align-items: center; 
    background: var(--light-bg); 
    padding: 10px 20px; 
    border-radius: 8px; 
    width: 300px; 
    gap: 10px; 
}
.search-bar input { border: none; background: transparent; outline: none; font-family: 'Poppins', sans-serif; font-size: 14px; width: 100%; }

.admin-profile { display: flex; align-items: center; gap: 15px; }
.profile-info { text-align: right; }
.profile-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.profile-role { font-size: 12px; color: var(--text-muted); }
.profile-img { width: 45px; height: 45px; border-radius: 12px; background: var(--dark-bg); color: var(--accent-color); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }

/* Dashboard Container */
.dashboard-container { padding: 40px; width: 100%; }
.page-title { font-size: 26px; font-weight: 700; margin-bottom: 5px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 30px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; margin-bottom: 40px; }
.stat-card { background: #fff; padding: 25px; border-radius: 16px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-main); }
.stat-icon { width: 60px; height: 60px; border-radius: 15px; background: rgba(212, 175, 55, 0.1); color: var(--accent-color); display: flex; align-items: center; justify-content: center; }

/* ========================================= */
/* TABLE SECTION - LOKAL SCROLL SİSTEMİ      */
/* ========================================= */
.table-section { 
    background: #fff; 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); 
    overflow: hidden; /* Cədvəlin kənarlarını kəsməsi üçün */
    width: 100%;
}

.table-header { padding: 25px 30px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }

/* BU HİSSƏ CƏDVƏLİ SÜRÜŞDÜRÜR */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; min-width: 900px; /* Mobildə formanı qoruyur */ }
th { text-align: left; padding: 15px 30px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border-color); background: var(--light-bg); }
td { padding: 20px 30px; font-size: 14px; color: var(--text-main); border-bottom: 1px solid var(--border-color); }

.status-badge { padding: 6px 12px; border-radius: 30px; font-size: 12px; font-weight: 600; }
.status-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

/* ========================================= */
/* 📱 MEDIA QUERIES (TOTAL RESPONSIVE)       */
/* ========================================= */

@media (max-width: 1200px) {
    .main-content { margin-left: 0; width: 100%; }
    .top-header { padding: 20px; }
}

@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dashboard-container { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .table-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .btn-primary { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .page-title { font-size: 20px; }
    .stat-value { font-size: 22px; }
    .table-title { font-size: 16px; }
}

/* ========================================= */
/* 📱 TOP HEADER MOBİL OPTİMİZASİYASI        */
/* ========================================= */

@media (max-width: 768px) {
    .top-header {
        padding: 10px 15px;
        flex-wrap: wrap; /* Elementlərin alt-alta keçməsinə icazə verir */
        gap: 10px;
    }

    /* Axtarış çubuğunu mobildə tam en (full width) edirik ki, rahat istifadə olunsun */
    .search-bar {
        display: flex !important; /* Gizli idisə geri qaytarırıq */
        order: 3; /* Elementi ən aşağı sıraya salır */
        width: 100%;
        margin-top: 5px;
        padding: 8px 15px;
    }

    .admin-profile {
        gap: 10px;
        order: 2; /* Profil sağda qalsın */
    }

    /* Profil məlumatlarını (CEO yazısını) mobildə gizli saxlayırıq ki, yer tutmasın, 
       amma bildiriş və avatarı göstəririk */
    .profile-info {
        display: none; 
    }

    .notification-btn {
        display: block !important;
        margin-right: 5px;
    }

    /* Hamburger düyməsinə (əgər varsa) birinci sıra veririk */
    .mobile-nav-toggle {
        order: 1;
    }
}

@media (max-width: 480px) {
    .profile-img {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .notification-btn svg {
        width: 20px;
        height: 20px;
    }
}