/**
 * app.css — Gelir-Gider Defteri üye arayüzü + tanıtım giydirmesi.
 *
 * Kurallar:
 *  - Tüm arayüz stilleri .dft sınıfı kapsamındadır; başka sayfaya sızmaz.
 *    Panel sekmeleri (manifest panel.views) her görünümü ayrı bir kaba
 *    koyduğu için kapsam id değil sınıftır: her görünüm köküne .dft verilir.
 *  - Tanıtım (promo) sayfası .dft taşımadığı için yalnızca
 *    `.dft-mock*` yardımcıları kapsam dışındadır (bu dosya yalnızca bu
 *    uygulamanın sayfalarında yüklenir).
 *  - Renkler panelin verdiği --brand ile uyumludur; gelir/gider renkleri
 *    tema değişkenlerinden (--green, --red) türetilir.
 *  - Mobil önce: temel tek kolon, 720px üzerinde ızgara düzenleri açılır.
 */

/* -------------------------------------------------------------------------
 |  Kapsam ve yerel değişkenler
 * ------------------------------------------------------------------------- */

.dft {
  display: block;
  --dft-income: var(--green, #6bd59b);
  --dft-expense: var(--red, #ef6c72);
  --dft-line: var(--line, rgba(255, 255, 255, .1));
  --dft-panel: var(--panel, #181d28);
  --dft-panel-2: var(--panel-2, #1f2531);
  --dft-muted: var(--muted, #8e97a6);
  --dft-text: var(--text, #f3f5f9);
  --dft-radius: 14px;
}

.dft *,
.dft *::before,
.dft *::after {
  box-sizing: border-box;
}

.dft :focus-visible {
  outline: 2px solid var(--brand, var(--accent, #efa448));
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 |  Başlık
 * ------------------------------------------------------------------------- */

.dft-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.dft-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand, var(--accent, #efa448));
}

.dft-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.dft-lead {
  margin: 0;
  max-width: 64ch;
  font-size: 14px;
  line-height: 1.7;
  color: var(--dft-muted);
}

.dft-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------------------------------------------------------------
 |  Özet kartları + kullanım çubuğu
 * ------------------------------------------------------------------------- */

.dft-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.dft-card {
  position: relative;
  padding: 15px 16px 16px;
  border: 1px solid var(--dft-line);
  border-radius: var(--dft-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 60%), var(--dft-panel);
  overflow: hidden;
}

.dft-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--dft-line-strong, rgba(255, 255, 255, .18));
}

.dft-card--income::before { background: var(--dft-income); }
.dft-card--expense::before { background: var(--dft-expense); }
.dft-card--net::before { background: var(--brand, var(--accent, #efa448)); }

.dft-card-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dft-muted);
}

.dft-card-value {
  display: block;
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.dft-card--income .dft-card-value { color: #a9e7c5; }
.dft-card--expense .dft-card-value { color: #f3b3b6; }
.dft-card-value.is-negative { color: #f3b3b6 !important; }

.dft-usage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}

.dft-usage-text {
  font-size: 12.5px;
  color: var(--dft-muted);
}

.dft-usage-text b {
  color: var(--dft-text);
  font-variant-numeric: tabular-nums;
}

.dft-usage-bar {
  position: relative;
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}

.dft-usage-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--brand, var(--accent, #efa448));
  transition: width .35s ease;
}

/* -------------------------------------------------------------------------
 |  Paneller
 * ------------------------------------------------------------------------- */

.dft-panel {
  margin-bottom: 20px;
  padding: 18px 16px;
  border: 1px solid var(--dft-line);
  border-radius: var(--dft-radius);
  background: var(--dft-panel);
}

.dft .dft-panel[hidden] {
  display: none;
}

.dft-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.dft-panel-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
}

.dft-panel-head .dft-panel-title {
  margin-bottom: 0;
}

.dft-muted {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dft-muted);
}

.dft-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dft-muted);
}

/* -------------------------------------------------------------------------
 |  Filtreler
 * ------------------------------------------------------------------------- */

.dft-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.dft-chip {
  padding: 7px 13px;
  border: 1px solid var(--dft-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--dft-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.dft-chip:hover {
  color: var(--dft-text);
  border-color: rgba(255, 255, 255, .24);
}

.dft-chip.is-active {
  color: var(--brand, var(--accent, #efa448));
  border-color: color-mix(in srgb, var(--brand, #efa448) 45%, transparent);
  background: color-mix(in srgb, var(--brand, #efa448) 12%, transparent);
}

.dft-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dft-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dft-field > span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--dft-muted);
}

.dft .dft-field input,
.dft .dft-field select,
.dft .dft-field textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--dft-line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .22);
  color: var(--dft-text);
  font-size: 13.5px;
  line-height: 1.4;
}

.dft .dft-field input::placeholder,
.dft .dft-field textarea::placeholder {
  color: var(--muted-2, #636c79);
}

.dft .dft-field input[type="color"] {
  padding: 4px;
  height: 40px;
  cursor: pointer;
}

.dft .dft-field textarea {
  resize: vertical;
}

/* -------------------------------------------------------------------------
 |  Kayıt formu
 * ------------------------------------------------------------------------- */

.dft-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin-top: 14px;
}

.dft-kind-toggle {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.dft-kind {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dft-kind input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dft-kind span {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--dft-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  color: var(--dft-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.dft-kind input:checked + span {
  color: var(--dft-text);
  border-color: color-mix(in srgb, var(--brand, #efa448) 50%, transparent);
  background: color-mix(in srgb, var(--brand, #efa448) 12%, transparent);
}

.dft-kind input:focus-visible + span {
  outline: 2px solid var(--brand, var(--accent, #efa448));
  outline-offset: 2px;
}

.dft-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
}

/* -------------------------------------------------------------------------
 |  Kayıt listesi
 * ------------------------------------------------------------------------- */

.dft-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dft-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "badge main amount"
    "actions actions actions";
  align-items: center;
  gap: 10px 12px;
  padding: 12px 13px;
  border: 1px solid var(--dft-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}

.dft-item--income { box-shadow: inset 3px 0 0 var(--dft-income); }
.dft-item--expense { box-shadow: inset 3px 0 0 var(--dft-expense); }

.dft-badge {
  grid-area: badge;
  align-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dft-item--income .dft-badge {
  color: #a9e7c5;
  border: 1px solid rgba(107, 213, 155, .35);
  background: rgba(107, 213, 155, .1);
}

.dft-item--expense .dft-badge {
  color: #f3b3b6;
  border: 1px solid rgba(239, 108, 114, .35);
  background: rgba(239, 108, 114, .1);
}

.dft-item-main {
  grid-area: main;
  min-width: 0;
}

.dft-item-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
}

.dft-item-cat {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--dft-text);
  overflow-wrap: anywhere;
}

.dft-item-cat.has-color::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 3px;
  background: var(--cat-color, var(--dft-muted));
}

.dft-item-date {
  font-size: 12px;
  color: var(--dft-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dft-item-note {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dft-muted);
  overflow-wrap: anywhere;
}

.dft-item-amount {
  grid-area: amount;
  justify-self: end;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dft-item--income .dft-item-amount { color: #a9e7c5; }
.dft-item--expense .dft-item-amount { color: #f3b3b6; }

.dft-item-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dft-empty {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px dashed var(--dft-line);
  border-radius: 12px;
  color: var(--dft-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.dft .dft-empty[hidden] {
  display: none;
}

.dft-more {
  margin-top: 14px;
  text-align: center;
}

.dft .dft-more [hidden] {
  display: none;
}

/* -------------------------------------------------------------------------
 |  Küçük düğmeler (liste ve kategori satırları)
 * ------------------------------------------------------------------------- */

.dft-mini {
  padding: 5px 11px;
  border: 1px solid var(--dft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--dft-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.dft-mini:hover {
  color: var(--dft-text);
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .06);
}

.dft-mini--danger:hover {
  color: #f7c3c5;
  border-color: rgba(239, 108, 114, .5);
  background: rgba(239, 108, 114, .12);
}

/* -------------------------------------------------------------------------
 |  Kategori kırılımı çubukları
 * ------------------------------------------------------------------------- */

.dft-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.dft-bars-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label net"
    "track track";
  align-items: center;
  gap: 5px 10px;
}

.dft-bars-label {
  grid-area: label;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dft-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dft-bars-net {
  grid-area: net;
  font-size: 12.5px;
  color: var(--dft-muted);
  font-variant-numeric: tabular-nums;
}

.dft-bars-track {
  grid-area: track;
  display: flex;
  gap: 3px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.dft-bars-bar {
  flex: none;
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}

.dft-bars-bar--expense { background: var(--dft-expense); }
.dft-bars-bar--income { background: var(--dft-income); }

/* -------------------------------------------------------------------------
 |  Kategori yönetimi
 * ------------------------------------------------------------------------- */

.dft-cat-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 16px;
}

/* Modal kartı dar olduğu için kategori formu tek kolonda kalır. */
.dft-cat-form--modal {
  grid-template-columns: 1fr;
  margin: 0;
}

.dft-cat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.dft-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dft-cat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--dft-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .02);
}

.dft-cat-item.is-archived {
  opacity: .62;
}

.dft-cat-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--dft-muted);
}

.dft-cat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.dft-cat-copy strong {
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.dft-cat-copy small {
  font-size: 11.5px;
  color: var(--dft-muted);
}

.dft-cat-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: none;
}

.dft-cat-empty {
  padding: 14px;
  border: 1px dashed var(--dft-line);
  border-radius: 11px;
  color: var(--dft-muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* -------------------------------------------------------------------------
 |  Meşgul durumu
 * ------------------------------------------------------------------------- */

.dft.is-busy {
  cursor: progress;
}

.dft.is-busy .dft-panel,
.dft.is-busy .dft-summary {
  opacity: .82;
  transition: opacity .2s ease;
}

/* -------------------------------------------------------------------------
 |  Tanıtım sayfası: örnek görünüm panelleri (kapsam dışı yardımcılar)
 * ------------------------------------------------------------------------- */

.dft-mock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 8px;
}

.dft-mock {
  padding: 16px;
  border: 1px solid var(--line, rgba(255, 255, 255, .1));
  border-radius: 14px;
  background: var(--panel, #181d28);
}

.dft-mock figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted, #8e97a6);
}

.dft-mock svg {
  display: block;
  width: 100%;
  height: auto;
}

/* -------------------------------------------------------------------------
 |  Duyarlı düzen
 * ------------------------------------------------------------------------- */

@media (min-width: 720px) {
  .dft-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }

  .dft-head-actions {
    flex: none;
  }

  .dft-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dft-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dft-field--wide {
    grid-column: 1 / -1;
  }

  .dft-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dft-cat-form {
    grid-template-columns: 150px minmax(0, 1fr) 90px auto;
    align-items: end;
  }

  .dft-item {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "badge main amount actions";
    align-items: center;
  }

  .dft-item-actions {
    opacity: .35;
    transition: opacity .18s ease;
  }

  .dft-item:hover .dft-item-actions,
  .dft-item:focus-within .dft-item-actions {
    opacity: 1;
  }

  .dft-bars-row {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto;
    grid-template-areas: "label track net";
  }

  .dft-mock-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dft-filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dft-field--wide {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dft *,
  .dft *::before,
  .dft *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* --- Dokunmatik hedef boyutu (AS-10 / maddeler 117, 82) ------------------ */
/* Defter mobil dokunmatikte filtre çipleri ve form alanları en az 44px
   dokunma alanı sunar; masaüstünde görünür ölçüler değişmez. */
@media (pointer:coarse) {
  .dft-chip {
    min-height: 44px;
  }
  .dft .dft-field input,
  .dft .dft-field select {
    min-height: 44px;
  }
}

/* -------------------------------------------------------------------------
 |  Tanıtım sayfası: TS-4 "Defter yaprağı" (TASARIM-SICILI.md)
 |
 |  Tezgâh sonrası serbest alan defter yaprağına döner: her satır yatay bir
 |  cetvel çizgisinin üstünde durur, solda tek dikey kenar çizgisi vardır,
 |  rakamlar sağa yaslıdır ve kapanış muhasebe geleneğindeki gibi çift
 |  çizgiyle yapılır. Görsel kullanılmaz; motif çizgi + rakam + kategori
 |  noktasıdır. `.ldg*` yalnız bu uygulamanın tanıtım sayfasında basılır.
 * ------------------------------------------------------------------------- */

.ldg {
  position: relative;
  padding-left: 34px;
}

/* Kenar çizgisi: yaprağın sol hattı (marka tonunda, ince). */
.ldg::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(98, 211, 148, .28);
}

.ldg-row,
.ldg-sub,
.ldg-grand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* Satır: cetvel çizgisi hücrenin alt kenarıdır. */
.ldg-row {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.ldg-date {
  flex: none;
  width: 52px;
  font-size: 12px;
  color: var(--muted, #8e97a6);
  font-variant-numeric: tabular-nums;
}

.ldg-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

/* Kategori noktası: rengi kategoriden gelir; gelir/gider anlamı tutarda. */
.ldg-dot {
  flex: none;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, #8e97a6);
  transform: translateY(-.5px);
}

.ldg-cat {
  font-size: 13.5px;
  color: var(--text, #f3f5f9);
}

.ldg-note {
  font-size: 12px;
  color: var(--muted, #8e97a6);
}

.ldg-note::before {
  content: "·";
  margin-right: 8px;
  opacity: .6;
}

/* Tutar: muhasebe dizimi — sağa yaslı, eş genişlikli rakam. */
.ldg-amount {
  flex: none;
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text, #f3f5f9);
}

.ldg-amount.is-income {
  color: #a9e7c5;
}

.ldg-amount.is-expense {
  color: #f3b3b6;
}

/* Ara toplamlar: ince ayraç; genel toplam (net) çift çizgiyle kapanır. */
.ldg-sub {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 12.5px;
  color: var(--muted, #8e97a6);
}

.ldg-sub .ldg-amount {
  font-size: 13px;
}

.ldg-grand {
  margin-top: 6px;
  padding: 12px 0 4px;
  border-top: 3px double rgba(255, 255, 255, .28);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text, #f3f5f9);
}

.ldg-grand .ldg-amount {
  font-size: 15px;
  font-weight: 700;
  color: #eaf6ef;
}

/* --- Kayıt anatomisi: tek satırın beş alanı; etiketler çentikte --------- */

.ldg-anatomy {
  display: grid;
  grid-template-columns: auto auto 1fr 1fr auto;
  gap: 14px 20px;
  padding: 16px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.ldg-acell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ldg-acell--amount {
  text-align: right;
}

.ldg-acell--amount .ldg-akey::before {
  left: auto;
  right: 0;
}

.ldg-aval {
  font-size: 14.5px;
  color: var(--text, #f3f5f9);
}

.ldg-aval--note {
  color: var(--muted, #8e97a6);
}

.ldg-aval .ldg-amount {
  font-size: 14.5px;
}

.ldg-akey {
  position: relative;
  margin-top: 14px;
  padding-top: 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted, #8e97a6);
}

/* Etiket çentiği: satır çizgisinden etikete inen kısa düşey işaret. */
.ldg-akey::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, .3);
}

.ldg-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.ldg-badge.is-expense {
  background: rgba(239, 108, 114, .14);
  color: #f3b3b6;
  box-shadow: inset 0 0 0 1px rgba(239, 108, 114, .35);
}

.ldg-badge.is-income {
  background: rgba(107, 213, 155, .14);
  color: #a9e7c5;
  box-shadow: inset 0 0 0 1px rgba(107, 213, 155, .35);
}

/* --- Adımlar: yevmiye numaralı defter satırları -------------------------- */

.ldg-cap {
  margin: 26px 0 4px;
  font-size: 12.5px;
  color: var(--muted, #8e97a6);
}

.ldg-steps {
  margin: 0;
  list-style: none;
  counter-reset: ldg-step;
}

.ldg-steps li {
  counter-increment: ldg-step;
  position: relative;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text, #f3f5f9);
}

/* Yevmiye numarası: kenar çizgisinin solunda, sağa yaslı. */
.ldg-steps li::before {
  content: counter(ldg-step);
  position: absolute;
  left: -36px;
  top: 11px;
  width: 18px;
  text-align: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #8e97a6);
}

/* --- Ay kapanışı: filtre çipleri + satır alıntısı + cetvel --------------- */

.ldg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
}

/* Örnek filtre çipleri: işlevsiz anlatım öğesi (etkileşimli kontrol değil). */
.ldg-chip {
  padding: 4px 11px;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted, #8e97a6);
}

.ldg-chip--csv {
  margin-left: auto;
  border-style: solid;
  border-color: rgba(98, 211, 148, .45);
  color: #a9e7c5;
}

.ldg-close-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* Kategori cetveli: pay, satırın cetvel çizgisi üstünde renkli kesimdir. */
.ldg-ruler-title {
  margin: 2px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #f3f5f9);
}

.ldg-rline {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.ldg-share {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: var(--w, 50%);
  border-radius: 2px;
  background: var(--dot, #8e97a6);
}

.ldg-ruler-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted, #8e97a6);
}

/* --- Senaryo yaprakları: persona başına mini defter alıntısı ------------- */

.ldg-leaves {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.ldg-leaf-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #f3f5f9);
}

/* Mini yaprağın kenar çizgisi persona tonuna döner. */
.ldg-leaf .ldg--mini::before {
  background: var(--leaf-hue, rgba(98, 211, 148, .28));
  opacity: .55;
}

.ldg--mini .ldg-grand {
  padding: 10px 0 2px;
  font-size: 12.5px;
}

.ldg--mini .ldg-grand .ldg-amount {
  font-size: 14px;
}

.ldg-leaf-text {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted, #8e97a6);
}

/* --- TS-4 duyarlı --------------------------------------------------------- */

@media (max-width: 639px) {
  /* Anatomi dar ekranda iki kolona düşer; tutar hücresi sola döner. */
  .ldg-anatomy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ldg-acell--amount {
    text-align: left;
  }

  .ldg-acell--amount .ldg-akey::before {
    left: 0;
    right: auto;
  }
}

@media (min-width: 720px) {
  .ldg {
    padding-left: 44px;
  }

  .ldg::before {
    left: 26px;
  }

  .ldg-steps li::before {
    left: -42px;
    width: 20px;
  }
}

@media (min-width: 900px) {
  .ldg-close-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
  }

  .ldg-leaves {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }
}