:root {
    color-scheme: dark;
    --bg: #090b12;
    --panel: rgba(22, 25, 35, .76);
    --line: rgba(255, 255, 255, .08);
    --text: #f6f8ff;
    --muted: #8b92a7;
    --green: #3ee5a1;
    --green-soft: rgba(62, 229, 161, .14);
    --red: #ff5c86;
    --red-soft: rgba(255, 92, 134, .13);
    --shadow: 0 24px 80px rgba(0, 0, 0, .42);
    --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: radial-gradient(circle at top right, rgba(41, 241, 176, .16), transparent 28rem), var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: var(--font-body);
    background: linear-gradient(150deg, rgba(255,255,255,.035) 0 1px, transparent 1px 48px), radial-gradient(circle at 20% 0%, rgba(47,255,196,.13), transparent 20rem), var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.phone-shell {
    width: min(100%, 460px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 20px 40px;
    position: relative;
    overflow: hidden;
}

.dashboard-shell { background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 28rem); }
.login-shell, .install-page { display: grid; place-items: center; padding: 20px; }

.login-card, .install-card {
    width: min(100%, 420px);
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.brand-logo {
    display: block;
    width: min(245px, 78%);
    max-height: 54px;
    margin-bottom: 28px;
    filter: invert(1) brightness(2.1);
}

.orb {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 999px;
    filter: blur(16px);
    opacity: .35;
    pointer-events: none;
    animation: floaty 7s ease-in-out infinite;
}

.orb-one { top: -60px; right: -45px; background: var(--green); }
.orb-two { bottom: -70px; left: -60px; background: #355cff; animation-delay: -2s; }

.eyebrow, .section-heading h2 {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .eyebrow, .section-heading h2, .button, .ghost-button, .icon-button, .quick-button small, .avatar, label { font-family: var(--font-display); }
.balance-card strong, .summary-grid strong, .transaction-actions strong { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.login-card h1 { max-width: 12ch; margin-bottom: 14px; font-size: clamp(2rem, 10vw, 3.6rem); line-height: 1.02; letter-spacing: -.05em; }
.muted { color: var(--muted); }

.notice {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: .92rem;
    border: 1px solid var(--line);
}
.notice.success { color: #baffdf; background: var(--green-soft); }
.notice.danger { color: #ffd0db; background: var(--red-soft); }

.pin-form, .transaction-form { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 18px;
    outline: none;
    background: rgba(255,255,255,.065);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
input:focus { border-color: rgba(62,229,161,.7); box-shadow: 0 0 0 4px rgba(62,229,161,.12); transform: translateY(-1px); }

.button, .ghost-button, .icon-button, .quick-button, .avatar, .close-button { border: 0; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.button { display: inline-grid; min-height: 52px; place-items: center; padding: 0 18px; color: #04120e; font-weight: 900; border-radius: 18px; background: linear-gradient(135deg, #55f2b2, #1fd18b); box-shadow: 0 16px 40px rgba(31,209,139,.22); }
.button.wide { width: 100%; }
.button:hover, .quick-button:hover, .avatar:hover { transform: translateY(-2px); }
.button:active, .quick-button:active, .ghost-button:active, .icon-button:active { transform: translateY(1px) scale(.98); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { margin: 2px 0 0; font-size: 1.35rem; letter-spacing: .02em; }
.profile-name { margin: 2px 0 0; font-size: 1.05rem; font-weight: 900; letter-spacing: .01em; }
.avatar { display: grid; width: 58px; height: 58px; place-items: center; color: #051410; font-weight: 900; border-radius: 999px; background: radial-gradient(circle at 70% 20%, #ff4f79 0 5px, transparent 6px), linear-gradient(135deg, #58f6b5, #23d795); box-shadow: inset 0 0 0 5px rgba(4,18,14,.32), 0 16px 38px rgba(35,215,149,.28); }

.balance-card {
    position: relative;
    min-height: 172px;
    overflow: hidden;
    padding: 28px;
    border: 1px solid rgba(62,229,161,.18);
    border-radius: 32px;
    background: radial-gradient(circle at 90% 20%, rgba(62,229,161,.16), transparent 12rem), linear-gradient(150deg, rgba(8,94,77,.72), rgba(12,39,48,.74));
    box-shadow: 0 26px 80px rgba(9,58,51,.45);
}
.card-glow { position: absolute; inset: auto -40px -75px 30%; height: 140px; border-radius: 50%; background: rgba(62,229,161,.22); filter: blur(45px); }
.balance-card strong { display: block; margin-top: 10px; font-size: clamp(2.45rem, 10.5vw, 3.9rem); line-height: 1; letter-spacing: -.04em; }
.balance-card strong.negative { color: #ffd0db; }
.balance-meta, .section-heading, .transaction-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.balance-meta { position: relative; margin-top: 20px; color: rgba(246,248,255,.68); }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.summary-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); backdrop-filter: blur(20px); }
.summary-grid p { margin: 10px 0 6px; color: var(--muted); font-size: .85rem; }
.summary-grid strong { font-size: 1rem; }

.mini-icon, .transaction-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 15px; font-weight: 900; }
.mini-icon.income, .is-income .transaction-icon { color: var(--green); background: var(--green-soft); }
.mini-icon.expense, .is-expense .transaction-icon { color: var(--red); background: var(--red-soft); }

.quick-actions, .transactions { margin-top: 34px; }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.quick-button { display: grid; gap: 10px; justify-items: center; min-width: 0; color: var(--text); background: transparent; }
.quick-button span { display: grid; width: 62px; height: 62px; place-items: center; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.035)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.quick-button small { color: var(--muted); font-weight: 700; }
.ghost-button, .icon-button { color: var(--green); border: 1px solid rgba(62,229,161,.22); border-radius: 999px; background: rgba(62,229,161,.08); }
.ghost-button { padding: 10px 14px; font-weight: 800; }
.icon-button { padding: 7px 10px; font-size: .72rem; font-weight: 900; }

.transaction-list { display: grid; gap: 14px; margin-top: 18px; }
.transaction-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid transparent; border-radius: 22px; background: rgba(255,255,255,.03); animation: slideIn .34s ease both; }
.transaction-item:hover { border-color: var(--line); background: rgba(255,255,255,.055); }
.transaction-copy { min-width: 0; }
.transaction-copy strong, .transaction-copy span { display: block; }
.transaction-copy span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.transaction-actions { flex-direction: column; align-items: flex-end; }
.is-income .transaction-actions strong { color: var(--green); }
.is-expense .transaction-actions strong { color: var(--red); }

.empty-state { display: grid; justify-items: start; gap: 12px; margin-top: 18px; padding: 24px; border: 1px dashed rgba(255,255,255,.14); border-radius: 28px; background: rgba(255,255,255,.035); }
.empty-state h3, .empty-state p { margin: 0; }
.empty-state p { color: var(--muted); }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.modal.is-open { pointer-events: auto; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,5,12,.72); backdrop-filter: blur(10px); }
.modal-panel { position: relative; width: min(100%, 460px); max-height: 92vh; margin: 0 auto; overflow-y: auto; padding: 26px 20px 28px; border: 1px solid var(--line); border-radius: 32px 32px 0 0; background: rgba(17,20,29,.98); box-shadow: var(--shadow); transform: translateY(24px) scale(.98); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.modal.is-open .modal-panel { transform: translateY(0) scale(1); }
.close-button { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; color: var(--text); border-radius: 999px; background: rgba(255,255,255,.08); }

.type-toggle { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-toggle label { letter-spacing: 0; text-transform: none; }
.type-toggle input { position: absolute; opacity: 0; }
.type-toggle span { display: grid; min-height: 48px; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.045); }
.type-toggle input:checked + span { color: #051410; border-color: transparent; background: var(--green); }
.form-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
#deleteForm { display: none; }

.motion-rise { animation: rise .46s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--delay, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes floaty { 0%, 100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(8px,14px,0); } }

@media (min-width: 720px) {
    body { display: grid; place-items: center; padding: 24px; }
    .phone-shell { min-height: min(920px, calc(100vh - 48px)); border: 1px solid var(--line); border-radius: 40px; box-shadow: var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}



.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255,255,255,.045);
}

.profile-card strong,
.profile-card span {
    display: block;
}

.profile-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .86rem;
}

.profile-avatar {
    flex: 0 0 auto;
    cursor: default;
}

.profile-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.logout-link {
    display: inline-grid;
    min-height: 52px;
    place-items: center;
    padding: 0 18px;
    color: #ffd0db;
    border-color: rgba(255, 92, 134, .24);
    background: rgba(255, 92, 134, .1);
    font-weight: 900;
}


