/* --- Admin Global Reset --- */
:root {
    --admin-navy: #003366;
    --admin-gold: #C5A059;
    --admin-white: #ffffff;
    --admin-bg: #f0f2f5;
    --admin-text: #333333;
    --sidebar-width: 280px;
}

body.admin-body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--admin-bg);
    color: var(--admin-text);
    overflow: hidden; /* Prevents double scrollbars */
}

.admin-container {
    display: flex;
    height: 100vh;
}

/* --- Sidebar Logic --- */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--admin-navy);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 30px 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-logo { width: 45px; height: 45px; border-radius: 8px; }

.brand-text { font-weight: 700; font-size: 18px; line-height: 1; }
.brand-text span { color: var(--admin-gold); display: block; font-size: 12px; margin-bottom: 4px; }

.admin-nav { padding: 10px 5px; flex-grow: 1; }

.nav-group {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin: 20px 0 10px 10px;
    letter-spacing: 1px;
}

.nav-item {
    width: 100%;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 12px 15px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.2s;
}

.nav-item i { width: 20px; text-align: center; }

.nav-item:hover, .nav-item.active {
    background: var(--admin-gold);
    color: var(--admin-navy);
    font-weight: 600;
}

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

.btn-logout {
    width: 100%;
    padding: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Main Content Logic --- */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-topbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-bar {
    background: #f4f7f6;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    border-radius: 30px;
    background: #f4f7f6;
}

.user-pill img { width: 30px; border-radius: 50%; }

/* --- Content Wrapper --- */
#module-container { padding: 30px; }

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Mobile Responsive Logic --- */

/* Hide mobile header on desktop */
.mobile-admin-header {
    display: none;
    background: var(--admin-navy);
    color: white;
    padding: 15px 20px;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.mobile-logo-group { display: flex; align-items: center; gap: 10px; }
.mobile-logo-group img { width: 30px; height: 30px; }

.mobile-nav-toggle {
    background: none;
    border: none;
    color: var(--admin-gold);
    font-size: 24px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media screen and (max-width: 1024px) {
    .admin-container { flex-direction: column; }

    /* Hide Desktop Topbar Search on Mobile to save space */
    .admin-topbar .search-bar { display: none; }

    .mobile-admin-header { display: flex; }

    .admin-sidebar {
        position: fixed;
        left: -100%; /* Hide off-screen */
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: 0.3s ease-in-out;
        width: 280px;
    }

    /* When the sidebar is active */
    .admin-sidebar.active { left: 0; }
    .sidebar-overlay.active { display: block; }

    /* Stack Analytics Cards in 1 or 2 columns */
    #module-container .stat-grid {
        grid-template-columns: 1fr !important; 
    }

    /* Force tables to scroll horizontally on small screens */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Analytics Layout --- */
.admin-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.current-date { color: #888; font-size: 14px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.stat-card h3 { font-size: 32px; margin: 10px 0 0; color: var(--admin-navy); }
.stat-card.navy-border { border-left: 5px solid var(--admin-navy); }
.stat-card.gold-border { border-left: 5px solid var(--admin-gold); }
.stat-card.green-border { border-left: 5px solid #27ae60; }
.stat-card.red-border { border-left: 5px solid #e74c3c; }

/* --- Activity Cards Grid --- */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.card-header h4 { margin: 0; font-size: 16px; color: var(--admin-navy); }

/* --- Mini Tables --- */
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: #aaa; padding-bottom: 10px; }
.mini-table td { padding: 12px 0; border-bottom: 1px solid #f9f9f9; font-size: 13px; }

/* Button Text Style */
.btn-text {
    background: none;
    border: none;
    color: var(--admin-gold);
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}

.btn-text:hover { text-decoration: underline; }

/* Status Dot Component */
.status-dot {
    height: 8px; width: 8px; border-radius: 50%; display: inline-block; margin-right: 5px;
}
.status-dot.in-transit { background: #3498db; }
.status-dot.pending { background: var(--admin-gold); }
.status-dot.delivered { background: #27ae60; }

/* Mobile View for Activity Grid */
@media screen and (max-width: 1100px) {
    .activity-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}









