/* =========================================
   1. CORE VARIABLES & BASE STYLES
   ========================================= */
:root {
    --sidebar-width: 250px;
    --primary-blue: #007aff;
    --bg-light: #f4f7f6;
    --text-main: #2d3436;
    --border-color: #dfe6e9;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    display: flex; /* Keeps Sidebar and Content side-by-side on Desktop */
}

/* =========================================
   2. DESKTOP SIDEBAR
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    padding: 30px 20px;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.logo-area {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: #636e72;
    padding: 12px;
    text-decoration: none;
    display: block;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: #eef2f3;
    color: var(--primary-blue);
}

/* =========================================
   3. MAIN CONTENT AREA
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    background-color: var(--bg-light);
    flex: 1;
}

.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* =========================================
   4. COMPONENTS (Cards, Buttons, Balance)
   ========================================= */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.balance-large {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: inline-block;
    letter-spacing: -1px;
}

.pulse-glow {
    animation: balancePulse 2s infinite ease-in-out;
}

@keyframes balancePulse {
    0%, 100% { text-shadow: 0 0 5px rgba(0, 122, 255, 0); opacity: 1; }
    50% { text-shadow: 0 0 20px rgba(0, 122, 255, 0.4); color: var(--primary-blue); opacity: 0.8; }
}

.btn-primary {
    background-color: var(--primary-blue);
    border: none;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: #0063cc;
}

.form-select, .form-control {
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

/* =========================================
   5. MOBILE NAVIGATION (Hidden on Desktop)
   ========================================= */
.mobile-nav {
    display: none;
}

/* =========================================
   6. RESPONSIVE MEDIA QUERY (Phone/Tablet)
   ========================================= */
@media (max-width: 768px) {
    body {
        display: block; /* Stack header and content vertically */
    }

    .mobile-nav {
        display: flex !important; /* Show the top bar */
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: white;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 1001;
    }

    #menu-btn {
        background: none;
        border: none;
        font-size: 28px;
        color: var(--primary-blue);
        cursor: pointer;
    }

    .sidebar {
        transform: translateX(-100%); /* Slide out of view */
        visibility: hidden;
        position: fixed;
        z-index: 2000;
    }

    .sidebar.active {
        transform: translateX(0); /* Slide back in when triggered */
        visibility: visible;
    }

    .main-content {
        margin-left: 0 !important; /* Remove desktop margin */
        padding: 15px;
        width: 100%;
    }

    .balance-large {
        font-size: 2.2rem !important; /* Prevent text overflow */
    }

    .row {
        margin: 0;
        width: 100%;
    }

    .col-lg-6 {
        width: 100% !important;
        margin-bottom: 20px;
    }
}