/* ============================================================
   NovaTrack — Claymorphism Design System
   Responsive: Mobile (< 768px) | Tablet (768–1024px) | Desktop (1025px+)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ===================== TOKENS ===================== */
:root {
    --primary: #6750A4;
    --primary-light: #EADDFF;
    --primary-dark: #4F378B;
    --secondary: #FF6B9D;
    --accent: #FFB347;
    --success: #51CF66;
    --danger: #FF6B6B;
    --warning: #FFD43B;
    --bg: #F0EEFF;
    --surface: #FFFFFF;
    --surface-rgb: 255, 255, 255;
    --surface-2: #F8F5FF;
    --text: #1C1B1F;
    --text-muted: #7A7289;
    --border: rgba(103, 80, 164, 0.15);

    /* Claymorphism shadows */
    --clay-shadow: 6px 6px 0px rgba(103, 80, 164, 0.2), 0 8px 24px rgba(103, 80, 164, 0.12);
    --clay-shadow-sm: 3px 3px 0px rgba(103, 80, 164, 0.18), 0 4px 12px rgba(103, 80, 164, 0.10);
    --clay-shadow-hover: 8px 8px 0px rgba(103, 80, 164, 0.25), 0 12px 32px rgba(103, 80, 164, 0.15);
    --clay-inset: inset 0 2px 4px rgba(255,255,255,0.8), inset 0 -2px 4px rgba(103,80,164,0.08);
    --clay-radius: 24px;
    --clay-radius-sm: 16px;
    --clay-radius-lg: 32px;

    /* Sidebar width for desktop */
    --sidebar-w: 260px;

    /* Transitions */
    --trans: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===================== LAYOUT SHELL ===================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — hidden on mobile/tablet, shown only on desktop (1025px+) */
.sidebar {
    display: none; /* Hidden by default — mobile first */
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 2px solid var(--border);
    box-shadow: var(--clay-shadow-sm);
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    padding: 32px 20px;
    gap: 8px;
    transition: var(--trans);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
}
.sidebar-brand .logo {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    box-shadow: var(--clay-shadow-sm);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
}
.sidebar-brand h1 { font-size: 20px; font-weight: 700; color: var(--primary); }
.sidebar-brand span { font-size: 11px; color: var(--text-muted); display: block; font-weight: 400; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: var(--clay-radius-sm);
    color: var(--text-muted); font-weight: 500; font-size: 15px;
    transition: var(--trans);
    position: relative;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--clay-shadow-sm);
    transform: translateX(4px);
}
.sidebar-link .material-symbols-outlined { font-size: 22px; }
.sidebar-link .badge {
    margin-left: auto; background: var(--primary);
    color: white; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
}
.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }

/* Main content area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===================== TOP BAR (Tablet + Desktop) ===================== */
.top-bar {
    display: none;
    padding: 20px 32px;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--clay-shadow-sm);
}
.top-bar h2 { font-size: 22px; font-weight: 700; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

/* ===================== MOBILE HEADER ===================== */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--clay-shadow-sm);
}
.mobile-header .brand { display: flex; align-items: center; gap: 10px; }
.mobile-header .logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px; box-shadow: var(--clay-shadow-sm);
    display: flex; align-items: center; justify-content: center; color: white; font-size: 18px;
}
.mobile-header h2 { font-size: 18px; font-weight: 700; color: var(--primary); }

/* ===================== BOTTOM NAV (Mobile Only) ===================== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 76px;
    background: rgba(var(--surface-rgb, 255, 255, 255), 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex; justify-content: space-around; align-items: center;
    padding: 0 12px env(safe-area-inset-bottom);
    z-index: 200;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 10px 16px; border-radius: 20px;
    color: var(--text-muted); font-size: 10px; font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
}
.nav-item .material-symbols-outlined { 
    font-size: 24px; 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.nav-item.active {
    color: var(--primary);
}
.nav-item.active .material-symbols-outlined { 
    transform: translateY(-4px) scale(1.1);
    font-variation-settings: 'FILL' 1;
}
.nav-item::after {
    content: '';
    position: absolute; bottom: 6px; left: 50%;
    width: 0; height: 4px; background: var(--primary);
    border-radius: 10px; transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}
.nav-item.active::after {
    width: 16px; opacity: 1;
}
.nav-item:active { transform: scale(0.92); }

/* ===================== PAGE CONTENT ===================== */
.page-content {
    padding: 24px 20px 96px;
    flex: 1;
}

