/* ============================================================
   Component: action-bar (liste üstü başlık + araç çubuğu)
   ============================================================ */
.action-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap;
}
.action-bar-title { font-size: var(--fs-lg); font-weight: 700; }
.action-bar-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* Liste arama (topbar yerine sayfa içinde, listenin üstünde) */
.tbl-search { position: relative; display: inline-flex; align-items: center; }
.tbl-search-ico { position: absolute; left: 11px; width: 16px; height: 16px; fill: none; stroke: var(--text-faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.tbl-search-input { width: 260px; max-width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-sm); color: var(--text); }
.tbl-search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
@media (max-width: 640px) { .tbl-search { width: 100%; } .tbl-search-input { width: 100%; } }

.ab-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
/* Sade (ghost) araç çubuğu butonları (Sütunlar/Kart/Excel/Yazdır/Ferah): hover'da
   BEYAZ arka plan + ince çerçeve + hafif gölge → açık zeminde belirgin (kalabalık değil). */
.ab-actions .btn--ghost:hover:not(:disabled) { background: #fff; border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
/* actionsRight: araç çubuğu tam genişlik; Sütunlar/Kart solda, aksiyonlar (spacer ile) sağda */
.ab-tools--split { flex: 1; }
.ab-tools--split .ab-actions { flex: 1; }
.ab-spacer { flex: 1 1 0; min-width: 8px; }
@media (max-width: 640px) { .ab-spacer { display: none; } }
.ab-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.ab-actions .btn svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Excel butonu — yeşil border (Excel olduğu belli olsun) */
.btn--excel { border-color: var(--green); color: var(--green); }
.btn--excel:hover { background: var(--green-soft); border-color: var(--green); color: var(--green); }

/* Cari liste sayfaları (müşteriler/tedarikçiler): inline filtre dropdownları (.sales-filters)
   aramanın SAĞINDA, Sütunlar/Kart'tan ÖNCE, hepsi aynı satırda (DOM sırası:
   arama → sales-filters → ab-actions). Her dropdown İÇERİĞE GÖRE dar (stretch yok). */
#custList .action-bar-tools .sales-filters > .cs-wrap,
#supList  .action-bar-tools .sales-filters > .cs-wrap { flex: 0 0 auto; width: auto; min-width: 0; }
/* Yükseklik = arama kutusu (customSelect cs-btn varsayılanı 42px; gereksiz boşluğu kaldır).
   Genişlik içeriğe göre (değer + ok sığacak kadar). */
#custList .action-bar-tools .sales-filters .cs-btn,
#supList  .action-bar-tools .sales-filters .cs-btn { width: auto; min-height: 0; padding: 8px 10px; gap: 6px; font-size: var(--fs-sm); }
/* ab-actions flex-basis AUTO (varsayılan basis:0 → 215px'e sıkışıp tüm butonları
   dikey yığıyordu). basis:auto + shrink → ab-actions satır 1'i arama+filtrelerle
   paylaşır; içinde Sütunlar/Kart kalır, Excelden/Yeni spacer'da temiz alt satıra
   sarar (right-aligned). Yani satır 1: arama·filtreler·Sütunlar·Kart, satır 2: ekle. */
#custList .action-bar-tools.ab-tools--split .ab-actions,
#supList  .action-bar-tools.ab-tools--split .ab-actions { flex: 1 0 auto; }

/* Sayfa açıklaması — açık mavi bilgi kutusu (depolar/.dt-info stili). Sayfa başlığı
   topbar'da gösterildiği için sayfalar kendi h1'ini taşımaz; yalnız açıklama bu kutuda. */
.page-intro {
  background: color-mix(in srgb, var(--blue) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent);
  color: var(--text); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
  font-size: var(--fs-sm); line-height: var(--lh-base, 1.5);
}
.page-intro b { font-weight: 700; }
.page-intro a { color: var(--brand); font-weight: 600; }

/* ── Orta/dar ekran (laptop · MacBook · tarayıcı zoom) ──────────────────────────
   Yoğun araç çubuğu (arama + çok buton) geniş ekranda tek satıra oturur; ~1300px
   altında sıkışıp ab-spacer ile dağınık/ortalanmış sarıyordu. Çözüm: aramayı kendi
   tam-genişlik satırına al, butonları tek tam-genişlik satıra ver — spacer böylece
   yardımcı araçları SOLDA, asıl aksiyonları (Yeni/Excel) SAĞDA tutar (temiz iki grup);
   sığmazsa düzgün, sola hizalı sarar. */
@media (max-width: 1300px) {
  .action-bar-tools { align-items: flex-start; }
  .action-bar-tools > .tbl-search { flex: 1 1 100%; }
  .action-bar-tools > .tbl-search .tbl-search-input { width: 100%; }
  .action-bar-tools.ab-tools--split .ab-actions { flex: 1 1 100%; }
  /* cari liste sayfaları aynı davransın (kendi flex kuralını burada geçersiz kıl) */
  #custList .action-bar-tools.ab-tools--split .ab-actions,
  #supList  .action-bar-tools.ab-tools--split .ab-actions { flex: 1 1 100%; }
}
