@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --navy-deep: #041E42;
    --navy: #0857C3;
    --blue: #307FE2;
    --blue-light: #71C5EB;
    --bg: #F3F6FB;
    --card: #ffffff;
    --dark: #10203A;
    --text-muted: #6B7A90;
    --text-faint: #9AA7BB;
    --blue-soft: #EAF3FF;
    --green-soft: #E7F7EE;
    --red-soft: #FDEBEA;
    --gold: #D9A441;
    --border: #E7ECF4;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow-card: 0 1px 2px rgba(16,32,58,.04), 0 8px 20px -12px rgba(16,32,58,.12);
    --shadow-hero: 0 1px 3px rgba(4,30,66,.15), 0 16px 32px -12px rgba(8,87,195,.35);
    --shadow-float: 0 6px 16px -4px rgba(8,87,195,.35), 0 2px 6px rgba(8,87,195,.2);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Menghilangkan kotak sorot kaku bawaan saat disentuh di Android */
a, button, .dock-item, .dock-fab {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.app-shell {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding: 18px 16px 96px;
    position: relative;
}

/* ---------- Topbar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.topbar .date { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.topbar h1 { margin: 3px 0 0; font-size: 23px; font-weight: 800; color: var(--navy-deep); letter-spacing: -.01em; }
.icon-btn {
    width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--navy); transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 2px rgba(16,32,58,.05);
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,32,58,.1); }
.icon-btn:active { transform: translateY(0); }

/* ---------- Hero card ---------- */
.hero-card {
    background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 55%, var(--blue) 100%);
    color: #fff; border-radius: 26px; padding: 22px 22px 20px; margin-bottom: 18px;
    box-shadow: var(--shadow-hero);
    position: relative; overflow: hidden;
}
.hero-card::after {
    content: ''; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%; pointer-events: none;
}
.hero-card .badge {
    display: inline-flex; align-items: center; background: var(--gold); color: #2b1d02; font-size: 10.5px;
    font-weight: 700; padding: 5px 11px; border-radius: 20px; margin-bottom: 14px;
    letter-spacing: .06em; text-transform: uppercase;
}
.hero-card .saldo { font-size: 32px; font-weight: 800; margin: 4px 0 10px; letter-spacing: -.01em; }
.hero-card .sub { font-size: 13px; opacity: .82; font-weight: 500; line-height: 1.6; }

/* ---------- Cards ---------- */
.card {
    background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}
