/* ================================================================ tema
   theme.js her zaman data-theme="dark" | "light" koyar (varsayılan koyu). */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0c0d;
  --surface: #151718;
  --surface-2: #1c1f21;
  --surface-3: #24282a;
  --ink: #f3f4f1;
  --ink-2: #a3a7ab;
  --muted: #6f7478;
  --grid: #222629;
  --axis: #2f3337;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #c5f07a;          /* lime vurgu */
  --accent-ink: #0b0c0d;      /* lime üstündeki yazı */
  --accent-text: #c5f07a;     /* koyu zeminde lime yazı */
  --accent-soft: rgba(197, 240, 122, 0.12);
  --in: #c5f07a;              /* tahsilat */
  --out: #f08a5d;             /* ödeme */
  --line: #c5f07a;            /* bakiye çizgisi */
  --critical: #ff6b6b;
  --critical-soft: rgba(255, 107, 107, 0.10);
  --good: #c5f07a;
  --good-soft: rgba(197, 240, 122, 0.10);
  --shadow: none;
  --radius: 20px;
  --radius-sm: 12px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f1f2ee;
  --surface: #ffffff;
  --surface-2: #f6f7f3;
  --surface-3: #eceee8;
  --ink: #101112;
  --ink-2: #5b5f63;
  --muted: #8a8e92;
  --grid: #eceee8;
  --axis: #d5d8d0;
  --border: rgba(0, 0, 0, 0.07);
  --accent: #c5f07a;
  --accent-ink: #101112;
  --accent-text: #4d7a0c;
  --accent-soft: rgba(122, 170, 30, 0.12);
  --in: #6aa51c;
  --out: #e8663a;
  --line: #4d7a0c;
  --critical: #d63b3b;
  --critical-soft: rgba(214, 59, 59, 0.07);
  --good: #4d7a0c;
  --good-soft: rgba(122, 170, 30, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* ================================================================ temel */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.45;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
h2 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
button, .btn, select, input {
  font: inherit; color: inherit; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 999px; padding: 8px 14px;
}
select, input { border-radius: var(--radius-sm); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--axis); background: var(--surface-3); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { filter: brightness(1.06); background: var(--accent); }
button.danger { color: var(--critical); }
button.danger-solid { background: var(--critical); border-color: var(--critical); color: #fff; font-weight: 600; }
button.link { border: 0; background: none; padding: 2px 6px; color: var(--accent-text); }
button:disabled { opacity: 0.5; cursor: default; }
input, select { width: 100%; }
.muted { color: var(--ink-2); } .small { font-size: 12.5px; }
.neg { color: var(--critical); }
.pos { color: var(--good); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.ico { width: 18px; height: 18px; flex: none; }

/* ================================================================ iskelet */
.app { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: calc(100vh / var(--zoom, 1)); display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 0; border-right: 1px solid var(--border); background: var(--page); z-index: 6;
}
.rail-avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; margin-bottom: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 0 0 2px var(--accent); }
.rail-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 18px; margin-bottom: 14px; letter-spacing: -0.04em; }
.rail nav { display: flex; flex-direction: column; gap: 10px; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 50%; padding: 0; justify-content: center; position: relative;
  background: var(--surface); border-color: var(--border); color: var(--ink-2);
}
.rail-btn:hover { color: var(--ink); }
.rail-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 22px rgba(197, 240, 122, 0.35); }
.fx-chip { gap: 10px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.fx-chip:empty { display: none; }
.fx-chip .fx b { color: var(--muted); font-weight: 600; margin-right: 3px; }
.rail-btn[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 54px; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--page); font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 50; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 16px 32px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { height: 26px; width: auto; display: block; }
.brand-sub { color: var(--ink-2); font-size: 14px; padding-left: 12px; border-left: 1px solid var(--border); white-space: nowrap; font-weight: 500; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctl-label { color: var(--muted); font-size: 12px; font-weight: 600; }
select.compact { width: auto; padding: 7px 12px; border-radius: 999px; background: var(--surface); }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }
.custom-range input { width: auto; padding: 6px 10px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; }
.seg button { border: 0; border-radius: 999px; padding: 5px 13px; background: transparent; color: var(--ink-2); }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

main { padding: 6px 32px 36px; width: 100%; flex: 1; }
.tab { display: none; } .tab.on { display: block; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { color: var(--ink-2); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.pill.bad { background: var(--critical); color: #fff; }
.pill.alert { background: var(--critical-soft); color: var(--critical); border: 1px solid color-mix(in srgb, var(--critical) 60%, transparent); font-size: 13px; padding: 5px 12px; animation: pulse 2.4s ease-in-out infinite; }
.pill .warn-ico { font-size: 14px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); } }
@media (prefers-reduced-motion: reduce) { .pill.alert { animation: none; } }
.kpi-sub2 { color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.pill.soft { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* Genel bakış: her satır eşit yükseklikte iki sütun; içerik taşarsa kart içinde kayar */
.ov-row { display: grid; gap: 18px; margin-bottom: 18px; align-items: stretch; }
.ov-row > * { min-width: 0; min-height: 0; }
.ov-row.r1 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); height: 380px; }
.ov-row.r2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ov-row.r2 .card.fill { height: auto; }
.ov-row.r4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 420px; }
.ov-row .card { margin-bottom: 0; }
.fill { display: flex; flex-direction: column; min-height: 0; }
.card.fill { height: 100%; }
.grow { flex: 1; min-height: 0; }
.chart-box.grow { height: auto; }
.side-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.side-col .credit-card { margin-bottom: 0; flex: none; }
.side-col .card { flex: 1; }
.scroll-card { overflow: hidden; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; }
.scroll .insight:last-child { margin-bottom: 0; }
.stack > * { margin-bottom: 18px; }

footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12.5px; padding: 18px 32px 24px; border-top: 1px solid var(--border); }

