/* Mobile Optimization */
@media (max-width: 768px) {
    .sidebar {
        display: none;
        /* Hides the sidebar on phones to save space */
    }

    .dashboard-workspace {
        margin-left: 0 !important;
        /* Removes the gap where the sidebar was */
        padding: 15px !important;
    }

    .top-nav {
        flex-direction: column;
        height: auto !important;
        padding: 10px !important;
    }

    .logo-text {
        font-size: 16px !important;
    }

    .search-bar {
        width: 100% !important;
        margin: 10px 0;
    }
}

/* --- THE CORPORATE PALETTE --- */
:root {
    --core-white: #ffffff;
    --off-white-bg: #f8f9fa;
    --executive-charcoal: #212529;
    --action-red: #d32f2f;
    --border-gray: #dee2e6;
}

/* --- SYSTEM RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* --- BASE STYLES --- */
body {
    background-color: var(--off-white-bg);
    color: var(--executive-charcoal);
}

/* --- UTILITY CLASSES --- */
.text-red {
    color: var(--action-red);
}

/* --- COMMAND BAR (HEADER) --- */
.top-nav {
    background-color: var(--core-white);
    height: 70px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 2px solid var(--border-gray);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
}



/* --- SEARCH BAR --- */
.search-bar input {
    width: 400px;
    padding: 10px 15px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--off-white-bg);
}

.search-bar input:focus {
    outline: 2px solid var(--action-red);
}

/* --- USER ACTIONS & BUTTONS --- */
.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-weight: 600;
    color: #555;
}

.btn-clock-in {
    background-color: var(--action-red);
    color: var(--core-white);
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-clock-in:hover {
    background-color: #b71c1c;
}

/* --- DASHBOARD WORKSPACE (UPDATED) --- */
.dashboard-workspace {
    margin-left: 250px;
    /* Pushes content exactly the width of the sidebar */
    padding: 40px;
    width: calc(100% - 250px);
    max-width: 1400px;
}

/* --- DASHBOARD GRID SYSTEM --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
}

/* --- THE CARDS --- */
.dashboard-card {
    background-color: var(--core-white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.dashboard-card h3 {
    font-size: 1.2rem;
    color: var(--executive-charcoal);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--off-white-bg);
    padding-bottom: 10px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- CARD INTERFACES (Buttons & Alerts) --- */
.btn-outline {
    background: transparent;
    border: 1px solid var(--executive-charcoal);
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: var(--executive-charcoal);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: var(--executive-charcoal);
    color: var(--core-white);
}

.alert-text {
    color: var(--action-red);
    font-weight: 700;
    margin: 0;
    font-size: 0.95rem;
}

/* --- DATA TABLES --- */
.table-container {
    background-color: var(--core-white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.table-container h3 {
    color: var(--executive-charcoal);
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--off-white-bg);
    padding-bottom: 10px;
}

.corporate-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.corporate-table th,
.corporate-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-gray);
}

.corporate-table th {
    background-color: var(--off-white-bg);
    color: var(--executive-charcoal);
    font-weight: 700;
}

.corporate-table tbody tr:nth-of-type(even) {
    background-color: #fcfcfc;
}

/* --- STATUS BADGES --- */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-badge.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.pending {
    background-color: #ffebee;
    color: var(--action-red);
}

/* --- SIDEBAR NAVIGATION --- */
.sidebar {
    position: fixed;
    /* Locks it to the screen */
    left: 0;
    top: 70px;
    /* Starts exactly under our 70px header */
    width: 250px;
    height: calc(100vh - 70px);
    /* Stretches to the bottom */
    background-color: var(--core-white);
    border-right: 1px solid var(--border-gray);
    padding-top: 20px;
}

.side-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    text-decoration: none;
    color: var(--executive-charcoal);
    padding: 15px 30px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    /* Invisible border ready for hover */
}

/* The Hover Effect */
.menu-item:hover {
    background-color: var(--off-white-bg);
    color: var(--action-red);
    border-left: 4px solid var(--action-red);
}

/* The Active Page Effect */
.menu-item.active {
    background-color: #ffebee;
    /* Very light red background */
    color: var(--action-red);
    border-left: 4px solid var(--action-red);
}

/* --- FOOTER --- */
.portal-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
    /* A muted, middle-management gray */
    font-size: 0.9rem;
}

@media (max-width: 768px) {

    /* 1. Show the hamburger menu button */
    .menu-toggle {
        display: block !important;
    }

    /* 2. Turn the sidebar into a hidden slide-out menu */
    .sidebar {
        position: fixed;
        left: -250px;
        /* Hidden off-screen */
        top: 70px;
        width: 250px;
        height: calc(100% - 70px);
        background-color: #212529;
        /* Solid charcoal background */
        transition: 0.3s ease-in-out;
        z-index: 999;
        display: block !important;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
    }

    /* 3. This class slides the menu IN (triggered by JS) */
    .sidebar.active {
        left: 0;
    }

    /* 4. Fix the workspace to take up the whole screen */
    .dashboard-workspace {
        margin-left: 0 !important;
        padding: 15px !important;
        width: 100% !important;
    }

    /* 5. Adjust the Top Nav for small screens */
    .top-nav {
        flex-direction: column;
        height: auto !important;
        padding: 15px !important;
        gap: 10px;
    }

    .logo-text {
        font-size: 16px !important;
        text-align: center;
    }

    .search-bar {
        width: 100% !important;
        margin: 5px 0;
    }

    .user-actions {
        width: 100%;
        justify-content: center;
    }
}