:root {
    --orange: #f15a22;
    --orange-dark: #e0480f;
    --orange-deep: #c33d0c;
    --orange-tint: #fff1ea;
    --ink: #2b2b2b;
    --muted: #8a8f98;
    --line: #eef0f3;
    --bg: #f0f2f5;
    --card: #ffffff;
    --green: #1ea672;
    --green-soft: #d8f3e6;
    --radius: 16px;
    --shadow: 0 4px 18px rgba(20, 20, 40, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: #d9dce1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ===== Phone frame ===== */
.phone {
    position: relative;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
}

.screen {
    flex: 1;
    padding: 14px 16px 96px;
    overflow-y: auto;
}

/* ===== Header ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 14px;
}

.profile { display: flex; align-items: center; gap: 12px; }

.avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb088, var(--orange));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.profile-rek {
    font-size: 12px; color: var(--muted);
    display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.copy-btn { color: var(--muted); display: inline-flex; padding: 0; }
.copy-btn:active { color: var(--orange); }

.bell-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink);
}

/* ===== Balance card ===== */
.balance-card {
    position: relative;
    background: linear-gradient(135deg, #ff7a3d 0%, var(--orange) 45%, var(--orange-dark) 100%);
    border-radius: 20px;
    padding: 18px 18px 20px;
    color: #fff;
    box-shadow: 0 10px 24px rgba(241, 90, 34, 0.32);
    overflow: hidden;
}
.balance-card::after {
    content: "";
    position: absolute;
    right: -40px; top: -30px;
    width: 180px; height: 180px;
    border: 26px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.balance-top {
    display: flex; align-items: center; justify-content: space-between;
    position: relative; z-index: 1;
}
.balance-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 14px; opacity: 0.95;
}
.riwayat-pill {
    display: inline-flex; align-items: center; gap: 2px;
    background: rgba(0, 0, 0, 0.18);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px; font-weight: 600;
}
.balance-amount {
    font-size: 30px; font-weight: 800;
    margin: 8px 0 18px;
    position: relative; z-index: 1;
    letter-spacing: -0.5px;
}
.balance-amount .rp-sm { font-size: 18px; font-weight: 700; }

.balance-note { font-size: 12px; opacity: 0.9; margin-top: 6px; }

.balance-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    position: relative; z-index: 1;
}
.split-item { display: flex; flex-direction: column; gap: 3px; color: #fff; }
.split-title {
    display: flex; align-items: center; gap: 4px;
    font-size: 14px; opacity: 0.95;
}
.split-value { font-size: 19px; font-weight: 800; }
.split-note { font-size: 11px; opacity: 0.82; }

.badge-aktif {
    background: var(--green-soft);
    color: #0d7a4f;
    font-style: normal;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: auto;
}

/* ===== Generic card ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 14px;
    padding: 16px;
}

/* ===== Menu grid ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 8px;
}
.menu-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center;
}
.menu-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--orange-tint);
    color: var(--orange);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.12s ease;
}
.menu-item:active .menu-icon { transform: scale(0.92); }
.menu-label { font-size: 11.5px; color: #4a4f57; line-height: 1.25; font-weight: 500; }

/* ===== Detail card ===== */
.detail-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 700;
    margin-bottom: 12px;
}
.detail-title-icon {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--orange-tint);
    color: var(--orange);
    display: flex; align-items: center; justify-content: center;
}
.detail-rows { display: flex; flex-direction: column; }
.detail-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: #5b616b; }
.detail-row dd { font-weight: 600; color: var(--ink); text-align: right; }
.detail-row.highlight dt { color: var(--orange); font-weight: 600; }
.detail-row.highlight dd { color: var(--orange); font-weight: 800; font-size: 16px; }
.detail-foot { font-size: 11.5px; color: var(--muted); margin-top: 10px; }

/* ===== Promo banner ===== */
.promo-banner {
    position: relative;
    margin-top: 14px;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
    border-radius: var(--radius);
    padding: 18px;
    color: #fff;
    overflow: hidden;
    min-height: 110px;
    display: flex; align-items: center;
    box-shadow: 0 8px 20px rgba(241, 90, 34, 0.28);
}
.promo-tag {
    display: inline-block;
    background: #1f5fd6;
    color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.promo-headline { font-size: 28px; font-weight: 800; line-height: 1; }
.promo-headline strong {
    background: #ffd23f; color: var(--orange-deep);
    padding: 0 8px; border-radius: 6px; margin-left: 4px;
}
.promo-fine { font-size: 9px; opacity: 0.85; margin-top: 8px; }
.promo-coins {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.coin {
    background: #ffd23f; color: var(--orange-deep);
    font-weight: 800; font-size: 13px;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.coin-2, .coin-3 { width: 22px; height: 22px; font-size: 12px; background: rgba(255,255,255,0.85); color: #fff; }

/* ===== Sub header (other pages) ===== */
.sub-header {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 2px 6px;
}
.sub-header h1 { font-size: 18px; font-weight: 700; }
.back-btn {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--line);
}

/* ===== Transaction list ===== */
.list-card { padding: 6px 16px; }
.tx-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.tx-row:last-child { border-bottom: none; }
.tx-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--orange-tint); color: var(--orange);
}
.tx-icon.tx-credit { background: var(--green-soft); color: var(--green); }
.tx-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-title { font-size: 14px; font-weight: 600; }
.tx-desc { font-size: 12px; color: var(--muted); }
.tx-date { font-size: 11px; color: #b3b8c0; }
.tx-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.tx-amount.credit { color: var(--green); }
.tx-amount.debit { color: var(--ink); }
.empty { padding: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== Profile ===== */
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; }
.avatar-lg { width: 76px; height: 76px; font-size: 26px; }
.profile-name-lg { font-size: 18px; font-weight: 700; }
.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 0;
    font-size: 14px; font-weight: 500;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .chevron { color: var(--muted); }
.settings-row.danger { color: #e23b3b; font-weight: 600; justify-content: center; }

/* ===== Bottom nav ===== */
.bottom-nav {
    position: sticky;
    bottom: 0;
    max-width: 430px;
    margin: 0 auto;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 6px max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10.5px; color: var(--muted);
    position: relative;
}
.nav-item.active { color: var(--orange); }
.nav-item span:last-child { line-height: 1.1; }

.nav-qris { color: var(--orange); }
.qris-btn {
    width: 54px; height: 54px;
    margin-top: -26px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 4px solid #fff;
    box-shadow: 0 6px 14px rgba(241, 90, 34, 0.4);
}
.qris-label { font-size: 10.5px; font-weight: 600; }

/* ===== Toast ===== */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translate(-50%, 12px);
    background: rgba(20, 20, 30, 0.92);
    color: #fff;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
