/* ============================================================
   Hesaplar modülü — ORTAK EKRAN İSKELETİ (yeni tasarım, 2026-08-11)
   Kaynak: "Hesaplar (Yeni Tasarım).dc.html"

   Tek iskelet; hem liste hem detay ekranları bunu kullanır:
     1) sekme çubuğu   2) geri linki   3) PageHead (başlık + aksiyonlar)
     4) uyarı şeridi   5) KPI kartları 6) hilite kartları
     7) TAM GENİŞLİK tablo            8) tablonun ALTINDA eşit yükseklikli paneller

   ⛔ Hex yazma — her renk variables.css token'ı. Tasarımdaki hex→token eşlemesi:
      #C8521E→--brand · #AC451A→--brand-dark · #463E7C→--navy · #272253→--text
      #6E6A8C→--text-muted · #9A96B4→--text-faint · #E5E1EE→--border
      #F2F0F6→--bg · #FFF→--surface · #F7F5FB→--surface-alt · #CFC9E0→--border-strong
   ============================================================ */

.he {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

/* ── 1) Sekme çubuğu ─────────────────────────────────────────── */
.he-tabs { overflow-x: auto; scrollbar-width: thin; }
.he-tabs::-webkit-scrollbar { height: 8px; }
.he-tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
.he-tabs::-webkit-scrollbar-track { background: transparent; }

.he-tabs-inner {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.he-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: var(--space-2) 15px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.he-tab:hover { color: var(--text); }
.he-tab--active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.he-tab-count {
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--navy-tint);
  color: var(--text-muted);
}
.he-tab--active .he-tab-count { background: var(--brand-tint); color: var(--brand-dark); }

/* ── 2) Geri linki (detay ekranları) ─────────────────────────── */
.he-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--navy);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.he-back:hover { color: var(--brand); }
.he-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── 3) PageHead ─────────────────────────────────────────────── */
.he-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.he-head-title {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}
.he-head-desc { margin: 0; font-size: var(--fs-base); color: var(--text-muted); }
.he-head-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.he-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition);
}
.he-btn:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.he-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.he-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.he-btn--primary:hover { background: var(--brand-light); border-color: var(--brand-light); }
.he-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── 4) Uyarı şeridi ─────────────────────────────────────────── */
.he-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 13px var(--space-4);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  --he-banner-color: var(--text-muted);
}
.he-banner--amber { border-color: var(--brand-tint); background: var(--brand-tint); --he-banner-color: var(--brand-dark); }
.he-banner--red   { border-color: var(--red-soft);   background: var(--red-soft);   --he-banner-color: var(--red); }
.he-banner--info  { border-color: var(--blue-soft);  background: var(--blue-soft);  --he-banner-color: var(--blue); }
.he-banner-ico {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--surface);
  color: var(--he-banner-color);
}
.he-banner-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.he-banner-body { flex: 1 1 240px; min-width: 0; }
.he-banner-title { font-size: 13.5px; font-weight: 800; color: var(--he-banner-color); }
.he-banner-text { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.he-banner-cta {
  flex: none;
  padding: var(--space-2) var(--space-3);
  border-radius: 9px;
  border: 1px solid var(--he-banner-color);
  background: var(--surface);
  color: var(--he-banner-color);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.he-banner-cta:hover { background: var(--he-banner-color); color: #fff; }

/* ── 5) KPI kartları ─────────────────────────────────────────── */
.he-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}
.he-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
/* Tıklanabilir KPI (ör. "Kategorisiz Harcama" → listeye götürür). */
.he-kpi--click { cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.he-kpi--click:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.he-kpi--click:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.he-kpi-label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.he-kpi-value {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  /* Uzun tek parça değerler kutuyu taşırmasın — son çare olarak SARAR. */
  overflow-wrap: anywhere;
  line-height: 1.25;
}
/* IBAN 32 karakter; KPI değeri puntosunda (22px) ikinci satıra taşıyordu.
   Tek satırda kalsın diye küçültülür (kullanıcı kararı 2026-08-11 — önceki
   "IBAN da diğer değerlerle aynı punto" kararının yerine geçer). */
.he-kpi-iban {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}
/* Dar düzende 18px tek satıra sığmaz → kademeli küçülür, en darda sarmaya izin verilir. */
@media (max-width: 1200px) { .he-kpi-iban { font-size: 16px; } }
@media (max-width: 900px) { .he-kpi-iban { font-size: 14px; } }
@media (max-width: 420px) { .he-kpi-iban { font-size: 13px; white-space: normal; } }
.he-kpi-sub { font-size: 11.5px; color: var(--text-muted); }
.he-kpi-chips { display: flex; gap: var(--space-1) 6px; flex-wrap: wrap; }
.he-chip {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--navy);
  background: var(--navy-tint);
  border-radius: var(--radius-full);
  padding: 3px var(--space-2);
  white-space: nowrap;
}

/* ── İlerleme çubuğu (KPI · hilite · panel ortak) ────────────── */
.he-bar { height: 8px; border-radius: var(--radius-sm); background: var(--navy-tint); overflow: hidden; }
.he-bar--sm { height: 7px; }
.he-bar--xs { height: 6px; }
.he-bar-fill { height: 100%; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--brand), var(--brand-light)); }
.he-bar-fill--navy  { background: linear-gradient(90deg, var(--navy), var(--navy-light)); }
.he-bar-fill--green { background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 55%, #fff)); }
.he-bar-fill--red   { background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 55%, #fff)); }
.he-bar-fill--blue  { background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 55%, #fff)); }

/* ── 6) Hilite kartları ──────────────────────────────────────── */
.he-hilite-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.he-hilite-h { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.he-hilite-note { font-size: var(--fs-xs); color: var(--text-muted); }
.he-hilites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: var(--space-3);
}
.he-hilite {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--he-accent, var(--navy));
  border-radius: 13px;
  padding: 15px var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
.he-hl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.he-hl-title {
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.he-hl-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }
.he-tag {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  color: var(--navy);
  background: var(--navy-tint);
}
.he-hl-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); }
.he-hl-k {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.he-hl-big { font-size: 20px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; color: var(--text); }
.he-hl-small { font-size: 13.5px; font-weight: 700; margin-top: 3px; color: var(--text); }
.he-hl-foot {
  display: flex; justify-content: space-between; gap: var(--space-2);
  margin-top: 7px; font-size: 11.5px; color: var(--text-muted);
}

/* ── 7) Tablo (TAM GENİŞLİK — panellerin ÜSTÜNDE) ────────────── */
.he-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}
.he-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.he-card-title { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.he-card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.he-card-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.he-tbl-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.he-btn--sm { padding: 7px var(--space-3); font-size: 12.5px; }

/* Mevcut ekranların hazır `.btn` aksiyonları (head.actionsHtml) — yeni
   başlık şeridinde tasarımın ölçüsüne oturur (§8: davranış korunur). */
.he-head-actions .btn { border-radius: var(--radius); }
.he-filters {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.he-filter {
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 6px var(--space-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.he-filter:hover { color: var(--text); }
.he-filter.is-active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* Tam genişlik satır (ay başlığı vb.) — sütun düzeni uygulanmaz. */
.he-tbl-row--full { display: block; padding-top: var(--space-2); padding-bottom: var(--space-2); background: var(--surface-alt); }

/* “N kayıt daha göster” — uzun ekstrelerde artımlı yükleme. */
.he-more {
  display: block;
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--navy);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.he-more:hover { background: var(--brand-tint); color: var(--brand-dark); }

.he-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-faint);
  min-width: 190px;
}
.he-search:focus-within { border-color: var(--brand); color: var(--brand); }
.he-search svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.he-search input {
  border: none; outline: none; background: none;
  font-family: inherit; font-size: 12.5px; color: var(--text);
  width: 100%; min-width: 0;
}
.he-search input::placeholder { color: var(--text-faint); }

/* Yatay kaydırma yalnız gerçekten sığmazsa (dar ekran). 1440px+ → çıkmaz. */
.he-tbl-wrap { overflow-x: auto; scrollbar-width: thin; }
.he-tbl-wrap::-webkit-scrollbar { height: 8px; }
.he-tbl-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }

.he-tbl-head,
.he-tbl-row { display: flex; align-items: center; padding: var(--space-3) var(--space-5); }
.he-tbl-head {
  padding-top: 11px; padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.he-tbl-row {
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
  transition: background var(--transition);
}
.he-tbl-row:last-child { border-bottom: none; }
.he-tbl-row:hover { background: var(--brand-tint); }
.he-tbl-row--static { cursor: default; }
.he-tbl-row--static:hover { background: transparent; }

.he-col, .he-cell { min-width: 0; padding-right: var(--space-2); }
.he-col--sort { cursor: pointer; user-select: none; }
.he-col--sort:hover { color: var(--brand); }
.he-col--sort:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ⚠ Sıralama oku — BOYUT ZORUNLU.
   Bu kural yazılmadığı için (2026-08-11) ok, boyutsuz + `fill` varsayılan (siyah)
   bir SVG olarak ekranı kaplayan DEV SİYAH ÜÇGEN şeklinde çizildi ve tablo başlığını
   dağıttı. `he-sort-ico` yalnız JS'te (ico(...,'he-sort-ico')) geçtiği için gözden
   kaçtı → bkz. tests/ikon-sinifi.test.mjs (artık CSS'siz ikon sınıfı testte kırılır). */
.he-sort-ico {
  width: 12px; height: 12px;
  flex: none;
  margin-left: var(--space-1);
  vertical-align: -1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Savunma: sütun başlığına giren HER svg sınırlı kalsın (yeni ikon eklenirse de). */
.he-col svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; }
.he-cell {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.he-cell--right, .he-col--right { text-align: right; }
.he-cell-sub { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; font-weight: 500; }
.he-cell-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  color: var(--navy);
  background: var(--navy-tint);
}
.he-tbl-empty { padding: var(--space-8) var(--space-5); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ── 8) Paneller — tablonun ALTINDA, yan yana, EŞİT yükseklik ── */
.he-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.he-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-5);
  align-items: stretch;      /* kabul kriteri 3: eşit yükseklik */
  min-width: 0;
}
.he-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}
.he-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.he-panel-title { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.he-panel-desc { font-size: 12.5px; color: var(--text-muted); line-height: var(--lh-base); }
.he-prow { display: flex; flex-direction: column; gap: var(--space-1) 6px; }
.he-prow-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.he-prow-k {
  font-size: 12.5px; color: var(--text-muted); font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.he-prow-v { font-size: var(--fs-sm); font-weight: 800; color: var(--text); flex: none; font-variant-numeric: tabular-nums; }
/* not + buton ALTA yapışır (kabul kriteri 3) */
.he-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: auto;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.45;
}
.he-note svg { width: 15px; height: 15px; margin-top: 1px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.he-panel-btn {
  margin-top: auto;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.he-panel-btn:hover { background: var(--brand-light); border-color: var(--brand-light); }
.he-panel .he-note + .he-panel-btn { margin-top: var(--space-1); }

/* ── Hareket drawer'ı (TÜM ekranlarda tek implementasyon) ─────── */
.he-dw-ov {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: flex; justify-content: flex-end;
}
.he-dw-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--text) 38%, transparent); }
.he-dw {
  position: relative;
  width: 460px; max-width: 92vw; height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  animation: heDwIn .22s cubic-bezier(.4, 0, .2, 1);
}
@keyframes heDwIn { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .he-dw { animation: none; } }

.he-dw-head {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-5) 22px var(--space-4);
  border-bottom: 1px solid var(--border);
}
.he-dw-kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.he-dw-title { font-size: 17px; font-weight: 800; color: var(--text); margin-top: 5px; line-height: 1.3; }
.he-dw-sub { font-size: 12.5px; color: var(--text-muted); margin-top: var(--space-1); }
.he-dw-x {
  flex: none; width: 32px; height: 32px;
  border-radius: 9px; border: none;
  background: var(--surface-alt); color: var(--text-muted);
  cursor: pointer; display: grid; place-items: center;
}
.he-dw-x:hover { background: var(--border); color: var(--text); }
.he-dw-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.he-dw-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--space-5) 22px;
  display: flex; flex-direction: column; gap: var(--space-4);
}
.he-dw-amt {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 13px;
  padding: var(--space-4) var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.he-dw-amt--in  { border-color: color-mix(in srgb, var(--green) 30%, transparent); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.he-dw-amt--out { border-color: color-mix(in srgb, var(--red) 28%, transparent);   background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.he-dw-amt-k { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.he-dw-amt-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: var(--space-1); font-variant-numeric: tabular-nums; color: var(--text); }
.he-dw-amt--in .he-dw-amt-v  { color: var(--green); }
.he-dw-amt--out .he-dw-amt-v { color: var(--red); }

.he-dw-sec { display: flex; flex-direction: column; gap: 11px; }
.he-dw-sec-t { font-size: var(--fs-xs); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.he-dw-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.he-dw-row:last-child { border-bottom: none; padding-bottom: 0; }
.he-dw-row-k { font-size: 12.5px; color: var(--text-muted); flex: none; }
.he-dw-row-v { font-size: var(--fs-sm); font-weight: 700; color: var(--text); text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }

.he-dw-link {
  display: flex; align-items: center; gap: 11px;
  padding: var(--space-3) 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-decoration: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.he-dw-link:hover { background: var(--brand-tint); border-color: var(--brand-tint); }
.he-dw-link-ico {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  background: var(--navy-tint); color: var(--navy);
}
.he-dw-link-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.he-dw-link-body { flex: 1; min-width: 0; }
.he-dw-link-t { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.he-dw-link-s { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.he-dw-link-arrow { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--text-faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.he-dw-note {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.55;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: var(--space-3) 14px;
}
.he-dw-foot {
  flex: none;
  display: flex; gap: var(--space-2);
  padding: var(--space-4) 22px;
  border-top: 1px solid var(--border);
}
.he-dw-foot .he-btn { flex: 1; justify-content: center; padding: 11px; font-size: 13.5px; font-weight: 700; }
.he-dw-foot .he-btn--primary { flex: 1.2; }
.he-dw-foot .he-btn--danger { border-color: color-mix(in srgb, var(--red) 30%, var(--border)); color: var(--red); }
.he-dw-foot .he-btn--danger:hover { background: var(--red-soft); border-color: var(--red); }

/* ── Dar ekran ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .he-head { align-items: flex-start; }
  .he-card-head { align-items: flex-start; }
  .he-search { min-width: 0; width: 100%; }
  .he-tbl-head, .he-tbl-row { padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* ══ Sıralama NOTU ══════════════════════════════════════════════════════════
   Aşağıdaki iki blok DOSYANIN SONUNDA durur. Sebep: hem `.he-cell-badge`
   (rozet hücresi) hem `.he-dw-row-v` (drawer satır değeri) kendi renk/zeminini
   tanımlar; ton (`.he-tag--*`) ve renk (`.he-c-*`) yardımcıları aynı
   özgüllükte olduğu için ancak SONRA gelirlerse kazanırlar.
   ⛔ Bu blokları yukarı taşıma — rozet tonları ve drawer renkleri sessizce ölür.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Ton modifiye edicileri (rozet · çip · etiket ortak) ────────────────── */
.he-tag--brand  { color: var(--brand-dark); background: var(--brand-tint); }
.he-tag--green  { color: var(--green); background: var(--green-soft); }
.he-tag--red    { color: var(--red);   background: var(--red-soft); }
.he-tag--blue   { color: var(--blue);  background: var(--blue-soft); }
.he-tag--yellow { color: var(--yellow); background: var(--yellow-soft); }
.he-tag--purple { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, var(--surface)); }

/* ── Renk yardımcıları (config'ten `color:'green'` gibi gelir) ─ */
.he-c-text   { color: var(--text); }
.he-c-muted  { color: var(--text-muted); }
.he-c-faint  { color: var(--text-faint); }
.he-c-brand  { color: var(--brand); }
.he-c-brandd { color: var(--brand-dark); }
.he-c-navy   { color: var(--navy); }
.he-c-green  { color: var(--green); }
.he-c-red    { color: var(--red); }
.he-c-blue   { color: var(--blue); }
.he-c-yellow { color: var(--yellow); }
.he-c-purple { color: var(--purple); }

/* ══════════════════════════════════════════════════════════════════════════
   KREDİ KARTLARI MERKEZİ (§4.4) — motorun ham HTML yuvalarına giren bölümler.
   Kart görselleri banka gradyanını taşır (tema tek kaynak: hesapEkran.cardTheme),
   bu yüzden İÇLERİNDE metin daima beyaz — token'a bağlanamaz, bilinçli istisna.
   ══════════════════════════════════════════════════════════════════════════ */

.hk { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.hk-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.hk-sec-t { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.hk-sec-n { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Kartlarım tablosu ──────────────────────────────────────────────────────
   Eskiden yatay kaydırmalı büyük kart görselleri (`hk-strip` / `hk-card`) vardı.
   15+ kartta aranan kartı bulmak için şeridi sürüklemek gerekiyordu; seçmek
   kullanışsızdı (kullanıcı bildirimi 2026-08-21). Yerine 4 sütunlu ızgara:
   sütun başına 5 satır → 20 kart TEK ekranda, yatay kaydırma YOK.
   Kart yüzü küçük bir künye olarak KALIR — kartı renginden/plastiğinden tanımak
   seçimin en hızlı yolu; künyede yazı olmadığı için perde de uygulanmaz
   (bkz. hesapEkran.cardFaceBg). */
.hk-ktab { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
@media (max-width: 1240px) { .hk-ktab { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px)  { .hk-ktab { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .hk-ktab { grid-template-columns: minmax(0, 1fr); } }

.hk-krow {
  display: flex; align-items: center; gap: var(--space-2);
  min-width: 0; width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.hk-krow:hover { border-color: var(--brand); box-shadow: 0 8px 18px -12px rgba(15, 23, 42, .45); transform: translateY(-1px); }
.hk-krow:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Durum şeridi: solda 3px iç gölge. Ayrı bir öğe değil ki satır yüksekliğini
   ve hizayı bozmasın (ızgarada tüm satırlar aynı yükseklikte kalmalı). */
.hk-krow--late { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); box-shadow: inset 3px 0 0 var(--red); }
.hk-krow--due  { border-color: color-mix(in srgb, var(--yellow) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--yellow); }
.hk-krow--warn { box-shadow: inset 3px 0 0 var(--brand); }
.hk-krow--iptalli { opacity: .62; }

/* Mini kart yüzü — gerçek kart görseli/gradyanı, 3:2'ye yakın plastik oranı. */
.hk-krow-face {
  flex: none; width: 44px; height: 29px;
  border-radius: 5px;
  box-shadow: 0 2px 6px -2px rgba(15, 23, 42, .55), inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.hk-krow-id { flex: 1 1 auto; min-width: 0; }
.hk-krow-ad {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hk-krow-alt {
  display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hk-krow-num { flex: none; text-align: right; min-width: 0; }
.hk-krow-v {
  display: block; font-size: 13px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  white-space: nowrap;
}
.hk-krow-num .hk-krow-alt { margin-top: 3px; }
.hk-krow-late  { color: var(--red); font-weight: 700; }
.hk-krow-today { color: var(--brand-dark); font-weight: 700; }

/* Limit doluluğu: satırın sağ kenarına dikey ince çubuk. Yatay çubuk satırı bir
   sıra daha uzatıyordu; dikey çubuk 20 satırlık ızgarayı kısa tutuyor. */
.hk-krow-lim { flex: none; width: 4px; height: 29px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; position: relative; }
.hk-krow-lim-f { position: absolute; left: 0; right: 0; bottom: 0; background: var(--brand); border-radius: var(--radius-full); }
.hk-krow-lim-f.is-warn { background: var(--yellow); }
.hk-krow-lim-f.is-full { background: var(--red); }

/* ── İki kolonlu alt ızgara (takvim | taksit + gecikme) ─────────────────── */
.hk-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.hk-col { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
@media (max-width: 1100px) { .hk-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Ödeme takvimi ──────────────────────────────────────────────────────── */
.hk-tl-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 13px var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; row-gap: var(--space-2);
}
.hk-tl-row:last-child { border-bottom: none; }
.hk-tl-row--late { background: var(--red-soft); }
.hk-tl-row--today { background: var(--brand-tint); }
/* Ekstresi kapanmış kart: satır kalır (vade ajandası) ama geri plana çekilir, "Öde" çıkmaz. */
.hk-tl-row--paid { background: color-mix(in srgb, var(--green) 5%, transparent); }
.hk-tl-row--paid .hk-tl-day,
.hk-tl-row--paid .hk-tl-card { color: var(--text-muted); }
.hk-tl-row--paid .hk-tl-amt { font-size: 13.5px; }
.hk-tl-date { width: 52px; flex: none; text-align: center; }
.hk-tl-day { font-size: 17px; font-weight: 800; line-height: 1.1; color: var(--text); }
.hk-tl-mon { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.hk-tl-spine { width: 3px; align-self: stretch; flex: none; border-radius: 3px; background: var(--border-strong); }
.hk-tl-spine--late { background: var(--red); }
.hk-tl-spine--soon { background: var(--brand); }
.hk-tl-spine--paid { background: var(--green); }
.hk-tl-body { flex: 1 1 190px; min-width: 0; }
.hk-tl-card { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hk-tl-det { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }
.hk-tl-right { flex: 0 1 auto; display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.hk-tl-amt { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.hk-tl-min { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Gelecek taksit grafiği ─────────────────────────────────────────────── */
.hk-bars { display: flex; align-items: flex-end; gap: var(--space-2); height: 132px; margin-top: var(--space-4); }
.hk-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.hk-bar-m { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.hk-bar { width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 4px 4px; background: var(--navy-tint); min-height: 3px; }
.hk-bar--on { background: linear-gradient(180deg, var(--brand-light), var(--brand)); }
.hk-bar-v { font-size: 10.5px; font-weight: 700; color: var(--text-faint); }

/* ── Gecikme & faiz kutusu ──────────────────────────────────────────────── */
.hk-late {
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  background: color-mix(in srgb, var(--red) 6%, var(--surface));
  border-radius: 12px;
  padding: var(--space-3) 15px;
  display: flex; flex-direction: column; gap: 11px;
}
.hk-late-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hk-late-name { font-size: 13.5px; font-weight: 800; color: var(--text); }
.hk-late-gun { font-size: var(--fs-xs); font-weight: 800; color: var(--red); }
.hk-late-sep { height: 1px; background: color-mix(in srgb, var(--red) 25%, transparent); }
.hk-late-note { font-size: 11.5px; color: var(--text-muted); line-height: var(--lh-base); }
.hk-late-acts { display: flex; gap: var(--space-2); }
.hk-late-acts .he-btn { flex: 1; justify-content: center; }
.hk-limit {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-3) 14px;
  border: 1px solid var(--brand-tint); background: var(--brand-tint);
  border-radius: 12px;
}
.hk-limit-t { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-dark); }
.hk-limit-s { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ── Kategorisiz harcamalar ─────────────────────────────────────────────── */
.hk-uncat { display: flex; flex-direction: column; }
/* KPI'dan gelindiğinde bölüm bir kez parlar (nereye indiğin belli olsun). */
.hk-flash { animation: hkFlash 1.6s ease-out 1; border-radius: var(--radius-lg); }
@keyframes hkFlash {
  0%   { box-shadow: 0 0 0 3px var(--brand); }
  60%  { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) { .hk-flash { animation: none; } }

/* Seçim çubuğu listenin ALTINDA yapışkan: uzun listede aşağı inerken kategori
   seçicisi ekranda kalır, bölümden çıkınca kendiliğinden gider.
   ⛔ .he-card içine konulamaz — kartta `overflow:hidden` var, sticky ölür. */
.hk-selbar-wrap { position: sticky; bottom: var(--space-3); z-index: 5; }
.hk-selbar-wrap:empty { display: none; }
.hk-selbar {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-3);
  padding: 12px var(--space-4);
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 13px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
/* Listeden düşen kayıtların açıklaması (atıflı harcamalar · gider olmayan kayıtlar). */
.hk-dusen {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45;
}
.hk-dusen svg { width: 15px; height: 15px; margin-top: 1px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hk-selbar-t { font-size: var(--fs-sm); font-weight: 800; color: var(--brand-dark); white-space: nowrap; }
.hk-selbar-sel { flex: 1; min-width: 200px; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.hk-selbar select {
  min-width: 170px;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px;
  font-family: inherit; font-size: var(--fs-sm);
  color: var(--text); background: var(--surface); cursor: pointer;
}
.hk-done {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--green-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  font-size: var(--fs-sm); font-weight: 700; color: var(--green);
}
.hk-done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hk-box {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: #fff;
}
.hk-box--on { border-color: var(--brand); background: var(--brand); }
.hk-box svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.hk-box--on svg { opacity: 1; }
.he-tbl-row--sel { background: var(--brand-tint); }

/* ══════════════════════════════════════════════════════════════════════════
   KART EKLE / DÜZENLE EKRANI (§4.7) — sol form, sağ canlı önizleme.
   Kart görseli kart detayının `.kcd-card` sınıflarını yeniden kullanır
   (tek görsel dil; gradyan tek kaynaktan: hesapEkran.cardTheme).
   ══════════════════════════════════════════════════════════════════════════ */
.kf { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; }
.kf-col, .kf-side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.kf-side { position: sticky; top: var(--space-4); }
@media (max-width: 1080px) {
  .kf { grid-template-columns: minmax(0, 1fr); }
  .kf-side { position: static; order: -1; }
}

.kf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3) var(--space-4); }
.kf-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kf-fld--full { grid-column: 1 / -1; }
.kf-lbl { font-size: 12.5px; font-weight: 700; color: var(--text); }
.kf-req { color: var(--brand); }
.kf-kayitli {
  font-weight: 500; font-size: var(--fs-xs); color: var(--text-faint);
  background: var(--surface-alt); border-radius: var(--radius-full); padding: 2px 8px; margin-left: 6px;
}
.kf-hint { font-size: var(--fs-xs); color: var(--text-muted); }
.kf-in {
  width: 100%; min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: inherit; font-size: var(--fs-sm);
  color: var(--text); background: var(--surface);
}
.kf-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
select.kf-in { cursor: pointer; }

.kf-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 9px; }
.kf-seg-b {
  border: none; background: transparent; border-radius: 7px;
  padding: 8px 13px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.kf-seg-b.is-active { background: var(--brand); color: #fff; }

.kf-ek { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.kf-exp { display: flex; align-items: center; gap: 6px; }
.kf-exp .kf-in { text-align: center; }
.kf-exp-sep { color: var(--text-faint); font-weight: 700; }
.kf-cvv { display: flex; align-items: center; gap: 6px; }
.kf-cvv-b {
  flex: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 9px; padding: 10px 12px;
  font-family: inherit; font-size: var(--fs-xs); font-weight: 700;
  color: var(--navy); cursor: pointer;
}
.kf-cvv-b:hover { background: var(--surface-alt); }

/* Ortak limit anahtarı */
.kf-switch {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; text-align: left;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; padding: var(--space-3) 14px;
  font-family: inherit; cursor: pointer;
}
.kf-switch.is-on { border-color: var(--brand); background: var(--brand-tint); }
.kf-switch-body { flex: 1; min-width: 0; }
.kf-switch-t { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.kf-switch-s { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.kf-track { flex: none; width: 40px; height: 22px; border-radius: var(--radius-full); background: var(--border-strong); position: relative; transition: background var(--transition); }
.kf-switch.is-on .kf-track { background: var(--brand); }
.kf-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(39, 34, 83, .3); transition: left var(--transition); }
.kf-switch.is-on .kf-knob { left: 21px; }

.kf-pool { border: 1px solid var(--border); background: var(--surface-alt); border-radius: 12px; padding: var(--space-3) 14px; display: flex; flex-direction: column; gap: var(--space-2); }
.kf-pool-t { font-size: 12.5px; font-weight: 700; color: var(--text); }
.kf-pool-rows { display: flex; flex-direction: column; gap: 6px; padding-top: var(--space-2); border-top: 1px solid var(--border); }
.kf-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.kf-acc {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; border: none; background: none; padding: 0; cursor: pointer; font-family: inherit;
}
.kf-acc-i { font-size: var(--fs-lg); font-weight: 800; color: var(--text-muted); line-height: 1; }

/* Sağ kolon: önizleme + kaydet */
.kf-prev { width: 100%; }
.kf-save { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.kf-save .he-btn { justify-content: center; padding: 12px; }
.kf-ready { font-size: var(--fs-xs); text-align: center; color: var(--text-muted); }
.kf-ready.is-ok { color: var(--green); font-weight: 700; }
