/* ============================================================
   Page: urunler
   ============================================================ */
/* Ürün triyaj kartları: ikon + (büyük sayı / başlık). Tıklanabilir olanlar
   ilgili görünüme götürür; statik olanlar (Stok Değeri / Stokta) yalnız bilgi. */
.ustat {
  display: flex; align-items: center; 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);
  text-align: left; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
button.ustat { cursor: pointer; }
button.ustat:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(26, 24, 54, .1); }
.ustat.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.ustat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ustat-val { font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.ustat-title { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }

.col-thumb { width: 48px; padding-right: 0 !important; }

/* Ürün detay modalı tablosu (Başlık / Açıklama + ikon + satır hover) */
.pd-table { display: flex; flex-direction: column; }
.pd-head {
  display: flex; gap: var(--space-4); padding: 8px var(--space-3);
  border-bottom: 2px solid var(--border-strong);
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.pd-head span:first-child { flex: 0 0 42%; }
.pd-head span:last-child { flex: 1; }
.pd-row {
  display: flex; gap: var(--space-4); padding: 9px var(--space-3);
  border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
  transition: background var(--transition);
}
.pd-row:last-child { border-bottom: none; }
.pd-row:hover { background: var(--row-hover); }
.pd-label { flex: 0 0 42%; display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-weight: 600; }
.pd-val { flex: 1; color: var(--text); overflow-wrap: anywhere; }
.pd-ico { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pd-foot { margin-top: var(--space-4); text-align: right; }
.prod-thumb {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg); display: block;
}
.prod-thumb--empty {
  display: grid; place-items: center; border: 1px solid var(--border);
}
.prod-thumb--empty svg {
  width: 18px; height: 18px; fill: none; stroke: var(--border-strong);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* Form görsel yükleme */
.img-upload { display: flex; align-items: center; gap: var(--space-3); }
.img-preview {
  width: 64px; height: 64px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: grid; place-items: center; overflow: hidden; background: var(--bg);
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-file { flex: 1; }

/* Stok özeti (detay modal) */
.stock-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2);
  margin: var(--space-4) 0; padding: var(--space-3);
  background: var(--surface-alt); border-radius: var(--radius-sm);
}
.stock-summary > div { display: flex; flex-direction: column; gap: 2px; }
.ss-label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.ss-val { font-size: var(--fs-md); font-weight: 700; }

/* Stok hareket geçmişi */
.sh-title { font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--space-2); }
.sh-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: var(--space-3);
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
  align-items: center;
}
.sh-row:last-child { border-bottom: none; }
.sh-d { font-variant-numeric: tabular-nums; font-weight: 700; }
.sh-d.pos { color: var(--green); }
.sh-d.neg { color: var(--red); }
.sh-c { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sh-t { color: var(--text-faint); font-size: var(--fs-xs); }

@media (max-width: 560px) { .stock-summary { grid-template-columns: repeat(2, 1fr); } }

/* Toplu barkod/etiket yazdırma modalı (bc-* sınıfları urun.css'ten paylaşılır) */
.bl-sum { width: 100%; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.bl-sum strong { color: var(--text); }
.bl-warn {
  width: 100%; padding: var(--space-2) var(--space-3); border-radius: var(--radius);
  background: var(--yellow-soft, rgba(234, 179, 8, .12)); border: 1px solid var(--yellow, #eab308);
  font-size: var(--fs-sm); color: var(--text); display: flex; flex-direction: column; gap: var(--space-1);
}
.bl-gen { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); cursor: pointer; font-weight: 600; }
.bl-gen input { width: 16px; height: 16px; }

/* Yeniden Sipariş Önerisi modalı (tedarikçiye göre gruplu öneri tablosu) */
.ro-empty { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); }
.ro-empty svg { width: 28px; height: 28px; color: var(--green); fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.ro-group { margin-bottom: var(--space-4); }
.ro-ghead {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 7px var(--space-3); background: var(--surface-alt);
  border-radius: var(--radius-sm); margin-bottom: var(--space-1);
}
.ro-sup { font-weight: 700; font-size: var(--fs-sm); }
.ro-gmeta { font-size: var(--fs-xs); color: var(--text-muted); }
.ro-head, .ro-row {
  display: grid; grid-template-columns: 1fr 64px 64px 64px var(--ro-cost, 0px);
  gap: var(--space-2); align-items: center; padding: 7px var(--space-3);
}
.ro-row.ro-row--cost, .ro-head.ro-head--cost { --ro-cost: 96px; }
.ro-head { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
.ro-row { border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.ro-row:last-child { border-bottom: none; }
.ro-row:hover { background: var(--row-hover); }
.ro-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ro-name a { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-name a:hover { color: var(--brand); }
.ro-code { font-size: var(--fs-xs); color: var(--text-faint); }
.ro-stat { align-self: flex-start; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); margin-bottom: 1px; }
.ro-stat--tukendi { background: var(--red-soft, rgba(220,38,38,.12)); color: var(--red); }
.ro-stat--kritik { background: var(--yellow-soft, rgba(234,179,8,.14)); color: var(--yellow); }
.ro-n { text-align: right; font-variant-numeric: tabular-nums; }
.ro-sug { font-weight: 800; color: var(--brand); }
.ro-grand { text-align: right; padding-top: var(--space-3); border-top: 2px solid var(--border-strong); font-size: var(--fs-md); }

/* Kampanyalı ürün rozeti (liste + kart) */
.prod-kampanya { display: inline-block; background: var(--brand); color: #fff; font-weight: 800; font-size: 9px; padding: 1px 5px; border-radius: var(--radius-full); vertical-align: middle; letter-spacing: .02em; white-space: nowrap; }

/* Ürünler tablosu satır hover (kullanıcı tercihi): çerçeve yerine hafif renkli zemin +
   YUMUŞAK GÖLGE (elevation). tr'a gölge için border-collapse:separate gerekir (collapse'ta
   render olmaz); border-spacing:0 → satır ayraçları aynı kalır. */
#prodList .data-table { border-collapse: separate; border-spacing: 0; }
#prodList .data-table tbody tr.is-clickable { transition: background var(--transition), box-shadow var(--transition); }
#prodList .data-table tbody tr.is-clickable:hover {
  background: #FBE3D1;
  box-shadow: 0 3px 14px rgba(70, 62, 124, .18);
  position: relative; z-index: 1;
}
/* Kart hover: daha kalın (halka ile, layout zıplamasız) çerçeve + yumuşak gölge → doğal kalkış. */
#prodList .tbl-card.is-clickable { transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
#prodList .tbl-card.is-clickable:hover {
  border-color: #F1BF9F;
  box-shadow: 0 0 0 2px #F1BF9F, 0 8px 24px rgba(0, 0, 0, .14);
  transform: translateY(-2px);
}

/* Tablo üstü araç çubuğu butonlarını HER genişlikte sağa daya (dar ekranda wrap
   olunca da sola yapışmasın). */
#prodList .action-bar-tools { margin-left: auto; justify-content: flex-end; }

/* Kart görünümü: geniş ekranda 9 değil EN FAZLA 6 sütun (kullanıcı tercihi).
   auto-fill yerine sabit sütun sayısı; dar ekranlarda kademeli iner. */
#prodList .tbl-cardgrid { grid-template-columns: repeat(2, 1fr); align-items: stretch; }
@media (min-width: 600px)  { #prodList .tbl-cardgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { #prodList .tbl-cardgrid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { #prodList .tbl-cardgrid { grid-template-columns: repeat(6, 1fr); } }

/* Fiyat / Alış / Stok pill'i HER ZAMAN kartın ALTINA sabitle — üstteki isim/kod/
   kategori uzunluğuna göre yer değiştirmesin. Kartlar satırda eşit boya gerilir;
   pc-body büyür, pc-foot margin-top:auto ile dibe iner → tüm kartlarda hizalı. */
#prodList .tbl-card { height: 100%; }
#prodList .pc-body { flex: 1 1 auto; }
#prodList .pc-foot { margin-top: auto; padding-top: 6px; }
/* İsim alanı daima 2 satır yüksekliği ayırsın (tek satırlık adlarda alttaki bilgiler
   zıplamasın) → kod/kategori/foot konumu kartlar arası tutarlı kalır. */
#prodList .pc-name { min-height: calc(1.3em * 2); }

