/* Harcama paneli · telefon öncelikli arayüz */
:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #eef1f6;
    --soft: #f3f6fb;
    --ink: #111827;
    --ink-2: #4b5563;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #1e3a8a;
    --brand-ink: #ffffff;
    --brand-soft: #eff6ff;
    --neg: #c0392b;
    --neg-soft: #fde9e7;
    --pos: #2f7a4d;
    --pos-soft: #e6f2ea;
    --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(30, 58, 138, .06);
    --shadow-lg: 0 10px 30px rgba(30, 58, 138, .16);
    --radius: 22px;
    --radius-sm: 14px;
    --dock-h: 68px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #131c2e;
        --surface-2: #1b263b;
        --soft: #1b263b;
        --ink: #f1f5f9;
        --ink-2: #cbd5e1;
        --muted: #94a3b8;
        --line: #24314a;
        --brand: #93b4f5;
        --brand-ink: #0b1120;
        --brand-soft: #1c2b4d;
        --neg: #ff7b72;
        --neg-soft: #3b2220;
        --pos: #4cd394;
        --pos-soft: #18342a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
        --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 500 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 14px 4px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
[hidden] { display: none !important; }

/* ---------- İskelet ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.page {
    padding: 8px 18px calc(var(--dock-h) + 48px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 18px;
}
.form-page .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar h1 { grid-column: 2; text-align: center; font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1.left { grid-column: 1 / 3; text-align: left; font-size: 26px; }
.topbar > :last-child:not(h1) { grid-column: 3; justify-self: end; }
.topbar > h1:only-child { grid-column: 1 / -1; }

.icon-btn {
    width: 46px; height: 46px; border-radius: 15px;
    display: inline-grid; place-items: center; flex: none;
    background: var(--surface); color: var(--ink-2); border: 0; cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .15s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 40px; height: 40px; border-radius: 13px; }
.icon-btn.ghost { background: transparent; box-shadow: none; pointer-events: none; }

/* ---------- Alt menü (dock) ---------- */
.dock {
    position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(560px, 100%); padding: 0 14px;
    display: flex; align-items: center; gap: 12px;
}
.dock-bar {
    flex: 1; height: var(--dock-h); border-radius: 26px; padding: 6px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: var(--shadow-lg); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.dock-bar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border-radius: 20px; color: var(--muted); font-size: 11px; font-weight: 700;
    transition: background .2s ease, color .2s ease;
}
.dock-bar a.active { background: var(--brand-soft); color: var(--brand); }
.dock-bar a:active { transform: scale(.95); }
.fab {
    width: 68px; height: 68px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--brand); color: var(--brand-ink);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 45%, transparent);
    transition: transform .15s ease;
}
.fab:active { transform: scale(.92); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; z-index: 50; left: 50%; top: calc(14px + env(safe-area-inset-top));
    transform: translateX(-50%); width: min(520px, calc(100% - 28px));
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-radius: 18px;
    background: var(--pos); color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: var(--shadow-lg);
    animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
    transition: opacity .3s ease, transform .3s ease;
}
.toast.hide { opacity: 0; transform: translate(-50%, -20px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -24px); } }

