/* ============================================================
   Page: cek_senet — çek/senet portföyü (legacy ag-dekor ile bire-bir
   görünüm). Stat kartları + toolbar + sayaçlı sekmeler + zengin tablo
   + vade vurgusu + durum/tür rozetleri + satır iş-akışı butonları.
   ============================================================ */

/* Stat kartları — satışlar (.sum-card) görünümüyle aynı: soft zeminli ikon,
   başlık altı ince çizgi, değer çizginin altında */
/* Üst özet — ADAPTİF (auto-fit): kart sayısına/ekran genişliğine göre kendini kurar.
   min 150px → mobilde 2'li, tablette 3-4'lü, geniş ekranda kartlar genişler (CLAUDE §8). */
.cs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.cs-stat-card {
  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);
}
.cs-stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0; align-self: center;
  display: grid; place-items: center;
}
.cs-stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cs-stat-icon.bg-green  { background: var(--green-soft); color: var(--green); }
.cs-stat-icon.bg-red    { background: var(--red-soft);   color: var(--red); }
.cs-stat-icon.bg-blue   { background: var(--blue-soft);  color: var(--blue); }
.cs-stat-icon.bg-orange { background: rgba(200, 82, 30, .12); color: var(--brand); }
.cs-stat-info { flex: 1; min-width: 0; }
.cs-stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.cs-stat-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text-muted); padding-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-stat-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-top: 2px; }

/* Toolbar */
.cs-toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.cs-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px var(--space-3);
  flex: 1; min-width: 220px; max-width: 380px;
}
.cs-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 82, 30, .15); }
.cs-search svg { width: 16px; height: 16px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.cs-search input { border: none; outline: none; background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text); width: 100%; }
.cs-tur-filter { max-width: 160px; }
.cs-toolbar .cs-add { margin-left: auto; white-space: nowrap; }

/* Sekmeler */
/* Sekme stili = Hesaplar (dolgulu segment: aktif koyu zemin + beyaz, pasif açık) */
.cs-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.cs-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px var(--space-3); cursor: pointer; font: inherit;
  background: var(--navy-tint); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.cs-tab:hover { background: var(--border-strong); border-color: var(--navy-light); }
.cs-tab--active, .cs-tab--active:hover { background: var(--text); border-color: var(--text); color: #fff; }
.cs-tab-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: 11px; font-weight: 700;
}
.cs-tab--active .cs-tab-count { background: rgba(255, 255, 255, .22); color: #fff; border-color: transparent; }

/* Tablo */
.cs-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; }
.cs-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.cs-table thead th { text-align: left; padding: 12px 14px; font-weight: 800; color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cs-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.cs-table tbody tr:last-child td { border-bottom: none; }
.cs-table tbody tr:hover { background: var(--row-hover); }
.cs-num { text-align: right; font-weight: 800; color: var(--navy); white-space: nowrap; }
.cs-sub { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.cs-ciro-line { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; margin-top: 3px; }

/* Vade vurgusu */
.vade-gecti { color: var(--red); font-weight: 800; }
.vade-yakin { color: var(--yellow); font-weight: 800; }

/* Tür rozeti */
.cs-tur-badge { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-sm); white-space: nowrap; }
.cs-tur-badge.cek   { background: rgba(53, 122, 189, .12); color: var(--blue); }
.cs-tur-badge.senet { background: rgba(155, 89, 182, .14); color: var(--purple); }

/* Durum rozeti */
.cs-status { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-full); white-space: nowrap; }
.cs-status.st-portfoy { background: rgba(53, 122, 189, .12); color: var(--blue); }
.cs-status.st-banka   { background: rgba(243, 156, 18, .14); color: var(--yellow); }
.cs-status.st-ok      { background: rgba(39, 174, 96, .14); color: var(--green); }
.cs-status.st-bad     { background: rgba(231, 76, 60, .14); color: var(--red); }
.cs-status.st-ciro    { background: rgba(155, 89, 182, .14); color: var(--purple); }
.cs-status.st-iptal   { background: rgba(127, 140, 141, .16); color: var(--text-muted); }

/* Satır iş-akışı butonları (Adım 4) */
.cs-actions { white-space: nowrap; }
.cs-act {
  width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 4px; transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.cs-act svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-act:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.cs-act.ok:hover  { background: var(--green); border-color: var(--green); }
.cs-act.bad:hover { background: var(--red); border-color: var(--red); }
.cs-act.del:hover { background: var(--red); border-color: var(--red); }

/* Satır/kart tıklanabilir (detay modalı) */
.is-clickable { cursor: pointer; }

/* ── Detay modalı (salt-okunur) ───────────────────────────────── */
.cs-d-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.cs-d-title { font-weight: 800; color: var(--navy); font-size: var(--fs-md); }
.cs-d-rows { display: flex; flex-direction: column; gap: 2px; }
.cs-d-row { display: flex; gap: var(--space-3); align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.cs-d-row:last-child { border-bottom: 0; }
.cs-d-k { flex: 0 0 38%; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.cs-d-v { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text); font-weight: 600; word-break: break-word; }
.cs-d-v .fx-try { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-top: 1px; }
.cs-d-hist { margin-top: var(--space-4); }
.cs-d-hist-title { font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: var(--space-2); }
.cs-d-hist-item { display: flex; gap: var(--space-3); padding-bottom: var(--space-3); position: relative; }
.cs-d-hist-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.cs-d-hist-dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: var(--radius-full); margin-top: 2px; background: var(--text-muted); position: relative; z-index: 1; }
.cs-d-hist-dot.st-portfoy { background: var(--blue); }
.cs-d-hist-dot.st-banka { background: var(--yellow); }
.cs-d-hist-dot.st-ok { background: var(--green); }
.cs-d-hist-dot.st-bad { background: var(--red); }
.cs-d-hist-dot.st-ciro { background: var(--purple); }
.cs-d-hist-dot.st-iptal { background: var(--text-muted); }
.cs-d-hist-body { flex: 1; min-width: 0; }
.cs-d-hist-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.cs-d-hist-durum { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.cs-d-hist-date { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.cs-d-hist-not { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }

/* Boş durum */
.cs-empty { padding: var(--space-8) var(--space-4); text-align: center; color: var(--text-muted); }
.cs-empty svg { width: 40px; height: 40px; fill: none; stroke: var(--border); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.cs-empty p { font-size: var(--fs-sm); font-weight: 700; }
