/* =========================================================
   Bütçe — stil dosyası
   Mobil öncelikli, koyu tema, harici font/asset yok.
   ========================================================= */

:root {
  --bg: #080b16;
  --bg-glow-1: rgba(227, 194, 122, 0.07);
  --bg-glow-2: rgba(122, 162, 255, 0.10);
  --card: #111726;
  --card-2: #161d2f;
  --card-3: #1d2331;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --muted: #8b93a7;
  --muted-2: #5f6779;
  --gold: #e6c98a;
  --mint: #5ee9b5;
  --rose: #ff7d95;
  --sky: #7aa2ff;
  --amber: #ffc46b;
  --violet: #b58cff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 20px 45px -28px rgba(0, 0, 0, 0.95);
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(900px 520px at 8% -12%, var(--bg-glow-1), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.locked { overflow: hidden; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar svg { fill: none; }

::selection { background: rgba(94, 233, 181, 0.28); }

/* ---------- sayfa iskeleti ---------- */

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px calc(132px + env(safe-area-inset-bottom));
}

/* ---------- üst bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, rgba(10, 12, 17, 0.94) 55%, rgba(10, 12, 17, 0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.logo-img {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: #0b1226;
  box-shadow: 0 6px 18px -8px rgba(227, 194, 122, 0.65);
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background 0.3s, box-shadow 0.3s;
}

.live.on {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(94, 233, 181, 0.16);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(94, 233, 181, 0.14); }
  50% { box-shadow: 0 0 0 6px rgba(94, 233, 181, 0.04); }
}

.monthnav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  transition: opacity 0.2s;
}

body[data-tab="ayarlar"] .monthnav { opacity: 0; pointer-events: none; }

.navbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
}

.navbtn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.navbtn:active { background: rgba(255, 255, 255, 0.08); }

.monthlabel {
  padding: 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  text-transform: capitalize;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--muted);
  justify-self: end;
  border: 1px solid transparent;
}

.iconbtn:active { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn.ghost { border-color: var(--line); width: 34px; height: 34px; }

/* ---------- görünümler ---------- */

.view {
  padding-top: 6px;
  animation: rise 0.35s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0)) , var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad { padding: 16px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 2px 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head a,
.section-head button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sky);
  padding: 4px 0;
}

/* ---------- kahraman kart ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid rgba(94, 233, 181, 0.16);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(94, 233, 181, 0.16), transparent 55%),
    radial-gradient(100% 100% at 0% 100%, rgba(122, 162, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #141b20, #11151d);
  box-shadow: 0 24px 60px -34px rgba(94, 233, 181, 0.5);
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(238, 241, 247, 0.62);
}

.hero-amount {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: clamp(34px, 10vw, 44px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.hero-amount span { font-size: 0.44em; font-weight: 600; margin-top: 0.32em; color: rgba(238, 241, 247, 0.5); }
.hero-amount.neg { color: var(--rose); }

.hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.hero-sub b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.budget { margin-top: 14px; }

.budget-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.budget-top b { color: var(--text); font-weight: 600; }

.bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5ee9b5, #7aa2ff);
  transition: width 0.6s var(--ease);
}

.bar.warn > i { background: linear-gradient(90deg, #ffc46b, #ff9f6b); }
.bar.over > i { background: linear-gradient(90deg, #ff7d95, #ff5c7a); }

/* ---------- istatistik kartları ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 13px 13px 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.stat .k {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.stat .v {
  margin-top: 6px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- ortak kasa ---------- */

.balance {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(122, 162, 255, 0.18);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(122, 162, 255, 0.14), transparent 60%),
    var(--card);
}

