/* ============================================================
   Page: urun — tek ürün detay sayfası
   ============================================================ */
.up-grid { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-5); align-items: stretch; }

.up-photo {
  width: 150px; height: 200px; border-radius: var(--radius);
  object-fit: cover; background: var(--bg); display: block;
}
.up-photo--empty {
  display: grid; place-items: center; border: 1px solid var(--border);
}
.up-photo--empty svg {
  width: 48px; height: 48px; fill: none; stroke: var(--border-strong);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.up-info { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-5); }
.up-info-col { display: flex; flex-direction: column; }
.up-row {
  display: flex; justify-content: flex-start; align-items: center;
  gap: var(--space-2); flex: 1; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.up-info-col .up-row:last-child { border-bottom: none; }
.up-k { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; white-space: nowrap; }
.up-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; }
.up-v { color: var(--text); text-align: left; white-space: nowrap; }
.up-link { color: var(--brand); text-decoration: none; }
.up-link:hover { text-decoration: underline; }
/* Stok Durumu satırında stok adedi — diğer yazılardan biraz daha büyük + vurgulu */
.up-stock-qty { font-size: 1.22em; font-weight: 800; color: var(--text); line-height: 1; vertical-align: -1px; }
.up-stock-unit { font-size: .85em; color: var(--text-muted); margin-right: 2px; }
/* Dip Fiyatı yanında maskeli alış fiyatı — yalnız kar.goruntule (satır zaten kapılı).
   Varsayılan (****), üzerine gelince/odaklanınca gerçek fiyat gösterilir. */
.up-cost-mask { margin-left: 4px; color: var(--text-muted); font-weight: 700; cursor: help; outline: none; }
.up-cost-real { display: none; color: var(--navy); }
.up-cost-mask:hover .up-cost-stars, .up-cost-mask:focus .up-cost-stars { display: none; }
.up-cost-mask:hover .up-cost-real, .up-cost-mask:focus .up-cost-real { display: inline; }

/* Satış/Alış geçmişi satırına tıklanınca açılan özet modalı (belge bilgileri). */
.up-detail .up-row { flex: 0 0 auto; }
.up-detail .up-k { flex: 0 0 130px; }
.up-detail .up-row:last-child { border-bottom: none; }
/* Modal altı: butonlar sağa yaslı (Kapat + Satışı/Alışı Görüntüle). */
.up-detail-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); }
.up-detail-foot .up-ico { color: inherit; }

/* Değerler sola dayalı — her sütunda etiket sabit genişlik → hizalı */
.up-info-col:first-child .up-k { flex: 0 0 88px; }
.up-info-col:last-child  .up-k { flex: 0 0 128px; }

/* Sağ üst köşe eylemleri: görünür butonlar + kebab (masaüstü dropdown / mobil alt sayfa) */
.up-card { position: relative; }
.up-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.up-actions .up-act-btn { white-space: nowrap; }

.up-menu { position: relative; }
.up-menu-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); background: var(--brand); color: #fff;
}
.up-menu-btn:hover { background: var(--brand-light); color: #fff; }
.up-menu-btn .up-ico { width: 18px; height: 18px; color: inherit; }

.up-menu-list {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(26, 24, 54, .12)); padding: 6px; z-index: 40; display: none;
}
.up-menu.is-open .up-menu-list { display: block; }
.up-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text);
}
.up-menu-item:hover { background: var(--bg); }
.up-menu-item .up-ico { color: var(--text-muted); }
.up-menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.up-menu-item--danger { color: var(--red); }
.up-menu-item--danger .up-ico { color: var(--red); }
.up-menu-item--danger:hover { background: var(--red-tint, rgba(220, 38, 38, .08)); }

.up-menu-backdrop { display: none; }
.up-show-mobile { display: none; }            /* Düzenle: mobilde menü öğesi olarak görünür */

@media (max-width: 560px) {
  .up-hide-mobile { display: none; }           /* Düzenle görünür butonu mobilde gizlenir */
  .up-show-mobile { display: flex; }           /* yerine menü öğesi olarak gelir */
  .up-menu-btn { width: 44px; height: 44px; }  /* dokunma hedefi ≥44px */

  /* Kebab → alttan açılan eylem sayfası (action sheet) */
  .up-menu.is-open .up-menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 60;
    background: rgba(26, 24, 54, .45);
  }
  .up-menu-list {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    min-width: 0; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    z-index: 70; box-shadow: 0 -8px 30px rgba(26, 24, 54, .22);
    animation: upSheetUp .18s ease-out;
  }
  .up-menu-item { padding: 14px 12px; font-size: var(--fs-md); }   /* ~48px dokunma satırı */
  .up-menu-item .up-ico { width: 18px; height: 18px; }
}
@keyframes upSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Sekmeler (müşteri sayfasındaki cari-tab ile aynı görünüm) */
.up-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: var(--space-5) 0 var(--space-4); flex-wrap: wrap; }
.up-tab { padding: 10px var(--space-4); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.up-tab:hover { color: var(--text); }
.up-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.up-tab-body { min-height: 200px; }
.up-tab-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px;
  padding: 0 7px; margin-left: 6px; border-radius: var(--radius-full);
  background: var(--brand-tint); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: 11px; font-weight: 800; line-height: 1; vertical-align: middle;
}
.up-tab.is-active .up-tab-count { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Yeniden sipariş uyarı bandı (stok kritik/tükendi) */
.up-reorder {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--yellow); border-radius: var(--radius);
  background: var(--yellow-tint, rgba(234, 179, 8, .08)); color: var(--text);
}
.up-reorder--out { border-color: var(--red); background: var(--red-tint, rgba(220, 38, 38, .07)); }
.up-reorder-ico { display: inline-flex; flex-shrink: 0; color: var(--yellow); }
.up-reorder--out .up-reorder-ico { color: var(--red); }
.up-reorder-ico .up-ico { width: 22px; height: 22px; color: inherit; }
.up-reorder-msg { flex: 1; min-width: 180px; font-size: var(--fs-sm); }
.up-reorder-sug { color: var(--text-muted); white-space: nowrap; }
.up-reorder .btn { flex-shrink: 0; white-space: nowrap; }

/* Tedarikçiler paneli (Alım Geçmişi sekmesi) */
.up-suppliers {
  margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.up-sup-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.up-sup-title { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.up-sup-title .up-ico { width: 16px; height: 16px; color: var(--text-muted); }

/* Barkod etiketi — adet seçimi */
.bc-qty { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.bc-qty-lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.bc-qty-in { width: 90px; }

/* Satış Geçmişi istatistik kutuları */
/* İstatistik kutucukları TEK SATIRA sığar (öğe sayısı kaç olursa olsun eşit genişlikte).
   Yatay düzen: solda büyük ikon, sağında başlık (üst) + değer (alt). */
.pstat-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); margin-bottom: var(--space-4); }
.pstat { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 16px rgba(0, 0, 0, .07); min-width: 0; transition: box-shadow var(--transition), transform var(--transition); }
.pstat:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 12px 28px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.pstat-ico { flex-shrink: 0; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--brand); }
.pstat-ico .up-ico { width: 24px; height: 24px; color: inherit; }
.pstat-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pstat-title { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstat-val { font-size: var(--fs-md); font-weight: 700; color: var(--text); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstat-act { display: inline-flex; vertical-align: middle; padding: 0 2px; color: var(--text-muted); flex-shrink: 0; }
.pstat-act:hover { color: var(--brand); }
.pstat-act .up-ico { width: 13px; height: 13px; color: inherit; }
@media (max-width: 720px) { .pstat-row { overflow-x: auto; grid-auto-columns: minmax(150px, 1fr); } }

/* — Barkodlar sekmesi — */
.ub-add { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-4); }
.ub-input { flex: 1 1 220px; max-width: 320px; }
.ub-add .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ub-add .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ub-list { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* Dikey kart: çubuk grafiği ÜSTTE, numara + rozet ALTINDA (ortalı); aksiyonlar sağ-üst köşe. */
.ub-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: var(--space-3) var(--space-2) var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ub-bars { display: grid; place-items: center; padding: 4px 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); max-width: 100%; overflow: hidden; }
.ub-bars svg { display: block; height: 30px; max-width: 100%; }
.ub-bars--none { color: var(--text-faint); }
.ub-bars--none svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ub-meta { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.ub-code { font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-xs); color: var(--text); letter-spacing: .03em; }
.ub-acts { position: absolute; top: 6px; right: 6px; }

/* Ürün listesi birincil barkod hücresi */
.prod-barcode { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: .02em; }

/* Ürün Görselleri sekmesi — sürükle-bırak yükleme + kapak galerisi */
.img-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center;
  padding: var(--space-6) var(--space-4); margin-bottom: var(--space-4);
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-alt); color: var(--text-muted); cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.img-drop:hover { border-color: var(--brand); color: var(--text); }
.img-drop.is-over { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.img-drop.is-disabled { cursor: default; border-style: solid; opacity: .75; }
.img-drop.is-disabled:hover { border-color: var(--border-strong); color: var(--text-muted); }
.img-drop-ico { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--space-1); }
.img-drop-text { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.img-drop.is-disabled .img-drop-text { color: var(--text-muted); }
.img-drop-text span { font-weight: 500; color: var(--brand); }
.img-drop-sub { font-size: var(--fs-xs); }
.btn.is-disabled { opacity: .5; pointer-events: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-3); }
.gal-item { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; background: var(--bg); }
.gal-item.is-default { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-badge { position: absolute; top: 6px; left: 6px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-sm); }
.gal-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.gal-act { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-sm); background: rgba(255,255,255,.92); color: var(--text-muted); box-shadow: var(--shadow-sm); }
.gal-act:hover { color: var(--brand); }
.gal-act--danger:hover { color: var(--red); }
.gal-act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gal-act--move { background: rgba(255,255,255,.92); }
.gal-act--right svg { transform: scaleX(-1); }
.gal-item img[data-act="zoom"] { cursor: zoom-in; }
.gal-lightbox { display: flex; justify-content: center; }
.gal-lightbox img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius); }

/* Stok Ekstresi rapor araç çubuğu */
.ekstre-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.ekstre-filters { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ekstre-filters .input { width: auto; min-width: 150px; }
.ekstre-actions { display: flex; gap: var(--space-2); }
/* Depo dağılımı şeridi (çoklu depo) */
.up-wh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface-alt); border-radius: var(--radius-sm); }
.up-wh-h { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: var(--space-1); }
.up-wh-chip { font-size: var(--fs-sm); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 2px var(--space-3); color: var(--text-muted); }
.up-wh-chip.is-pos { color: var(--text); border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }

/* Açılış/Devir = defter başlangıç bakiyesi satırı (hareket değil) — hafif vurgulu */
.data-table tr.ekstre-opening { background: var(--navy-tint, color-mix(in srgb, var(--navy) 7%, transparent)); }
.data-table tr.ekstre-opening td { font-weight: 600; }
.data-table tr.ekstre-opening .badge { font-weight: 700; }

/* Barkod / Etiket önizleme modalı */
.bc-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.bc-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; padding: var(--space-4) 0; }
.bc-label {
  display: inline-block; text-align: center; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4);
}
.bc-name { font-size: var(--fs-sm); font-weight: 700; color: #1a1836; margin-bottom: 4px; }
.bc-meta { display: flex; justify-content: space-between; gap: var(--space-4); font-size: var(--fs-xs); color: #555; margin-bottom: var(--space-2); }
.bc-price { font-weight: 700; color: #1a1836; }
.bc-bars { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.bc-num { font-size: var(--fs-sm); letter-spacing: 2px; margin-top: 4px; color: #1a1836; }
.bc-label--compact { padding: var(--space-2) var(--space-3); }

/* Büyük önizleme: seçili şablon — modalın görsel odağı, ortalı */
.bc-preview { display: flex; justify-content: center; width: 100%; }

/* Etiket şablonu seçici: yatay kaydırılır küçük önizleme şeridi */
.bc-tpl-lbl { align-self: flex-start; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.bc-tpl-row { display: flex; gap: var(--space-2); width: 100%; overflow-x: auto; padding-bottom: var(--space-1); }
.bc-tpl-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: var(--space-2); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.bc-tpl-chip:hover { border-color: var(--brand-light); }
.bc-tpl-chip.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.bc-tpl-prev {
  width: 124px; height: 76px; overflow: hidden; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: var(--radius-sm);
}
.bc-tpl-prev .bc-label { transform: scale(.46); transform-origin: center; border: none; padding: 0; }
.bc-tpl-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }

@media (max-width: 560px) {
  .up-grid { grid-template-columns: 1fr; }
  .up-info { grid-template-columns: 1fr; }
  /* Tek sütun mobilde değer alanı sarabilir (örn. çoklu yayın rozetleri taşmasın) */
  .up-v { white-space: normal; }
}

/* Ürün detayında tedarikçi adı → tedarikçi kartına link (id tabanlı bağ) */
.up-sup-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.up-sup-link:hover { text-decoration: underline; text-underline-offset: 2px; }
