/* Para Üssü — tasarım sistemi. Operate kipi: sakin, taranabilir, rakam öncelikli. */
:root {
  color-scheme: light;
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --side: #ecebe5;
  --ink: #141413;
  --ink-2: #47463f;
  --ink-3: #6b6962;
  --line: #e3e1d9;
  --line-2: #cfccc1;
  --accent: #1f5fd1;
  --accent-2: #174fb0;
  --accent-ink: #ffffff;
  --accent-soft: #e8effc;
  --good: #0e7a3c;
  --good-bg: #e4f3ea;
  --bad: #bf2f2e;
  --bad-bg: #fbe8e7;
  --warn: #8a5800;
  --warn-bg: #fcf0d3;
  --info-bg: #e8effc;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --grid: #e6e4dc;
  --axis: #c3c1b6;
  --shadow: 0 1px 2px rgba(20, 20, 19, 0.05), 0 8px 24px -12px rgba(20, 20, 19, 0.18);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --side-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #20201f; --side: #161615; --ink: #f0efec; --ink-2: #c8c7bd; --ink-3: #9d9b92;
    --line: #2d2d2b; --line-2: #3e3e3b; --accent: #6aa3f2; --accent-2: #8bb8f6; --accent-ink: #0b1220; --accent-soft: #1b2a44;
    --good: #4cc47d; --good-bg: #14301f; --bad: #f08585; --bad-bg: #3a1a1a; --warn: #e5b24a; --warn-bg: #3a2c0e; --info-bg: #1b2a44;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #14a014; --c7: #9085e9; --c8: #e66767;
    --grid: #2a2a28; --axis: #3e3e3b; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #20201f; --side: #161615; --ink: #f0efec; --ink-2: #c8c7bd; --ink-3: #9d9b92;
  --line: #2d2d2b; --line-2: #3e3e3b; --accent: #6aa3f2; --accent-2: #8bb8f6; --accent-ink: #0b1220; --accent-soft: #1b2a44;
  --good: #4cc47d; --good-bg: #14301f; --bad: #f08585; --bad-bg: #3a1a1a; --warn: #e5b24a; --warn-bg: #3a2c0e; --info-bg: #1b2a44;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #14a014; --c7: #9085e9; --c8: #e66767;
  --grid: #2a2a28; --axis: #3e3e3b; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs)/1.5 var(--font); -webkit-font-smoothing: antialiased; caret-color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-md); } h3 { font-size: var(--fs); }
p { margin: 0; }
.num, .tbl td.num, .tbl th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Uygulama kabuğu ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.brand-name { font-weight: 700; font-size: var(--fs-md); letter-spacing: -0.015em; line-height: 1.15; }
.brand-sub { font-size: var(--fs-xs); color: var(--ink-3); }
.branch-pick { margin: 6px 14px 8px; }
.nav { padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 14px 10px 5px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 520; text-decoration: none; position: relative; }
.nav a svg { flex: none; opacity: 0.8; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav .badge-n { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; font-weight: 650; }
.nav .badge-n.warn { background: var(--warn); }
.side-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); flex: none; }
.main { min-width: 0; }
.content { padding: 22px 30px 60px; max-width: 1560px; margin: 0 auto; }
.topbar-m { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: min(86vw, 300px); transform: translateX(-102%); transition: transform 0.2s ease-out; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 39; }
  .topbar-m { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .content { padding: 16px 14px 70px; }
}