/* ---------- Ortak parçalar ---------- */
.card {
    background: var(--surface); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.link { color: var(--brand); font-weight: 700; font-size: 15px; }
.link.center { display: block; text-align: center; margin-top: 12px; }
.tag {
    display: inline-block; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .04em;
    padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle;
}
.badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.badge.sirket { background: #e7eefc; color: #2f5bb8; }
.badge.kisisel { background: #f6e9fb; color: #8a3fa6; }
@media (prefers-color-scheme: dark) {
    .badge.sirket { background: #1e2a44; color: #9bb8f5; }
    .badge.kisisel { background: #35203f; color: #dba8ef; }
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; padding: 0 22px; border-radius: 16px; border: 0; cursor: pointer;
    background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 16px;
    transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: 18px; border-radius: 18px; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { background: var(--neg-soft); color: var(--neg); }
.danger-text { color: var(--neg) !important; }
.mini-btn {
    display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 12px;
    border-radius: 12px; border: 0; cursor: pointer;
    background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13px;
}
.mini-btn.ok { background: var(--brand); color: var(--brand-ink); }
.mini-btn:active { transform: scale(.95); }

.error { color: var(--neg); font-size: 14px; font-weight: 600; margin-top: 6px; }
.error.card { margin: 0; }

/* Tutar */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money .cur { font-size: .5em; margin-right: .12em; vertical-align: .28em; opacity: .85; }
.money small { font-size: .5em; opacity: .7; font-weight: 700; }

/* ---------- Ana ekran ---------- */
.hello { display: flex; align-items: flex-start; justify-content: space-between; padding-top: calc(14px + env(safe-area-inset-top)); }
.hello h1 { font-size: 30px; font-weight: 800; }
.hello p { color: var(--muted); font-size: 15px; }
.balance { display: flex; flex-direction: column; gap: 2px; }
.balance-num { font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.balance.compact .balance-num { font-size: 42px; }
.balance-num em { font-size: 15px; font-style: normal; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.balance-sub { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-weight: 600; margin-top: 4px; width: fit-content; }
.balance-sub b { font-weight: 800; }
.balance-sub i { font-style: normal; opacity: .5; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split-card {
    background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 4px;
}
.split-card b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.split-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.split-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px; }
.split-ico.sirket { background: #e7eefc; color: #2f5bb8; }
.split-ico.kisisel { background: #f6e9fb; color: #8a3fa6; }
@media (prefers-color-scheme: dark) {
    .split-ico.sirket { background: #1e2a44; color: #9bb8f5; }
    .split-ico.kisisel { background: #35203f; color: #dba8ef; }
}

.tip h2 { font-size: 19px; margin: 8px 0 6px; }
.tip p { color: var(--ink-2); font-size: 15px; }

.chips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    display: inline-flex; align-items: center; gap: 9px; min-height: 48px;
    padding: 6px 16px 6px 6px; border-radius: 999px;
    background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 15px;
}
.chip:active { transform: scale(.97); }
.chip-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.c-violet { background: #efe9fb; color: #6d4bc4; }
.c-green { background: #e3f5ec; color: #1f9d63; }
.c-amber { background: #fdf0dc; color: #c27a12; }
.c-blue { background: #e5effb; color: #2f6bc4; }
.c-rose { background: #fde8ea; color: #c4405a; }
.c-slate { background: #edf0f3; color: #4f5d6b; }
@media (prefers-color-scheme: dark) {
    .c-violet { background: #2e2545; color: #b9a3f5; }
    .c-green { background: #18342a; color: #4cd394; }
    .c-amber { background: #3a2c16; color: #f2b45a; }
    .c-blue { background: #1c2b40; color: #8fb6f2; }
    .c-rose { background: #3d1f26; color: #f2899c; }
    .c-slate { background: #2a2f35; color: #b2bdc8; }
}

.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.block-head h2 { font-size: 24px; font-weight: 800; margin: 0; }
.card .block-head h2 { font-size: 18px; }
.pill-link { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.trend-sum { display: flex; flex-direction: column; }
.trend-sum > span { color: var(--muted); font-weight: 700; font-size: 14px; }
.trend-sum b { font-size: 26px; font-weight: 800; }
.trend-sum em { font-style: normal; font-size: 13px; font-weight: 700; }
.trend { position: relative; color: var(--brand); }
.trend svg { width: 100%; height: 120px; display: block; overflow: visible; }
.trend.tall svg { height: 140px; }
.trend-empty { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--surface); padding: 6px 14px; border-radius: 12px; font-size: 14px; color: var(--muted); box-shadow: var(--shadow); }
.trend-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* İşlem satırı */
.list-card { padding: 6px; }
.tx, .due, .row-item, .menu-item {
    display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; min-height: 64px;
}
.tx:active, .menu-item:active { background: var(--surface-2); }
.list-card > * + * { border-top: 1px solid var(--line); border-radius: 0; }
.list-card > *:first-child { border-radius: 16px 16px 0 0; }
.list-card > *:last-child { border-radius: 0 0 16px 16px; }
.list-card > *:only-child { border-radius: 16px; }
.tx-ico {
    width: 46px; height: 46px; border-radius: 15px; flex: none;
    display: grid; place-items: center; font-size: 22px; background: var(--surface-2);
}
.tx-ico.gider { background: var(--neg-soft); }
.tx-ico.gelir { background: var(--pos-soft); }
.tx-ico.xl { width: 72px; height: 72px; border-radius: 24px; font-size: 34px; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main strong { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tx-meta.neg { color: var(--neg); }
.tx-amt { text-align: right; font-weight: 800; font-size: 16px; white-space: nowrap; display: flex; flex-direction: column; }
.tx-amt small { color: var(--muted); font-size: 12px; font-weight: 600; }
.row-item.dim { opacity: .55; }

.date-badge {
    width: 52px; height: 56px; border-radius: 15px; flex: none; background: var(--surface-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .06em; line-height: 1.1;
}
.date-badge b { font-size: 20px; color: var(--ink); letter-spacing: -.02em; }
.date-badge.late { background: var(--neg-soft); color: var(--neg); }
.date-badge.late b { color: var(--neg); }
.due-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.due-side b { white-space: nowrap; }
.due-actions { display: flex; gap: 6px; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 10px; }
.empty-ico { width: 72px; height: 72px; border-radius: 22px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.empty-state p { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.empty-state .muted { font-size: 14px; max-width: 34ch; }
.empty-state .btn { margin-top: 8px; }

/* ---------- İşlemler listesi ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.month-title { font-size: 19px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.month-pick { position: relative; }
.month-pick select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.sum-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 6px; }
.sum-strip > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sum-strip > div + div { border-left: 1px solid var(--line); }
.sum-strip span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sum-strip b { font-size: 16px; font-weight: 800; white-space: nowrap; }

.search {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px;
    background: var(--soft); border-radius: 16px; color: var(--muted);
    border: 1.5px solid transparent;
}
.search:focus-within { border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--surface); }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; font-size: 16px; color: var(--ink); }

.filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
    border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
    font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.fchip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.fsep { flex: none; width: 1px; background: var(--line); margin: 6px 2px; }

.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px; margin-bottom: -8px; }
.day-head span { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.day-head b { font-size: 14px; font-weight: 800; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Bottom sheet ---------- */
.sheet {
    border: 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); margin: auto 0 0;
    width: 100%; max-width: 560px; max-height: 86dvh; left: 0; right: 0; margin-inline: auto;
    border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-lg); overflow-y: auto;
}
.sheet[open] { animation: sheet-in .3s cubic-bezier(.2, .9, .3, 1); }
.sheet::backdrop { background: rgba(11, 17, 32, .42); backdrop-filter: blur(2px); }
@keyframes sheet-in { from { transform: translateY(40%); opacity: .4; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 21px; font-weight: 800; }
.sheet-head .icon-btn { box-shadow: none; background: var(--surface-2); }
.sheet-form { display: flex; flex-direction: column; gap: 14px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.cat-cell {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
    border: 2px solid transparent; border-radius: 18px; background: var(--surface-2); cursor: pointer;
    font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.2;
}
.cat-cell i { font-style: normal; font-size: 26px; }
.cat-cell.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- İşlem formu ---------- */
.tx-form { display: flex; flex-direction: column; gap: 20px; }
.kind-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 5px; border-radius: 18px; background: var(--surface-2); }
.kind-tab, .seg label, .opt, .cat-chip, .tabs-radio { position: relative; }
.kind-tab input, .seg input, .opt input, .cat-chip input, .tabs-radio > input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kind-tab span {
    display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 14px;
    font-weight: 800; color: var(--muted); cursor: pointer; transition: background .2s ease, color .2s ease;
}
.kind-tab.gider input:checked + span { background: var(--neg); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--neg) 35%, transparent); }
.kind-tab.gelir input:checked + span { background: var(--pos); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--pos) 35%, transparent); }
.kind-tab input:focus-visible + span, .seg input:focus-visible + span, .opt input:focus-visible + span, .cat-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.amount-block { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.amount-input { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 4px; width: 100%; max-width: 100%; }
.amount-input input { width: 2ch; min-width: .6em; padding: 0; margin: 0; border-radius: 0; -webkit-appearance: none; }
.amount-measure { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
.amount-input .cur { font-size: 34px; font-weight: 800; color: var(--muted); }
.amount-input input {
    max-width: calc(100% - 24px); border: 0; background: transparent; outline: none; text-align: center;
    font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; color: var(--ink);
    font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input input::placeholder { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.amount-line { width: 56px; height: 4px; border-radius: 4px; background: var(--neg); transition: background .2s ease, width .2s ease; }
.kind-gelir .amount-line { background: var(--pos); }
.amount-input:focus-within + .amount-line { width: 90px; }
.date-chip {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
    border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); font-weight: 700; font-size: 15px;
}
.date-chip input { border: 0; background: transparent; outline: none; font-weight: 700; color: var(--ink); min-width: 0; }
.date-chip.static { box-shadow: none; background: var(--surface-2); }

.f-sec { display: flex; flex-direction: column; gap: 10px; }
.f-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg span, .opt span {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 16px;
    border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
    font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all .18s ease;
}
.seg input:checked + span, .opt input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.opt span { min-height: 46px; border-radius: 999px; }
.opt .tick { display: none; }
.opt input:checked + span .tick { display: block; }

.cat-row { display: flex; align-items: center; gap: 8px; }
.cat-scroll { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, #000 88%, transparent); }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; scroll-snap-align: start; }
.cat-chip span {
    display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 5px 16px 5px 6px;
    border-radius: 999px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow);
    font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.cat-chip i { font-style: normal; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 19px; }
.cat-chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cat-more { width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }

.details { padding: 0; }
.details summary {
    list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
    font-weight: 800; font-size: 16px;
}
.details summary::-webkit-details-marker { display: none; }
.sum-ico { width: 40px; height: 40px; border-radius: 13px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.sum-hint { color: var(--muted); font-weight: 600; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.details[open] .sum-chev { transform: rotate(180deg); }
.details[open] .sum-hint { visibility: hidden; }
.details-body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.soft-input {
    display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px;
    background: var(--soft); border-radius: 16px; color: var(--muted); border: 1.5px solid transparent;
}
.soft-input:focus-within { border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--surface); }
.soft-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); min-width: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-field { display: flex; flex-direction: column; gap: 6px; }
.mini-field > span { font-size: 13px; font-weight: 700; color: var(--muted); padding-left: 4px; }
.mini-field input, .mini-field select, .add-row input, .add-row select {
    width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px;
    border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; outline: none;
}
.mini-field input:focus, .mini-field select:focus, .add-row input:focus { border-color: var(--brand); }
.file-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.file-btn {
    display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; flex: 1 1 100%;
    border-radius: 16px; border: 1.5px dashed var(--line); color: var(--ink-2); font-weight: 700; cursor: pointer; justify-content: center;
}
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

.save-bar {
    position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: 0;
    width: min(560px, 100%); padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* ---------- Rapor ---------- */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px; border-radius: 18px; background: var(--surface-2); }
.segmented a, .segmented label {
    display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; border-radius: 14px;
    font-weight: 700; color: var(--muted); cursor: pointer; text-align: center; font-size: 15px;
}
.segmented .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented.small a, .segmented.small label { font-size: 13px; min-height: 40px; }
.hero-card { display: flex; flex-direction: column; gap: 6px; }
.hero-num { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.hero-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.hero-sub b { font-weight: 800; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.pos { background: var(--pos); }
.dot.neg { background: var(--neg); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-card b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.stat-card b.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.tabs-radio { display: flex; flex-direction: column; gap: 14px; }
.tab-panel { display: none; flex-direction: column; gap: 14px; }
#cs-sirket:checked ~ .p-sirket, #cs-kisisel:checked ~ .p-kisisel { display: flex; }
#cs-sirket:checked ~ .segmented label[for=cs-sirket], #cs-kisisel:checked ~ .segmented label[for=cs-kisisel] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.bar-row { display: flex; flex-direction: column; gap: 7px; }
.bar-row + .bar-row { margin-top: 12px; }
.bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 700; }
.bar-head em { font-style: normal; font-size: 12px; font-weight: 600; }
.bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 10px; background: var(--neg); }
.bar.alt i { background: var(--brand); }
.dark-card { background: #1e3a8a; color: #f1f5ff; }
.dark-card .eyebrow { color: #bfdbfe; margin-bottom: 8px; }
.dark-card .muted, .dark-card em { color: #c7d6f5; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--line); }
.dark-card .kv + .kv { border-color: #3552a3; }
.kv > span { color: var(--muted); font-weight: 600; }
.dark-card .kv > span { color: #dbe6fb; }
.kv b { font-weight: 800; text-align: right; }
.kv em { font-style: normal; font-size: 13px; }
.kv.col { flex-direction: column; align-items: flex-start; gap: 4px; }
.kv.col b { text-align: left; font-weight: 600; }

/* ---------- İşlem detayı ---------- */
.detail-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 6px 0; }
.detail-hero h2 { font-size: 21px; font-weight: 800; }
.facts { padding: 6px 18px; }
.receipt { border-radius: 16px; width: 100%; max-height: 520px; object-fit: contain; background: var(--surface-2); }
.plain-details { margin-top: 12px; }
.plain-details summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.receipt-text { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); padding: 12px; border-radius: 12px; overflow-x: auto; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-row form { display: contents; }

/* ---------- Ayarlar / menü ---------- */
.add-row { display: flex; gap: 8px; padding: 12px; }
.add-row .emoji-in { width: 58px; flex: none; text-align: center; padding: 0; }
.add-row input[name=name] { flex: 1; min-width: 0; }
.add-row select { width: auto; }
.add-row .mini-btn { min-height: 50px; width: 50px; justify-content: center; flex: none; }
.profile { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.menu-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }

/* ---------- Giriş ve şifre sayfası ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field input { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; outline: none; }
.field input:focus { border-color: var(--brand); }
.hint { font-size: 13px; color: var(--muted); }
.page > form.card { max-width: none !important; }
.page > form.card .btn { width: 100%; }
.login-page .page { min-height: 100dvh; justify-content: center; padding-bottom: 40px; }
.login-page .brand { display: block; text-align: center; margin-bottom: 4px; }
.login-page .brand img { margin: 0 auto 6px; height: auto; }
.login-page .brand small { display: block; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login-page .brand-name { font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }

@media (min-width: 720px) {
    .page { padding-top: 16px; }
    .balance-num { font-size: 60px; }
}
@media (max-width: 360px) {
    .balance-num { font-size: 42px; }
    .amount-input input { font-size: 52px; }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Fişten doldur (formun en üstü) */
.scan-card { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px; margin-bottom: 18px;
  border-radius: 18px; background: var(--brand-soft); border: 1.5px dashed var(--brand); color: var(--ink); cursor: pointer;
  transition: background .2s, border-color .2s; -webkit-tap-highlight-color: transparent; }
.scan-card:active { transform: scale(.99); }
.scan-card:focus-within, .scan-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.scan-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: var(--brand-ink, #fff); }
.scan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-text strong { font-size: 16px; font-weight: 800; }
.scan-text span { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; }
.scan-spin { display: none; flex: none; margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: scan-spin .8s linear infinite; }
.scan-card.busy { pointer-events: none; border-style: solid; }
.scan-card.busy .scan-spin { display: block; }
.scan-card.done { border-style: solid; border-color: var(--pos); background: var(--pos-soft); }
.scan-card.done .scan-ico { background: var(--pos); }
.scan-card.fail { border-style: solid; border-color: var(--neg); }
.scan-card.fail .scan-ico { background: var(--neg); }
@keyframes scan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scan-spin { animation-duration: 2.4s; } }
.scan-ico { position: relative; overflow: hidden; }
.scan-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
/* Kullanıcılar */
.avatar.sm { width: 42px; height: 42px; border-radius: 14px; font-size: 17px; flex: none; }
.menu-item.dim { opacity: .55; }
form.card .check { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 16px; line-height: 1.4; }
form.card .check input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.user-list .tx-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kapsam aktarma */
.scope-switch .hint { margin: 10px 2px 0; line-height: 1.45; text-align: center; }
.scope-switch .btn { flex-direction: row; gap: 8px; }
/* Özet: şirket / kişisel net ayrı */
.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.balance .split { margin-top: 8px; }
.scope-net { gap: 6px; padding: 14px; min-width: 0; }
.scope-net-head { display: flex; align-items: center; gap: 8px; }
.scope-net-head .split-ico { width: 32px; height: 32px; border-radius: 10px; margin: 0; }
.scope-net-num { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; color: var(--ink); }
.scope-net-num.neg { color: var(--neg); }
.scope-net-sub { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.scope-net-sub > span { display: flex; flex-wrap: wrap; column-gap: 4px; }
.scope-net-sub b { white-space: nowrap; }
.split-card .scope-net-sub b { font-size: 13px; font-weight: 800; letter-spacing: 0; }
.scope-net-sub i { font-style: normal; }
@media (max-width: 360px) { .scope-net-sub i { display: none; } .scope-net { padding: 12px; } }
.balance-sub.total { margin-top: 10px; }
/* Alt menünün arkası: kayan içerik menü ile + arasında görünmesin */
.dock::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    left: 50%; width: 100vw; transform: translateX(-50%);
    top: -28px; bottom: calc(-14px - env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 42%);
}
