/* --- Base Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /* Pink and semi-pink gradient background */
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(40px); /* Starts slightly lower */
    }
    100% {
        opacity: 1;
        transform: translateY(0); /* Settles in place */
    }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Login Box Container --- */
.login-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    
    /* Applies the slide-up animation to the main box */
    animation: slideInUp 0.6s ease-out forwards;
}

/* --- Header Text --- */
.login-header {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0; /* Hidden before animation starts */
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.3s; /* Delays so the box loads first */
}

.login-header h2 {
    color: #1a365d; /* Dark professional blue */
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 0.95rem;
}

/* --- Error Messages --- */
.error-msg {
    background-color: #fed7d7;
    color: #c53030;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- Form Inputs --- */
.input-group {
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.5s;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f7fafc;
    transition: all 0.3s ease; /* Smooth transition for focus */
}

/* Animation when the user clicks inside the text box */
.input-group input:focus {
    border-color: #3182ce;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

/* --- Login Button --- */
.login-btn {
    width: 100%;
    padding: 14px;
    background-color: #3182ce;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transition for hover */
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.7s;
}

/* Animation when the user hovers over the button */
.login-btn:hover {
    background-color: #2b6cb0;
    transform: translateY(-2px); /* Lifts the button up slightly */
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3); /* Adds a shadow */
}

.login-btn:active {
    transform: translateY(0); /* Pushes it back down when clicked */
}


/* =========================================
   DASHBOARD STYLES (Admin, Leader, User)
   ========================================= */

/* Override the pink login background for dashboards */
body.dashboard-body {
    background: #fff5f7; /* Very soft blush background */
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #831843; /* Deep professional maroon-pink */
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.5rem;
    border-bottom: 1px solid #be185d; /* Lighter pink border */
    padding-bottom: 15px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 15px;
}

.sidebar ul li a {
    color: #cbd5e0;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar ul li a:hover, 
.sidebar ul li a.active {
    background-color: #db2777; /* Vibrant rose pink for active links */
    color: white;
}

.sidebar ul li a.logout-btn {
    background-color: #c53030;
    color: white;
    margin-top: 50px;
}

.sidebar ul li a.logout-btn:hover {
    background-color: #9b2c2c;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column; /* Stacks Top Bar above the rest */
    height: 100vh;
    overflow: hidden;
}

.main-content header {
    margin-bottom: 40px;
}

.main-content header h1 {
    color: #2d3748;
    margin-bottom: 8px;
}

.main-content header p {
    color: #718096;
}

/* Dashboard Cards */
.dashboard-cards {
    display: flex;
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(219, 39, 119, 0.08); /* Soft pink shadow */
    flex: 1;
    border-top: 4px solid #db2777; /* Rose pink top border */
}

.card h3 {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 15px;
}

.card h2 {
    color: #831843; /* Deep pink text for the numbers */
    font-size: 2.2rem;
}

/* =========================================
   FORMS & TABLES (User Management)
   ========================================= */
.admin-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.admin-card h3 {
    margin-bottom: 20px;
    color: #831843; /* Deep pink for card titles */
    border-bottom: 2px solid #fce7f3; /* Very light pink divider */
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .input-group {
    flex: 1;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f7fafc;
}

.btn-primary {
    background-color: #db2777; /* Rose pink */
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover { 
    background-color: #be185d; /* Darker pink on hover */
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background-color: #f7fafc;
    color: #4a5568;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.role-admin { background-color: #bee3f8; color: #2b6cb0; }
.role-leader { background-color: #c6f6d5; color: #2f855a; }
.role-requestor { background-color: #feebc8; color: #c05621; }
.role-bhw { background-color: #e9d8fd; color: #a71c8f; }

.btn-small {
    padding: 6px 12px;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Alerts */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 8px; font-weight: bold; }
.alert.success { background-color: #c6f6d5; color: #2f855a; }
.alert.error { background-color: #fed7d7; color: #c53030; }



/* This container will hold your cards and tables and allow scrolling */
.dashboard-scroll-area {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* =========================================
   SIDEBAR BOTTOM PROFILE
   ========================================= */
.sidebar-bottom {
    margin-top: auto; /* Pushes this section to the very bottom */
    border-top: 1px solid #be185d; /* Light pink divider */
    padding-top: 20px;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 5px;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    background: white;
    color: #831843; /* Deep pink text */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sidebar-profile-info {
    display: flex;
    flex-direction: column;
}

.sidebar-profile-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: white;
}

.sidebar-profile-role {
    font-size: 0.75rem;
    color: #fbcfe8; /* Soft light pink */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info {
    text-align: right;
}

.profile-name {
    display: block;
    font-weight: bold;
    color: #831843;
    font-size: 0.95rem;
}

.profile-role {
    display: block;
    color: #db2777;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(190, 24, 93, 0.3);
}

/* =========================================
   TABLE PAGINATION STYLES
   ========================================= */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #fff5f7;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #fce7f3;
}

.per-page-selector label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: bold;
    margin-right: 8px;
}

.per-page-selector select {
    width: auto;
    padding: 6px 12px;
    border-radius: 6px;
    border: 2px solid #fbcfe8;
    color: #831843;
    font-weight: bold;
    cursor: pointer;
    background: white;
}

.pagination-buttons button {
    background: #db2777; /* Rose pink */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.pagination-buttons button:hover:not(:disabled) {
    background: #be185d;
}

.pagination-buttons button:disabled {
    background: #fbcfe8; /* Faded pink for disabled state */
    cursor: not-allowed;
}

.pagination-buttons .page-info {
    font-weight: bold;
    color: #831843;
    margin: 0 15px;
    font-size: 0.95rem;
}

/* =========================================
   SIDEBAR DROPDOWN MENUS
   ========================================= */
.sidebar-dropdown-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: #cbd5e0;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.sidebar-dropdown-btn:hover {
    background-color: #db2777; /* Rose pink hover */
    color: white;
}

.sidebar-dropdown-btn.active-dropdown {
    background-color: #831843; /* Darker pink when open */
    color: white;
}

/* The hidden submenu list */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0,0,0,0.1); /* Slight dark background to indent */
    border-radius: 8px;
    margin-top: 5px;
}

/* Indent the submenu links slightly */
.sidebar-submenu li a {
    padding: 10px 15px 10px 30px !important; 
    font-size: 0.9rem;
    color: #fbcfe8 !important; /* Lighter pink text for sub-items */
}

.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
    color: white !important;
    background-color: transparent !important;
    text-decoration: underline;
}

/* The arrow icon */
.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* Rotates the arrow when open */
.rotate-arrow {
    transform: rotate(180deg);
}

.role-cac_head { background-color: #2b6cb0; color: white; }
/* =========================================
   MOBILE RESPONSIVENESS (Phones & Tablets)
   ========================================= */
/* =========================================
   MOBILE RESPONSIVENESS (Phones & Tablets)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Stack the dashboard layout vertically */
    body.dashboard-body {
        flex-direction: column;
        height: auto;
    }

    /* 2. Adjust Sidebar */
    .sidebar {
        width: 100%;
        padding: 20px;
    }

    .sidebar h2 {
        margin-bottom: 20px;
    }

    /* Fix the sidebar links so dropdowns stack neatly */
    .sidebar > div > ul {
        display: flex;
        flex-direction: column; 
        gap: 5px;
    }

    .sidebar ul li a.logout-btn {
        margin-top: 15px;
    }

    /* 3. Adjust Main Content padding */
    .main-content {
        padding: 10px;
    }
    
    .dashboard-scroll-area {
        padding: 15px;
    }

    /* 4. Stack Dashboard Cards & Form inputs */
    .dashboard-cards {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* 5. Fix the squished Tabs */
    .tab-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    /* 6. Fix Squished Tables (Force sideways scroll) */
    .table-card {
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on phones */
    }
    
    .data-table {
        min-width: 700px; /* Forces the table to stay wide so it scrolls instead of squishing */
    }
}