/* Sol panel gizlendiğinde: içerik tam genişlik, sol üstte geri açma düğmesi (Ctrl+B) */
.btn.side-toggle { display: none; }
.side-hide { flex: none; }
@media (min-width: 961px) {
  .app.side-off { grid-template-columns: 1fr; }
  .app.side-off .side { display: none; }
  .btn.side-toggle { position: fixed; left: 12px; top: 12px; z-index: 35; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .app.side-off .btn.side-toggle { display: inline-flex; }
  .app.side-off .content { padding-left: 62px; }
}

/* ---------- Kartlar ve düzen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 0; }
.card-head h2 { font-size: var(--fs); }
.card-head .sub { color: var(--ink-3); font-size: var(--fs-xs); }
.card-body { padding: 12px 18px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .split-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } .split-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split-21, .split-12, .split-32 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.sect { margin-top: 22px; }
.sect > h2 { margin-bottom: 10px; }

/* Rakam şeridi: kart yığını yerine tek yüzeyde bölünmüş göstergeler.
   Kutular ekrana göre kendiliğinden sığar: dar ekranda alt satıra geçer, rakam kutunun genişliğine göre ölçeklenir.
   Ayraç çizgisi kutunun sol/üst kenarlığıdır; eksi kenar boşluğuyla komşuyla üst üste biner, en dıştakiler de şeridin
   kendi kenarlığının altında kalır. Böylece kaç satıra bölünürse bölünsün çizgiler tek kalır, boş hücre iz bırakmaz. */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.strip > div { padding: 14px 18px; min-width: 0; container-type: inline-size; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; }
.strip .lbl { font-size: var(--fs-sm); color: var(--ink-3); }
/* Rakam, içinde bulunduğu kutunun genişliğine göre büyüyüp küçülür (cqw); taşmaz, gerekirse alt satıra sarar */
/* Rakamlar sağa yaslı (başlık ve açıklama solda kalır): sayılar kutunun sağ kenarında hizalanır */
.strip .val { font-size: clamp(15px, 8cqw, 20px); font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: break-word; text-align: right; }
.strip .val.hero { font-size: clamp(18px, 11cqw, 26px); letter-spacing: -0.03em; }
.strip .val .nw { white-space: nowrap; } /* çok parçalı değerde (ör. döviz) parçanın kendisi bölünmez */
/* Döviz tutarları alt alta ve sağa yaslı: kutu genişliği kadar değil, en uzun tutar kadar yer kaplar,
   böylece basamaklar ve para birimi simgeleri alt alta hizalanır (muhasebe görünümü). */
.strip .val .fxlist { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; width: fit-content; margin-left: auto; text-align: right; }
.strip .hint { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
@media (max-width: 960px) {
  .strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .strip > div { padding: 12px 14px; }
}

/* ---------- Düğmeler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 560; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line-2)); }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.icon { width: 34px; padding: 0; } .btn.icon.sm { width: 30px; }
.btn[disabled], .btn.loading { opacity: 0.55; pointer-events: none; }
.btn.loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Form elemanları ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl-t { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 520; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.field .err { font-size: var(--fs-xs); color: var(--bad); }
.inp, select.inp, textarea.inp { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); transition: border-color 0.12s, box-shadow 0.12s; min-width: 0; }
textarea.inp { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }
.inp:hover { border-color: var(--ink-3); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp::placeholder { color: var(--ink-3); opacity: 0.8; }
.inp[disabled], .inp[readonly] { background: var(--surface-2); color: var(--ink-2); }
.inp.money { text-align: right; font-variant-numeric: tabular-nums; }
.inp.invalid { border-color: var(--bad); }
.inp.calc { background: var(--surface-2); font-weight: 600; border-style: dashed; }
select.inp { appearance: none; padding-right: 28px; 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='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs); }
.fgrid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.fgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 680px) { .fgrid.c2, .fgrid.c3 { grid-template-columns: minmax(0, 1fr); } }
.input-affix { position: relative; } .input-affix .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: var(--fs-sm); }
.input-affix .inp { padding-right: 26px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 540; color: var(--ink-2); font-size: var(--fs-sm); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; font-weight: 560; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Tablolar ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: var(--tbl-max, none); }
.card .tbl-wrap { border: 0; border-radius: 0; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: var(--fs-xs); text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num, .tbl th.right, .tbl td.right { text-align: right; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.tbl tr.click { cursor: pointer; }
.tbl tr.total td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.tbl tr.group td { font-weight: 650; background: var(--surface-2); color: var(--ink-2); }
.tbl tr.sub td { font-weight: 600; border-top: 1px solid var(--line-2); }
/* Mizan düzeyleri: Hesap Planı renkleri (kebir kırmızı, grup / alt hesap mavi, muavin beyaz) ve punto sırası */
.tbl tr.kebir td { font-size: 15px; font-weight: 750; color: var(--bad); border-top: 1px solid var(--line-2); }
.tbl tr.grup td { font-size: 14px; font-weight: 700; color: var(--accent); }
.tbl tr.alt td { font-size: 13.5px; font-weight: 500; color: color-mix(in srgb, var(--accent) 78%, var(--ink)); }
.tbl tr.muavin td { font-size: 12.5px; font-weight: 400; }
.tbl tr.grand td { font-weight: 700; background: var(--accent-soft); border-top: 2px solid var(--accent); }
.tbl tr.head td { font-weight: 700; letter-spacing: 0.02em; color: var(--ink); padding-top: 14px; background: transparent; border-bottom: 1px solid var(--line-2); }
.tbl tr.missing td { background: var(--warn-bg); color: var(--warn); }
.chip { display: inline-flex; align-items: center; gap: 2px; }
.chip .chip-x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.chip .chip-x:hover { color: var(--bad); }
.tbl tr.warnrow td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.tbl tr.off td { color: var(--ink-3); }
.tbl tr.done td { opacity: .5; transition: opacity .15s; }
.tbl tr.done:hover td, .tbl tr.done:focus-within td { opacity: .9; } /* işlenmiş satır: soluk; üzerine gelince okunur */
.tbl td.pos { color: var(--good); } .tbl td.neg { color: var(--bad); }
.tbl .cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.tbl tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-2); position: sticky; bottom: 0; }
.tbl.sticky-first th:first-child, .tbl.sticky-first td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tbl.sticky-first th:first-child { background: var(--surface-2); z-index: 3; }
.tbl.sticky-first tr.total td:first-child, .tbl.sticky-first tr.grand td:first-child { background: inherit; }

