/* [UPDATED] Increased Max-Width to allow more tabs to fit */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Dashboard & Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--surface);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    flex-wrap: wrap;
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

/* Utility */
.hidden {
    display: none !important;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* LOGIN SCREEN & OVERLAYS */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* --- RESPONSIVE HEADER FOR MOBILE --- */
@media (max-width: 600px) {

    /* 1. Stack Logo and Actions vertically */
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 20px;
    }

    /* 2. Allow actions to wrap nicely */
    .header-actions {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    /* 3. Give Profile its own "Card" look */
    .profile-section {
        width: 100%;
        background: var(--surface);
        border: 1px solid var(--border);
        padding: 8px 12px;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        order: 1;
        /* Ensure it appears at the top of the actions block */
    }

    /* 4. Theme toggle sits next to the main button or floats */
    #theme-toggle {
        order: 2;
        padding: 10px;
        background: var(--surface);
        border-radius: 8px;
        border: 1px solid var(--border);
        width: 45px;
        /* Fixed square width */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 5. Make the Main Action Button Big and Tappable */
    .header-actions .btn {
        order: 3;
        flex-grow: 1;
        /* Fill the rest of the row */
        text-align: center;
        padding: 12px;
        /* Taller touch target */
    }
}