@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f6f9;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* ---------------------------------------------------
    1. LOGIN PAGE
----------------------------------------------------- */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ---------------------------------------------------
    2. SIDEBAR & LAYOUT
----------------------------------------------------- */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    background: #1e293b; /* Dark Slate */
    color: #94a3b8;
    transition: all 0.3s;
    overflow-y: auto;
    border-right: 1px solid #334155;
    
    /* Flexbox for sticky footer */
    display: flex;
    flex-direction: column;
}

/* Pushes the main menu to the top */
#sidebar ul.components {
    flex: 1 0 auto;
    padding: 15px 0;
}

/* Keeps logout at the bottom */
#sidebar .sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid #334155;
    margin-top: auto;
}

#sidebar.collapsed {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #334155;
}

#sidebar ul li a {
    padding: 14px 25px;
    display: block;
    color: #94a3b8;
    text-decoration: none;
}
#sidebar ul li a:hover,
#sidebar ul li.active a {
    color: #fff;
    background: #334155;
    border-left-color: #3b82f6;
}

#content {
    width: calc(100% - 260px);
    min-height: 100vh;
    position: absolute;
    top: 0;
    right: 0;
    background-color: #f4f6f9;
    transition: all 0.3s;
}

.top-navbar {
    padding: 0 20px;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
}

.main-content {
    padding: 20px;
}

/* ---------------------------------------------------
    3. RESPONSIVE MOBILE STYLES
----------------------------------------------------- */
@media (max-width: 992px) {
    /* Hide sidebar by default on mobile */
    #sidebar {
        margin-left: -260px;
    }
    
    /* When active class is added via JS, show it */
    #sidebar.active {
        margin-left: 0;
    }

    /* Content takes full width */
    #content {
        width: 100%;
    }

    /* Overlay for closing menu */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        display: none;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    /* Reduce padding on mobile */
    .main-content {
        padding: 15px;
    }
    
    /* Cards take full width */
    .stat-card .value {
        font-size: 1.5rem;
    }
    
    /* Tables: Force horizontal scroll */
    .table-responsive {
        border-radius: 8px;
    }
    
    /* Smaller fonts for tables on mobile */
    .table th, .table td {
        white-space: nowrap; /* Prevent text wrapping inside cells */
        font-size: 0.85rem;
        padding: 10px;
    }
    
    /* Hide less important columns on very small screens if needed */
    /* Example: .hide-col-mobile { display: none; } */
}

/* ---------------------------------------------------
    4. COMPONENTS
----------------------------------------------------- */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 15px 20px;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    border-top: none;
    background: #f8fafc;
}

.avatar-sm {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animations */
.low-balance-alert {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}