/* ---------- Rozetler, uyarılar, boş durum ---------- */
/* Şube rengi: günlük kasada şubeleri ayırt eden rozet (renk şubenin sırasına göre sabittir) */
.branch-chip { font-weight: 650; }
.branch-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 20px; font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; line-height: 20px; }
.badge.good { background: var(--good-bg); color: var(--good); border-color: transparent; } .badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .badge.info { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.notice { display: flex; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: var(--fs-sm); align-items: flex-start; background: var(--info-bg); color: var(--ink); }
.notice svg { flex: none; margin-top: 2px; color: var(--accent); }
.notice.warn { background: var(--warn-bg); } .notice.warn svg { color: var(--warn); }
.notice.bad { background: var(--bad-bg); } .notice.bad svg { color: var(--bad); }
.notice.good { background: var(--good-bg); } .notice.good svg { color: var(--good); }
.empty { text-align: center; padding: 38px 20px; color: var(--ink-3); }
.empty svg { color: var(--line-2); margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; font-size: var(--fs-sm); }
.skel { background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } * { transition: none !important; } }

/* ---------- Çekmece, onay, toast ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(10, 10, 9, 0.38); z-index: 60; animation: fade 0.15s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.drawer.wide { width: min(820px, 100vw); }
.tbl th .col-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 3; }
.tbl th .col-grip::after { content: ''; position: absolute; top: 20%; bottom: 20%; left: 6px; width: 1px; background: var(--line-2); }
.tbl th .col-grip:hover::after { background: var(--accent); width: 2px; left: 5px; }
.accpick-pop { position: fixed; z-index: 95; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.accpick-pop .opt { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: var(--fs-sm); }
.accpick-pop .opt:hover, .accpick-pop .opt.on { background: var(--accent-soft); }
.accpick-pop .opt .c { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 92px; }
.accpick-pop .opt .n { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accpick-pop .opt.new .c { color: var(--accent); }
.accpick-pop .opt.none { color: var(--ink-3); cursor: default; }
.col-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px; }
.col-pop .col-row { display: flex; align-items: center; gap: 4px; padding: 3px 4px; }
.col-pop .col-row .btn { min-width: 30px; padding: 2px 6px; }
.drawer.ledger-win { transition: width 0.18s ease; }
.drawer.ledger-win .drawer-head { gap: 4px; }
.drawer.ledger-win .drawer-head h2 { margin-right: 8px; }
.tbl tr[title] { cursor: pointer; }
.tbl tr.kebir[title], .tbl tr.grup[title], .tbl tr.alt[title], .tbl tr.muavin[title] { user-select: none; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-head h2 { flex: 1; font-size: var(--fs-lg); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
dialog.dlg { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.dlg::backdrop { background: rgba(10, 10, 9, 0.42); }
.dlg-body { padding: 20px 22px 6px; } .dlg-body h2 { margin-bottom: 6px; } .dlg-body p { color: var(--ink-2); }
.dlg-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: var(--fs-sm); animation: slidein 0.18s ease-out; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: var(--bad); color: #fff; } .toast.ok { background: var(--good); color: #fff; }
@media print { .toasts { display: none; } }

/* ---------- Grafikler ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis-l { stroke: var(--axis); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: var(--fs-xs); min-width: 140px; opacity: 0; transition: opacity 0.08s; }
.tip.on { opacity: 1; }
.tip .t { font-weight: 650; margin-bottom: 4px; color: var(--ink); }
.tip .r { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.tip .r b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-2); margin-top: 8px; }
.legend .k { display: inline-flex; align-items: center; gap: 6px; } .legend .sw { width: 14px; height: 3px; border-radius: 2px; } .legend .sw.box { height: 9px; width: 9px; border-radius: 2px; }
.segbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); }
.segbar > i { display: block; min-width: 2px; border-radius: 2px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar .top { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 3px; gap: 8px; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; }
.tableview { margin-top: 10px; } .tableview summary { cursor: pointer; font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- Giriş ekranı ---------- */
/* ---------- Giriş, şirket seçimi, davet (marka: "Ü" işareti, yeşil / krem / bozukluk sarısı) ----------
   Yalnızca .auth altında geçerli: uygulamanın belirteçleri bu yüzeyde marka değerleriyle yeniden tanımlanır, böylece
   .btn, .inp, odak halkası ve seçim rengi kendiliğinden markaya uyar; uygulamanın geri kalanı etkilenmez. */