.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.balance-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.pill {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.pill.ok { background: rgba(94, 233, 181, 0.12); color: var(--mint); }

.settle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.settle-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.mono-arrow {
  color: var(--muted-2);
  font-size: 15px;
}

.settle-amount {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.settle-note {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.paid-grid {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}

.paid-item .n { font-size: 11.5px; color: var(--muted); }
.paid-item .v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- kişi kartları ---------- */

.person-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.avatar.p1 { background: rgba(94, 233, 181, 0.14); color: var(--mint); }
.avatar.p2 { background: rgba(255, 125, 149, 0.14); color: var(--rose); }

.person-name { font-size: 14px; font-weight: 600; }
.person-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.person-net { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.person-net small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted-2); text-align: right; letter-spacing: 0; }

/* ---------- kategori dağılımı ---------- */

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

.donut { position: relative; width: 148px; height: 148px; flex: none; }
.donut svg { width: 148px; height: 148px; stroke: none; }
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.donut-center .sum { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.donut-center .cap { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }

.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row .sw { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9cfdd; }
.legend-row .pc { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.legend-row .am { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }

/* ---------- trend ---------- */

.trend {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 132px;
  padding: 8px 14px 0;
}

.trend-col { flex: 1; display: flex; flex-direction: column; height: 100%; align-items: center; gap: 6px; }
.trend-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.trend-bar { width: 9px; border-radius: 4px 4px 2px 2px; min-height: 3px; transition: height .5s var(--ease); }
.trend-bar.inc { background: rgba(94, 233, 181, 0.85); }
.trend-bar.exp { background: rgba(255, 125, 149, 0.75); }
.trend-label { font-size: 10.5px; color: var(--muted-2); text-transform: capitalize; }
.trend-col.now .trend-label { color: var(--text); font-weight: 600; }

.trend-legend { display: flex; gap: 14px; padding: 10px 16px 14px; font-size: 11.5px; color: var(--muted); }
.trend-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }

/* ---------- işlem listesi ---------- */

.day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.day-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.day-sum { font-variant-numeric: tabular-nums; color: var(--muted-2); font-weight: 600; }

.rows {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

.row:last-child { border-bottom: 0; }
.row:active { background: rgba(255, 255, 255, 0.035); }

.cat-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 17px;
  flex: none;
  background: rgba(255, 255, 255, 0.05);
}

.row-main { min-width: 0; }
.row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(122, 162, 255, 0.14);
  color: #a7c0ff;
  flex: none;
}

.tag.personal { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

.row-amount {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.row-amount.inc { color: var(--mint); }
.row-amount.exp { color: #e6eaf3; }

/* ---------- filtreler ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 2px 10px;
}

.chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.chip.on {
  background: rgba(94, 233, 181, 0.14);
  border-color: rgba(94, 233, 181, 0.4);
  color: var(--mint);
}

.chip .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}

.filters-people { padding-top: 0; margin-top: -3px; }

.mini-sum {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.mini-sum b { color: var(--text); font-variant-numeric: tabular-nums; }

/* kategori limitleri */
.limit-list { display: flex; flex-direction: column; gap: 13px; }
.limit-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.limit-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.limit-amt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.limit-amt em { font-style: normal; color: var(--muted-2); }
.limit-amt.over { color: var(--rose); }
.limit-amt.warn { color: var(--amber); }

.limit-rows { display: flex; flex-direction: column; gap: 7px; }
.limit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.limit-name { font-size: 12.5px; color: #c9cfdd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.limit-row .limit-input { width: 108px; min-height: 38px; padding: 8px 10px; font-size: 14px; text-align: right; flex: none; }

/* ---------- boş durum ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 36px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.015);
}

.empty .em { font-size: 30px; }
.empty h3 { margin: 2px 0 0; font-size: 15px; font-weight: 700; }
.empty p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 30ch; }

.textlink {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sky);
  padding: 4px;
}

/* ---------- butonlar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.12s, filter 0.15s, background 0.15s;
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(180deg, #6df0c0, #45cf9f);
  color: #052a1e;
  box-shadow: 0 10px 24px -14px rgba(94, 233, 181, 0.9);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.btn.danger {
  background: rgba(255, 125, 149, 0.14);
  border-color: rgba(255, 125, 149, 0.3);
  color: #ff9aac;
}

.btn.danger-text { color: var(--rose); }
.btn.wide { width: 100%; }

.btn:disabled { opacity: 0.5; }

/* ---------- alt menü + ekleme ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(560px, calc(100% - 32px));
  padding: 7px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 22, 31, 0.86);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.9);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 15px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}

.tab svg { width: 20px; height: 20px; }
.tab.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.tab.active svg { stroke: var(--mint); }

.tab-add { color: var(--mint); }
.tab-add.active { background: none; }

.add-circle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(160deg, #6df0c0, #3fc99b);
  color: #052a1e;
  box-shadow: 0 8px 18px -10px rgba(94, 233, 181, 0.95);
  transition: transform 0.16s var(--ease);
}

.add-circle svg { width: 20px; height: 20px; stroke-width: 2.7; stroke: #052a1e; }
.tab-add:active .add-circle { transform: scale(0.92); }
.tab-add span:last-child { margin-top: -1px; }

/* ---------- alt sayfa (form) ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 6, 10, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}

body.sheet-open .scrim { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  width: min(620px, 100%);
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate(-50%, 104%);
  transition: transform 0.38s var(--ease);
  background: linear-gradient(180deg, #171c27, #11151d);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.9);
  visibility: hidden;
}

body.sheet-open .sheet { transform: translate(-50%, 0); visibility: visible; }

.sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  margin: 9px auto 0;
  flex: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
  flex: none;
}

.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }

.sheet-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 16px 10px;
}

.sheet-body .field { min-width: 0; }

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.seg button {
  padding: 8px 2px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg button.on { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.seg-lg { border-radius: 14px; margin-top: 2px; }
.seg-lg button { padding: 9px; font-size: 13.5px; }
.seg-lg button[data-kind="expense"].on { background: rgba(255, 125, 149, 0.16); color: #ff9aac; }
.seg-lg button[data-kind="income"].on { background: rgba(94, 233, 181, 0.16); color: var(--mint); }

.amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 0;
  border-bottom: 1px solid var(--line);
}

.amount-cur { font-size: 26px; font-weight: 600; color: var(--muted-2); }

.amount {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0 0 6px;
  border: 0;
  background: transparent;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.amount::placeholder { color: rgba(255, 255, 255, 0.16); }

.quick-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: -6px; }

.receipt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(122, 162, 255, 0.28);
  background: rgba(122, 162, 255, 0.1);
  color: #bcd0ff;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s, opacity 0.15s;
}

.receipt-btn svg { width: 16px; height: 16px; stroke-width: 1.9; }
.receipt-btn:active { background: rgba(122, 162, 255, 0.18); }
.receipt-btn.busy { opacity: 0.55; pointer-events: none; }

.receipt-status {
  margin: -3px 2px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.receipt-status.ok { color: var(--mint); }
.receipt-status.err { color: var(--rose); }

.receipt-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 2px 0;
  font-size: 11px;
  color: var(--muted-2);
}

.receipt-choices .choice {
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.receipt-choices .choice:active { background: rgba(94, 233, 181, 0.14); }

.field-label {
  display: block;
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.field-label em { font-style: normal; font-weight: 400; color: var(--muted-2); }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px 6px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: all 0.15s;
  overflow: hidden;
}

.cat-btn .e { font-size: 17px; line-height: 1.1; }
.cat-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-btn.on { border-color: rgba(94, 233, 181, 0.45); background: rgba(94, 233, 181, 0.1); color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 .field { min-width: 0; }

.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}

.input:focus { border-color: rgba(94, 233, 181, 0.45); background: rgba(94, 233, 181, 0.05); }

input[type="date"].input { min-height: 44px; color-scheme: dark; }

.hint { margin: 7px 2px 0; font-size: 11.5px; color: var(--muted-2); }

.sheet-actions {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(17, 21, 29, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sheet-actions .btn { flex: 1; }
.sheet-actions #btnDelete { flex: 0 0 auto; }

/* ---------- ayarlar ---------- */

.settings-card { padding: 16px; }
.settings-card + .settings-card { margin-top: 12px; }

.settings-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.settings-desc { font-size: 11.5px; color: var(--muted); margin: 0 0 14px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { font-size: 11.5px; font-weight: 600; color: var(--muted); }

.split-row { display: flex; align-items: center; gap: 12px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint) var(--pct, 50%), rgba(255, 255, 255, 0.1) var(--pct, 50%));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef1f7;
  border: 4px solid #0f131a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.split-val {
  min-width: 54px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cat-manage { display: flex; flex-wrap: wrap; gap: 7px; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 500;
}

.cat-pill button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1;
}

.cat-pill button:hover { color: var(--rose); }

.add-cat { display: flex; gap: 7px; margin-top: 10px; }
.add-cat .input { padding: 9px 10px; font-size: 14px; min-height: 40px; }
.add-cat select.input { max-width: 108px; }

.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-row .btn { flex: 1; min-width: 130px; padding: 11px 12px; font-size: 12.5px; }

.danger-zone { border-color: rgba(255, 125, 149, 0.22); }

.footnote {
  margin: 18px 4px 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}

.footnote code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- modal ---------- */

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(360px, 100%);
  padding: 20px;
  border-radius: 20px;
  background: #171c27;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9);
  animation: pop 0.24s var(--ease) both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------- bildirim ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(170px + env(safe-area-inset-bottom));
  z-index: 90;
  transform: translate(-50%, 14px);
  padding: 11px 18px;
  border-radius: 99px;
  background: rgba(30, 36, 48, 0.96);
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s var(--ease);
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- küçük ekranlar ---------- */

@media (max-width: 640px) {
  .tabbar {
    bottom: 0;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { padding: 7px 4px; }
  .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .donut-wrap { gap: 12px; padding: 14px; }
  .donut, .donut svg { width: 120px; height: 120px; }
  .stat-grid { gap: 8px; }
  .stat { padding: 11px 10px; }
  .stat .v { font-size: 14px; }
  .card-pad { padding: 14px; }
  .grid-2 { gap: 10px; }
  .grid-2 .seg button { font-size: 11.5px; padding: 8px 1px; }
}

@media (max-width: 360px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat .k { font-size: 10px; }
}

@media (hover: hover) {
  .row:hover { background: rgba(255, 255, 255, 0.035); }
  .chip:hover { color: var(--text); border-color: var(--line-strong); }
  .navbtn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
  .tab:hover { color: var(--text); }
  .btn.primary:hover { filter: brightness(1.06); }
  .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
  .cat-btn:hover { color: var(--text); }
  .person-card:hover { border-color: var(--line-strong); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