/* ================================================================ KPI kartları */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 14px;
  cursor: pointer; min-width: 0; text-align: left; display: block; width: 100%; box-shadow: var(--shadow); color: inherit;
}
.kpi:hover { background: var(--surface); border-color: var(--axis); }
.kpi.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: 13px; color: var(--ink); }
.kpi.bad { border-color: color-mix(in srgb, var(--critical) 55%, transparent); background: linear-gradient(180deg, var(--critical-soft), transparent 75%), var(--surface); }
.kpi.bad:hover { background: linear-gradient(180deg, var(--critical-soft), transparent 75%), var(--surface); }
.kpi.bad.sel { border-color: var(--critical); box-shadow: 0 0 0 1px var(--critical) inset; }
.kpi.bad .kpi-icon { background: var(--critical); color: #fff; border-color: transparent; }
.kpi.neg .kpi-value { color: var(--critical); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 10px 0 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi-cap { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 22px; }
.kpi .spark { height: 44px; margin-top: 10px; position: relative; }

.tag { display: inline-flex; align-items: center; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.tag.cat-inline { font-size: 10.5px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
#dueTable .desc-line { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dueTable .due-name { line-height: 1.3; }
#dueTable td { padding-top: 7px; padding-bottom: 7px; }
#dueTable .dir { width: 26px; height: 26px; }
#dueTable .dir .ico { width: 14px; height: 14px; }
#dueTable .due-actions { margin-top: 0; justify-content: flex-end; }
#dueTable .due-actions button { padding: 4px 9px; font-size: 11.5px; }
.tag.warn { background: var(--critical-soft); border-color: transparent; color: var(--critical); }
.tag.ok { background: var(--good-soft); border-color: transparent; color: var(--good); }
.cat-pill { display: inline-flex; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

/* ================================================================ içgörü / uyarı kartları */
.insight { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 14px; }
.insight.bad { border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: linear-gradient(180deg, var(--critical-soft), transparent 70%), var(--surface); }
.insight.ok { border-color: color-mix(in srgb, var(--good) 40%, transparent); background: linear-gradient(180deg, var(--good-soft), transparent 70%), var(--surface); }
.insight-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.insight-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; }
.insight.bad .insight-icon { background: var(--critical); color: #fff; }
.insight.ok .insight-icon { background: var(--accent); color: var(--accent-ink); }
.insight-title { font-weight: 600; font-size: 14px; }
.insight p { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.insight p strong { color: var(--ink); }
.insight .big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 2px 0 4px; }

.credit-card {
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; background: var(--accent); color: var(--accent-ink);
  position: relative; overflow: hidden;
}
.credit-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(0, 0, 0, 0.06); }
.credit-card .cc-label { font-size: 13px; font-weight: 600; opacity: 0.75; }
.credit-card .cc-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.credit-card .cc-sub { font-size: 12.5px; opacity: 0.8; }
.credit-card .cc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 8px; position: relative; z-index: 1; }
.credit-card button { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); font-weight: 600; }
.credit-card button:hover { background: var(--accent-ink); filter: brightness(1.2); }

/* ================================================================ özet şeritleri */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-strip .st { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 0; }
.stat-strip .st .l { color: var(--muted); font-size: 11.5px; }
.stat-strip .st .v { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-strip .st .s { color: var(--ink-2); font-size: 11.5px; }
.stat-strip.big { margin-bottom: 18px; }
.stat-strip.big .st { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); }
.stat-strip.big .st .v { font-size: 20px; }
.kpi { position: relative; }
.info-btn { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #2a78d6; color: #fff; font-size: 11px; font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: pointer; box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
.info-btn:hover { background: #3987e5; transform: scale(1.1); }
.kpi-top { padding-right: 18px; }
.kpi-fx { font-size: 12px; color: var(--critical); margin-top: 2px; }
.sum-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sum-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.sum-card h3 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.sum-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.sum-card dt { color: var(--ink-2); } .sum-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
button.confirm { background: transparent; border: 1px dashed var(--accent-text); color: var(--accent-text); font-weight: 600; font-size: 12px; padding: 5px 11px; }
button.confirm:hover { background: var(--accent); color: var(--accent-ink); border-style: solid; }
.days { font-size: 11.5px; font-weight: 600; }
tr.today-sep td { background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 6px 10px; }

/* ================================================================ vade takibi */
.due-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; height: 280px; }
.due-grid > * { min-height: 0; }
.due-days { font-size: 12px; font-weight: 600; }
.due-actions { display: flex; gap: 6px; justify-content: flex-end; }
.due-actions button { padding: 5px 11px; font-size: 12px; }
.seg .cnt:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 11px; margin-left: 4px; }
.form-error { background: var(--critical-soft); border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); color: var(--critical); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; font-weight: 500; }
.form input.invalid, .form select.invalid { border-color: var(--critical); box-shadow: 0 0 0 1px var(--critical); }
.cc-lines { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; position: relative; z-index: 1; flex: 1; }
.cc-line { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,0.12); }
.cc-line .cur { font-weight: 800; }
.cc-line .gap { opacity: 0.75; font-size: 12px; }
.cc-line .usd { font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 15px; padding-top: 10px; margin-top: auto; border-top: 2px solid rgba(0,0,0,0.25); }
.cc-total .v { font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.credit-card.fill { height: 100%; margin-bottom: 0; display: flex; flex-direction: column; }
.nowrap { white-space: nowrap; }
.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.icon-mini { width: 28px; height: 28px; padding: 0; justify-content: center; font-size: 15px; }
#dueCard td { padding: 9px 7px; }
#dueCard .due-actions { flex-wrap: nowrap; }
.due-actions.left { justify-content: flex-start; margin-top: 6px; }
.gap-cell { color: var(--critical); font-weight: 700; }
#dueSeg span:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 11px; margin-left: 4px; }

/* ================================================================ banka logoları */
.bank { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; vertical-align: middle; }
.fund-acc { display: flex; align-items: center; gap: 6px; margin-top: 6px; white-space: nowrap; }
#accTable td, #fundTable td, #wiseTable td { vertical-align: middle; }
.acc-actions { flex-wrap: nowrap; gap: 4px; }
.acc-actions button { padding: 4px 8px; font-size: 11.5px; }
.acc-actions button.link { padding: 4px 3px; }
#accTable th, #accTable td { padding-left: 9px; padding-right: 9px; }
#accTable th { white-space: normal; line-height: 1.25; }
@media (min-width: 801px) and (max-width: 1279px) {
  .acc-actions { flex-wrap: wrap; max-width: 150px; margin-left: auto; }
  #accTable .bank .bank-logo + span { font-size: 12.5px; }
}
#accTable td.upd { white-space: nowrap; font-size: 12.5px; }
.bank-logo { height: 26px; min-width: 26px; border-radius: 7px; display: inline-grid; place-items: center; padding: 3px 7px; }
.bank-logo img { height: 18px; width: auto; display: block; }
.bank-logo.isbank { background: #0b3b8f; }
.bank-logo.eximbank { background: #ffffff; border: 1px solid var(--border); }
.bank-logo.eximbank img { height: 22px; }
.bank-logo.wise { background: #9fe870; color: #163300; font-weight: 800; font-size: 13px; }
.bank-logo.other { background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 700; }

/* ================================================================ grafikler */
.legend { display: flex; gap: 14px; align-items: center; color: var(--ink-2); font-size: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sw-line { background: var(--line); }
.sw-past { background: var(--muted); }
.sw-neg { background: var(--critical); }
.sw-low { background: var(--muted); }
.sw-in { background: var(--in); } .sw-out { background: var(--out); }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 150px; }
.donut-wrap { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.donut-box { position: relative; height: 100%; min-height: 150px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center .v { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.donut-center .l { font-size: 11px; color: var(--muted); }
.donut-legend { display: grid; gap: 7px; font-size: 12.5px; }
.donut-legend div { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; }
.donut-legend .p { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ================================================================ tablolar */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.bad td { background: var(--critical-soft); }
tr.total td { border-top: 1px solid var(--axis); font-weight: 700; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.empty-row { color: var(--muted); padding: 14px 0; }
.dir { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.dir.in { background: var(--good-soft); color: var(--good); }
.dir.out { background: var(--critical-soft); color: var(--critical); }
.who { display: flex; align-items: center; gap: 10px; }
.who .n { font-weight: 600; }
.who .d { color: var(--muted); font-size: 12px; }

/* ================================================================ formlar */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.form .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: flex-end; }
.form-actions.wide { align-items: center; }
.rate-box { grid-column: 1 / -1; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.rate-box label { flex: 0 1 210px; }
.rate-box .equiv { font-size: 13px; color: var(--ink-2); padding-bottom: 9px; }
.rate-box .equiv strong { color: var(--ink); }
.hint { color: var(--muted); font-size: 12px; margin: 0; }

.dialog { border: 1px solid var(--border); border-radius: 22px; padding: 24px 26px; background: var(--surface); color: var(--ink); width: min(780px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }

.card.empty p { max-width: 70ch; color: var(--ink-2); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 999px; z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,0.3); font-weight: 500; }
.banner { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); background: var(--critical-soft); display: flex; gap: 10px; }

/* ================================================================ kredi hesaplama */
.calc-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.calc-form { display: grid; gap: 14px; }
.calc-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.calc-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bank-pick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bank-pick button { border-radius: var(--radius-sm); height: 54px; justify-content: center; background: var(--surface-2); flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-2); }
.bank-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--ink); }
.need-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.need-chips button { font-size: 12px; padding: 5px 11px; }
.sum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sum { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.sum .l { color: var(--ink-2); font-size: 12px; }
.sum .v { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sum.hl { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sum.hl .l { color: var(--accent-ink); opacity: 0.75; }

/* ================================================================ kredi şeridi, detay, tahmini */
.credit-strip { display: flex; align-items: stretch; gap: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); margin-bottom: 18px; overflow: hidden; }
.credit-strip .cs-head { padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; min-width: 220px; }
.credit-strip .cs-head .t { font-weight: 800; font-size: 15px; }
.credit-strip .cs-head .s { font-size: 12px; opacity: 0.75; margin-top: 2px; }
.credit-strip .cs-items { display: flex; flex: 1; flex-wrap: wrap; }
.credit-strip .cs-item { flex: 1; min-width: 190px; padding: 14px 18px; border-left: 1px solid rgba(0,0,0,0.12); display: flex; flex-direction: column; justify-content: center; }
.credit-strip .cs-item .c { font-size: 12px; font-weight: 700; opacity: 0.7; }
.credit-strip .cs-item .g { font-size: 12.5px; margin-top: 2px; }
.credit-strip .cs-item .u { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.credit-strip .cs-total { background: rgba(0,0,0,0.1); padding: 14px 22px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; min-width: 230px; }
.credit-strip .cs-total .c { font-size: 12px; font-weight: 700; opacity: 0.75; }
.credit-strip .cs-total .u { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.detail-btn { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(42, 120, 214, 0.15); color: #5b9cf0; border: 1px solid rgba(42, 120, 214, 0.45); cursor: pointer; z-index: 2; }
.detail-btn:hover { background: #2a78d6; color: #fff; }
:root[data-theme="light"] .detail-btn { color: #1c5cab; }
.kpi .kpi-top { padding-right: 60px; }
.kpi-top .kpi-icon { display: none; }
.est { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 1px 7px; border-radius: 999px; background: rgba(237, 161, 0, 0.16); color: #eda100; border: 1px solid rgba(237, 161, 0, 0.45); margin-left: 6px; vertical-align: middle; text-transform: lowercase; }
:root[data-theme="light"] .est { color: #8a5d00; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.form label.check input { width: auto; margin-top: 3px; }
.pill.beta { background: #eda100; color: #0b0c0d; }
.beta-banner { background: rgba(237, 161, 0, 0.1); border-color: rgba(237, 161, 0, 0.5); align-items: center; }
.beta-banner strong { background: #eda100; color: #0b0c0d; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.due-card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; margin-bottom: 14px; min-height: 52px; }
.due-card-head .card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { .credit-strip { flex-direction: column; } .credit-strip .cs-item { border-left: 0; border-top: 1px solid rgba(0,0,0,0.12); } .credit-strip .cs-total { align-items: flex-start; } }

/* ================================================================ rapor tablosu */
tr.exp-row { cursor: pointer; }
tr.exp-row:hover td { background: var(--surface-2); }
tr.exp-row .caret { display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
tr.exp-row.open .caret { transform: rotate(90deg); }
tr.child td { background: var(--surface-2); font-size: 12.5px; padding-top: 7px; padding-bottom: 7px; }
tr.child td:first-child { padding-left: 34px; }
tr.child.bad td { background: var(--critical-soft); }
tr.child.quiet td { color: var(--muted); }
.items { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.items .i-in { color: var(--good); } .items .i-out { color: var(--critical); }

.stmt { border-collapse: separate; border-spacing: 0; }
.stmt th, .stmt td { white-space: nowrap; }
.stmt th:first-child, .stmt td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 210px; }
.stmt tr.sec td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.stmt tr.sec td:first-child { background: var(--surface-2); }
.stmt tr.cat td:first-child { padding-left: 24px; color: var(--ink-2); }
.stmt tr.sum td { font-weight: 700; border-top: 1px solid var(--axis); }
.stmt tr.key td { font-weight: 800; background: var(--accent-soft); }
.stmt tr.key td:first-child { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.stmt td.tot, .stmt th.tot { border-left: 1px solid var(--axis); }
.stmt td.nz { color: var(--muted); }
tr.day td { background: var(--surface-2); font-weight: 600; border-top: 2px solid var(--axis); }
tr.day td:first-child { padding-left: 24px; }
tr.item td { font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
tr.item td:first-child { padding-left: 46px; }

/* ================================================================ kredi simülasyonu */
.sim-grid { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 22px; align-items: start; }
.sim-form { display: grid; gap: 12px; }
.sim-group { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px 14px; display: grid; gap: 10px; min-width: 0; }
.sim-group legend { padding: 0 6px; margin-left: -6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.sim-group .legend-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 4px; }
.sim-form label { white-space: nowrap; }
.sim-form label.check-inline { white-space: normal; font-size: 12.5px; }
.field-hint { font-size: 11px; color: var(--muted); font-weight: 400; white-space: normal; }
.sim-chips { gap: 6px; }
.sim-chips button { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); }
.sim-chips button b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.sim-chips button:hover { border-color: var(--accent); }
.sim-chips button.total { border-color: var(--accent); }
.sim-submit { width: 100%; justify-content: center; height: 42px; }
.sim-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.sim-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-form label.check-inline { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 400; }
.sim-form label.check-inline input { width: auto; }
.inst-list { display: grid; gap: 8px; }
.inst-row { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.inst-row .no { color: var(--muted); font-weight: 700; }
.sim-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sim-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.sim-box h3 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; }
.sim-box dl { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.sim-box dt { color: var(--ink-2); } .sim-box dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sim-box .hd { color: var(--muted); font-size: 11px; }
tr.fx td { background: rgba(42, 120, 214, 0.08); }
tr.credit-row td { background: var(--accent-soft); }
.sim-note { font-size: 12.5px; color: var(--ink-2); margin: 0 0 12px; }
@media (max-width: 1280px) { .sim-grid { grid-template-columns: 1fr; } .sim-compare { grid-template-columns: 1fr; } }

.ok-mark { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--good); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; margin-left: 6px; vertical-align: middle; }
:root[data-theme="light"] .ok-mark { color: #fff; }

/* büyük ekranlarda her şey orantılı büyür (2K / 4K monitörler) */
/* zoom içinde 100vh da büyüdüğü için sol menü yüksekliği --zoom ile bölünür */
@media (min-width: 1900px) { body { zoom: 1.12; --zoom: 1.12; } }
@media (min-width: 2300px) { body { zoom: 1.25; --zoom: 1.25; } }
@media (min-width: 2800px) { body { zoom: 1.45; --zoom: 1.45; } }
@media (min-width: 3400px) { body { zoom: 1.75; --zoom: 1.75; } }
/* kısa ekranlarda tüm menü sığsın diye düğmeler küçülür */
@media (min-width: 801px) and (max-height: 700px) {
  .rail { gap: 6px; padding: 10px 0; }
  .rail nav, .rail-bottom { gap: 6px; }
  .rail-btn { width: 38px; height: 38px; }
  .rail-avatar, .rail-mark { width: 38px; height: 38px; margin-bottom: 6px; }
}
@media (min-width: 801px) and (max-height: 560px) {
  .rail, .rail nav, .rail-bottom { gap: 3px; }
  .rail-btn { width: 32px; height: 32px; }
  .rail-btn .ico { width: 15px; height: 15px; }
  .rail-avatar, .rail-mark { width: 32px; height: 32px; margin-bottom: 3px; }
}

.pl-badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 3px; }
.pl-badge.gain { background: rgba(12, 163, 12, 0.14); color: #2fbf4a; border: 1px solid rgba(12, 163, 12, 0.45); }
.pl-badge.loss { background: var(--critical-soft); color: var(--critical); border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); }
:root[data-theme="light"] .pl-badge.gain { color: #0a7d24; }

/* ================================================================ giriş */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-wrap { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 36px 30px; box-shadow: var(--shadow); }
.login-card .logo { height: 40px; margin: 0 auto 8px; }
.login-card h1 { text-align: center; font-size: 17px; font-weight: 500; color: var(--ink-2); margin: 0 0 26px; letter-spacing: 0; }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.login-card button.primary { width: 100%; justify-content: center; padding: 11px; margin-top: 4px; }
.login-error { color: var(--critical); font-size: 13px; min-height: 18px; text-align: center; }
.login-theme { position: fixed; top: 16px; right: 16px; }
.login-card form, #recoveryPanel { display: grid; gap: 14px; }
.mfa-head { text-align: center; }
.mfa-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.mfa-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.login-card input.otp { text-align: center; font-size: 22px; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.qr-box { display: grid; place-items: center; }
.qr-box svg { width: 200px; height: 200px; border-radius: 12px; background: #fff; }
.mfa-manual summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.mfa-secret { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: 0.05em; text-align: center; padding: 10px; margin: 8px 0 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; user-select: all; word-break: break-all; }
.mfa-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mfa-links .link { font-size: 12px; }
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; padding: 12px 16px 12px 34px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; }
#recoveryPanel button { width: 100%; justify-content: center; }

/* ================================================================ duyarlı */
@media (max-width: 1280px) {
  .ov-row.r1, .ov-row.r2, .ov-row.r4 { grid-template-columns: 1fr; height: auto; }
  .ov-row .card.fill { height: auto; }
  .ov-row .chart-box.grow { height: 280px; flex: none; }
  .ov-row .scroll { max-height: 420px; }
  .donut-box { height: 200px; }
  .calc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) { .due-grid { grid-template-columns: 1fr; height: auto; } .due-grid .chart-box.grow { height: 240px; flex: none; } .due-grid .scroll { max-height: 400px; } }
@media (max-width: 900px) { .sum-cards { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: 1fr 1fr; } .sum-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; align-items: center; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); justify-content: space-between; z-index: 20; }
  .rail nav { flex-direction: row; gap: 2px; flex: 1; justify-content: space-around; }
  .rail-avatar, .rail-mark { display: none; }
  .rail-bottom { margin: 0; flex-direction: row; gap: 2px; }
  .rail-btn { width: 38px; height: 38px; }
  .rail-btn .ico { width: 17px; height: 17px; }
  .rail-btn.on { box-shadow: none; }
  .rail-btn[data-tip]:hover::after { display: none; }
  .shell { padding-bottom: 72px; }
  .topbar { padding: 12px 14px 4px; gap: 10px; }
  main, footer { padding-left: 14px; padding-right: 14px; }
  footer { padding-bottom: 90px; font-size: 11.5px; }
  .toolbar { width: 100%; gap: 10px; }
  .ctl { width: 100%; }
  .ctl .seg { flex: 1; } .ctl .seg button { flex: 1; padding: 6px 4px; }
  .ctl select.compact { flex: 1; }
  .ctl-label { width: 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .page-head { margin: 4px 0 14px; }
  .page-head > .row, .page-head > button { width: 100%; }
  .card { padding: 16px 14px; border-radius: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 12px 10px; border-radius: 16px; }
  .kpi-value { font-size: 17px; margin-top: 6px; }
  .kpi-label { font-size: 12px; }
  .kpi .spark { height: 30px; margin-top: 6px; }
  .kpi-fx { font-size: 11px; }
  .detail-btn { top: 8px; right: 8px; font-size: 10.5px; padding: 2px 8px; }
  .kpi .kpi-top { padding-right: 46px; }
  .credit-strip .cs-head, .credit-strip .cs-item, .credit-strip .cs-total { padding: 12px 14px; min-width: 0; }
  .credit-strip .cs-total .u { font-size: 24px; }
  .due-card-head { grid-template-columns: 1fr; min-height: 0; }
  .due-card-head .card-sub { white-space: normal; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip.big .st .v { font-size: 16px; }
  .sum-grid { grid-template-columns: 1fr 1fr; }
  .filters { width: 100%; } .filters input, .filters select { flex: 1 1 140px; width: auto !important; }
  .dialog { padding: 18px 16px; border-radius: 18px; width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .form { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rate-box label { flex: 1 1 100%; }
  .bank-pick button { height: 50px; }
  .calc-form .two, .sim-form .two { grid-template-columns: 1fr 1fr; }

  /* tablolar telefonda kart satırlara dönüşür (nakit akış tablosu hariç: o yatay kayar, ilk sütun sabit) */
  .table-wrap table:not(.stmt), .table-wrap table:not(.stmt) tbody { display: block; }
  .table-wrap table:not(.stmt) thead { display: none; }
  .table-wrap table:not(.stmt) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 12px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .table-wrap table:not(.stmt) td { display: block; border: 0; padding: 0; text-align: left !important; white-space: normal; min-width: 0; }
  .table-wrap table:not(.stmt) td:first-child { grid-column: 1 / -1; font-size: 13.5px; }
  .table-wrap table:not(.stmt) td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 1px; }
  .table-wrap table:not(.stmt) td:empty { display: none; }
  .table-wrap table:not(.stmt) tr.bad { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
  .table-wrap table:not(.stmt) tr.bad td, .table-wrap table:not(.stmt) tr.child td, .table-wrap table:not(.stmt) tr.day td { background: transparent; }
  .table-wrap table:not(.stmt) tr.total { background: var(--surface-2); }
  .table-wrap table:not(.stmt) tr.day { background: var(--surface-2); border-color: var(--axis); margin-top: 12px; }
  .table-wrap table:not(.stmt) tr.item { margin-left: 14px; padding: 8px 10px; }
  .table-wrap table:not(.stmt) tr.item td:first-child { padding-left: 0; }
  .table-wrap table:not(.stmt) tr.today-sep { display: block; background: var(--surface-2); }
  .table-wrap table:not(.stmt) .due-actions { justify-content: flex-start; flex-wrap: wrap; }
  .clip { max-width: none; white-space: normal; }
  #dueCard .scroll { max-height: none; }
  .ov-row.r2 { height: auto; }
  .stmt th:first-child, .stmt td:first-child { min-width: 150px; max-width: 170px; white-space: normal; }
}
@media (max-width: 420px) { .brand-sub { display: none; } .form { grid-template-columns: 1fr; } }
@media print {
  .rail, .toolbar, .form, button, .btn, .filters, footer, .user-chip { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .tab { display: none !important; } .tab.on { display: block !important; }
}

/* ================================================================ admin */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.admin-grid .card { margin-bottom: 0; }
.admin-form { display: grid; gap: 12px; }
.admin-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.admin-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.invite-result { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 8px; font-size: 12.5px; }
.invite-link { display: flex; gap: 8px; }
.share-text { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; resize: vertical; }
.invite-link input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-av { position: relative; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.create-user { grid-template-columns: 1fr 1.3fr 0.8fr 1.3fr auto; align-items: end; }
.pw-field { display: flex; gap: 6px; }
.pw-field input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 1100px) { .admin-grid, .create-user { grid-template-columns: 1fr; } }

button.rail-avatar, button.user-av { padding: 0; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
button.rail-avatar:hover, button.user-av:hover { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(197, 240, 122, 0.3); }

/* Tahsilat & Ödemeler: işlem butonları yan yana, müşteri sütunu biraz daha dar */
#txTable .tx-actions { flex-wrap: nowrap; }
#txTable .tx-actions button { padding: 4px 9px; font-size: 11.5px; }
#txTable td:first-child { max-width: 210px; }
#txTable td:first-child .d { overflow-wrap: anywhere; }

/* Tek aylık tarih seçici (datepicker.js) */
.dp-pop { position: fixed; z-index: 1000; width: 264px; padding: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head strong { font-size: 14px; }
.dp-pop button { width: auto; border: 0; background: transparent; color: inherit; padding: 0; font: inherit; cursor: pointer; }
.dp-nav { width: 30px !important; height: 30px; border-radius: 10px; font-size: 18px; line-height: 1; }
.dp-nav:hover, .dp-day:hover { background: var(--accent-soft) !important; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-wd { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.dp-day { height: 32px; border-radius: 9px; font-size: 13px; font-variant-numeric: tabular-nums; }
.dp-day.out { color: var(--muted); opacity: 0.55; }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent-text); }
.dp-day.sel { background: var(--accent) !important; color: var(--accent-ink); font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-foot button { font-size: 12.5px; font-weight: 600; color: var(--accent-text); padding: 4px 8px; border-radius: 8px; }
.dp-foot button:hover { background: var(--accent-soft); }
