/* ========================================================
   CatatUang v3.4 - Soft Modern Financial Design System
   Fitur: Kategori 3-Level Terisolasi, Pengeluaran Express Dinamis,
   Tombol Pilihan Rekening, Auto-Verifikasi, Modal Profesional Edit/Hapus,
   Sistem Hutang Per Kategori / Orang / Lembaga, Drag-to-scroll Rekening,
   dan Waktu Transaksi Detail.
   ======================================================== */

:root {
    --bg-app: #f4f6fb;
    --bg-surface: #ffffff;
    --bg-muted: #f8fafc;
    --bg-hover: #f1f5f9;
    
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-gradient: linear-gradient(135deg, #2563eb, #3b82f6);
    --primary-dark: #1d4ed8;

    --spending-bg: #e0f2fe;
    --spending-text: #0284c7;
    --spending-arrow: #0284c7;
    --expense: #ef4444;

    --income-bg: #ede9fe;
    --income-text: #7c3aed;
    --income-arrow: #7c3aed;
    --income: #10b981;

    --transfer: #8b5cf6;
    --warning: #f59e0b;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #edf2f7;
    --border-subtle: #f1f5f9;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --radius-full: 9999px;

    --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 8px 24px -4px rgba(30, 41, 59, 0.06);
    --shadow-debit: 0 12px 28px -6px rgba(37, 99, 235, 0.28);
    --shadow-float: 0 12px 32px -4px rgba(37, 99, 235, 0.35);
}

[data-theme="dark"] {
    --bg-app: #0f172a;
    --bg-surface: #1e293b;
    --bg-muted: #182234;
    --bg-hover: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: #334155;
    --border-subtle: #1e293b;

    --spending-bg: rgba(2, 132, 199, 0.15);
    --income-bg: rgba(124, 58, 237, 0.15);
    --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'Inter', Roboto, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: var(--bg-app);
    position: relative;
    padding-bottom: 96px;
    overflow-x: hidden;
}

/* ========================================================
   1. DASHBOARD CARD & HEADER LIHAT SEMUA PROFESIONAL
   ======================================================== */
.dashboard-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    margin: 0 20px 14px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.dashboard-card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-see-all-pro {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-subtle);
}

.btn-see-all-pro:active {
    transform: scale(0.95);
    background: var(--primary);
    color: #ffffff;
}

/* ========================================================
   2. LOCKSCREEN & LOGIN KELUARGA
   ======================================================== */
.lockscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-app);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lockscreen-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.family-profile-picker {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
}

.family-avatar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
}

.family-avatar-circle {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: var(--shadow-card);
    border: 3px solid transparent;
    transition: all 0.2s;
}

.family-avatar-btn.active .family-avatar-circle {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.family-avatar-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-avatar-btn.active .family-avatar-name {
    color: var(--primary);
    font-weight: 700;
}

.pin-dots-container {
    display: flex;
    gap: 14px;
    margin: 18px 0 20px 0;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    border: 2px solid var(--text-muted);
    background: transparent;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.pin-keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.pin-key {
    height: 60px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-subtle);
    transition: all 0.1s;
}

.pin-key:active {
    background: var(--bg-hover);
    transform: scale(0.92);
}

/* ========================================================
   3. TOP APP BAR (HEADER)
   ======================================================== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px 20px;
}

.header-user-info {
    display: flex;
    flex-direction: column;
}

.greeting-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-name-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    color: var(--text-secondary);
    transition: all 0.15s;
}

.profile-avatar-top {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
}

/* ========================================================
   4. TOTAL SALDO CARD & 4-STAT GRID
   ======================================================== */
.balance-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.balance-title-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.balance-big-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

.stats-2x2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.stat-box-card {
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-box-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-box-value {
    font-size: 0.88rem;
    font-weight: 700;
}

.stat-box-value.inc { color: var(--income); }
.stat-box-value.exp { color: var(--expense); }

/* SPENDING & INCOME PILLS ROW */
.spending-income-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 20px 14px 20px;
}

.pill-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-subtle);
}

.pill-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pill-card.spending .pill-icon-circle {
    background: var(--spending-bg);
    color: var(--spending-arrow);
}

.pill-card.income .pill-icon-circle {
    background: var(--income-bg);
    color: var(--income-arrow);
}

.pill-content {
    display: flex;
    flex-direction: column;
}

.pill-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pill-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ========================================================
   5. DEBIT CARDS CAROUSEL (DRAG-TO-SCROLL ENABLED)
   ======================================================== */
.debit-cards-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.debit-cards-carousel:active { cursor: grabbing; }
.debit-cards-carousel::-webkit-scrollbar { display: none; }

.debit-card-item {
    flex: 0 0 240px;
    height: 136px;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-debit);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
    user-select: none;
}

.debit-card-item:active { transform: scale(0.98); }

