/* ============================================================
   Page: giderler — "Masraf Kontrol"
   Adaptif KPI şeridi + sabit gider banner/yönetim + ödeme rozetleri
   + satır detay modalı + fiş görseli. cek_senet/.sum-card görünüm dili.
   ============================================================ */

/* ── KPI şeridi (adaptif auto-fit — yetkiye/ekrana göre kendini kurar, CLAUDE §8) ── */
.gd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.gd-kpi {
  display: flex; align-items: stretch; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--space-3) var(--space-4);
}
.gd-kpi-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0; align-self: center; display: grid; place-items: center; }
.gd-kpi-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gd-kpi-icon.bg-green  { background: var(--green-soft); color: var(--green); }
.gd-kpi-icon.bg-red    { background: var(--red-soft);   color: var(--red); }
.gd-kpi-icon.bg-blue   { background: var(--blue-soft);  color: var(--blue); }
.gd-kpi-icon.bg-orange { background: rgba(200, 82, 30, .12); color: var(--brand); }
.gd-kpi-info { flex: 1; min-width: 0; }
.gd-kpi-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.gd-kpi-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text-muted); padding-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-kpi-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-top: 2px; }
.gd-kpi-delta { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.gd-kpi-delta.is-bad { color: var(--red); }
.gd-kpi-delta.is-good { color: var(--green); }
.gd-kpi-delta-sub { font-weight: 600; color: var(--text-muted); }

/* ── Sabit gider banner ── */
.gd-rec-bar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px var(--space-4);
  margin-bottom: var(--space-4); background: var(--surface); box-shadow: var(--shadow-sm);
}
.gd-rec-bar.is-due { background: rgba(243, 156, 18, .08); border-color: rgba(243, 156, 18, .4); }
.gd-rec-bar.is-clear { background: var(--surface-alt); }
.gd-rec-ico { display: inline-flex; color: var(--brand); }
.gd-rec-bar.is-clear .gd-rec-ico { color: var(--green); }
.gd-rec-ico svg { width: 18px; height: 18px; }
.gd-rec-txt { font-size: var(--fs-sm); font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.gd-rec-txt b { font-weight: 800; color: var(--navy); }
.gd-rec-overdue { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: var(--radius-full); background: var(--red-soft); color: var(--red); margin-left: 4px; }
.gd-rec-manage { white-space: nowrap; }

/* ── Ödeme rozeti ── */
.gd-pk { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-full); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.gd-pk svg { width: 12px; height: 12px; }
.gd-pk.pk-cash { background: rgba(39, 174, 96, .14); color: var(--green); }
.gd-pk.pk-bank { background: rgba(53, 122, 189, .12); color: var(--blue); }
.gd-pk.pk-card { background: rgba(155, 89, 182, .14); color: var(--purple); }
.gd-pk.pk-auto { background: rgba(243, 156, 18, .14); color: var(--yellow); }
.gd-pk.pk-none { background: rgba(127, 140, 141, .16); color: var(--text-muted); }
.gd-taksit-hint { font-size: 11px; color: var(--text-soft, #7a8290); margin-top: 4px; }

/* Kilit chip (otomatik POS satırı) */
.gd-lock-chip { display: inline-flex; vertical-align: middle; color: var(--text-muted); }
.gd-lock-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ── Detay modalı ── */
.gd-d-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.gd-d-title { font-weight: 800; color: var(--navy); font-size: var(--fs-md); }
.gd-d-amt { font-weight: 800; color: var(--brand); font-size: var(--fs-lg); white-space: nowrap; }
.gd-d-rows { display: flex; flex-direction: column; gap: 2px; }
.gd-d-row { display: flex; gap: var(--space-3); align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.gd-d-row:last-child { border-bottom: 0; }
.gd-d-k { flex: 0 0 34%; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.gd-d-v { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text); font-weight: 600; word-break: break-word; }
.gd-d-fis { margin-top: var(--space-3); }
.gd-d-fis img { max-width: 100%; max-height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.gd-d-locknote { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.gd-d-locknote svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.gd-del:hover { color: var(--red); }

/* ── Form: kategori grup→alt iki sütun + fiş seçici ── */
.gd-catrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.gd-catcol { display: flex; flex-direction: column; }
.gd-fis-pick { display: flex; flex-direction: column; gap: var(--space-2); }
.gd-fis-input { font-size: var(--fs-sm); }
.gd-fis-prev { display: flex; align-items: flex-start; gap: var(--space-3); }
.gd-fis-thumb { max-width: 120px; max-height: 120px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ── Sabit gider yönetim listesi ── */
.gd-rec-list { display: flex; flex-direction: column; gap: var(--space-2); }
.gd-rec-item { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.gd-rec-item.is-paused { opacity: .62; }
.gd-rec-main { flex: 1; min-width: 0; }
.gd-rec-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.gd-rec-meta { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.gd-rec-amt { font-weight: 800; color: var(--navy); white-space: nowrap; }
.gd-rec-acts { display: flex; gap: 4px; flex-shrink: 0; }
.gd-rec-tag { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-full); }
.gd-rec-tag.due { background: rgba(243, 156, 18, .16); color: var(--yellow); }
.gd-rec-tag.over { background: var(--red-soft); color: var(--red); }
.gd-rec-tag.paused { background: var(--surface-alt); color: var(--text-muted); }
.gd-rec-empty { padding: var(--space-6); text-align: center; color: var(--text-muted); font-weight: 700; font-size: var(--fs-sm); }

/* Mobil: kategori iki sütun → tek sütun */
@media (max-width: 560px) {
  .gd-catrow { grid-template-columns: 1fr; }
}
