/* Paracep — lacivert kurumsal tema, gelir yeşil, gider kırmızı */
:root {
    --navy: #0B1F4D;
    --navy-2: #13306E;
    --navy-3: #1E3A8A;
    --blue: #2563EB;
    --green: #16A34A;
    --green-bg: #DCFCE7;
    --red: #DC2626;
    --red-bg: #FEE2E2;
    --amber: #D97706;
    --amber-bg: #FEF3C7;
    --bg: #EEF2F7;
    --card: #FFFFFF;
    --line: #E2E8F0;
    --text: #0F172A;
    --muted: #64748B;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}
body.has-nav { padding-bottom: calc(76px + var(--safe-b)); }
a { color: var(--blue); text-decoration: none; }
b, strong { font-weight: 600; }
.ic { flex-shrink: 0; vertical-align: middle; }
.ic.inline { vertical-align: -1px; }
.num, .amt, .money { font-variant-numeric: tabular-nums; }

/* ── Üst bar ── */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 4px;
    height: 56px; padding: 0 8px 0 16px;
    background: var(--navy); color: #fff;
}
.topbar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 50%; color: #fff; background: none; border: 0; cursor: pointer; }
.tb-btn:active { background: rgba(255,255,255,.12); }
.tb-right { display: flex; align-items: center; gap: 2px; }
.tb-right .tb-btn { margin-left: 0; }

.page { max-width: 640px; margin: 0 auto; padding: 16px; }
body.hero .page { padding-top: 0; }