.debit-card-deco {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
    top: -40px;
    right: -30px;
    pointer-events: none;
}

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

.debit-name {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.debit-brand-badge {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.debit-bottom {
    display: flex;
    flex-direction: column;
}

.debit-balance-label {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 600;
}

.debit-balance-val {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ========================================================
   6. PENGELUARAN SERING & EXPRESS DINAMIS
   ======================================================== */
.smart-chips-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    cursor: grab;
    user-select: none;
}
.smart-chips-scroll:active { cursor: grabbing; }
.smart-chips-scroll::-webkit-scrollbar { display: none; }

.smart-chip-card {
    flex: 0 0 148px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.12s;
    user-select: none;
}

.smart-chip-card:active { transform: scale(0.96); }

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

.chip-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chip-action-hint {
    font-size: 0.62rem;
    background: var(--spending-bg);
    color: var(--spending-text);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.chip-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-amount {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary);
}

.chip-acc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.express-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.express-card {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.12s;
}

.express-card:active {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(0.95);
}

.express-del-btn {
    position: absolute;
    top: 2px;
    right: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 2px;
}

.express-del-btn:hover { color: var(--expense); }

.express-nominal {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
}

.express-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
}

/* ========================================================
   7. TRANSAKSI LIST, WAKTU DETAIL & CATATAN
   ======================================================== */
.verification-banner {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin: 0 20px 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-item {
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: background 0.12s;
}

.tx-item-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tx-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tx-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tx-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tx-time-badge {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.tx-right {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: right;
}

.tx-amount {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.tx-amount.income { color: var(--text-primary); }
.tx-amount.expense { color: var(--text-primary); }
.tx-amount.transfer { color: var(--transfer); }

.tx-note-badge {
    font-size: 0.75rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    word-break: break-word;
}

.btn-verify-chip {
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.1s;
}

.btn-verify-chip:active { transform: scale(0.92); }

/* ========================================================
   8. SISTEM HUTANG (ORANG / LEMBAGA) DALAM MENU DOMPET
   ======================================================== */
.debt-summary-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.03));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debt-card-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debt-cat-card {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.15s ease;
}

.debt-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.debt-cat-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.debt-cat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.debt-cat-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.debt-cat-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.debt-balance-wrap {
    text-align: right;
}

.debt-rem-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
}

.debt-rem-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--expense);
}

.debt-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    gap: 6px;
}

.debt-toggle-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.debt-record-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.debt-tx-history-box {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.debt-tx-history-box.active {
    display: flex;
}

.debt-history-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

/* ========================================================
   9. TOMBOL PILIHAN REKENING & KATEGORI 3 TINGKAT
   ======================================================== */
.account-pills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding: 2px;
}

.acc-pill-btn {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.acc-pill-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.acc-pill-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.acc-pill-bal {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.header-categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 10px 0;
    scrollbar-width: none;
}
.header-categories-scroll::-webkit-scrollbar { display: none; }

.header-cat-tab-btn {
    flex: 0 0 auto;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.header-cat-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-subtle);
}

.sub-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px;
}

.sub-cat-select-btn {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.12s;
}

.sub-cat-select-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.sub-cat-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.2;
}

.nominal-mode-tabs {
    display: flex;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    padding: 3px;
    margin-bottom: 12px;
}

.nominal-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}

.nominal-tab-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-subtle);
}

.money-bills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.bill-card {
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
}

.bill-card:active { transform: scale(0.95); }

.bill-count-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

/* ========================================================
   10. MODAL & BOTTOM SHEET
   ======================================================== */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 20px 32px 20px;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 38px;
    height: 4px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    margin: 0 auto 16px auto;
    opacity: 0.5;
}

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

.sheet-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.sheet-close-btn {
    background: var(--bg-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    height: 46px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    font-size: 0.88rem;
    color: var(--text-primary);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.btn-submit-action {
    width: 100%;
    height: 52px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-float);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s;
}

.btn-submit-action:active { transform: scale(0.98); }

/* ========================================================
   11. BOTTOM NAVIGATION BAR
   ======================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 72px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    z-index: 900;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

.nav-item.active { color: var(--primary); }

.fab-quick-add {
    width: 52px;
    height: 52px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-float);
    cursor: pointer;
    margin-top: -24px;
    transition: transform 0.15s;
}

.fab-quick-add:active { transform: scale(0.92); }

.fab-quick-add svg { width: 26px; height: 26px; }

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.view-section { display: none; }
.view-section.active { display: block; }

/* ========================================================
   17. COLOR SWATCHES & REKENING CARD STYLING
   ======================================================== */
.color-swatches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.color-swatch-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0;
}

.color-swatch-btn:hover {
    transform: scale(1.08);
}

.color-swatch-btn:active {
    transform: scale(0.95);
}

.color-swatch-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px var(--primary);
    transform: scale(1.1);
}

.color-picker-custom {
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    cursor: pointer;
}

