/* Bakita (Bakiye Takip) — modern minimal tema */
/* Yazı tipi sunucudan yüklenir: Windows ve Mac'te birebir aynı görünüm ve çıktı için */
@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plex-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plex-latin-ext-500.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plex-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plex-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plex-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/plex-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --brand: #0f6e6e;
  --brand-dark: #0b5656;
  --brand-soft: #e7f4f3;
  --brand-softer: #f3faf9;
  --text: #17212b;
  --muted: #667085;
  --line: #e4e8eb;
  --line-soft: #eef1f3;
  --bg: #f5f7f8;
  --paper: #ffffff;
  --debt: #d0342c;
  --debt-soft: #fef1f0;
  --paid: #0a8a50;
  --paid-soft: #eaf8f0;
  --warn: #b25e09;
  --warn-soft: #fff6e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --font: "Plex", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .money, td.r, th.r { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.print-only { display: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { width: 16px; height: 16px; flex: none; }
.nowrap { white-space: nowrap; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 20px 20px 0;
  background: radial-gradient(1200px 600px at 20% -10%, #dff1ef 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e8f0fb 0, transparent 60%), var(--bg); }
.login { background: var(--paper); width: 100%; max-width: 390px; border-radius: 16px; padding: 30px 28px; box-shadow: 0 12px 40px rgba(16, 24, 40, .1); border: 1px solid var(--line); }
.login h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.login p.sub { margin: 14px 0 20px; color: var(--muted); font-size: 14px; }
.login .btn { width: 100%; margin-top: 6px; padding: 11px; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.notice .ic { margin-top: 2px; }

/* ---------- Üst bar ve menü ---------- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar > .in { max-width: 1200px; margin: 0 auto; padding: 0 18px; height: 58px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.brand .logo .ic { width: 18px; height: 18px; }
.brand .bn { font-weight: 700; font-size: 16px; letter-spacing: -.01em; line-height: 1.15; }
.brand .bn .tg, .login-brand .tg { font-weight: 500; font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 1px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 2px; letter-spacing: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.login-brand .logo .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.login-brand .tg { display: inline-block; margin: 2px 0 0; }
.brand .logo .ic { stroke-width: 2.2; }
.brand .firm { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; margin-right: 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.who-tx { display: flex; flex-direction: column; line-height: 1.2; }
.who-tx b { font-size: 13px; font-weight: 600; }
.who-tx small { font-size: 11.5px; color: var(--muted); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.tb-btn:hover { background: var(--bg); color: var(--text); }
nav.menu .in { max-width: 1200px; margin: 0 auto; padding: 0 12px 8px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.menu a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; }
nav.menu a .ic { width: 17px; height: 17px; }
nav.menu a:hover { background: var(--bg); color: var(--text); }
nav.menu a.on { background: var(--brand-soft); color: var(--brand-dark); }
nav.menu a.cta { color: var(--brand); font-weight: 600; }
nav.menu a.cta.on { background: var(--brand); color: #fff; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
main { max-width: 1200px; width: 100%; margin: 0 auto; padding: 20px 18px 40px; flex: 1; }
/* Alt bilgi çubuğu (Bakita / Codoge) */
.app-foot { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 12.5px; }
.app-foot .in { max-width: 1200px; margin: 0 auto; padding: 12px 18px; display: flex; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; }
.app-foot b { color: var(--brand); }
.login-wrap .app-foot { width: 100vw; margin-top: auto; background: transparent; border-top-color: rgba(0,0,0,.06); }
.login-wrap .app-foot .in { justify-content: center; text-align: center; }
.print-ad { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.015em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.back .ic { width: 14px; height: 14px; }

/* ---------- Bileşenler ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel, .panel + .stats, .stats + .panel, .target + .stats, .panel + .target { margin-top: 14px; }
.panel-pad { padding: 16px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel h3 .ic { color: var(--brand); }
.panel-title { padding: 12px 16px 6px; font-weight: 600; font-size: 14.5px; }
.panel-note { padding: 9px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); min-width: 0; }
.st-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.st-ic .ic { width: 19px; height: 19px; }
.stat.paid .st-ic { background: var(--paid-soft); color: var(--paid); }
.stat.debt .st-ic { background: var(--debt-soft); color: var(--debt); }
.stat.warn .st-ic { background: var(--warn-soft); color: var(--warn); }
.st-tx { min-width: 0; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.015em; line-height: 1.25; white-space: nowrap; }
.stat.debt .v { color: var(--debt); } .stat.paid .v { color: var(--paid); }
.stat .h { font-size: 12px; color: var(--muted); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; font-size: 14px; text-decoration: none !important; white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--paper); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--paper); color: var(--debt); border-color: #f5cdca; }
.btn.danger:hover { background: var(--debt-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 26px; border: 0; background: transparent; cursor: pointer; border-radius: 7px; color: var(--muted); padding: 0; }
.icon-btn .ic { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.icon-btn.del:hover { color: var(--debt); background: var(--debt-soft); }
.link-btn { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }

label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.inp { width: 100%; padding: 8px 10px; border: 1px solid #d3dade; border-radius: 9px; background: #fff; font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 110, 110, .12); }
.inp.money { text-align: right; font-variant-numeric: tabular-nums; }
textarea.inp { min-height: 64px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hint.new { color: var(--warn); }
.err { color: var(--debt); background: var(--debt-soft); padding: 8px 12px; border-radius: 9px; font-size: 13.5px; margin-bottom: 12px; }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .inp { padding-left: 33px; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; padding: 12px 16px; }
.filters .inp { width: auto; min-width: 130px; }

.seg { display: inline-flex; background: #eef2f3; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.seg button.on { background: var(--paper); color: var(--brand-dark); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }

/* ---------- Tablolar ---------- */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8fafb; white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; white-space: nowrap; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--brand-softer); }
table.t tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: #f8fafb; }
th.sort { cursor: pointer; user-select: none; }
th.sort:after { content: ' ↕'; opacity: .3; }
th.sort.asc:after { content: ' ↑'; opacity: 1; } th.sort.desc:after { content: ' ↓'; opacity: 1; }
/* Kompakt (Excel satır yüksekliği) */
table.t.compact { font-size: 13.5px; line-height: 1.35; }
table.t.compact th { padding: 6px 10px; font-size: 11.5px; }
table.t.compact td { padding: 4px 10px; height: 30px; }
table.t.compact .actions { flex-wrap: nowrap; gap: 2px; }
.debt { color: var(--debt); } .paid { color: var(--paid); } .muted { color: var(--muted); }
.b { font-weight: 600; }
.small { font-size: 12.5px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-weight: 500; }
.tag.debt { background: var(--debt-soft); color: var(--debt); } .tag.paid { background: var(--paid-soft); color: var(--paid); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar-panel { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 12px; margin-bottom: 12px; }
.toolbar-panel .grow { flex: 1; min-width: 200px; }

/* ---------- Müşteri kartları ---------- */
.cards { display: grid; gap: 8px; }
details.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.card > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary:hover { background: var(--brand-softer); border-radius: var(--radius); }
details.card[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.card-name { font-weight: 600; font-size: 15px; }
.card-meta { color: var(--muted); font-size: 12.5px; }
.card-figs { display: flex; gap: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.card-figs .k { font-size: 11px; color: var(--muted); }
.card-figs .v { font-weight: 600; font-size: 14px; }
.card-body { padding: 12px 16px 14px; }
.split { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.split h4 { margin: 0 0 6px; font-size: 13.5px; }

/* ---------- Karne (ekstre) ---------- */
.ledger td.desc .sub { font-size: 12.5px; color: var(--muted); }
.ledger td.desc .sub .owner { color: var(--text); font-weight: 500; }
.ledger tr.pay td { background: #f7fbf9; }
.ledger .bal { font-weight: 600; }
.note-cut { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.print-head { display: none; }

/* ---------- Hedef göstergesi ---------- */
.target { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.target.empty { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; padding: 11px 16px; }
.target.empty .ic { color: var(--brand); }
.tg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tg-t { display: flex; gap: 12px; align-items: center; }
.target .k { color: var(--muted); font-size: 12.5px; }
.target .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.target .v .muted { font-weight: 500; font-size: 15px; }
.tg-pct { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tg-bar { height: 10px; border-radius: 99px; background: #eef2f3; margin: 10px 0 6px; overflow: hidden; }
.tg-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .5s; }
.tg-foot { font-size: 12.5px; color: var(--muted); }
.target.ok .tg-pct { color: var(--paid); } .target.ok .tg-bar i { background: var(--paid); } .target.ok .st-ic { background: var(--paid-soft); color: var(--paid); }
.target.mid .tg-pct { color: var(--warn); } .target.mid .tg-bar i { background: #e8a33d; } .target.mid .st-ic { background: var(--warn-soft); color: var(--warn); }
.target.low .tg-pct { color: var(--debt); } .target.low .tg-bar i { background: #e8746c; } .target.low .st-ic { background: var(--debt-soft); color: var(--debt); }
.pct { display: inline-block; min-width: 44px; text-align: center; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 99px; color: var(--muted); }
.pct.ok { background: var(--paid-soft); color: var(--paid); }
.pct.mid { background: var(--warn-soft); color: var(--warn); }
.pct.low { background: var(--debt-soft); color: var(--debt); }
.bar { height: 6px; background: #eef2f3; border-radius: 3px; position: relative; min-width: 60px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 3px; opacity: .85; }
.bar.p i { background: var(--paid); }
.bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .45; border-radius: 1px; z-index: 1; }
th.bar-col { width: 16%; }

/* ---------- Formlar ---------- */
.form-panel { max-width: 820px; }
.form-panel.wide { max-width: 1040px; }
.fg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.fg .span2 { grid-column: span 2; }
.fg .span3 { grid-column: span 3; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lbl-row .hint { margin: 0; }
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exp { display: grid; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 6px 5px 12px; background: #fafbfc; }
.exp.fixed { grid-template-columns: 1fr 130px; }
.exp.custom { grid-template-columns: 1fr 130px 28px; padding-left: 6px; background: var(--paper); }
.exp .lbl { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp .inp { padding: 6px 9px; font-size: 14px; }
.advance { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px dashed #9fcfca; background: var(--brand-softer); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.adv-t { display: flex; gap: 10px; align-items: center; }
.adv-t > .ic { width: 20px; height: 20px; color: var(--brand); }
.adv-t .hint { margin: 0; }
.adv-f { display: flex; gap: 8px; }
.adv-f .money { width: 150px; }
.adv-f .inp:not(.money) { width: 180px; }
.jf-foot { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); margin: 4px -18px -16px; padding: 12px 18px; border-radius: 0 0 var(--radius) var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 5; }
.sumline { display: flex; gap: 22px; flex-wrap: wrap; }
.sumline span { display: block; font-size: 11.5px; color: var(--muted); }
.sumline b { font-size: 18px; font-variant-numeric: tabular-nums; }
.lines { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.alloc-row { display: grid; grid-template-columns: 1fr auto 150px; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.alloc-row:last-child { border-bottom: 0; }
.alloc-row .inp { padding: 6px 9px; }

/* ---------- Diyalog ---------- */
dialog.dlg { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 25px 60px rgba(16, 24, 40, .25); }
dialog.dlg::backdrop { background: rgba(16, 24, 40, .4); backdrop-filter: blur(2px); }
.dlg-h { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.dlg-b { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.dlg-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc; border-radius: 0 0 16px 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #17212b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--debt); }

/* ---------- Mobil ---------- */
@media screen and (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .fg { grid-template-columns: 1fr 1fr; }
  .fg .span2, .fg .span3 { grid-column: span 2; }
}
@media screen and (max-width: 760px) {
  main { padding: 14px 12px 60px; }
  .split, .exp-grid { grid-template-columns: 1fr; }
  .stats, .stats.three { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; gap: 10px; }
  .st-ic { width: 32px; height: 32px; }
  .stat .v { font-size: 17px; }
  details.card > summary { grid-template-columns: 1fr; }
  .card-figs { justify-content: space-between; text-align: left; }
  .who, .tb-btn span, .brand .firm { display: none; }
  .topbar > .in { padding: 0 12px; }
  .page-head .actions { width: 100%; justify-content: flex-start; }
  .fg { grid-template-columns: 1fr; }
  .fg .span2, .fg .span3 { grid-column: span 1; }
  .advance, .adv-f { flex-direction: column; align-items: stretch; }
  .adv-f .money, .adv-f .inp:not(.money) { width: 100%; }
  .alloc-row { grid-template-columns: 1fr 120px; }
  .alloc-row .open { grid-column: 1; }
  .tg-pct { font-size: 22px; }
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { border-bottom: 1px solid var(--line); padding: 6px 2px; }
  table.t.stack td { border: 0; padding: 2px 10px; height: auto; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.t.stack td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; }
  table.t.stack td:empty { display: none; }
  table.t.stack td.first { font-weight: 600; font-size: 14.5px; }
  table.t.stack td.first::before { content: none; }
  table.t.stack td.desc { display: block; text-align: left; }
  table.t.stack tfoot { display: block; }
  table.t.ledger.stack tfoot { display: none; }
}

/* ---------- Yazdırma (kağıt tasarrufu: sıkı satırlar) ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { width: auto !important; }
  body { background: #fff; font-size: 10px; line-height: 1.25; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tbl-wrap { overflow: visible !important; }
  .note-cut { max-width: 95px; }
  main { padding: 0 1px !important; }
  .topbar, nav.menu, .no-print, .toast, .page-head, .cards, .toolbar { display: none !important; }
  .print-only { display: block !important; }
  .print-ad { display: block !important; margin-top: 10px; padding-top: 5px; border-top: .5px solid #999; font-size: 8.5px; color: #555; text-align: center; }
  .app-foot, #app > footer { display: none !important; }
  #app { min-height: 0; display: block; }
  main { padding: 0; max-width: none; }
  .panel, .stat, .target { border: 1px solid #bbb; box-shadow: none; border-radius: 4px; }
  .panel + .panel, .panel + .stats, .stats + .panel { margin-top: 8px; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
  .print-head h1 { margin: 0; font-size: 15px; }
  .stats, .stats.three { display: flex; gap: 0; margin-bottom: 8px; border: .75px solid #888; }
  .stat { flex: 1; padding: 4px 8px; border: 0 !important; border-right: .5px solid #aaa !important; border-radius: 0 !important; }
  .stat:last-child { border-right: 0 !important; }
  .st-ic { display: none; }
  .stat .k { font-size: 9.5px; } .stat .v { font-size: 13px; } .stat .h { font-size: 9px; }
  .target { padding: 6px 10px; margin-bottom: 8px; }
  .target .st-ic { display: none; }
  .target .v { font-size: 12px; } .tg-pct { font-size: 15px; } .tg-bar { height: 5px; margin: 4px 0; }
  .panel-title { padding: 4px 8px; font-size: 11px; }
  .panel-note { padding: 3px 8px; font-size: 9px; }
  table.t, table.t.compact { width: 100%; font-size: 9.5px; line-height: 1.2; }
  table.t th, table.t.compact th { padding: 3px 5px; font-size: 9px; background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.t, table.t.compact { border-collapse: collapse; border: .75px solid #888; }
  table.t th, table.t td, table.t.compact th, table.t.compact td { border: .5px solid #aaa !important; }
  table.t td, table.t.compact td { padding: 2px 5px; height: auto; white-space: nowrap; }
  table.t td.wrap, table.t td.first { white-space: normal; }
  .panel { border: 0 !important; }
  .panel-title { padding: 6px 0 3px; }
  .ledger .small { font-size: 9px; }
  .ledger tr.pay td { background: #f3f8f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tag { padding: 0 4px; font-size: 9px; }
  th.sort:after { content: none !important; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  p.small { font-size: 9px; margin: 4px 0 0; }
}