.auth {
  --brand: #127a57; --brand-ink: #f4f1ea; --coin: #eda100;
  --bg: #f4f1ea; --surface: #fffdf8; --surface-2: #f7f3ea; --ink: #16150f; --ink-2: #4b483f; --ink-3: #6e695c;
  --line: #e4ddcc; --line-2: #d6cdb8; --accent: #127a57; --accent-2: #0e6748; --accent-ink: #ffffff; --accent-soft: #d6ece2;
  --bad: #b3261e; --bad-bg: #fbe9e6;
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
  background: var(--bg); color: var(--ink); caret-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth {
    --brand: #0c4f39; --brand-ink: #efeadd;
    --bg: #11120e; --surface: #191a15; --surface-2: #20211b; --ink: #efece3; --ink-2: #c6c2b4; --ink-3: #9a9688;
    --line: #2c2d25; --line-2: #3b3c33; --accent: #46c495; --accent-2: #67d3aa; --accent-ink: #06150f; --accent-soft: #15382a;
    --bad: #f09b93; --bad-bg: #3a1c19;
  }
}
:root[data-theme="dark"] .auth {
  --brand: #0c4f39; --brand-ink: #efeadd;
  --bg: #11120e; --surface: #191a15; --surface-2: #20211b; --ink: #efece3; --ink-2: #c6c2b4; --ink-3: #9a9688;
  --line: #2c2d25; --line-2: #3b3c33; --accent: #46c495; --accent-2: #67d3aa; --accent-ink: #06150f; --accent-soft: #15382a;
  --bad: #f09b93; --bad-bg: #3a1c19;
}
.auth ::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); }