/* ===================== CLAYMORPHISM CARDS ===================== */
.clay-card {
    background: var(--surface);
    border-radius: var(--clay-radius);
    box-shadow: var(--clay-shadow);
    border: 2px solid var(--border);
    padding: 24px;
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}
.clay-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 24px 24px 0 0;
    opacity: 0.5;
}
.clay-card:hover {
    box-shadow: var(--clay-shadow-hover);
    transform: translateY(-2px);
}
.clay-card-sm {
    background: var(--surface);
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-sm);
    border: 2px solid var(--border);
    padding: 16px;
    transition: var(--trans);
}
.clay-card-sm:hover {
    box-shadow: var(--clay-shadow);
    transform: translateY(-2px);
}

/* Hero balance card */
.balance-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #7B5EA7 100%);
    border-radius: var(--clay-radius-lg);
    box-shadow: 8px 8px 0px rgba(79, 55, 139, 0.4), 0 16px 40px rgba(103, 80, 164, 0.3);
    padding: 28px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}
.balance-hero::before, .balance-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.balance-hero::before { width: 200px; height: 200px; top: -60px; right: -60px; }
.balance-hero::after { width: 120px; height: 120px; bottom: -40px; left: -20px; }

/* ===================== STATS GRID ===================== */
.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.stat-mini {
    background: var(--surface);
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-sm);
    border: 2px solid var(--border);
    padding: 16px 14px;
    text-align: center;
    transition: var(--trans);
}
.stat-mini:hover { transform: translateY(-3px); box-shadow: var(--clay-shadow); }
.stat-mini .icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}
.stat-mini h3 { font-size: 17px; font-weight: 700; }
.stat-mini p { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ===================== LIST ITEMS ===================== */
.list-group { display: flex; flex-direction: column; gap: 12px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface);
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-sm);
    border: 2px solid var(--border);
    padding: 14px 16px;
    transition: var(--trans);
}
.list-item:hover { box-shadow: var(--clay-shadow); transform: translateX(4px); }
.list-item-link { text-decoration: none; color: inherit; cursor: pointer; }
.item-left { display: flex; align-items: center; gap: 14px; }
.item-icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 22px;
}
.item-icon.given   { background: #EDE9FF; color: var(--primary); box-shadow: 2px 2px 0 rgba(103,80,164,0.2); }
.item-icon.received { background: #ECFDF5; color: #059669; box-shadow: 2px 2px 0 rgba(5,150,105,0.2); }
.item-icon.expense { background: #FFF0F0; color: var(--danger); box-shadow: 2px 2px 0 rgba(255,107,107,0.2); }
.item-icon.settle  { background: #E0F7FA; color: #0097a7; box-shadow: 2px 2px 0 rgba(0,151,167,0.2); }
.item-icon.income  { background: #E8F5E9; color: #2E7D32; box-shadow: 2px 2px 0 rgba(46,125,50,0.2); }
.item-icon.neutral { background: var(--surface-2); color: var(--text-muted); }

.item-title { font-size: 15px; font-weight: 600; }
.item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.txn-amount { font-weight: 700; font-size: 16px; }
.txn-amount.pos { color: var(--success); }
.txn-amount.neg { color: var(--danger); }

/* Balance Pills */
.pill {
    display: inline-flex; align-items: center;
    padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 600; gap: 4px;
}
.pill.pos { background: #ECFDF5; color: #059669; border: 1.5px solid #A7F3D0; }
.pill.neg { background: #FFF0F0; color: var(--danger); border: 1.5px solid #FECACA; }
.pill.zero { background: var(--surface-2); color: var(--text-muted); border: 1.5px solid var(--border); }

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 14px 24px;
    border-radius: var(--clay-radius);
    font-size: 15px; font-weight: 600;
    transition: var(--trans); cursor: pointer; border: none;
    font-family: 'Poppins', sans-serif;
}
.btn-primary {
    background: var(--primary); color: white;
    box-shadow: 4px 4px 0px rgba(103,80,164,0.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 6px 6px 0px rgba(103,80,164,0.35); }
.btn-primary:active { transform: translateY(0px); box-shadow: 2px 2px 0px rgba(103,80,164,0.35); }

.btn-outline {
    background: var(--surface); color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: var(--clay-shadow-sm);
}
.btn-outline:hover { background: var(--primary-light); transform: translateY(-2px); }

.btn-danger {
    background: var(--danger); color: white;
    box-shadow: 4px 4px 0px rgba(255,107,107,0.35);
}
.btn-success {
    background: var(--success); color: white;
    box-shadow: 4px 4px 0px rgba(81,207,102,0.35);
}
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--clay-radius-sm); }
.btn-block { width: 100%; }

/* ===================== FAB ===================== */
.fab {
    position: fixed;
    bottom: 88px; right: 20px;
    width: 60px; height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 4px 4px 0px rgba(103,80,164,0.4), 0 8px 24px rgba(103,80,164,0.25);
    display: flex; align-items: center; justify-content: center;
    z-index: 150; transition: var(--trans); border: none; cursor: pointer;
}
.fab:hover { transform: scale(1.08) translateY(-2px); box-shadow: 6px 6px 0px rgba(103,80,164,0.4); }
.fab:active { transform: scale(0.96); }
.fab .material-symbols-outlined { font-size: 28px; }

/* ===================== FORMS / INPUTS ===================== */
.form-group { margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--clay-radius-sm);
    background: var(--surface-2);
    box-shadow: var(--clay-inset);
    font-size: 15px; color: var(--text);
    transition: var(--trans);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--clay-shadow-sm);
}
.form-input::placeholder { color: var(--text-muted); }

/* ===================== TYPE SELECTOR ===================== */
.type-selector { display: flex; gap: 8px; margin-bottom: 20px; }
.type-btn {
    flex: 1; padding: 11px 8px;
    border: 2px solid var(--border);
    border-radius: var(--clay-radius-sm);
    background: var(--surface-2);
    font-size: 13px; font-weight: 600;
    color: var(--text-muted); transition: var(--trans);
    box-shadow: var(--clay-shadow-sm);
}
.type-btn:hover { border-color: var(--primary); color: var(--primary); }
.type-btn.active.given { background: #EDE9FF; border-color: var(--primary); color: var(--primary); box-shadow: 3px 3px 0 rgba(103,80,164,0.25); }
.type-btn.active.received { background: #ECFDF5; border-color: #059669; color: #059669; box-shadow: 3px 3px 0 rgba(5,150,105,0.25); }
.type-btn.active.expense { background: #FFF0F0; border-color: var(--danger); color: var(--danger); box-shadow: 3px 3px 0 rgba(255,107,107,0.25); }

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(28, 27, 31, 0.45);
    backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 500;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box {
    background: var(--surface);
    width: 100%; max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    border: 2px solid var(--border);
    padding: 32px 24px 40px;
    box-shadow: 0 -8px 32px rgba(103,80,164,0.15);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -ms-overflow-style: none; /* Hide scrollbar IE and Edge */
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.modal-box::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari/Opera */
}
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-handle { width: 48px; height: 5px; background: var(--border); border-radius: 4px; margin: 0 auto 24px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.modal-close { position: absolute; right: 20px; top: 20px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--text-muted); transition: var(--trans); }
.modal-close:hover { background: #FFF0F0; color: var(--danger); }

/* ===================== SNACKBAR ===================== */
.snackbar {
    position: fixed; bottom: 88px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1C1B1F; color: white;
    padding: 14px 24px; border-radius: var(--clay-radius-sm);
    font-size: 14px; font-weight: 500; z-index: 999;
    opacity: 0; pointer-events: none;
    transition: all 0.3s; white-space: nowrap;
    box-shadow: var(--clay-shadow);
}
.snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== AVATAR ===================== */
.avatar {
    width: 44px; height: 44px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-light), #D0BCFF);
    color: var(--primary); font-weight: 700; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--clay-shadow-sm); flex-shrink: 0;
}
.avatar-lg {
    width: 80px; height: 80px; border-radius: 24px; font-size: 32px;
    box-shadow: var(--clay-shadow);
}

/* ===================== SECTION HEADER ===================== */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; margin-top: 24px; }
.section-hdr h3 { font-size: 17px; font-weight: 700; }
.section-hdr a { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ===================== TABS (filter) ===================== */
.filter-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.tab-pill {
    padding: 8px 20px; border-radius: 20px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
    border: 2px solid var(--border); background: var(--surface);
    color: var(--text-muted); transition: var(--trans);
    box-shadow: var(--clay-shadow-sm);
}
.tab-pill.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 3px 3px 0 rgba(103,80,164,0.3);
}

/* ===================== AUTH PAGES ===================== */
.auth-container {
    min-height: calc(100vh - env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: radial-gradient(circle at 0% 0%, rgba(103,80,164,0.05) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(0,224,150,0.05) 0%, transparent 50%),
                var(--bg);
    position: relative;
    overflow: hidden;
}
.auth-card {
    background: rgba(var(--surface-rgb), 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), var(--clay-shadow);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 32px 24px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}
.auth-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    box-shadow: 0 8px 16px rgba(103,80,164,0.25);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 28px;
    margin: 0 auto 16px;
}
.auth-title { font-size: 24px; font-weight: 900; text-align: center; color: var(--text); letter-spacing: -0.5px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-top: 4px; margin-bottom: 28px; font-size: 13px; opacity: 0.8; }

/* ===================== EMPTY STATE ===================== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 56px; opacity: 0.4; margin-bottom: 12px; }
.empty-state h4 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ===================== USER MENU (Top Bar) ===================== */
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--surface-2); border-radius: 50px;
    border: 2px solid var(--border);
    box-shadow: var(--clay-shadow-sm); cursor: pointer;
    transition: var(--trans);
}
.user-chip:hover { box-shadow: var(--clay-shadow); }
.user-chip .avatar { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
.user-chip span { font-weight: 600; font-size: 14px; }

/* ===================== SETTLE UP BADGE ===================== */
.settle-bar {
    background: linear-gradient(90deg, #E0F7FA, #B2EBF2);
    border: 2px solid #80DEEA;
    border-radius: var(--clay-radius-sm);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
    box-shadow: 3px 3px 0 rgba(0,151,167,0.2);
}
.settle-bar .material-symbols-outlined { color: #0097A7; font-size: 24px; flex-shrink: 0; }
.settle-bar p { font-size: 13px; font-weight: 500; flex: 1; }


/* ===================== RESPONSIVE ===================== */

/* Tablet (768px – 1024px) — sidebar stays hidden, show top-bar, hide mobile header & bottom nav */
@media (min-width: 768px) {
    /* .sidebar stays display:none — already set in base */
    .top-bar { display: flex; }
    .mobile-header { display: none; }
    .bottom-nav { display: none; }
    .fab { bottom: 32px; right: 32px; width: 64px; height: 64px; border-radius: 22px; }
    .page-content { padding: 32px; padding-bottom: 32px; }
    .stats-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .snackbar { bottom: 32px; }
    .main-content { margin-left: 0; }
    .auth-card { padding: 48px 40px; max-width: 460px; border-radius: 40px; }
    .auth-title { font-size: 28px; }
}

/* Desktop (1025px+) — show sidebar, push main content right */
@media (min-width: 1025px) {
    .sidebar { display: flex; } /* ✅ Only here does sidebar appear */
    .top-bar { display: flex; }
    .mobile-header { display: none; }
    .bottom-nav { display: none; }
    .main-content { margin-left: var(--sidebar-w); }
    .fab { display: none; } /* Desktop uses sidebar Add button instead */
    .page-content {
        padding: 32px 40px;
        max-width: 900px;
    }
    .balance-hero { padding: 36px; }
    .stats-grid-3 { gap: 24px; }
    .modal-overlay { align-items: center; }
    .modal-box { border-radius: 32px; max-width: 500px; padding: 40px; margin: 0 auto; }
    .snackbar { bottom: 40px; }
}

/* Desktop wide content grid */
@media (min-width: 1200px) {
    .page-content { max-width: 1000px; }
}

/* Animations */
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.95); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.animate-up { animation: slideUp 0.4s ease forwards; }
.animate-pop { animation: pop 0.3s ease forwards; }

/* ===================== DARK MODE ===================== */
[data-theme="dark"] {
    --primary: #D0BCFF;
    --primary-light: #381E72;
    --primary-dark: #B69DF8;
    --secondary: #FFB3C6;
    --bg: #1C1B1F;
    --surface: #2B2930;
    --surface-rgb: 43, 41, 48;
    --surface-2: #332F40;
    --text: #E6E1E5;
    --text-muted: #9E99A7;
    --border: rgba(208, 188, 255, 0.15);
    --clay-shadow: 6px 6px 0px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
    --clay-shadow-sm: 3px 3px 0px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.25);
    --clay-shadow-hover: 8px 8px 0px rgba(0,0,0,0.5), 0 12px 32px rgba(0,0,0,0.35);
    --clay-inset: inset 0 2px 4px rgba(255,255,255,0.05), inset 0 -2px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .balance-hero {
    background: linear-gradient(135deg, #4A4458, #381E72, #4A4458);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.3);
}
[data-theme="dark"] .item-icon.given   { background: #381E72; color: #D0BCFF; }
[data-theme="dark"] .item-icon.received { background: #1B4332; color: #6EE7B7; }
[data-theme="dark"] .item-icon.expense { background: #7F1D1D; color: #FCA5A5; }
[data-theme="dark"] .item-icon.settle  { background: #164E63; color: #67E8F9; }
[data-theme="dark"] .pill.pos { background: #1B4332; color: #6EE7B7; border-color: #065F46; }
[data-theme="dark"] .pill.neg { background: #7F1D1D; color: #FCA5A5; border-color: #991B1B; }
[data-theme="dark"] .auth-container { background: radial-gradient(ellipse at top-left, #2D2438 0%, #1C1B1F 50%, #2A1F35 100%); }
[data-theme="dark"] .snackbar { background: #E6E1E5; color: #1C1B1F; }
[data-theme="dark"] .type-btn.active.given { background: #381E72; border-color: #D0BCFF; color: #D0BCFF; }
[data-theme="dark"] .type-btn.active.received { background: #1B4332; border-color: #6EE7B7; color: #6EE7B7; }
[data-theme="dark"] .type-btn.active.expense { background: #7F1D1D; border-color: #FCA5A5; color: #FCA5A5; }
[data-theme="dark"] .settle-bar { background: linear-gradient(90deg, #164E63, #155E75); border-color: #0E7490; }

/* ===================== PREMIUM INFO & PROMO CARDS ===================== */
.promo-card {
    background: var(--surface);
    border-radius: 32px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--clay-shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.promo-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--clay-shadow-hover);
}
.promo-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(135deg, var(--primary-light), transparent);
    opacity: 0.15; z-index: 0;
}
.promo-icon-box {
    width: 64px; height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 12px 24px rgba(103, 80, 164, 0.25);
    margin-bottom: 20px;
    position: relative; z-index: 1;
}
.promo-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; position: relative; z-index: 1; }
.promo-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; position: relative; z-index: 1; }

.info-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    border: 1px solid var(--border);
}

/* Empty States */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    background: rgba(var(--surface-rgb), 0.5);
    border: 2px dashed var(--border);
    border-radius: 32px;
    margin: 20px 0;
}
.empty-state .material-symbols-outlined {
    font-size: 64px; color: var(--text-muted); opacity: 0.3;
    margin-bottom: 20px;
}
.empty-state h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.empty-state p { font-size: 14px; color: var(--text-muted); max-width: 280px; margin: 0 auto 24px; line-height: 1.5; }

/* Responsive Grid Fixes */
@media (max-width: 360px) {
    .promo-card { padding: 20px; border-radius: 24px; }
    .promo-icon-box { width: 50px; height: 50px; margin-bottom: 16px; }
    .promo-card h3 { font-size: 17px; }
}

@media (min-width: 768px) {
    .promo-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}
@media (min-width: 1200px) {
    .promo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.promo-grid { margin-top: 24px; margin-bottom: 40px; }
.mobile-header { margin-bottom: 12px; }
.top-bar { margin-bottom: 12px; }
/* Layout Padding */
.pad-view {
    padding: 16px 20px 100px;
    max-width: 1400px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .pad-view { padding: 32px 40px 100px; }
}
@media (min-width: 1400px) {
    .pad-view { padding: 40px 60px 120px; }
}
