/* ----------------------------------- */
/* FIX: Robust reset for background image positioning */
/* ----------------------------------- */
html {
    margin: 0;
    padding: 0;
    /* Ensures the HTML container takes up 100% of the viewport height */
    height: 100%; 
    /* FIX: Removing overflow: hidden to allow scrolling */
}

/* ===== BASE ===== */
body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: #eef1f5;
    margin: 0;
    padding: 0; /* Ensures the background image starts flush with the viewport edge */
    
    /* Ensures the body container takes up 100% of the HTML/viewport height */
    height: 100%;
    min-height: 100vh;
    box-sizing: border-box;

    /* --- BACKGROUND IMAGE STYLES --- */
    background-image: url("images/BEG-Brand-Values-Branding-Teams-Background-01.png");
    background-size: cover; 
    /* Explicitly prioritize the top of the image */
    background-position: top center; 
    background-repeat: no-repeat; 
    /* Keep background fixed so it doesn't scroll with the content */
    background-attachment: fixed; 
}

/* ===== TOP NAVIGATION BAR (New Section) ===== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px; /* Set a fixed height for the bar */
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000; /* Ensure it stays above other content */
    display: flex;
    justify-content: center; /* Center the logo horizontally */
    align-items: center; /* Center the logo vertically */
}

.navbar-logo {
    height: 50px; /* Logo size */
    width: auto;
    border-radius: 4px; /* Optional: adds a slight visual touch */
}


/* ===== GRID LAYOUT ===== */
.dashboard-container {
    display: grid;
    /* Responsive grid: min 300px, max 1fr */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.9); /* Lighter background for readability */
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    /* ADJUSTED MARGIN: 80px (navbar height) + 40px (original margin) = 120px top margin */
    margin: 120px auto 40px auto; 
    max-width: 1400px;
}

/* ===== DEPARTMENT CARD (Parent container) ===== */
.dept-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #ddd;
}

.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

/* ===== TITLES (Uses the dynamically set variable) ===== */
.dept-title {
    text-align: center;
    background: var(--dept-color);
    color: white;
    padding: 12px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 8px;
    margin: 0 0 15px 0;
}

/* ===== COUNT CARD (Uses the dynamically set variable) ===== */
.count-card {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    font-size: 64px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    background: var(--dept-color);
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* ===== TABLE ===== */
.info-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.info-table th {
    background: color-mix(in srgb, var(--dept-color) 20%, white);
    color: #333;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.info-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.info-table tbody tr:last-child td {
    border-bottom: none;
}

.info-table tr:hover td {
    background: #f5f5f5;
}

/* ---------------------------------------------------- */
/* ===== GLOBAL LOADER STYLES (Rolling Effect) ===== */
/* ---------------------------------------------------- */
#global-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    font-size: 24px;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite ease-in-out;
}

/* Pulse Animation for text */
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Rolling Circle Spinner */
.rolling-circle {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3; 
    border-top: 6px solid #3498db; 
    border-radius: 50%;
    animation: roll-spin 1s linear infinite;
}

@keyframes roll-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------------------------------------------------- */
/* ===== Removed #live-badge styles ===== */
/* ---------------------------------------------------- */