/* Marka paneli: yeşil zemin, defter çizgileri, "toplam tamam" çift çizgisi */
.auth-brand {
  position: relative; isolation: isolate; overflow: hidden; background: var(--brand); color: var(--brand-ink);
  padding: clamp(32px, 4.5vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(to bottom, transparent 0 39px, color-mix(in srgb, var(--brand-ink) 10%, transparent) 39px 40px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 30%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent 4%, #000 30%, #000 82%, transparent);
}
.auth-brand::after {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: clamp(20px, 3vw, 36px); width: 1px;
  background: color-mix(in srgb, var(--coin) 45%, transparent);
}
.auth-lockup, .auth-top { display: flex; align-items: center; gap: 12px; }
.auth-mark { width: 40px; height: 40px; display: block; flex: none; }
.auth-brand .auth-mark { width: 52px; height: 52px; margin: -6px; }
.auth-word { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.auth-claim { max-width: 12.5em; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.12; font-weight: 650; letter-spacing: -0.03em; text-wrap: balance; }
.auth-rule { display: block; width: 72px; height: 7px; margin-top: 22px; border-top: 2px solid var(--coin); border-bottom: 2px solid var(--coin); }
.auth-small { font-size: var(--fs-sm); font-weight: 520; color: var(--brand-ink); }

/* Form tarafı */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(28px, 6vw, 72px) 20px; }
.auth-top { display: none; }
.auth-card { width: min(400px, 100%); }
.auth-card.wide { width: min(460px, 100%); }
.auth-step { animation: auth-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes auth-in { from { opacity: 0.35; transform: translateY(8px); filter: blur(1.5px); } }
@media (prefers-reduced-motion: reduce) { .auth-step { animation: none; } }
.auth-form { gap: 16px; }
.auth-head { margin-bottom: 6px; }
.auth-head h1 { font-size: 27px; line-height: 1.15; font-weight: 680; letter-spacing: -0.025em; text-wrap: balance; }
.auth-head p { margin-top: 8px; color: var(--ink-2); font-size: var(--fs); line-height: 1.5; max-width: 46ch; text-wrap: pretty; }
.auth .field > label { color: var(--ink-2); }
.auth .inp { height: 44px; padding: 0 12px; font-size: 15px; border-radius: 8px; background: var(--surface); }
.auth .inp:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.auth .inp::placeholder { color: var(--ink-3); opacity: 1; }
.auth .inp:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--surface) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--accent); }
.auth .inp.auth-code { height: 54px; text-align: center; font-size: 24px; letter-spacing: 0.32em; font-variant-numeric: tabular-nums; }
.auth .inp.auth-mono { letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.auth .inp.auth-mono::placeholder { text-transform: none; }
.auth .btn.auth-submit { height: 46px; width: 100%; font-size: 15px; font-weight: 620; border-radius: 8px; margin-top: 4px; }
.auth .notice { border-radius: 8px; }
.auth-alt { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: baseline; font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }
.auth-link { border: 0; background: none; padding: 2px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.auth-link:hover { text-decoration-color: currentColor; }

/* Hesap rozeti: doğrulanan e-posta (kod, şifre ve şirket adımlarında) */
.auth-chip { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); }
.auth-avatar { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.auth-chip-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.auth-chip .auth-link { margin-left: 2px; white-space: nowrap; font-size: var(--fs-sm); }

/* Şirket listesi */
.auth-co { display: flex; flex-direction: column; gap: 8px; }
.auth-co-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 1px rgba(22, 21, 15, 0.03); transition: border-color 0.14s, box-shadow 0.18s, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-co-row:hover { border-color: var(--accent); box-shadow: 0 1px 2px rgba(22, 21, 15, 0.05), 0 10px 22px -16px color-mix(in srgb, var(--accent) 70%, transparent); transform: translateY(-1px); }
.auth-co-row:active { transform: translateY(0); }
.auth-co-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-co-row.loading { opacity: 0.6; pointer-events: none; }
.auth-co-ini { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 720; font-size: 17px; }
.auth-co-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.auth-co-tag { flex: none; font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; }
.auth-co-go { color: var(--ink-3); display: grid; place-items: center; transform: rotate(180deg); transition: color 0.14s, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.auth-co-row:hover .auth-co-go { color: var(--accent); transform: rotate(180deg) translateX(-2px); }

/* Davet kodu (açılır) */
.auth-invite { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.auth-invite > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--accent); font-weight: 600; font-size: var(--fs); border-radius: 6px; padding: 2px; }
.auth-invite > summary::-webkit-details-marker { display: none; }
.auth-invite[open] > summary { color: var(--ink); }
.auth-invite-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.auth-invite-body > p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.auth-invite-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.auth-invite-form .btn { height: 44px; padding: 0 18px; border-radius: 8px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { justify-content: flex-start; padding: 22px 18px 40px; }
  .auth-top { display: flex; align-self: stretch; max-width: 400px; width: 100%; margin: 0 auto 36px; }
  .auth-head h1 { font-size: 24px; }
}

/* ---------- Sayfaya özel ---------- */
.day-nav { display: flex; align-items: center; gap: 6px; }
.form-sect { padding: 16px 18px 18px; border-bottom: 1px solid var(--line); }
.form-sect:last-child { border-bottom: 0; }
.form-sect > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sum-panel { position: sticky; top: 16px; align-self: start; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: var(--fs-sm); }
.sum-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.sum-row.big { font-size: var(--fs-md); padding: 8px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.sum-row.big b { font-weight: 700; }
.sum-sep { border-top: 1px solid var(--line); margin: 8px 0; }
.alert-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; align-items: flex-start; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { text-decoration: none; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.alert-row .ico { flex: none; margin-top: 2px; }
.alert-row .ico.critical { color: var(--bad); } .alert-row .ico.warning { color: var(--warn); } .alert-row .ico.info { color: var(--accent); }
.alert-row .tt { font-weight: 600; font-size: var(--fs-sm); } .alert-row .dd { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.grid-ts { border-collapse: separate; border-spacing: 0; font-size: var(--fs-xs); }
.grid-ts th, .grid-ts td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; min-width: 38px; height: 30px; background: var(--surface); }
.grid-ts th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; position: sticky; top: 0; z-index: 2; padding: 4px 2px; }
.grid-ts th.we, .grid-ts td.we { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.grid-ts td.name, .grid-ts th.name { text-align: left; padding: 0 10px; position: sticky; left: 0; z-index: 3; min-width: 190px; background: var(--surface); white-space: nowrap; }
.grid-ts th.name { background: var(--surface-2); }
.grid-ts td input { width: 100%; height: 29px; border: 0; background: transparent; text-align: center; font: inherit; color: inherit; padding: 0; }
.grid-ts td input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.grid-ts td.code input { color: var(--warn); font-weight: 650; }
.grid-ts td.sum { min-width: 64px; font-weight: 650; background: var(--surface-2); padding: 0 6px; }
.kbd { font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 36px 20px; text-align: center; color: var(--ink-2); transition: border-color 0.12s, background 0.12s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.steps { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--ink-3); flex-wrap: wrap; }
.steps .st { display: inline-flex; align-items: center; gap: 6px; } .steps .st b { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; }
.steps .st.on { color: var(--ink); font-weight: 600; } .steps .st.on b { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .steps .st.done b { background: var(--good); color: #fff; border-color: var(--good); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; }
.perm-grp { grid-column: 1 / -1; font-weight: 650; margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: var(--fs-sm); } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 520; }

/* ---------- Platform yönetimi ---------- */
.pf .nowrap { white-space: nowrap; }
.pf .kv dd { min-width: 0; overflow-wrap: anywhere; }
.pf-search { flex: 1 1 260px; max-width: 360px; }
.pf-sect { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.pf-sect h3 { font-size: var(--fs); margin: 0; }
.pf-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: var(--fs-sm); max-height: 240px; overflow: auto; }
.pf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pf-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pf-invite { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.pf-invite-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-sm); color: var(--good); }
.pf-invite-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-code { font: 600 22px/1.2 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; user-select: all; }
.pf-invite p { margin: 0; }
.pf code { font: 13px ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; overflow-wrap: anywhere; }
.pf-only { min-height: 100vh; }
.pf-only-bar > b, .pf-only-bar > span { white-space: nowrap; }
.pf-only-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.pf-only .content { max-width: 1180px; margin: 0 auto; }
@media (max-width: 680px) {
  .pf-only-mail, .pf-only-bar > .muted { display: none; }
  .pf-search { max-width: none; }
  .pf .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .pf .kv dd { margin-bottom: 8px; }
  .pf-stack .tbl thead { display: none; }
  .pf-stack .tbl, .pf-stack .tbl tbody, .pf-stack .tbl tr { display: block; width: 100%; }
  .pf-stack .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .pf-stack .tbl tr:last-child { border-bottom: 0; }
  .pf-stack .tbl td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 3px 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .pf-stack .tbl td > * { justify-self: start; }
  .pf-stack .tbl td[colspan] { display: block; }
  .pf-stack .tbl td::before { content: attr(data-label); color: var(--ink-3); font-size: var(--fs-xs); }
  .pf-stack .tbl td[data-label=""]::before { content: none; } .pf-stack .tbl td[data-label=""] { display: block; }
  .pf-stack .tbl tbody tr:hover td { background: transparent; }
}

@media print {
  .side, .side-toggle, .topbar-m, .page-actions, .btn, .tabs, .no-print, .drawer, .toasts { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; } .card, .tbl-wrap { border-color: #bbb; box-shadow: none; }
  .tbl th { position: static; } .tbl-wrap { max-height: none !important; overflow: visible; }
  :root { --surface: #fff; --surface-2: #f3f3f3; --ink: #000; --ink-2: #222; --ink-3: #444; --line: #bbb; }
  /* Çok sayfalı çıktıda başlık satırı her sayfada tekrarlasın, satırlar ikiye bölünmesin */
  thead { display: table-header-group; }
  tr, .card { break-inside: avoid; }
  /* Geniş tablolar (ör. kupür sütunları) A4'e sığsın */
  .tbl { font-size: 10.5px; }
  .tbl th, .tbl td { padding: 3px 5px; }
}
@page { margin: 10mm; }

/* ---- Genel arama (Ctrl+K) ve liste içi arama ---- */
.side-search { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-3); cursor: pointer; font: inherit; text-align: left; }
.side-search:hover { border-color: var(--ink-3); color: var(--ink-2); }
.side-search span { flex: 1; }
/* Verileri güncelle: sunucudaki son sürümü ve verileri getirir (yan panelin altında, kullanıcı satırının üstünde) */
.side-update { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 12px 10px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit; font-size: var(--fs-sm); font-weight: 520; }
.side-update:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.side-update:disabled { cursor: default; opacity: 0.7; }
.side-update.busy svg { animation: spin 1s linear infinite; }
kbd { font: 600 11px/1 var(--font); padding: 3px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); color: var(--ink-3); }
.pal-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(15, 15, 14, 0.45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.pal-box { width: min(660px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 76vh; overflow: hidden; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-head input.inp { border: 0; box-shadow: none; height: 32px; background: transparent; padding: 0; }
.pal-head input.inp:focus { box-shadow: none; }
.pal-list { overflow: auto; padding: 6px; }
.pal-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.pal-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.pal-item.sel { background: var(--accent-soft); }
.pal-t { font-weight: 560; }
.pal-s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--line); }
.pal-empty { padding: 28px; text-align: center; color: var(--ink-3); }
mark.hl { background: color-mix(in srgb, var(--accent) 24%, transparent); color: inherit; border-radius: 2px; }
input[type="search"].inp { appearance: none; }

/* Kaydedilmiş (kilitli) ayar bölümü */
.faded { opacity: 0.6; }
.faded .inp { pointer-events: none; }

/* Banka › birim seçimi: tıklanarak seçilen kartlar */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.unit-pick { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background .12s; }
.unit-pick:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.unit-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.unit-pick:disabled { cursor: default; opacity: .75; }
.unit-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.unit-pick .chk-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent-ink, #fff); }
.unit-pick.on .chk-dot { background: var(--accent); border-color: var(--accent); }
.unit-pick .nm { display: block; font-weight: 600; }
.unit-pick .sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 1px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tbl tbody tr.sel td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.tbl tbody tr.dirty td { background: var(--warn-bg); }

/* ---------- Para dökümü yazdırma formu (KUR HESAPLAMA VE ADETLERİ) ---------- */
.sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; border-bottom: 2px solid var(--ink-2); padding-bottom: 10px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 17px; letter-spacing: 0.02em; }
.sheet-meta { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; font-weight: 600; }
.sheet-rates { display: flex; gap: 18px; font-size: var(--fs-sm); white-space: nowrap; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.sheet-tbl { font-size: var(--fs-sm); }
.sheet-tbl th, .sheet-tbl td { padding: 3px 7px; }
.sheet-tbl tbody tr.bos td { color: var(--ink-3); }
.sheet-tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); }
.sheet-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet-sign { font-weight: 600; min-width: 240px; border-bottom: 1px solid var(--ink-3); padding-bottom: 20px; }
.sheet-grand { font-size: 17px; }
@media (max-width: 900px) { .sheet-grid { grid-template-columns: 1fr; } }
@media print {
  .sheet { border: 0; padding: 0; }
  .sheet-grid { gap: 8px 14px; }
  .sheet-tbl { font-size: 9.5px; }
  .sheet-tbl th, .sheet-tbl td { padding: 1.5px 5px; }
  .sheet-blok { break-inside: avoid; }
  .sheet-head h2 { font-size: 15px; }
}
.sheet-accounts { margin-top: 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px; }
.sheet-accounts-t { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 6px; }
.sheet-accounts-b { white-space: pre-line; font-size: var(--fs-sm); line-height: 1.5; column-gap: 28px; }
@media (min-width: 700px) { .sheet-accounts-b { columns: 2; } }
@media print { .sheet-accounts { margin-top: 10px; padding: 6px 10px; } .sheet-accounts-b { font-size: 9.5px; line-height: 1.35; } }

/* e-Belge */
.eb-lines { display: grid; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.eb-lines .eb-row { display: grid; grid-template-columns: minmax(180px, 2.4fr) minmax(120px, 1.4fr) 80px 110px 100px 80px minmax(120px, 1fr) 100px 90px 36px; gap: 6px; align-items: center; min-width: 1040px; }
.eb-lines .eb-row.eb-head { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); letter-spacing: 0.04em; }
.eb-lines .inp { height: 32px; padding: 0 8px; font-size: var(--fs-sm); }
.eb-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px 24px; margin: 0; font-variant-numeric: tabular-nums; }
.eb-totals dt { color: var(--ink-2); text-align: right; }
.eb-totals dd { margin: 0; text-align: right; font-weight: 600; }
.eb-totals dt.eb-grand, .eb-totals dd.eb-grand { font-size: var(--fs-md); font-weight: 700; border-top: 2px solid var(--line-2); padding-top: 6px; color: var(--ink); }
.eb-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line-2); display: grid; gap: 14px; }
.eb-timeline li { position: relative; font-size: var(--fs-sm); }
.eb-timeline li::before { content: ''; position: absolute; left: -25px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.eb-timeline .eb-ts { color: var(--ink-3); font-size: var(--fs-xs); }
.eb-xml { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-xs); white-space: pre; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 420px; overflow: auto; }
.eb-test { background: var(--warn-bg); color: var(--warn); border-color: transparent; font-weight: 700; letter-spacing: 0.05em; }
@media (max-width: 700px) { .eb-totals { justify-content: stretch; } }

