* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f5f7;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px; /* Nav bar ki height ke barabar spacing */
}

/* Top brand header */
.topbar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    display: none;
}
/* Mobile Screens (768px ya us se choti screens) par topbar show hogi */
@media (max-width: 768px) {
    .topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        background: #fff;
        border-bottom: 1px solid #eee;
    }
}

.topbar .brand { font-weight: 600; font-size: 18px; color: #6b3f4d; }

/* Auth pages */
.auth-wrap { padding: 40px 24px; }
.auth-wrap h1 { font-size: 26px; color: #6b3f4d; font-weight: 500; margin-bottom: 4px; }
.auth-wrap p.subtitle { color: #999; margin-bottom: 28px; }

.field {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.field input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    background: transparent;
}
.field .icon { margin-right: 10px; color: #999; }

.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 24px;
    background: #6b3f4d;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.btn:hover { background: #5a3441; }
.btn.secondary { background: #fff; color: #6b3f4d; border: 1px solid #6b3f4d; }

.link-row { text-align: right; margin-top: 12px; }
.link-row a { color: #6b3f4d; text-decoration: none; font-size: 14px; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error { background: #fdeceb; color: #b3261e; }
.alert.success { background: #e8f5e9; color: #1e7e34; }

/* Wallet header (maroon gradient like the reference design) */
.wallet-header {
    background: linear-gradient(135deg, #6b3f4d, #4a2b35);
    color: #fff;
    padding: 24px 20px 28px;
}
.wallet-header .greeting { font-size: 16px; opacity: 0.9; }
.wallet-header .balance-label { margin-top: 18px; font-size: 13px; opacity: 0.8; }
.wallet-header .balance-amount { font-size: 32px; font-weight: 600; margin-top: 4px; }

.action-row {
    display: flex;
    gap: 12px;
    padding: 20px;
}
.action-btn {
    flex: 1;
    text-align: center;
    padding: 16px 8px;
    border-radius: 10px;
    background: #f5f5f7;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}
.action-btn .icon { font-size: 22px; display: block; margin-bottom: 6px; }

.section-title {
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin: 8px 0;
}

.tx-list { padding: 0 20px 20px; }
.tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.tx-item .tx-type { font-weight: 500; font-size: 14px; }
.tx-item .tx-date { font-size: 12px; color: #999; }
.tx-item .tx-amount { font-weight: 600; }
.tx-item .tx-amount.deposit { color: #1e7e34; }
.tx-item .tx-amount.withdraw { color: #b3261e; }
.status-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 6px;
}
.status-badge.pending { background: #fff3cd; color: #8a6500; }
.status-badge.approved { background: #e8f5e9; color: #1e7e34; }
.status-badge.rejected { background: #fdeceb; color: #b3261e; }

.form-page { padding: 20px; }
.form-page h2 { color: #6b3f4d; font-weight: 500; margin-bottom: 20px; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 480px; /* Mobile layout container width match karne ke liye */
    margin: 0 auto;
    display: flex;
    border-top: 1px solid #eee;
    background: #fff;
    z-index: 9999; /* Is se nav bar baaki content ke upar rahegi */
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    text-decoration: none;
    color: #888;
    font-size: 12px;
}
.bottom-nav a.active { color: #6b3f4d; font-weight: 600; }

.empty-state { text-align: center; padding: 40px 20px; color: #999; }

/* ==========================================================
   RESPONSIVE / DESKTOP LAYOUT
   Everything below only activates at >= 900px so the mobile
   view (which matches the original design) stays untouched.
   ========================================================== */

.sidebar { display: none; }

@media (min-width: 900px) {
    body { background: #ececef; }

    .app-shell {
        display: flex;
        max-width: 1100px;
        margin: 40px auto;
        min-height: 640px;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 20px 50px rgba(0,0,0,0.10);
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        width: 250px;
        flex-shrink: 0;
        background: linear-gradient(180deg, #6b3f4d, #3f2530);
        color: #fff;
        padding: 32px 22px;
    }
    .sidebar .side-brand {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 8px;
    }
    .sidebar .side-user {
        font-size: 13px;
        opacity: 0.75;
        margin-bottom: 36px;
    }
    .sidebar nav { display: flex; flex-direction: column; gap: 4px; }
    .sidebar nav a {
        color: rgba(255,255,255,0.85);
        text-decoration: none;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sidebar nav a:hover { background: rgba(255,255,255,0.10); color: #fff; }
    .sidebar nav a.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
    .sidebar .side-logout {
        margin-top: auto;
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        font-size: 14px;
        padding: 12px 14px;
    }
    .sidebar .side-logout:hover { color: #fff; }

    /* Main content becomes the flexible right-hand column */
    .app-shell .container {
        max-width: none;
        min-height: auto;
        flex: 1;
        box-shadow: none;
    }

    /* Bottom tab bar is a mobile-only pattern; desktop uses the sidebar instead */
    .app-shell .bottom-nav { display: none; }

    /* Give content more breathing room on wide screens */
    .app-shell .wallet-header { padding: 32px 36px 36px; }
    .app-shell .action-row { padding: 24px 36px; max-width: 520px; }
    .app-shell .section-title,
    .app-shell .tx-list,
    .app-shell .form-page { padding-left: 36px; padding-right: 36px; }
    .app-shell .form-page { max-width: 460px; }
    .app-shell .topbar { padding: 20px 36px; }

    /* Auth pages (login/register) - center a card on the page */
    body.auth-body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    body.auth-body .container {
        max-width: 420px;
        min-height: auto;
        border-radius: 18px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.10);
        margin: 0;
    }

    /* Admin panel gets breathing room too */
    .admin-shell .container { max-width: 960px; margin: 40px auto; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.08); }
}

/* Small-screen safety net: allow admin tables to scroll instead of overflowing */
@media (max-width: 640px) {
    .admin-shell table { display: block; overflow-x: auto; white-space: nowrap; }
}
