/* Hera Global · Defter v2 */
:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --line: #e2e8f0;
    --line-2: #cbd5e1;
    --ink: #0f1c2e;
    --ink-2: #334155;
    --muted: #64748b;
    --brand: #1e4fd8;
    --brand-2: #163fb0;
    --brand-soft: #e8efff;
    --side: #0d1726;
    --side-2: #15233a;
    --side-ink: #c7d2e3;
    --in: #0b8a5a;
    --in-soft: #e5f6ee;
    --out: #d13b4f;
    --out-soft: #fdecee;
    --alacak: #1e63d6;
    --alacak-soft: #e7effd;
    --verecek: #b45d09;
    --verecek-soft: #fdf1e3;
    --warn: #b7791f;
    --warn-soft: #fdf6e3;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 28, 46, .05), 0 1px 3px rgba(15, 28, 46, .04);
    --shadow-lg: 0 12px 32px rgba(15, 28, 46, .14);
    --sidebar-w: 248px;
    --sans: "Inter", "SF Pro Text", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
small { font-size: 12px; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--in); }
.neg { color: var(--out); }
.c-alacak { color: var(--alacak); }
.c-verecek { color: var(--verecek); }
[hidden] { display: none !important; }

/* ── Kabuk ───────────────────────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh;
    background: var(--side);
    color: var(--side-ink);
    display: flex; flex-direction: column;
    padding: 18px 12px 12px;
    overflow-y: auto;
    z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; text-decoration: none; color: #fff; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(140deg, #3b82f6, #1e40af); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; font-weight: 650; }
.brand-text em { font-style: normal; font-size: 11.5px; color: #8796ad; }
.nav-group { margin-top: 14px; }
.nav-label { padding: 0 10px 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #64748b; font-weight: 600; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px; margin-bottom: 2px;
    text-decoration: none; font-weight: 500; color: var(--side-ink);
}
.nav a .ico { color: #7c8ba3; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.is-active { background: #1d2f4d; color: #fff; }
.nav a.is-active .ico { color: #7fb0ff; }
.nav a .count { margin-left: auto; font-size: 11px; background: #2a3c5c; color: #dbe6f7; border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.nav a .count.late { background: #5b2330; color: #ffc9d1; }
.side-foot { margin-top: auto; padding: 12px 6px 2px; border-top: 1px solid #1c2a40; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #dbe4f0; min-width: 0; }
.side-foot .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot a { color: #8796ad; display: inline-flex; padding: 6px; border-radius: 8px; }
.side-foot a:hover { color: #fff; background: var(--side-2); }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 28px;
    background: rgba(243, 245, 249, .86);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; }
.rates { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.rate-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap;
}
.rate-chip b { font-weight: 650; }
.rate-chip .num { color: var(--ink-2); }
.rate-chip small { color: var(--muted); }
.rate-chip.warn { color: var(--out); border-color: #f5c2ca; background: var(--out-soft); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page { padding: 24px 28px 40px; width: 100%; max-width: 2200px; }
.colophon { padding: 0 28px 24px; color: var(--muted); font-size: 12px; }

/* ── Sayfa başlığı ───────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.page-head .crumbs a { text-decoration: none; }
.page-head .crumbs a:hover { color: var(--brand); }
.page-head .lead { color: var(--muted); margin-top: 4px; max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.section-title h2 { font-size: 15px; }

/* ── Düğmeler ────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent;
    font-weight: 550; font-size: 13.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(30, 79, 216, .3); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn-in { background: var(--in); color: #fff; }
.btn-in:hover { filter: brightness(.95); }
.btn-out { background: var(--out); color: #fff; }
.btn-out:hover { filter: brightness(.95); }
.btn-danger { background: var(--surface); border-color: #f2c4cb; color: var(--out); }
.btn-danger:hover { background: var(--out-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.link { color: var(--brand); text-decoration: none; font-weight: 550; font-size: 13px; }
.link:hover { text-decoration: underline; }
.inline-form { display: inline; }

/* Açılır menü */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
    min-width: 248px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: var(--shadow-lg);
}
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu a small { display: block; color: var(--muted); font-size: 11.5px; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.dm-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.dm-ico .ico { width: 16px; height: 16px; }

/* ── Kartlar ─────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--line-2); }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi-sub b { font-weight: 600; color: var(--ink-2); }
.kpi.is-in .dot { background: var(--in); }
.kpi.is-out .dot { background: var(--out); }
.kpi.is-alacak .dot { background: var(--alacak); }
.kpi.is-verecek .dot { background: var(--verecek); }
.kpi.is-brand .dot { background: var(--brand); }
.kpi.is-hero { background: linear-gradient(150deg, #13284a, #0d1726); border-color: #13284a; color: #fff; }
.kpi.is-hero .kpi-label, .kpi.is-hero .kpi-sub { color: #9fb0c8; }
.kpi.is-hero .kpi-sub b { color: #e2e8f0; }
.kpi.is-hero .dot { background: #60a5fa; }

/* Kasa kartları */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acc {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; min-width: 0;
}
.acc:hover { border-color: var(--line-2); box-shadow: 0 4px 14px rgba(15, 28, 46, .07); }
.acc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acc-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.acc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-type { font-size: 12px; color: var(--muted); }
.acc-bal { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.acc-foot { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.acc.is-passive { opacity: .6; }
.acc-add { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); font-weight: 550; min-height: 128px; flex-direction: row; }
.t-nakit { background: #e5f6ee; color: #0b8a5a; }
.t-banka { background: #e8efff; color: #1e4fd8; }
.t-pos { background: #f3e8ff; color: #7c3aed; }
.t-diger { background: #f1f5f9; color: #475569; }
.t-in { background: var(--in-soft); color: var(--in); }
.t-out { background: var(--out-soft); color: var(--out); }
.t-alacak { background: var(--alacak-soft); color: var(--alacak); }
.t-verecek { background: var(--verecek-soft); color: var(--verecek); }
.t-brand { background: var(--brand-soft); color: var(--brand); }

/* ── Tablolar ────────────────────────── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
    text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-2); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tr[data-href] { cursor: pointer; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td small { display: block; color: var(--muted); margin-top: 1px; }
.tbl td a { text-decoration: none; }
.tbl td a:hover { color: var(--brand); }
.tbl tfoot td { background: var(--surface-2); font-weight: 650; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl .row-late td:first-child { box-shadow: inset 3px 0 0 var(--out); }
.tbl .row-muted td { color: var(--muted); }
.tbl .row-open td { background: var(--surface-2); font-weight: 600; }
.tbl .w-actions { width: 1%; white-space: nowrap; text-align: right; }
.card > .table-wrap:last-child .tbl tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }

/* Rozetler */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: var(--ink-2); }
.badge-in { background: var(--in-soft); color: var(--in); }
.badge-out { background: var(--out-soft); color: var(--out); }
.badge-alacak { background: var(--alacak-soft); color: var(--alacak); }
.badge-verecek { background: var(--verecek-soft); color: var(--verecek); }
.badge-late { background: var(--out); color: #fff; }
.badge-soon { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--in-soft); color: var(--in); }
.badge-mute { background: #f1f5f9; color: var(--muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.amount-in { color: var(--in); font-weight: 600; }
.amount-out { color: var(--out); font-weight: 600; }

.avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-weight: 650; font-size: 12px; flex: 0 0 auto; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Formlar ─────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small, .hint { color: var(--muted); font-size: 12px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%; height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface);
    transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 79, 216, .14); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input.input-lg { height: 48px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2, .field-wide { grid-column: 1 / -1; }
.form-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-section > h3 .step { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 11.5px; }
.form-actions { display: flex; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions .spacer { flex: 1; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); }
.input-group { display: flex; }
.input-group > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > select { width: auto; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; flex: 0 0 auto; }

/* Segment seçici */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: #eef1f6; border-radius: 10px; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-weight: 550; font-size: 13px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 28, 46, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg.seg-kind input[value="gelir"]:checked + span { color: var(--in); }
.seg.seg-kind input[value="gider"]:checked + span { color: var(--out); }
.seg.seg-block { display: flex; }
.seg.seg-block label { flex: 1; }
.seg.seg-block span { justify-content: center; width: 100%; }

/* Seçim kartları (ödeme durumu) */
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice > div { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; height: 100%; }
.choice strong { display: block; font-size: 13.5px; }
.choice small { color: var(--muted); }
.choice input:checked + div { border-color: var(--brand); background: var(--brand-soft); }
.choice input:focus-visible + div { outline: 2px solid var(--brand); }

.preview { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.preview span { color: var(--muted); font-size: 12.5px; }
.preview b { font-size: 18px; font-variant-numeric: tabular-nums; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: #1e3a8a; font-size: 13px; }
.note.warn { background: var(--warn-soft); color: #7c4a03; }

/* Filtre çubuğu */
.toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.toolbar .field { min-width: 130px; }
.toolbar .field.grow { flex: 1; min-width: 180px; }
.toolbar input, .toolbar select { height: 34px; font-size: 13px; }
.toolbar .btn { height: 34px; }
.period { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period select { height: 34px; width: auto; font-size: 13px; }
.period .btn { height: 34px; }

/* Sekmeler */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 12px 12px 10px; text-decoration: none; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-color: var(--brand); }
.tabs a .badge { font-size: 11px; }

/* Bildirim */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid; }
.flash a { font-weight: 600; }
.flash-ok { background: var(--in-soft); border-color: #bfe7d3; color: #0a5c3d; }
.flash-err { background: var(--out-soft); border-color: #f5c2ca; color: #8f1d2c; }
.flash-info { background: var(--brand-soft); border-color: #c9d8fb; color: #1e3a8a; }
.errors { margin: 0 0 14px; padding: 11px 14px 11px 32px; border-radius: 10px; background: var(--out-soft); border: 1px solid #f5c2ca; color: #8f1d2c; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px; }

/* ── Grafik ─────────────────────────── */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .bar-in { fill: var(--in); }
.chart .bar-out { fill: #f08f9c; }
.chart .bar-dim { opacity: .35; }
.chart .net-line { fill: none; stroke: var(--brand); stroke-width: 2; }
.chart .net-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Yaşlandırma çubuğu */
.aging { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #eef1f6; }
.aging span { display: block; height: 100%; }
.aging-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; margin-top: 12px; font-size: 12.5px; }
.aging-legend div { display: flex; justify-content: space-between; gap: 8px; }
.aging-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.ag-vadesiz { background: #94a3b8; }
.ag-gelecek { background: #60a5fa; }
.ag-1-30 { background: #fbbf24; }
.ag-31-60 { background: #f97316; }
.ag-61-90 { background: #ef4444; }
.ag-90 { background: #991b1b; }

.split-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #eef1f6; margin-top: 10px; }
.split-bar .a { background: var(--alacak); }
.split-bar .v { background: var(--verecek); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li .grow { flex: 1; min-width: 0; }
.list li .grow strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li .grow small { color: var(--muted); }
.list a.rowlink { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.date-chip { width: 42px; text-align: center; border-radius: 9px; padding: 4px 0; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.1; flex: 0 0 auto; }
.date-chip b { display: block; font-size: 15px; }
.date-chip small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.date-chip.late { background: var(--out-soft); border-color: #f5c2ca; color: var(--out); }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.bar-item .track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.bar-item .track span { display: block; height: 100%; border-radius: 999px; }

.danger-zone { border-color: #f5c2ca; }
.print-only { display: none; }

/* İşlem günlüğü */
.chg-list { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.chg s { color: var(--muted); }
.timeline li { align-items: flex-start; }
.timeline .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--line-2); padding: 0; }
.timeline .grow small { display: block; }
.who-tag { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ── Giriş ───────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: linear-gradient(160deg, #13284a, #0a1220); color: #e2e8f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero h1 { font-size: 34px; color: #fff; margin: 0 0 14px; }
.login-hero ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; color: #b6c3d6; }
.login-hero li { display: flex; gap: 10px; align-items: center; }
.login-hero li .ico { color: #60a5fa; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { font-size: 22px; }

/* ── Duyarlı ─────────────────────────── */
@media (max-width: 1180px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .main { grid-column: 1; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
    .scrim { position: fixed; inset: 0; background: rgba(13, 23, 38, .45); z-index: 35; display: none; }
    .scrim.is-on { display: block; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .page { padding: 18px 16px 32px; }
    .colophon { padding: 0 16px 20px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .rates .rate-chip.hide-sm { display: none; }
    .login { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}
@media (max-width: 640px) {
    .kpis { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .choice-cards { grid-template-columns: minmax(0, 1fr); }
    .page-head { align-items: stretch; }
    .page-head .actions { width: 100%; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 8px; }
    .topbar .btn-label { display: none; }
    h1 { font-size: 21px; }
}

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .no-print, .colophon, .scrim, .toolbar, .tabs, .pager { display: none !important; }
    .app { display: block; }
    .page { padding: 0; max-width: none; }
    .card, .kpi { box-shadow: none; break-inside: avoid; }
    .print-only { display: block; }
}