/* ---- Eşleşmeyenler: satır düzeni (tanım · neden · etki · düzeltme); dar ekranda düzeltme alanı alta iner ---- */
.unm-body { padding: 0; }
.unm-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.8fr); gap: 6px 16px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.unm-row > * { min-width: 0; overflow-wrap: anywhere; }
.unm-why { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.unm-fix .inp { flex: 1 1 180px; min-width: 0; width: auto; }
@media (max-width: 1100px) { .unm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .unm-fix { grid-column: 1 / -1; } }
@media (max-width: 680px) { .unm-row { grid-template-columns: minmax(0, 1fr); } }

/* Hesap Kodlarını Değiştir: geniş ekranda iki sütun, 900 px altında tek sütun */
.rc-layout { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .rc-layout { grid-template-columns: minmax(0, 1fr); } }
.bp-row { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }

/* ---- Personel: yasal kart, tanımlar, brüt-net aracı (.py-) ---- */
.py-sec { font-weight: 650; font-size: var(--fs-sm); color: var(--ink-2); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 2px; }
.py-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; font-size: var(--fs-sm); }
.py-kv > div { min-width: 0; overflow-wrap: anywhere; }
.py-cols { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .py-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---- Belge Şablonları (.bs-) ---- */
.bs-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.bs-doc { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; font: inherit; }
.bs-doc:hover { border-color: var(--ink-3); }
.bs-doc.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.bs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.bs-cols { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.bs-edit, .bs-prev { min-width: 0; }
.bs-prev { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 1100px) { .bs-cols { grid-template-columns: minmax(0, 1fr); } .bs-prev { position: static; max-height: none; } }
.bs-list { display: flex; flex-direction: column; gap: 8px; }
.bs-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.bs-row.bs-dragging { opacity: 0.5; }
.bs-row.bs-over { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bs-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.bs-grip { cursor: grab; color: var(--ink-3); user-select: none; padding: 0 2px; letter-spacing: -2px; }
.bs-mvs { display: inline-flex; gap: 4px; }
.bs-mv, .bs-del { min-width: 30px; padding: 2px 6px; }
.bs-mv svg.bs-rot-up { transform: rotate(90deg); }
.bs-mv svg.bs-rot-down { transform: rotate(-90deg); }
.bs-vis { display: inline-flex; align-items: center; min-width: 20px; }
.bs-lbl { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; min-width: 0; }
.bs-lbl .btn[hidden] { display: none; }
.bs-wrap { flex: 0 0 96px; }
.bs-w { text-align: right; }
.bs-sig { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 240px; min-width: 0; }
.bs-sig > * { flex: 1 1 140px; min-width: 0; }
.bs-note { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bs-locked { color: var(--ink-2); overflow-wrap: anywhere; }
.bs-req { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 4px; }
.bs-err { font-size: var(--fs-xs); color: var(--bad); }
.bs-ul { margin: 4px 0 0; padding-left: 18px; }
.bs-prev-body { padding-top: 12px; }
.bs-paper { background: #fff; color: #141413; border: 1px solid var(--line-2); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; min-width: 0; }
.bs-paper.portrait { max-width: 420px; }
.bs-ptitle { font-size: 15px; font-weight: 700; text-align: center; }
.bs-psec { font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #47463f; border-bottom: 1px solid #cfccc1; padding-bottom: 2px; margin-bottom: 4px; }
.bs-pkv { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 3px 14px; }
.bs-pkv > div { display: flex; gap: 6px; min-width: 0; }
.bs-pkv dt { color: #6b6962; flex: none; }
.bs-pkv dd { margin: 0; overflow-wrap: anywhere; }
.bs-pkv .b dd, .bs-pitems .b { font-weight: 700; }
.bs-ptbl { overflow-x: auto; }
.bs-ptbl table { border-collapse: collapse; width: 100%; min-width: max-content; }
.bs-ptbl th, .bs-ptbl td { border: 1px solid #cfccc1; padding: 3px 6px; text-align: left; vertical-align: top; }
.bs-ptbl th { background: #f1efe8; font-weight: 650; }
.bs-ptbl .r { text-align: right; }
.bs-ptbl tfoot td { font-weight: 700; background: #faf9f6; }
.bs-pitems { display: flex; flex-direction: column; gap: 2px; }
.bs-pitems > div { display: grid; grid-template-columns: minmax(0, 1fr) 80px 100px; gap: 8px; border-bottom: 1px dotted #cfccc1; }
.bs-pitems .r { text-align: right; }
.bs-psig { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.bs-psig .t { font-weight: 650; }
.bs-psig .line { height: 32px; border-bottom: 1px solid #141413; margin-bottom: 3px; }
.bs-pnotes p { margin: 0 0 4px; color: #47463f; }
@media (max-width: 480px) { .bs-wrap { flex-basis: 80px; } }