/* ── Ana sayfa bakiye alanı ── */
.hero-box {
    margin: 0 -16px 16px; padding: 4px 20px 56px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
}
.hero-greet { font-size: 14px; color: #BFD0F5; }
.hero-label { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: #BFD0F5; }
.hero-label button { background: none; border: 0; color: #BFD0F5; padding: 4px; cursor: pointer; }
.hero-balance { font-size: 34px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; }
.hero-month { display: flex; gap: 10px; margin-top: 18px; }
.hero-month > div { flex: 1; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.hero-month small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #BFD0F5; }
.hero-month b { display: block; font-size: 16px; margin-top: 2px; }
.hero-month .g small .ic { color: #4ADE80; }
.hero-month .r small .ic { color: #F87171; }
.lift { margin-top: -44px; position: relative; }

/* ── Kartlar ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head a { font-size: 13px; font-weight: 500; }
.section-title { margin: 20px 4px 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text); text-align: center; }
.quick .qi { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; }
.qi-g { background: var(--green-bg); color: var(--green); }
.qi-r { background: var(--red-bg); color: var(--red); }
.qi-b { background: #DBEAFE; color: var(--navy-3); }
.qi-a { background: var(--amber-bg); color: var(--amber); }

/* ── Satırlar ── */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text); border-top: 1px solid var(--line); min-height: 64px; }
.card > .row:first-child, .card-head + .row, .day-head + .row { border-top: 0; }
.row:active { background: #F8FAFC; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; }
.row-end small { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); }
@supports not (background: color-mix(in srgb, red 10%, white)) { .badge { background: #F1F5F9; } }
.amt { font-weight: 600; white-space: nowrap; }
.amt-gelir, .pos { color: var(--green); }
.amt-gider, .neg { color: var(--red); }
.amt-tr { color: var(--muted); }
.day-head { display: flex; justify-content: space-between; padding: 10px 16px; background: #F8FAFC; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.card > .day-head:first-child { border-top: 0; }
.day-head b { color: var(--text); font-weight: 600; }

/* ── Ay seçici ── */
.month-nav { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; margin-bottom: 14px; }
.month-nav a { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; color: var(--navy-3); }
.month-nav a:active { background: #EFF6FF; }
.month-nav b { font-size: 16px; }

.summary3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.summary3 > div { padding: 14px 6px; }
.summary3 > div + div { border-left: 1px solid var(--line); }
.summary3 small { display: block; font-size: 12px; color: var(--muted); }
.summary3 b { display: block; font-size: 15px; margin-top: 2px; }

/* ── Formlar ── */
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.input, select.input, textarea.input {
    width: 100%; height: 50px; padding: 0 14px;
    font: inherit; font-size: 16px; color: var(--text);
    background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
    outline: none; appearance: none; -webkit-appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy-3); flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.amount-box { text-align: center; padding: 22px 16px 10px; }
.amount-box .cur { font-size: 28px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.amount-box input {
    width: 100%; max-width: 320px; border: 0; outline: none; background: none; text-align: center;
    font: inherit; font-size: 40px; font-weight: 700; color: var(--text); padding: 0;
}
.amount-box.t-gelir input { color: var(--green); }
.amount-box.t-gider input { color: var(--red); }
.amount-wrap { display: flex; align-items: center; justify-content: center; border-bottom: 2px solid var(--line); padding-bottom: 8px; }

.seg { display: flex; padding: 4px; background: #E2E8F0; border-radius: 12px; gap: 4px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 9px; font-weight: 600; font-size: 14px; color: #475569; cursor: pointer; }
.seg input:checked + span { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg input[value="gelir"]:checked + span { color: var(--green); }
.seg input[value="gider"]:checked + span { color: var(--red); }
.seg input[value="transfer"]:checked + span { color: var(--navy-3); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat-grid label { position: relative; }
.cat-grid input { position: absolute; opacity: 0; pointer-events: none; }
.cat-grid .ct { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 12px; border: 1.5px solid transparent; font-size: 11.5px; line-height: 1.2; text-align: center; color: #334155; cursor: pointer; word-break: break-word; }
.cat-grid input:checked + .ct { border-color: var(--navy-3); background: #EFF6FF; }
.cat-grid input:focus-visible + .ct { outline: 2px solid var(--blue); }

.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-grid label { position: relative; }
.icon-grid input { position: absolute; opacity: 0; }
.icon-grid span { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); color: #334155; cursor: pointer; }
.icon-grid input:checked + span { border-color: var(--navy-3); background: #EFF6FF; color: var(--navy-3); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 3px #fff; border: 2px solid transparent; }
.swatch input:checked + span { border-color: var(--c); }

/* ── Butonlar ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; text-align: center; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--navy-3); color: #fff; }
.btn-primary:active { background: var(--navy); }
.btn-green { background: var(--green); color: #fff; }
.btn-light { background: #E2E8F0; color: var(--text); }
.btn-danger { background: none; color: var(--red); border: 1.5px solid #FECACA; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0 calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); }

/* ── Bildirim/uyarı ── */
.toast { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--text); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toast 3.2s forwards; }
.toast-err { background: var(--red); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.alert-err { background: var(--red-bg); color: #991B1B; }
.alert-warn { background: var(--amber-bg); color: #92400E; }
.alert-info { background: #DBEAFE; color: #1E3A8A; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #F1F5F9; color: #475569; }
.pill-warn { background: var(--amber-bg); color: #92400E; }
.pill-over { background: var(--red-bg); color: #991B1B; }
.pill-ok { background: var(--green-bg); color: #166534; }

/* ── İlerleme çubuğu ── */
.bar { height: 8px; border-radius: 99px; background: #E2E8F0; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar.warn > i { background: var(--amber); }
.bar.over > i { background: var(--red); }
.budget { padding: 14px 16px; border-top: 1px solid var(--line); }
.card-head + .budget, .card > .budget:first-child { border-top: 0; }
.budget-top { display: flex; align-items: center; gap: 10px; }
.budget-top .row-main small { white-space: normal; }
.budget-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Grafikler ── */
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 16px; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center small { font-size: 11px; color: var(--muted); }
.donut-center b { font-size: 14px; }
.legend { flex: 1; min-width: 0; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend em { font-style: normal; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 16px 12px 0; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bars .pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bars .pair i { width: 40%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .pair .g { background: var(--green); }
.bars .pair .r { background: var(--red); }
.bars .col small { font-size: 11px; color: var(--muted); padding: 6px 0 10px; }
.bars .col.cur small { color: var(--text); font-weight: 600; }
.bars-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); padding: 0 0 14px; }
.bars-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.rank { padding: 12px 16px; border-top: 1px solid var(--line); }
.rank:first-child { border-top: 0; }
.rank-top { display: flex; align-items: center; gap: 12px; }
.rank .bar { height: 6px; }
.rank .bar > i { background: var(--c); }

/* ── Arama/filtre ── */
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search .input { height: 44px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; border-radius: 99px; background: #fff; color: #334155; font-size: 13px; font-weight: 500; border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--navy-3); color: #fff; border-color: var(--navy-3); }
.filters { display: none; }
.filters.open { display: block; }

/* ── Hesap kartları ── */
.acc-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.acc-strip::-webkit-scrollbar { display: none; }
.acc-card { flex: 0 0 auto; min-width: 150px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); color: var(--text); border-top: 3px solid var(--c); }
.acc-card small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.acc-card b { display: block; margin-top: 6px; font-size: 16px; }

/* ── Menü (Diğer) ── */
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.menu > :first-child { border-top: 0; }
.menu .mi { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: #EFF6FF; color: var(--navy-3); }
.menu span { flex: 1; }
.menu small { display: block; color: var(--muted); font-size: 12px; }
.menu .chev { color: #CBD5E1; }
.menu .danger { color: var(--red); }
.menu .danger .mi { background: var(--red-bg); color: var(--red); }
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--navy-3); color: #fff; font-size: 20px; font-weight: 700; }

/* ── Alt menü ── */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: stretch; justify-content: space-around;
    height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b);
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .05);
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: #94A3B8; }
.bottomnav a.on { color: var(--navy-3); }
.bottomnav .fab { flex: 0 0 auto; width: 58px; height: 58px; margin: -18px 6px 0; border-radius: 50%; background: var(--navy-3); color: #fff; box-shadow: 0 6px 16px rgba(30, 58, 138, .4); align-self: flex-start; }
.bottomnav .fab:active { background: var(--navy); }

/* ── Giriş sayfaları ── */
body.bare { background: var(--navy); }
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { padding: 48px 24px 32px; color: #fff; text-align: center; }
.auth-top .logo { width: 72px; height: 72px; margin: 0 auto 14px; }
.auth-top h1 { margin: 0; font-size: 26px; }
.auth-top p { margin: 6px 0 0; color: #BFD0F5; }
.auth-card { flex: 1; background: var(--bg); border-radius: 24px 24px 0 0; padding: 24px 20px 32px; }
.auth-card .inner { max-width: 420px; margin: 0 auto; }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 4px; top: 5px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 24px; color: var(--muted); }
.empty .ic { color: #CBD5E1; margin-bottom: 10px; }
.empty b { color: var(--text); font-size: 16px; }
.empty p { margin: 6px 0 16px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.hidden-balance .secret { color: transparent !important; text-shadow: 0 0 9px rgba(15,23,42,.55); user-select: none; }
.hidden-balance .hero-box .secret { text-shadow: 0 0 10px rgba(255,255,255,.85); }

@media (min-width: 700px) {
    .page { padding: 20px; }
    .hero-box { margin: 0 -20px 16px; border-radius: 0 0 24px 24px; }
}