.card .eyebrow { font-size: 10.5px; text-transform: uppercase; color: var(--blue); letter-spacing: .08em; font-weight: 700; }
.card h2 { margin: 3px 0 14px; font-size: 17px; font-weight: 700; color: var(--navy-deep); letter-spacing: -.01em; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat .label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat .value { font-size: 18px; font-weight: 700; margin: 3px 0; color: var(--navy-deep); }
.stat .count { font-size: 11px; color: var(--text-faint); font-weight: 500; }

.progress-bar { height: 7px; border-radius: 8px; background: #e6edf6; overflow: hidden; margin-top: 8px; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--navy), var(--blue-light)); border-radius: 8px; transition: width .3s ease; }

.badge-in { background: var(--blue-soft); border-radius: 16px; padding: 14px; border: 1px solid #dbeaff; }
.badge-out { background: var(--red-soft); border-radius: 16px; padding: 14px; border: 1px solid #fbdcda; }
.badge-in .label, .badge-out .label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.badge-in .value, .badge-out .value { font-size: 17px; font-weight: 700; color: var(--navy-deep); }

/* ---------- Floating action button (Disembunyikan karena diganti Dock FAB) ---------- */
.fab {
    display: none !important;
}

/* ---------- Floating Dark Dock Navigation ---------- */
.nav-dock-container {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 420px;
    z-index: 9999;
}

.bottom-dock {
    position: relative;
    background: #18181b;
    border-radius: 32px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px 10px 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    z-index: 2;
    font-family: inherit;
    padding: 6px 2px;
    border-radius: 18px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.dock-item:active {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(0.96);
}

.dock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    margin-bottom: 2px;
    transition: transform 0.25s ease;
}

.dock-item.active {
    color: #60a5fa !important;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.15) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.dock-item.active .dock-icon {
    transform: translateY(-1px) scale(1.08);
}

.dock-fab-wrapper {
    position: relative;
    top: -22px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 4px;
    z-index: 10;
}

.dock-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    padding: 0;
    transition: transform 0.2s ease;
}

.dock-fab:active {
    transform: scale(0.92);
}

.dock-fab .plus-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    border-radius: 50%;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin .6s ease; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; background: linear-gradient(150deg, var(--navy), var(--blue)); color: #fff; border: none; padding: 13px 18px;
    border-radius: 14px; font-weight: 700; font-size: 14.5px; cursor: pointer; text-align: center; text-decoration: none;
    box-shadow: 0 4px 14px -4px rgba(8,87,195,.4);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--navy-deep); box-shadow: none; }
.btn-outline:hover { background: #fafbfd; filter: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 7px; }
.field input, .field select {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    font-size: 14.5px; background: #fbfcfe; color: var(--dark); font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(48,127,226,.14); background: #fff; }
.field input::placeholder { color: var(--text-faint); }

.pill {
    display: inline-flex; align-items: center; gap: 7px; background: var(--blue-soft); color: var(--navy-deep); border-radius: 20px;
    padding: 6px 6px 6px 13px; font-size: 12.5px; font-weight: 600; margin: 4px 6px 0 0;
}
.pill button { background: rgba(192,57,43,.1); width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer; color: #c0392b; font-weight: 700; font-size: 12px; line-height: 1; display:flex; align-items:center; justify-content:center; }

.tabs { display: flex; background: var(--blue-soft); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tabs button {
    flex: 1; border: none; background: transparent; padding: 10px; border-radius: 10px; cursor: pointer;
    font-weight: 600; color: var(--text-muted); font-family: inherit; transition: background .15s ease, color .15s ease;
}
.tabs button.active { background: var(--navy-deep); color: #fff; }

/* ---------- Transaction rows & action buttons with icons ---------- */
.trx-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.trx-row:last-child { border-bottom: none; }
.trx-row .meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.trx-note { font-style: italic; }
.trx-amount.income { color: #1E9E64; font-weight: 700; }
.trx-amount.expense { color: #D64545; font-weight: 700; }

.trx-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.trx-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: filter .12s ease, transform .12s ease;
}
.trx-icon-btn:hover { transform: translateY(-1px); }
.trx-icon-btn.edit { background: var(--blue-soft); color: var(--navy); }
.trx-icon-btn.delete { background: var(--red-soft); color: #c0392b; }
.trx-icon-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

.empty-state { text-align: center; color: var(--text-faint); font-size: 13.5px; font-weight: 500; padding: 44px 10px; border: 1.5px dashed var(--border); border-radius: 18px; }

/* ---------- Cashflow bar chart (7 hari) ---------- */
.chart-bars { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; padding-top: 4px; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.chart-bar-value { font-size: 10px; font-weight: 700; color: var(--navy-deep); margin-bottom: 4px; height: 13px; }
.chart-bar-track { width: 100%; max-width: 26px; height: 72px; display: flex; align-items: flex-end; }
.chart-bar-fill {
    width: 100%; background: linear-gradient(180deg, var(--blue-light), var(--navy));
    border-radius: 7px 7px 3px 3px; transition: height .3s ease;
}
.chart-bar-fill.today { background: linear-gradient(180deg, var(--gold), #b9812c); }
.chart-bar-label { font-size: 10.5px; color: var(--text-faint); font-weight: 600; margin-top: 7px; }
.chart-bar-label.today { color: var(--navy); font-weight: 800; }

/* ---------- Monthly expense bars (4 bulan) ---------- */
.month-bar-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.month-bar-label { width: 42px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.month-bar-track { flex: 1; height: 9px; background: #eef2f8; border-radius: 6px; overflow: hidden; }
.month-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--blue-light), var(--navy)); transition: width .3s ease; }
.month-bar-value { width: 68px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--navy-deep); flex-shrink: 0; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(4,20,42,.5); backdrop-filter: blur(2px); display: none;
    align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
    background: #fff; width: 100%; max-width: 420px; border-radius: 26px 26px 0 0; padding: 12px 22px 90px 22px;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(4,20,42,.2);
}
.modal-sheet::before {
    content: ''; display: block; width: 40px; height: 4px; background: var(--border); border-radius: 4px;
    margin: 6px auto 16px;
}
.modal-sheet .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-sheet h2 { color: var(--navy-deep); font-weight: 700; }

.toggle-inout { display: flex; background: var(--blue-soft); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.toggle-inout button { flex: 1; border: none; background: transparent; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--navy-deep); font-family: inherit; transition: background .15s ease, color .15s ease; }
.toggle-inout button.active-out { background: linear-gradient(150deg, var(--navy), var(--blue)); color: #fff; box-shadow: 0 4px 10px -2px rgba(8,87,195,.4); }
.toggle-inout button.active-in { background: #1E9E64; color: #fff; box-shadow: 0 4px 10px -2px rgba(30,158,100,.4); }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 400px; margin: 60px auto; padding: 24px; }
.auth-card { background: #fff; border-radius: 22px; padding: 32px 26px; box-shadow: 0 20px 50px -12px rgba(4,30,66,.18); border-top: 4px solid var(--navy); }
.auth-card h1 { font-size: 21px; font-weight: 800; margin-top: 0; color: var(--navy-deep); letter-spacing: -.01em; }
.auth-error { background: var(--red-soft); color: #b03636; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--navy); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------- Admin dashboard ---------- */
.admin-shell { max-width: 960px; margin: 0 auto; padding: 28px 24px; font-family: inherit; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-header h1 { color: var(--navy-deep); font-weight: 800; letter-spacing: -.01em; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); }
.admin-table th, .admin-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.admin-table th { background: var(--navy-deep); color: #fff; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tbody tr { transition: background .12s ease; }
.admin-table tbody tr:hover { background: #f8fafd; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.tag-pro { background: var(--gold); color: #2b1d02; padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.tag-free { background: #e6edf6; color: var(--text-muted); padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.admin-stats { display: flex; gap: 16px; margin-bottom: 22px; }
.admin-stat-card { background: #fff; border-radius: 18px; padding: 18px 22px; flex: 1; box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.admin-stat-card .num { font-size: 28px; font-weight: 800; color: var(--navy-deep); letter-spacing: -.01em; }

/* ---------- Upgrade CTA ---------- */
.upgrade-cta { text-align: center; padding: 22px 16px; margin-top: 8px; border-radius: 18px; background: var(--blue-soft); border: 1px dashed #bcd7f5; }
.upgrade-cta-icon {
    width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(150deg, var(--navy-deep), var(--blue));
    color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.upgrade-cta-icon svg { width: 22px; height: 22px; }
.upgrade-cta-title { font-weight: 700; color: var(--navy-deep); font-size: 14.5px; margin-bottom: 4px; }
.upgrade-cta-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }