/* Kırtasiye Stok Takip Sistemi — Görsel Kimlik
   Palet: Zafer Kırtasiye ve Baskı Merkezi marka renkleri — lacivert / sarı
   Tipografi: Space Grotesk (başlık) + Inter (gövde) + IBM Plex Mono (veri/barkod) */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #2A4694;           /* marka lacivert */
  --ink-soft: #3D5AA8;
  --paper: #FBF9F3;
  --paper-dim: #F1ECE1;
  --pencil: #F9B328;        /* marka sarı — vurgu/aksiyon rengi */
  --pencil-dark: #E09C10;
  --sage: #2A4694;
  --stamp-red: #C0492E;
  --line: #E4DDCB;
  --text: #2A2D34;
  --text-mute: #6B7080;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* Kartlar ve tablo sarmalayıcıları taşmayı kendi içinde tutsun, sayfayı kaydırmasın. */
.card { max-width: 100%; overflow: hidden; }
.tablo-scroll { max-width: 100%; }

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; color: var(--ink); margin: 0 0 6px; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 500; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; }

code, .mono, .barkod-deger, input[name="barkod"], .stat-num { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--ink); }

/* --- İmza öğesi: barkod çizgi bandı --- */
.barkod-band {
  height: 34px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink) 0px, var(--ink) 2px,
    transparent 2px, transparent 5px,
    var(--ink) 5px, var(--ink) 6px,
    transparent 6px, transparent 11px,
    var(--ink) 11px, var(--ink) 14px,
    transparent 14px, transparent 17px
  );
  opacity: .9;
}
.topbar .barkod-band { height: 6px; }

/* --- Üst bar --- */
.topbar {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--pencil);
  position: relative;
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; flex-shrink: 0; }
/* kod_v26: logo görseli yerine yazı (aşağıdaki .marka-yazi); bu kural artık kullanılmıyor. */
.brand-logo { height: 42px; width: auto; max-width: 170px; display: block; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px 8px; }

/* --- Ana menü: sade, yatay, her zaman görünür --- */
nav.mainnav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
nav.mainnav > a {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 9px 14px; border-radius: 8px; white-space: nowrap;
}
nav.mainnav > a:hover { background: rgba(255,255,255,.12); color: #fff; }
nav.mainnav > a.active { background: var(--pencil); color: var(--ink); font-weight: 700; }

/* --- İkinci satır (kod_v26): açık bölümün sayfaları, her zaman görünür --- */
.nav-kisayol {
  background: var(--pencil); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700;
  padding: 9px 14px; border-radius: 8px; white-space: nowrap; flex-shrink: 0;
}
.nav-kisayol:hover { filter: brightness(1.08); color: var(--ink); }
.nav-kisayol.active { outline: 2px solid #fff; outline-offset: 1px; }
.altmenu { background: #fff; border-bottom: 1px solid var(--line); }
.altmenu-inner {
  max-width: 1320px; margin: 0 auto; padding: 6px 24px;
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
}
.altmenu a {
  color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 11px; border-radius: 7px; white-space: nowrap;
}
.altmenu a:hover { background: var(--paper-dim); color: var(--ink); }
.altmenu a.active { background: var(--pencil); color: var(--ink); font-weight: 700; }

/* Satıcı rolü: tek "Satış" linki her zaman görünür bir sekme gibi durur. */
.mainnav-basit { display: flex; }
.mainnav-basit a { background: var(--pencil); color: #fff; font-weight: 600; padding: 9px 18px; border-radius: 8px; text-decoration: none; }
.user-chip { font-size: 13px; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip a { color: rgba(255,255,255,.9); }
.user-chip a:hover { color: var(--pencil); }

/* --- İçerik kabı --- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 60px; }
.geri-cubugu { margin-bottom: 14px; }
.geri-buton { font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-head p { color: var(--text-mute); margin: 4px 0 0; font-size: 14px; }

/* --- Kartlar --- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pencil);
  border-radius: var(--radius);
  padding: 11px 13px;
}
.stat-card.alert { border-left-color: var(--stamp-red); }
.stat-card.ok { border-left-color: var(--sage); }
.stat-num { font-size: 17px; font-weight: 600; color: var(--ink); display: block; line-height: 1.2; white-space: nowrap; letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .03em; }

/* Panel'deki öncelikli 3 kart: normal stat-card'lardan belirgin şekilde büyük. */
a.stat-card { text-decoration: none; display: block; cursor: pointer; }
.stat-buyuk { padding: 18px 20px; }
.stat-buyuk .stat-num { font-size: 27px; white-space: normal; }
.stat-buyuk .stat-label { font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- Formlar --- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin: 12px 0 5px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14.5px;
  background: var(--paper);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pencil); background: #fff; }
input[name="barkod"], .barkod-input { font-family: 'IBM Plex Mono', monospace; letter-spacing: .03em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; font-weight: 400; color: var(--text-mute);
  margin: 10px 0 0; cursor: pointer;
}
.checkbox-row input[type="checkbox"] { width: auto; margin-top: 2px; accent-color: var(--pencil-dark); }

/* --- Ürün görseli --- */
.urun-thumb {
  width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
  display: inline-block; border: 1px solid var(--line); vertical-align: middle;
  cursor: zoom-in;
}
.urun-thumb-bos {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-mute); background: var(--paper-dim); font-size: 11px;
}
.gorsel-onizleme { margin: 8px 0 4px; }
.gorsel-onizleme img {
  width: 140px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
  display: block; cursor: zoom-in;
}
input[type="file"] { padding: 8px 10px; background: #fff; cursor: pointer; }

/* --- Kamera tam ekran katmanı ---
   Kamera alanı sayfanın içinde açılınca (özellikle telefonda) ekranın altında kalıyor,
   kullanıcı aşağı kaydırmak zorunda kalıyordu. Açılınca bu sınıf ekleniyor ve alan
   tam ekrana geçiyor: kaydırma derdi bitiyor, görüntü de büyüdüğü için barkodu
   tutturmak kolaylaşıyor. */
.kamera-katman {
  display: flex !important;
  position: fixed; inset: 0; z-index: 900;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(12, 14, 20, .94);
  padding: 20px; margin: 0 !important;
  overflow-y: auto;
}
.kamera-katman > div { width: 100%; max-width: 420px !important; border-radius: 12px; overflow: hidden; }
.kamera-katman p, .kamera-katman .helptext {
  color: #fff !important; text-align: center; font-size: 15px; margin: 0 !important; max-width: 420px;
}
.kamera-katman .btn {
  background: #fff; color: var(--ink); border: none; font-size: 16px; font-weight: 700;
  padding: 14px 30px; margin: 0 !important;
}
.kamera-katman .btn:hover { background: var(--pencil); color: var(--ink); }
/* Kamera ekranındaki canlı sepet özeti: okuttukça güncellenir, sepeti kontrol etmek için
   kamerayı kapatıp yukarı kaydırmaya gerek kalmaz. */
.kamera-katman .kamera-sepet-ozet {
  background: var(--pencil); color: var(--ink) !important;
  font-weight: 700; font-size: 16px !important;
  padding: 10px 18px; border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
}
.kamera-katman .kamera-ipucu { opacity: .75; font-size: 13px !important; }
/* Bu iki satır yalnızca tam ekran kamerada görünür; sayfa içindeyken gizli kalır. */
.kamera-sepet-ozet, .kamera-ipucu { display: none; }
.kamera-katman .kamera-sepet-ozet, .kamera-katman .kamera-ipucu { display: block; }

/* --- Görsel büyütme (lightbox) --- */
.lightbox {
  display: none; position: fixed; inset: 0; background: rgba(15,17,26,.88);
  z-index: 999; align-items: center; justify-content: center; cursor: zoom-out;
  padding: 24px;
}
.lightbox.acik { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-soft); }
.btn-gold { background: var(--pencil); color: var(--ink); font-weight: 700; }
.btn-gold:hover { background: var(--pencil-dark); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: #fff; color: var(--stamp-red); border: 1px solid #E3C3BD; }
.btn-danger:hover { background: #FBEDEB; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* --- Tablolar --- */
.tablo-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-mute); padding: 10px 12px; border-bottom: 2px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: var(--paper-dim); }
.tablo-scroll table { width: 100%; min-width: 0; }
/* Uzun metinler (ürün adı gibi) alt satıra kaysın; böylece tablo ekrana sığar, yatay kaydırma çıkmaz. */
.tablo-scroll td, .tablo-scroll th { white-space: normal; }
/* Barkod ve işlem butonları tek satırda kalsın (barkodlar boşluksuz olduğu için zaten kırılmaz). */
.tablo-scroll .mono, .tablo-scroll .hucre-islem { white-space: nowrap; }
.tag { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 20px; background: var(--paper-dim); color: var(--ink-soft); font-weight: 500; }
.tag-alert { background: #FBEDEB; color: var(--stamp-red); }
.tag-ok { background: #EFF4EE; color: var(--sage); }
.tag-bilgi { background: #E9EDF9; color: var(--ink-soft); }

.bakiye { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.bakiye-borclu { color: var(--stamp-red); }
.bakiye-temiz { color: var(--sage); }

.toplu-cubuk {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tablo-scroll td.aksiyon-hucre {
  white-space: normal;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}

/* --- Uyarı kutuları --- */
.flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px; }
.flash-ok { background: #EFF4EE; color: #4C6548; border: 1px solid #CFE0CB; }
.flash-err { background: #FBEDEB; color: #8C3B30; border: 1px solid #E3C3BD; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-mute); }
.helptext { font-size: 12.5px; color: var(--text-mute); margin-top: 5px; }

/* --- Giriş sayfası --- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink);   /* kod_v26: düz renk — eski desen görseli (pattern.png, 409 KB) açılışı yavaşlatıyordu */
  padding: 20px;
}
.login-card { background: var(--paper); border-radius: 14px; padding: 0; width: 100%; max-width: 380px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); border-top: 5px solid var(--pencil); }
.login-card .barkod-band { height: 10px; }
.login-inner { padding: 20px 30px 30px; }
.login-inner .brand { color: var(--ink); }
.login-brand { width: 100%; padding: 26px 30px 0; box-sizing: border-box; text-align: center; }
/* kod_v26: logo görseli yerine yazı — üst çubukta beyaz, giriş kartında lacivert; "Panel" sarı vurgu */
.marka-yazi { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; color: #fff; }
.marka-yazi span { color: var(--pencil); }
.login-brand .marka-yazi { color: var(--ink); font-size: 26px; }
.login-brand .marka-yazi span { color: var(--pencil-dark, #d99410); }

@media screen and (max-width: 820px) {
  /* iOS, 16px'ten küçük inputlara odaklanınca sayfayı zorla yakınlaştırır — bunu önle. */
  input, select, textarea { font-size: 16px; }
  .form-row { grid-template-columns: 1fr; }

  /* Satış ekranı arama çubuğu: arama kutusu tam görünür kalsın, kamera yanında. */
  .satis-arama-input { width: 100%; padding: 13px 14px; }
  .satis-kamera-buton { padding: 0 16px; font-size: 22px; }
  /* Kısayol butonları (Günlük / İade / Hızlı Gider) alt satırda eşit bölünsün. */
  .satis-kisayollar { gap: 6px; }
  .satis-kisayollar .btn { padding: 10px 6px; font-size: 13px; }
  .topbar-inner { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; }
  .wrap { padding: 18px 14px 40px; }
  .card { padding: 14px; }
  /* Menü, marka ve kullanıcı bilgisinin altına tam genişlikte iner; bölümler gerekirse iki satıra kırılır (hepsi görünür). */
  nav.mainnav { order: 3; width: 100%; flex-wrap: wrap; gap: 4px; }
  nav.mainnav > a { padding: 7px 10px; font-size: 14px; }
  .nav-kisayol { order: 2; padding: 8px 12px; }
  /* kod_v26: dar ekranda da gizli/kaydırmalı kalmasın — sekmeler alt satırlara kırılır. */
  .altmenu-inner { padding: 6px 14px; gap: 2px; }
  .altmenu a { padding: 5px 8px; font-size: 13px; }
  .user-chip { order: 2; }
  .page-head { align-items: stretch; }
  .page-head > div:last-child,
  .page-head a.btn,
  .page-head button.btn { width: 100%; }
  .page-head { flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  #panel-ozet { grid-template-columns: 1fr; }
  /* Dar ekranda para rakamı kutuya sığmayıp kırpılmasın: tek satır zorunluluğunu kaldır,
     gerekirse alt satıra sarsın. (Büyük tutarlarda "1.234.567,89 ₺" kesiliyordu.) */
  .stat-num { white-space: normal; font-size: 16px; }
  .stat-buyuk .stat-num { font-size: 22px; }
  .stat-buyuk { padding: 14px 15px; }
  /* Sepet başlığı + adet rozeti + Temizle yan yana sığmazsa alt satıra geçsin. */
  .sepet-baslik-satiri { flex-wrap: wrap; gap: 6px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  h1 { font-size: 21px; }
  /* Mobilde tabloda az kullanılan sütunları gizle; tablo ekrana sığsın, yatay kaydırma çubuğu çıkmasın. */
  .mobil-gizle { display: none !important; }
  .tablo-scroll table { min-width: 0; }
  .tablo-scroll td, .tablo-scroll th { white-space: normal; }
  /* Yatay kaydırma mobilde en sevilmeyen şey: yazıyı ve boşlukları küçülterek
     tabloların ekrana sığmasını sağlıyoruz (kullanıcı tercihi: küçülsün ama kaymasın). */
  .tablo-scroll table { font-size: 13px; }
  .tablo-scroll th, .tablo-scroll td { padding: 8px 6px; }
  .tablo-scroll .btn-sm { padding: 6px 8px; font-size: 12px; }
  .tablo-scroll .tag { font-size: 11px; padding: 2px 7px; }
  /* Barkod gibi uzun kodlar tek satırda kalmaya çalışıp tabloyu genişletmesin. */
  .tablo-scroll .mono { white-space: normal; word-break: break-all; font-size: 12px; }

  /* Ürünler listesi mobilde KART görünümü: her ürün alt alta bir kart, butonlar içinde. */
  .urunler-tablo, .urunler-tablo tbody { display: block; width: 100%; }
  .urunler-tablo tr:first-child { display: none; }   /* başlık satırı gizlenir */
  .urunler-tablo tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
  }
  .urunler-tablo td { display: block; border: none !important; padding: 0; }
  .urunler-tablo .hucre-sec { order: 1; }
  .urunler-tablo .hucre-gorsel { order: 2; }
  .urunler-tablo .hucre-gorsel .urun-thumb { width: 52px; height: 52px; }
  .urunler-tablo .hucre-ad { order: 3; flex: 1; min-width: 120px; font-weight: 700; font-size: 16px; }
  .urunler-tablo td[data-label="Barkod"] { order: 4; flex-basis: 100%; font-size: 13px; color: var(--text-mute); font-family: 'IBM Plex Mono', monospace; }
  .urunler-tablo td[data-label="Stok"] { order: 5; }
  .urunler-tablo td[data-label="Satış"] { order: 6; margin-left: auto; }
  .urunler-tablo td[data-label="Stok"]::before,
  .urunler-tablo td[data-label="Satış"]::before {
    content: attr(data-label) ": ";
    font-size: 12px; color: var(--text-mute); font-weight: 400;
  }
  .urunler-tablo .hucre-islem { order: 7; flex-basis: 100%; margin-top: 8px; display: flex; gap: 8px; }
  .urunler-tablo .hucre-islem .btn { flex: 1; justify-content: center; }
}

@media screen and (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ============================================
   SATIŞ EKRANI — minimal, geometrik, büyük dokunmatik kartlar
   ============================================ */
.satis-ekrani { display: grid; grid-template-columns: 1fr 440px; gap: 20px; align-items: start; }
.satis-sol { order: 1; }   /* masaüstünde: ürünler solda */
.satis-sag { order: 2; }   /* masaüstünde: sepet sağda, sabit */

.satis-arama-cubugu { display: flex; gap: 8px; margin-bottom: 10px; }
.satis-arama-input { flex: 1; min-width: 0; font-size: 16px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 10px; }
.satis-arama-input:focus { border-color: var(--pencil); }
.satis-kamera-buton { font-size: 20px; padding: 0 18px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; flex-shrink: 0; }
.satis-kisayollar { display: flex; gap: 8px; margin-bottom: 16px; }
.satis-kisayollar .btn { flex: 1; justify-content: center; }

/* --- Açık Satış: sisteme kayıtlı olmayan ufak ürünler için hızlı tutar girişi --- */
.acik-satis-kutu { margin-bottom: 12px; }
.acik-satis-ac { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }
.acik-satis-form {
  margin-top: 10px; padding: 14px;
  background: #FFF9EC; border: 2px solid var(--pencil); border-radius: 12px;
}
.acik-satis-form input[type="number"] { flex: 1; font-size: 18px; padding: 12px 14px; font-family: 'IBM Plex Mono', monospace; }

/* --- Hızlı Gider: satış ekranından çıkmadan gider kaydı --- */
.hizli-gider-form {
  margin-bottom: 14px; padding: 14px;
  background: #FBEDEB; border: 2px solid #E3C3BD; border-radius: 12px;
}
.hizli-gider-form label { margin-top: 0; }

/* --- Hızlı satış: barkodsuz hizmet kalemleri (fotokopi, cilt…) ekranın üstünde sabit --- */
.hizli-satis {
  background: #FFF9EC; border: 2px solid var(--pencil); border-radius: 12px;
  padding: 12px; margin-bottom: 14px;
}
.hizli-satis-etiket {
  display: block; margin-bottom: 9px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--pencil-dark);
}
/* Izgara düzeni: tüm butonlar birebir aynı genişlik ve yükseklikte, satırlar tam dolar. */
.hizli-satis-liste {
  display: grid;
  /* kod_v32: satır başına sabit 4 sütun (eskiden genişliğe göre ~5). minmax(0,1fr): uzun ad sütunu genişletip taşırmaz. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
/* Kompakt ve SABİT genişlikte butonlar: kalem sayısı arttıkça çubuk kontrolsüz
   büyümesin, satırlar düzgün hizalansın. Uzun isim 2 satıra sarar, taşarsa kırpılır. */
.hizli-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px;
  padding: 9px 10px; width: 100%; height: 70px; cursor: pointer;
  font-family: 'Inter', sans-serif; text-align: left;
}
.hizli-btn:hover { background: var(--ink); }
.hizli-btn:hover .hizli-ad, .hizli-btn:hover .hizli-fiyat { color: #fff; }
.hizli-btn:active { transform: scale(.97); }
.hizli-ad {
  font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.25; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.hizli-fiyat { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 700; color: var(--pencil-dark); white-space: nowrap; }
/* kod_v31: kart numarası (köşede, yalnız sıra/etiket) + yönetici "Sırala" modu */
.hizli-satis-ust { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.hizli-satis-ust .hizli-satis-etiket { margin-bottom: 0; }
.hizli-sirala-araclar { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hizli-sirala-bilgi { font-size: 12px; color: var(--pencil-dark); }
.hizli-kart { position: relative; }
.hizli-kart .hizli-btn { padding-right: 30px; }
.hizli-no {
  position: absolute; top: 5px; right: 5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--paper-dim, #EFEAE0); color: var(--ink); font: 700 11px/20px 'IBM Plex Mono', monospace; text-align: center;
  pointer-events: none;
}
.hizli-btn:hover ~ .hizli-no { background: #fff; }
.hizli-no-kutu {
  position: absolute; bottom: 4px; right: 4px; width: 40px !important; height: 24px; padding: 2px 4px !important;
  font: 700 12px 'IBM Plex Mono', monospace; text-align: center; border: 2px solid var(--pencil) !important; border-radius: 6px; background: #fff;
}
/* kod_v32: numara kutusunda ok düğmeleri yok (iki haneli numara kırpılmasın); numara yazılarak değiştirilir */
.hizli-no-kutu { -moz-appearance: textfield; appearance: textfield; }
.hizli-no-kutu::-webkit-inner-spin-button, .hizli-no-kutu::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hizli-satis.siralama { border-style: dashed; }
.hizli-satis.siralama .hizli-btn { cursor: grab; background: #FFFDF6; padding-right: 30px; }   /* kod_v32: numara kutusu sağ altta, ad tam genişlik */
.hizli-satis.siralama .hizli-btn:hover { background: #FFFDF6; }
.hizli-satis.siralama .hizli-btn:hover .hizli-ad { color: var(--ink); }
.hizli-satis.siralama .hizli-btn:hover .hizli-fiyat { color: var(--pencil-dark); }
.hizli-satis.siralama .hizli-no { display: none; }
.hizli-kart.suruklenen { opacity: .45; }

@media screen and (max-width: 520px) {
  .hizli-satis-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* telefonda iki sütun */
}

.urun-ad-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--line); }
.urun-ad-link:hover { color: var(--pencil); border-bottom-color: var(--pencil); }

/* Arama önerileri (autocomplete açılır liste) — üstteki "Diğer" menüsüyle aynı görünüm */
.arama-sarmal { position: relative; }
/* Öneri kutusu kartın altına taşar; içinde bulunduğu kart 'overflow:hidden' ise kırpar.
   Bu yüzden arama önerisi içeren kartlarda taşmayı serbest bırak. */
.card-arama { overflow: visible; }
.card:has(.arama-sarmal) { overflow: visible; }
.oneri-kutu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 300;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.16); padding: 6px; max-height: 340px; overflow-y: auto;
}
.oneri-satir {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 8px 11px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none;
}
.oneri-satir + .oneri-satir { border-top: 1px solid var(--line); }
.oneri-satir:hover, .oneri-satir.vurgu { background: var(--paper-dim); color: var(--ink); }
.oneri-ad { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.oneri-fiyat { font-weight: 700; color: var(--ink); white-space: nowrap; font-size: 13px; }

.urun-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.urun-kart {
  background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 0; cursor: pointer; text-align: left; font-family: 'Inter', sans-serif;
  overflow: hidden; transition: border-color .12s, transform .08s;
  display: flex; flex-direction: column;
}
.urun-kart:hover { border-color: var(--ink); }
.urun-kart:active { transform: scale(.97); }
.urun-kart-gorsel {
  width: 100%; aspect-ratio: 3 / 2; background: var(--paper-dim);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.urun-kart-gorsel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.urun-kart-placeholder {
  font-family: 'Space Grotesk', sans-serif; font-size: 30px; font-weight: 700; color: var(--ink);
  opacity: .3;
}
.urun-kart-ad {
  font-size: 15.5px; font-weight: 600; color: var(--ink); padding: 10px 12px 2px;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.urun-kart-fiyat {
  font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 700; color: var(--pencil-dark);
  padding: 0 12px 12px;
}

/* --- Sepet paneli (sağda sabit) --- */
.sepet-panel { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 18px; position: sticky; top: 16px; }
.sepet-panel h2 { margin-bottom: 12px; }
.sepet-liste { max-height: 40vh; overflow-y: auto; margin-bottom: 12px; }
.sepet-satir-alt { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sepet-baslik-satiri { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
/* Sepetteki kalem/adet sayacı — okutulan ürünün gerçekten eklendiğini teyit eder. */
.sepet-sayac {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--pencil); border-radius: 999px;
  padding: 3px 11px; margin-left: 6px; white-space: nowrap; vertical-align: middle;
}
.sepet-baslik-satiri h2 { margin: 0; }
.sepet-temizle-buton { background: none; border: none; color: var(--stamp-red); font-size: 13px; cursor: pointer; font-family: 'Inter', sans-serif; text-decoration: underline; }

/* Sepet satırı: görselli liste — her ürün alt alta, tek sütun. */
.sepet-liste { display: flex; flex-direction: column; gap: 8px; }
.sepet-liste .empty { text-align: center; }
.sepet-satir { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sepet-satir-bilgi { display: flex; align-items: center; gap: 10px; }
/* Sepette küçük ürün görseli (liste görünümü) */
.sepet-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; overflow: hidden;
  background: var(--paper-dim); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.sepet-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sepet-thumb-bos { color: var(--text-mute); font-size: 16px; }
.sepet-satir-metin { flex: 1; min-width: 0; }
.sepet-satir-ad { display: block; font-weight: 600; font-size: 16.5px; color: var(--ink); }
.sepet-satir-barkod { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--text-mute); }
.sepet-satir-sil {
  background: none; border: none; color: var(--stamp-red); cursor: pointer; line-height: 1; flex-shrink: 0;
  width: 38px; height: 38px; font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.sepet-satir-alt { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sepet-adet-kontrol { display: flex; align-items: center; gap: 6px; }
.sepet-adet-buton {
  width: 44px; height: 44px; border: 1.5px solid var(--ink); background: #fff; border-radius: 8px;
  font-size: 22px; font-weight: 700; cursor: pointer; color: var(--ink); line-height: 1;
}
.sepet-adet-buton:hover { background: var(--paper-dim); }
input.sepet-adet-goster {
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 17px;
  width: 60px; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 6px;
  -moz-appearance: textfield;
}
input.sepet-adet-goster::-webkit-outer-spin-button,
input.sepet-adet-goster::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sepet-satir-fiyat { display: flex; align-items: center; gap: 4px; font-size: 15px; color: var(--text-mute); font-weight: 600; }
input.sepet-birim-fiyat {
  width: 92px; padding: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 16px;
  border: 1px solid var(--line); border-radius: 6px; text-align: right; font-weight: 600;
}
input.sepet-birim-fiyat.ozel { border-color: var(--pencil); background: #FFF9EC; color: var(--ink); }
.sepet-fiyat-sifirla { background: none; border: none; cursor: pointer; color: var(--ink); font-size: 20px; padding: 4px; }
.sepet-satir-tutar { margin-left: auto; font-weight: 700; font-size: 17px; color: var(--ink); font-family: 'IBM Plex Mono', monospace; }

/* Belirgin özet (ara toplam / KDV / genel toplam) */
.sepet-ozet { margin: 12px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sepet-ozet-satir { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; padding: 3px 0; color: var(--text-mute); }
.sepet-ozet-genel {
  font-size: 22px; font-weight: 700; color: var(--ink);
  padding-top: 10px; margin-top: 4px; border-top: 2px solid var(--ink);
}
.satis-odeme-satiri { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.satis-buton-grubu { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 14px; }
.satis-tamamla-buton { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }
.satis-tamamla-buton:disabled, #dokumButon:disabled { opacity: .4; cursor: not-allowed; }
#dokumButon { padding: 14px 10px; justify-content: center; }

@media (min-width: 901px) {
  .sepet-liste { max-height: min(56vh, 560px); }
}

@media screen and (max-width: 900px) {
  .satis-ekrani { grid-template-columns: 1fr; }
  .satis-sag { order: 1; }   /* mobilde: sepet üstte */
  .satis-sol { order: 2; }   /* mobilde: ürünler altta */
  .sepet-panel { position: static; }

  /* Mobilde ürünler KART değil LİSTE olarak dizilir: ekrana iki katı ürün sığar,
     isimler kırpılmadan okunur ve satırın tamamı dokunma alanı olur. */
  .urun-grid { grid-template-columns: 1fr; gap: 8px; }
  .urun-kart { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px; }
  .urun-kart-gorsel {
    width: 48px; height: 48px; aspect-ratio: auto; flex-shrink: 0; border-radius: 8px;
  }
  .urun-kart-placeholder { font-size: 20px; }
  .urun-kart-ad {
    flex: 1; min-width: 0; padding: 0; font-size: 15px; -webkit-line-clamp: 2;
  }
  .urun-kart-fiyat { padding: 0; font-size: 16px; white-space: nowrap; flex-shrink: 0; }
}

/* --- Mobil satış alt çubuğu ---
   Telefonda sepet üstte, kamera butonu altta kaldığı için sürekli kaydırmak gerekiyordu.
   Bu çubuk ekranın altına sabitlenir: kamera ve "Tamamla" her an elinizin altındadır.
   Masaüstünde gizlidir (orada sepet paneli zaten sağda sabit duruyor). */
.satis-alt-cubuk { display: none; }

@media screen and (max-width: 900px) {
  .satis-alt-cubuk {
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
    background: #fff; border-top: 2px solid var(--ink);
    padding: 10px 12px; box-shadow: 0 -6px 20px rgba(20, 22, 30, .14);
  }
  .sac-kamera {
    width: 54px; height: 54px; flex-shrink: 0; font-size: 24px; line-height: 1;
    background: #fff; border: 2px solid var(--ink); border-radius: 10px; cursor: pointer;
  }
  .sac-kamera:active { background: var(--paper-dim); }
  .sac-ozet {
    flex: 1; min-width: 0; font-family: 'IBM Plex Mono', monospace;
    font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3;
  }
  .sac-tamamla { flex-shrink: 0; padding: 15px 18px; font-size: 15px; }
  .sac-tamamla:disabled { opacity: .4; }
  /* Sayfanın son satırları çubuğun altında kalmasın — yalnızca çubuğun olduğu sayfada. */
  .wrap:has(.satis-alt-cubuk) { padding-bottom: 100px; }
}

/* Satış — tahsil edilecek tutar (genel indirim) kutusu */
.tahsil-kutu { margin: 12px 0; padding: 10px 12px; background: var(--paper-dim); border-radius: 10px; }
.tahsil-kutu input { width: 100%; box-sizing: border-box; margin-top: 4px; }

/* Sepette elle indirim yapılıp alış fiyatının altına düşülünce çıkan zarar uyarısı. */
.sepet-zarar {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: #FBEDEB; border: 1px solid #E3C3BD; color: #8C3B30;
  font-size: 13px; font-weight: 500; line-height: 1.35;
}
.sepet-zarar strong { font-family: 'IBM Plex Mono', monospace; }

/* Sepete yeni eklenen/okutulan satır kısa süre vurgulanır (göze çarpsın). */
.sepet-satir-vurgu { animation: sepetVurgu 1.1s ease; }
@keyframes sepetVurgu {
  0% { background: #FFE9A8; }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .sepet-satir-vurgu { animation: none; background: #FFE9A8; }
}

/* Uzun listeler için dikey kaydırılabilir kutu (ör. panel kritik stok). */
.dikey-kaydir { max-height: 420px; overflow-y: auto; }
.dikey-kaydir table { width: 100%; }
.dikey-kaydir thead th, .dikey-kaydir tr:first-child th {
  position: sticky; top: 0; background: #fff; z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

/* ============================================================
   Satış ekranı — v7 eklemeleri
   ============================================================ */

/* Sayfa yenilemeden tamamlanan satışın sonuç mesajı */
#satisMesaj { margin: 0 0 12px; font-weight: 600; }

/* Sepette arama ("şunu eklediniz mi?") */
.sepet-ara { margin: 0 0 8px; }
.sepet-ara input { width: 100%; box-sizing: border-box; }
.sepet-ara-sonuc { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; min-height: 1em; }
.sepet-ara-var { color: #2F7D4F; }
.sepet-ara-yok { color: var(--stamp-red); font-size: 15px; }
.sepet-satir.sepet-ara-eslesen { background: #FFF4CC; box-shadow: inset 4px 0 0 var(--pencil); }
.sepet-satir.sepet-ara-soluk { opacity: .35; }

/* Sepet satırındaki stok bilgisi */
.sepet-stok { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.sepet-stok-az { color: #B7791F; font-weight: 600; }
.sepet-stok-son { color: var(--stamp-red); font-weight: 600; }

/* % indirim + tahsil tutarı yan yana */
.indirim-satiri { display: flex; gap: 8px; flex-wrap: wrap; }
.indirim-satiri .indirim-yuzde { flex: 0 0 90px; }
.indirim-satiri .indirim-tutar { flex: 1 1 140px; }

/* İndirimin kâra etkisi */
.kar-etki { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; background: #fff; border: 1px solid var(--line); }
.kar-etki > div + div { margin-top: 3px; }
.kar-etki-durum { font-weight: 700; }
.kar-etki-not { color: var(--text-mute); }
.kar-etki-iyi { border-color: #BFDCC9; }
.kar-etki-iyi .kar-etki-durum { color: #2F7D4F; }
.kar-etki-dusuk { border-color: #F2D29B; background: #FFF8EA; }
.kar-etki-dusuk .kar-etki-durum { color: #B7791F; }
.kar-etki-zarar { border-color: #E9B9AE; background: #FBEDEB; }
.kar-etki-zarar .kar-etki-durum { color: var(--stamp-red); }

/* Stok düzeltme penceresi (kamera katmanının da üstünde açılır) */
.stok-pencere-arka {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 24, 40, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
/* hidden özniteliği, display tanımlı sınıflarda (.flash vb.) da kesin gizlesin */
[hidden] { display: none !important; }
.stok-pencere {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  width: 100%; max-width: 440px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  border-top: 5px solid var(--stamp-red);
}
.stok-pencere h3 { margin: 0 0 8px; color: var(--stamp-red); }
.stok-pencere input { width: 100%; box-sizing: border-box; font-size: 20px; }
.stok-pencere-butonlar { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
@media screen and (max-width: 480px) {
  .stok-pencere-butonlar .btn { flex: 1 1 100%; }
}

/* Menü içi sayfa arama */

/* Satır içi düzeltme (tedarikçi cari dökümü) */
.satir-duzenle summary { list-style: none; cursor: pointer; display: inline-block; }
.satir-duzenle summary::-webkit-details-marker { display: none; }
.satir-duzenle[open] summary { background: var(--paper-dim); }

/* Ürün formu: alış — kâr % — satış yan yana */
.fiyat-satiri { display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 14px; }
.fiyat-yuvarla { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
@media screen and (max-width: 640px) { .fiyat-satiri { grid-template-columns: 1fr; } }

/* Arama önerilerinde stok bilgisi */
.oneri-stok { display: block; font-size: 12px; font-weight: 500; color: var(--text-mute); margin-top: 2px; }
.oneri-stok-az { color: #B7791F; font-weight: 600; }
.oneri-stok-yok { color: var(--stamp-red); font-weight: 600; }

/* İade para özeti */
.iade-ozet { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.iade-ozet-tablo { width: 100%; border-collapse: collapse; font-size: 15px; }
.iade-ozet-tablo td { padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.iade-ozet-tablo td:last-child { text-align: right; white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }
.iade-ozet-eksi td:last-child { color: var(--stamp-red); }
.iade-ozet-ara td { color: var(--text-mute); }
.iade-ozet-buyuk td { font-size: 17px; border-top: 2px solid var(--ink); }
.iade-ozet-zarar td { color: var(--stamp-red); font-size: 17px; background: #FBEDEB; }
.iade-ozet-sifir td { color: #2F7D4F; }
.iade-ozet-butonlar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.iade-ozet-not { font-size: 13px; color: var(--text-mute); margin: 6px 0 0; }

/* WhatsApp mesaj önizlemesi */
.wa-onizleme { white-space: pre-wrap; background: #E7F8E9; border: 1px solid #BFE3C4; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* Değişim: sepette geri alınan ürün satırı + fark satırı + arama penceresi */
.sepet-satir-iade { background: #FFF5F5; border-left: 4px solid var(--stamp-red); }
.sepet-satir-iade .sepet-satir-tutar { color: var(--stamp-red); }
.sepet-iade-etiket { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--stamp-red); border-radius: 4px; padding: 1px 6px; margin-right: 4px; vertical-align: 1px; }
.sepet-iade-adet { min-width: 34px; min-height: 34px; font-size: 18px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.sepet-iade-adet:disabled { opacity: .4; cursor: default; }
.sepet-iade-adet-goster { display: inline-block; min-width: 32px; text-align: center; font-weight: 700; font-size: 16px; }
.sepet-iade-kusur { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-left: 8px; cursor: pointer; }
.degisim-fark { background: #F0FFF4; border-radius: 6px; padding: 6px 8px; }
.degisim-fark-ver { background: #FFF5F5; color: var(--stamp-red); }
.degisim-pencere { max-width: 560px; border-top-color: var(--gold, #C9A227); }
.degisim-pencere h3 { color: var(--ink); }
.degisim-sonuc { max-height: 50vh; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.degisim-sonuc-satir { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; }
.degisim-sonuc-satir:hover, .degisim-sonuc-satir:focus { border-color: var(--stamp-red); background: #FFF9F0; }
.degisim-sonuc-satir span { font-size: 12px; color: var(--text-mute); }

/* Günlük satışlar: her fiş ayrı, tam genişlikte, alt alta (fiş/defter görünümü) */
.fis-suzgec { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; max-width: 1000px; box-sizing: border-box; }
.fis-suzgec-grup { display: flex; flex-wrap: wrap; gap: 4px; }
.fis-cip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.fis-cip.secili { background: var(--ink); border-color: var(--ink); color: #fff; }
.fis-suzgec input[type=search] { flex: 1 1 220px; min-width: 0; }
.fis-liste { display: flex; flex-direction: column; gap: 10px; max-width: 1000px; }
.fis-kart { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 8px; overflow: hidden; }
.fis-kart-musteri { border-left-color: #B7791F; }
.fis-kart-degisim { border-left-color: var(--stamp-red); }
.fis-kart-bas { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 9px 14px; background: var(--paper-dim); border-bottom: 1px solid var(--line); }
.fis-kart-no { font-weight: 700; font-size: 15px; }
.fis-kart-saat { font-family: 'IBM Plex Mono', monospace; color: var(--text-mute); }
.fis-kart-kim { color: var(--text-mute); font-size: 13px; }
.fis-kart-toplam { margin-left: auto; font-weight: 700; font-size: 17px; white-space: nowrap; font-family: 'IBM Plex Mono', monospace; }
.fis-kart-kalemler { width: 100%; border-collapse: collapse; margin: 0; }
.fis-kart-kalemler td { padding: 5px 8px; border-bottom: 1px solid #F3EFE6; font-size: 14px; background: transparent !important; vertical-align: baseline; }
.fis-kart-kalemler tr:last-child td { border-bottom: 0; }
.fis-kart-kalemler td:first-child { padding-left: 14px; }
.fis-kart-kalemler td:last-child { padding-right: 14px; }
.fis-adet { width: 1%; white-space: nowrap; text-align: right; color: var(--text-mute); font-family: 'IBM Plex Mono', monospace; }
.fis-ad { width: auto; }
.fis-birim { width: 1%; white-space: nowrap; text-align: right; color: var(--text-mute); font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.fis-tutar { width: 1%; white-space: nowrap; text-align: right; font-family: 'IBM Plex Mono', monospace; }
.fis-ozel { font-size: 11px; color: #B7791F; background: #FFF6E5; border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.fis-iade-satir td { color: var(--stamp-red); }
.fis-iade-satir .fis-ozel { color: var(--stamp-red); background: #FBEDEB; }
.fis-kart-fark { display: flex; justify-content: flex-end; gap: 10px; padding: 6px 14px; background: #FBEDEB; color: var(--stamp-red); font-size: 14px; }
.fis-kart-alt { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 14px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--text-mute); }
.fis-not-indirim { color: var(--stamp-red); }
.fis-kart-islem { margin-left: auto; display: flex; gap: 14px; }
.fis-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; text-decoration: none; }
.fis-link:hover { text-decoration: underline; }
@media screen and (max-width: 560px) {
  .fis-kart-bas { padding: 8px 10px; }
  .fis-kart-kim { flex-basis: 100%; order: 3; }
  .fis-birim { display: none; }
  .fis-kart-kalemler td:first-child { padding-left: 10px; }
  .fis-kart-kalemler td:last-child { padding-right: 10px; }
  .fis-kart-alt, .fis-kart-fark { padding: 6px 10px; }
}

/* İade sayfasında değişim önerisi */
.degisim-oneri { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; background: #F0F4FF; border: 1px solid #C9D4F2; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.degisim-oneri > div { flex: 1 1 260px; }

/* Ürün listesi sayfalama */
.sayfalama { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sayfalama-no { min-width: 32px; text-align: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 13px; }
.sayfalama-no.secili { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.sayfalama-ara { color: var(--text-mute); padding: 0 2px; }
.sayfalama-bilgi { color: var(--text-mute); font-size: 13px; margin-right: auto; }
.sayfalama-hepsi { margin-left: auto; font-size: 13px; }
.oneri-bos { padding: 10px 12px; color: var(--text-mute); font-size: 13px; }

/* Sıralanabilir tablo başlıkları + tablo arama kutusu */
th.siralanir { cursor: pointer; user-select: none; white-space: nowrap; }
th.siralanir:hover { text-decoration: underline; }
th.siralanir::after { content: ' ⇅'; opacity: .35; font-size: 11px; }
th.sirali-artan::after { content: ' ↑'; opacity: 1; }
th.sirali-azalan::after { content: ' ↓'; opacity: 1; }
.tablo-arac { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 10px; }
.tablo-arac .tablo-ara { flex: 1 1 240px; min-width: 0; margin: 0; }

/* Stok ekranındaki ürün önerilerinde pasif ürün işareti — pasif ürün de listelenir
   (yeni stoğu girilebilsin diye), ama karışmasın diye görsel olarak ayrılır. */
.oneri-pasif { color: #b45309; font-style: normal; font-weight: 600; }

/* ÇIKTI: "PDF / Yazdır" ve "Excel" düğmeleri (assets/cikti.js ekler) ve yazdırma görünümü.
   Yazdırırken menü, düğmeler ve veri giriş formları gizlenir; başlık, tarih aralığı, rakam
   kutuları ve tablolar A4'e sığacak şekilde basılır. Tablo içeren formlar (stok sayımı gibi) kalır. */
.cikti-dugmeleri { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cikti-ust-bilgi { display: none; }
@media print {
  @page { size: A4; margin: 12mm 10mm; }
  html, body { background: #fff !important; color: #000; }
  body { font-size: 11px; }
  .topbar, .mainnav, .mainnav-basit, .altmenu, .cikti-dugmeleri, .lightbox,
  .btn, button, select, .flash, .no-print, .cikti-haric,
  form:not(:has(table)), .page-head a { display: none !important; }
  /* Yalnızca filtre / veri giriş formu taşıyan kutular yazdırmada boş kalmasın (cikti.js işaretler) */
  .cikti-gizle, .sayfalama, input[type=checkbox], img.urun-thumb { display: none !important; }
  /* Kaydırma kutuları kağıtta kesilmesin: yükseklik sınırı ve yapışkan başlıklar kalkar */
  .dikey-kaydir, .tablo-scroll { max-height: none !important; overflow: visible !important; }
  .dikey-kaydir thead th, .dikey-kaydir tr:first-child th, thead th { position: static !important; box-shadow: none !important; }
  .cikti-ust-bilgi { display: block; font-size: 10px; color: #444; border-bottom: 1px solid #999; padding-bottom: 4px; margin-bottom: 8px; }
  .wrap, .container, main { max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
  .page-head { margin-bottom: 8px; }
  .page-head h1 { font-size: 18px; margin: 0; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; padding: 8px !important; break-inside: auto; overflow: visible !important; }
  .card + .card { margin-top: 8px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; margin-bottom: 8px; }
  .stat-card { box-shadow: none !important; border: 1px solid #ccc; padding: 6px 8px !important; break-inside: avoid; }
  .stat-num, .stat-buyuk .stat-num { font-size: 13px !important; }
  .tablo-scroll { overflow: visible !important; }
  table { width: 100% !important; font-size: 9.5px; border-collapse: collapse; }
  th, td { padding: 3px 4px !important; }
  td.mono, td.sag, td.s { white-space: nowrap; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  input { border: none !important; background: none !important; padding: 0 !important; font-size: 9.5px; }
  h2, h3 { break-after: avoid; }
}

/* --- Sadeleştirme (v23): listelerde satır altı hızlı form (Tahsilat al / Ödeme-Fatura) --- */
.hizli-satir td { background: var(--paper-dim); border-left: 4px solid var(--pencil); }
.hizli-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.hizli-form label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }
.hizli-form input, .hizli-form select { margin: 0; width: auto; }
.hizli-form select { max-width: 240px; }
@media print { .hizli-satir { display: none !important; } }
/* Günlük Satışlar fiş kartı: "Fişi iptal et" (form, bağlantı gibi görünür) */
.fis-iptal-form { display: inline; margin: 0; }
.fis-link-iptal { color: var(--stamp-red); }
@media screen and (max-width: 560px) { .fis-kart-islem { flex-wrap: wrap; gap: 10px; } }
/* Satış ekranı: ödeme şekli düğmeleri (Sadeleştirme B) ve KDV özeti (D) */
.odeme-dugmeleri { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.odeme-dugme {
  padding: 12px 8px; border: 2px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.odeme-dugme:hover { border-color: var(--pencil); }
.odeme-dugme.secili { background: var(--pencil); border-color: var(--pencil-dark); color: #1d1d1d; }
.odeme-dugme:disabled { opacity: .45; cursor: not-allowed; }
/* kod_v26: Banka ve Tedarikçi POS — Nakit/Kart'ın altında küçük ama hep görünür */
.odeme-dugme-kucuk { padding: 6px 8px; font-size: 13px; font-weight: 500; border-width: 1px; }
/* kod_v26: kartlardaki tek kutunun seçicisi (Tahsilat aldım / Borç ekle — Ödeme yaptım / Fatura geldi) */
.mod-secici { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.mod-dugme {
  flex: 1; min-width: 150px; max-width: 260px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 8px;
  background: #fff; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.mod-dugme:hover { border-color: var(--pencil); }
.mod-dugme.secili { background: var(--pencil); border-color: var(--pencil-dark); color: #1d1d1d; }
.kdv-ozet { margin: 8px 0 0; font-size: 13px; color: var(--text-mute); }
.kdv-ozet .fis-link { font-size: 13px; }
/* İade / Değişim penceresi: her satırda iki seçenek */
.degisim-sonuc-kalem { display: flex; gap: 8px; align-items: stretch; }
.degisim-sonuc-kalem .degisim-sonuc-satir { flex: 1; }
.degisim-iade-link { display: flex; align-items: center; white-space: nowrap; }
/* Kasa defteri: fiş bazında satış satırı, ürünler açılınca (Faz 6 #15) */
.kasa-fis > summary { cursor: pointer; }
.kasa-fis-kalemler { margin: 6px 0 2px; padding-left: 18px; font-size: 13px; color: var(--text-mute); }
.kasa-fis-kalemler li { display: flex; justify-content: space-between; gap: 12px; max-width: 520px; }
/* Tedarikçi / müşteri detayı: döküm süzgeci (Faz 6 #17) */
.detay-suzgec { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.detay-suzgec label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }
.detay-suzgec input, .detay-suzgec select { width: auto; margin: 0; }
/* Satış: özel fiyatlı satıra ekleme uyarısı (Faz 6 #18) */
.sepet-ozel-uyari { flex-basis: 100%; width: 100%; margin-top: 4px; padding: 4px 8px; font-size: 12px; border-radius: 6px;
  background: #FFF4D6; color: #7A5200; border: 1px solid #F3D58A; }
/* kod_v26: tedarikçi ödemesi tek yol — Kasa / Hızlı Gider'de karta yönlendirme kutusu ve çift ödeme onayı */
.tedarikci-yonlendir { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13.5px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--paper-dim); }
.tedarikci-yonlendir select { width: auto; max-width: 100%; }
.ayri-odeme-kutu { padding: 8px 10px; border: 2px solid var(--stamp-red); border-radius: 8px; background: #fff5f3; }
/* kod_v26: ÖZET sayfası — durum cümlesi, Dikkat panosu (en fazla 4 açık, gerisi katlanır), iki sütunlu bölümler */
.ozet-cumle p { margin: 0; font-size: 17px; line-height: 1.7; }
.ozet-arti { color: #2C6A4B; }
.ozet-eksi { color: var(--stamp-red); }
.dikkat-sayi { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 11px; background: var(--stamp-red); color: #fff; font-size: 13px; text-align: center; vertical-align: middle; }
.dikkat-satir { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; margin-top: 6px; border-radius: 8px; border-left: 4px solid var(--line); background: var(--paper-dim); font-size: 14px; }
.dikkat-satir span { flex: 1; min-width: 200px; }
.dikkat-kirmizi { border-left-color: var(--stamp-red); background: #fff3f0; }
.dikkat-sari { border-left-color: var(--pencil); background: #fffaeb; }
.dikkat-bilgi { border-left-color: #8aa4c0; }
.dikkat-daha > summary { cursor: pointer; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--text-mute); }
.ozet-ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ozet-ayrinti { margin: 4px 0 20px; line-height: 1.8; }
@media screen and (max-width: 820px) { .ozet-ikili { grid-template-columns: 1fr; } .ozet-cumle p { font-size: 15.5px; } }
.ozet-ikili > .card { margin-top: 0; }   /* yan yana iki kutu aynı hizada başlasın (.card + .card boşluğu burada istenmez) */
/* Özet tablolarında tutarlar satıra bölünmesin ("110.610,5 / 2 ₺" olmasın); telefonda biraz küçülür, sığmazsa tablo kendi içinde kayar. */
.ozet-ikili td.mono, #urunTablo td.mono { white-space: nowrap; }
@media screen and (max-width: 560px) {
  .ozet-ikili table, #urunTablo { font-size: 12.5px; }
  .ozet-ikili td, .ozet-ikili th, #urunTablo td, #urunTablo th { padding-left: 5px; padding-right: 5px; }
}
