:root {
  color-scheme: light dark;
  /* Kurumsal tema — Şahin Kırtasiye: lacivert + altın */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #dde3ec;
  --text: #17223b;
  --text-muted: #5c6a80;
  --primary: #1b3a68;
  --primary-text: #ffffff;
  --primary-dark: #12284a;
  --primary-soft: #e7edf6;
  --accent: #c9a13b;
  --accent-soft: #f6efdb;
  --navy-1: #12284a;
  --navy-2: #1b3a68;
  --navy-3: #234a80;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --sahin: #7c3aed;
  --sahin-bg: #ede9fe;
  --mikro: #0891b2;
  --mikro-bg: #cffafe;
  --radius: 12px;
  --radius-sm: 8px;
  /* EDA51 sadeleştırması (2026-09-21): tek katmanlı hafif gölge — kalın
   * kart gölgeleri küçük ekranda gürültüydü. */
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.07);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #1a2436;
    --border: #263145;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --primary: #4d7cb6;
    --primary-dark: #3a659c;
    --primary-soft: #1e2f4d;
    --accent: #d4b45c;
    --accent-soft: #322a12;
    --navy-1: #0e1f3c;
    --navy-2: #142c50;
    --navy-3: #1d3d6e;
    --danger: #f87171;
    --danger-bg: #3f1d1d;
    --success: #4ade80;
    --success-bg: #14301f;
    --warning: #fbbf24;
    --warning-bg: #3a2c0e;
    --sahin: #a78bfa;
    --sahin-bg: #2c2350;
    --mikro: #22d3ee;
    --mikro-bg: #0e3238;
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Layout primitives ---------- */

/* Kurumsal topbar — EDA51 sadeleştırması (2026-09-21): gradyan ve altın
 * çizgi kaldırıldı; düz lacivert yüzey küçük ekranda daha sakin. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(12px + var(--safe-top)) 12px 12px;
  background: var(--navy-2);
  color: #ffffff;
}

.topbar h1 {
  font-size: 17px;
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
}

.topbar .icon-btn {
  flex-shrink: 0;
  color: #ffffff;
}
.topbar .icon-btn:active { background: rgba(255, 255, 255, .15); }
.topbar a { color: #ffffff; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 12px calc(16px + var(--safe-bottom));
  gap: 12px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.screen-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  gap: 16px;
}

.spacer { flex: 1; }

/* ---------- Typography ---------- */

h2 { font-size: 19px; margin: 4px 0; }
h3 { font-size: 15px; margin: 0 0 6px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em;}
p { line-height: 1.5; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* ---------- Buttons ---------- */

button {
  font: inherit;
  cursor: pointer;
}

/* Tek elle kullanım: tüm dokunma hedefleri en az 52px — başparmakla
 * rahat vurulur, yanlış dokunma azalır. */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px; /* ana dokunma alanı hedefi ~56px (2026-09-17) */
  transition: transform .05s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
.btn-primary:active { background: var(--primary-dark); }

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bg);
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
}

.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 8px 14px; font-size: 14px; border-radius: 999px; }

.icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.icon-btn:active { background: var(--surface-2); }

.fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 20;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 26px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .4);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 14px; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* iOS zoom-in engelle */
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

textarea { resize: vertical; min-height: 64px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
}
.checkbox-row input { width: 18px; height: 18px; }

/* Cari kayıt formundaki büyük harf alanları (yeniMusteri.js) — görsel
 * dönüşüm canlı gösterir; gerçek değer gönderimde JS/backend ile büyür. */
.buyuk-giris { text-transform: uppercase; }
.buyuk-giris::placeholder { text-transform: none; }

.search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.search-row input { flex: 1; }
/* Arama kutusunun yanındaki barkod kamera düğmesi — kutuyla aynı yükseklikte,
 * başparmakla kolay vurulur. */
.search-row .btn {
  flex-shrink: 0;
  padding-left: 18px;
  padding-right: 18px;
  font-size: 20px;
}

.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface-2);
}
.toggle-group button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 12px;
  min-height: 48px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.toggle-group button.active {
  background: var(--primary);
  color: var(--primary-text);
}

/* Siparişlerim'deki 4'lü durum filtresi — "Gönderilmeyen" gibi uzun
 * etiketler dar ekranda sığsın diye varsayılan toggle-group'tan sıkı. */
.toggle-group.toggle-group-sik button {
  padding: 12px 6px;
  font-size: 13px;
  white-space: nowrap;
}

/* Filtre amaçlı tek başına duran select — satır genişliğini kaplasın. */
.filtre-select {
  width: 100%;
}

/* Siparişlerim'deki seçilebilir satır — onay kutusu kartın solunda,
 * başparmakla kolay vurulur boyutta. */
.siparis-satir {
  display: flex;
  align-items: center;
  gap: 10px;
}
.siparis-satir .list-item { flex: 1; }
.siparis-satir .siparis-sec {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ---------- Cards / lists ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 60px;
  text-align: left;
  width: 100%;
}

.avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.list-item-body { flex: 1; min-width: 0; }
/* EDA51 (2026-09-21): liste başlıkları 16px — ürün/müşteri adı ekrandaki
 * en kolay okunan öğe olsun. */
.list-item-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Uzun cari ünvanları "…" ile kısaltılmaz — sarmala sınıfı satırı kaç
 * satır gerekirse o kadar uzatır (cari seçimi ve sipariş listeleri). */
.list-item-title.sarmala,
.list-item-sub.sarmala {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* KOD'u "120.01" ile başlayan toptancı cariler — müşteri aramasında normal
 * müşterilerden gözle ayrışsın diye amber satır + rozet. */
.list-item.toptanci-cari { background: var(--warning-bg); border-color: var(--warning); }
.list-item.toptanci-cari .avatar { background: var(--warning); color: #17223b; }

.chevron { color: var(--text-muted); flex-shrink: 0; }

/* ---------- Hızlı ekleme (arama sonuçlarında miktar + ＋) ----------
 * EDA51 düzeni (2026-09-21): satır dikey akışta — ürün adı tam genişlikte,
 * fiyat kendi satırında, miktar kutusu + ＋ ürün bilgisinin ALTINDA tam
 * genişlik. Böylece uzun ürün adı kontrol düğmeleriyle yatayda yarışmaz. */
.hizli-satir { display: block; cursor: pointer; }
.urun-bilgi { cursor: pointer; }
.urun-fiyat { font-size: 16px; font-weight: 700; margin-top: 2px; }
.hizli-ekle {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}
.hizli-ekle .hizli-miktar {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 8px 6px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}
.hizli-ekle .hizli-btn {
  flex-shrink: 0;
  width: 72px;
  height: auto;
  min-height: 56px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hizli-ekle .hizli-btn:active { background: var(--primary-dark); }
.hizli-ekle .hizli-btn:disabled { opacity: .5; }

/* Sepete eklenmiş ürün — EDA51 (2026-09-21): satırın tamamı yeşile
 * boyanmaz; yalnız kenarlık yeşile döner ve satırda okunabilir
 * "✓ Sepette N" rozeti durur (bkz. .sepette-rozeti). */
.hizli-satir.sepette-var {
  border-color: var(--success);
}
.sepette-rozeti {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
/* display kuralı [hidden] özniteliğinin varsayılan display:none'unu ezer —
 * olmadan gizli rozet yine görünür olur. */
.sepette-rozeti[hidden] { display: none; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-sahin { background: var(--sahin-bg); color: var(--sahin); }
.badge-mikro { background: var(--mikro-bg); color: var(--mikro); }
.badge-acik { background: var(--warning-bg); color: var(--warning); }
.badge-gonderildi { background: var(--success-bg); color: var(--success); }
.badge-hata { background: var(--danger-bg); color: var(--danger); }
.badge-bekliyor { background: var(--surface-2); color: var(--text-muted); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }
.badge-toptanci { background: var(--warning); color: #17223b; }

/* Müşteri geçmişi rozetleri — Ürün Ekle arama satırında, seçili müşterinin
 * geçen yıl (dönem DB'si eksikse bu yıl) satışı ve ERP'deki bekleyen sipariş
 * kalanı (2026-09-06 kullanıcı isteği). Veri /stok/gecmis'ten asenkron
 * gelir; kapsayıcı satır şablonunda boş yer alır. KOD/fiyat satırı
 * `nowrap`+ellipsis kestiği için rozetler KENDİ satırında durur — boşken
 * yükseklik de kaplamasın diye display:flex sadece dolunca geçerli olur. */
.gecmis-rozetleri:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.badge-gecmis { background: var(--surface-2); color: var(--text-muted); }
.badge-bekleyen { background: var(--warning-bg); color: var(--warning); }

/* Rozet akış durumları (2026-09-10): geçmiş verisi arkada yüklenirken satır
 * boş kalmaz (soluk çip); yüklenemezse sessizlik yerine dokununca yeniden
 * denenen uyarı çipi gelir. Özellik sunucuda kapalıysa (GECMIS_ROZET=0)
 * hiçbir çip basılmaz. */
.badge-yukleniyor { background: var(--surface-2); color: var(--text-muted); font-weight: 500; }
.badge-rozet-hata { background: var(--danger-bg); color: var(--danger); cursor: pointer; }

/* Ürün popup'ındaki aynı bilginin kutu hâli. */
.gecmis-kutu {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Sepet / kalem satırı ---------- */

.kalem-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kalem-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
/* EDA51 (2026-09-21): kalem adı ve tutarı sepetin en kolay okunan
 * yazılarıdır — 16px, yardımcı bilgi 13px. */
.kalem-adi { font-weight: 600; font-size: 16px; }
.kalem-kodu { font-size: 13px; color: var(--text-muted); }
.kalem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.kalem-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.kalem-tutar { font-weight: 700; font-size: 16px; white-space: nowrap; }

/* Sepet kalemi jestleri (sepet.js): sola kaydır-sil + uzun bas/çoklu seçim.
 * `touch-action: pan-y` dikey kaydırmayı tarayıcıya bırakır, yatay pointer
 * hareketini bize verir; `user-select: none` uzun basmada metin seçimini
 * engeller. Satır kaydırılırken arkasında kırmızı "Sil" ipucu görünür. */
.kalem-baslik-satiri {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kalem-baslik-satiri h3 { margin: 0; }
/* Kaydırma ipucu satırın SAĞ DIŞINDA durur; liste yatayda kırpılır ki sayfa
 * yana kaymasın (clip: kaydırma kabı oluşturmaz; hidden eski tarayıcı yedeği). */
#kalem-liste { overflow-x: hidden; overflow-x: clip; }
.kalem-row {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .18s ease, background-color .15s ease, border-color .15s ease;
}
.kalem-row.kaydiriliyor { transition: none; }
.kalem-row .kalem-row-ic { display: flex; gap: 10px; align-items: flex-start; }
.kalem-row .kalem-row-govde { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kalem-row .kalem-sec { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.kalem-kaydir-ipucu {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 160px;
  display: flex;
  align-items: center;
  padding-left: 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}
.kalem-row.kaydiriliyor .kalem-kaydir-ipucu { opacity: 1; }
.kalem-row.kaydir-esik .kalem-kaydir-ipucu { background: var(--danger); color: #fff; }
.kalem-row.secim-modu { cursor: pointer; }
.kalem-row.secili {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ---------- Fuar kampanyası (app/kampanya.py) ----------
 * Bedava satır (kalem.kampanya_id dolu): 🎁, kesik liste değeri, dokunulmaz.
 * Çip: ürün ekleme satırında ve admin formunda seçili ürün. İpucu: sepette
 * "3 daha alırsan 1 bedava" kartı. Renkler --accent/--accent-soft (altın):
 * success yeşili "sepette var" için kullanılıyor, karışmasın. */
.kalem-row.kampanya {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: dashed;
  touch-action: auto;
}
.kalem-row.kampanya .kalem-tutar s { font-weight: 400; font-size: 12px; margin-right: 4px; }
.kampanya-etiket {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1400;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.totals-row.kampanya-kazanc { color: var(--text); font-weight: 600; }
.totals-row.kampanya-kazanc .mono { color: var(--accent); }
.kampanya-ipucu {
  margin: 0 0 4px;
  padding: 8px 12px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kampanya-cipler-satir:not(:empty) { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.kampanya-cipler { display: flex; flex-wrap: wrap; gap: 6px; }
.kampanya-cip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
}
.kampanya-cip-kucuk { font-size: 11px; padding: 2px 8px; font-weight: 600; }
.kampanya-cip.kazandi { background: var(--accent); color: #1a1400; }
.kampanya-cip-sil {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0 2px;
  min-height: 0;
  min-width: 0;
  line-height: 1;
}
.kampanya-nm { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kart-pasif { opacity: .6; }
.list-item.secili-urun { background: var(--primary-soft); border-color: var(--primary); }

/* ---------- Self-servis sipariş (js/screens/istek.js) ----------
 * Giriş yapılmamış müşteri telefonu: büyük QR + 6 haneli kod plasiyere
 * gösterilir; firma/telefon alanları; miktar satırı − / kutu / ＋ / 🗑️. */
.istek-qr-karti { display: flex; flex-direction: column; align-items: center; padding: 14px; }
.istek-qr {
  width: min(62vw, 260px);
  aspect-ratio: 1;
  background: #ffffff;   /* QR her temada beyaz zeminde — okutma güvenilirliği */
  border-radius: var(--radius-sm);
  padding: 8px;
}
.istek-qr svg { width: 100%; height: 100%; display: block; }
.istek-kod {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--text);
}
.istek-kimlik { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 10px; }
@media (max-width: 420px) { .istek-kimlik { grid-template-columns: 1fr; } }
.badge-selfservis { background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent); }
.istek-miktar-satiri { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.istek-miktar-satiri .btn-sm { min-width: 44px; padding: 6px 10px; }
.istek-miktar { width: 72px; text-align: center; font-weight: 700; padding: 8px 6px; }

/* ---------- Raf etiketi yazdırma (js/screens/adminEtiket.js) ----------
 * Ekranda önizleme ızgarası; yazdırmada A4 2×5 (etiket ~95×55 mm). */
.etiket-izgara {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.etiket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #111111;    /* kâğıt: tema bağımsız siyah/beyaz */
  break-inside: avoid;
}
.etiket-ad { font-weight: 700; font-size: 14px; line-height: 1.2; max-height: 3.6em; overflow: hidden; }
.etiket-kod { font-size: 11px; color: #555555; margin-top: 2px; }
.etiket-fiyat { font-size: 22px; font-weight: 800; margin-top: 4px; }
.etiket-not { font-size: 10px; color: #555555; margin-top: 4px; }
.etiket-qr { width: 96px; height: 96px; }
.etiket-qr svg { width: 100%; height: 100%; display: block; }
.etiket-sil {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 0;
  min-width: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
}
@media print {
  .topbar, .no-print, .toast-root, #guncelleme-kok, #pwa-yukle-kok { display: none !important; }
  body, .app, .screen { background: #ffffff !important; color: #111111 !important; padding: 0 !important; margin: 0 !important; }
  .etiket-izgara {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
  }
  .etiket {
    height: 55mm;
    border: 1px dashed #bbbbbb;
    border-radius: 0;
    padding: 5mm 6mm;
    grid-template-columns: 1fr 34mm;
  }
  .etiket-qr { width: 34mm; height: 34mm; }
  .etiket-ad { font-size: 13pt; }
  .etiket-fiyat { font-size: 20pt; }
  @page { size: A4 portrait; margin: 8mm; }
}

/* Ürün ekleme — arama kutusunun ÜSTÜNDEKİ sepet özeti şeridi: kalem sayısı,
 * tutar (eklemede "nabız" atar) ve son eklenen kalem (urunEkle.js
 * sepetAltBarCiz). Şeridin tamamı dokunulabilir → sepete gider. */
.sepet-ust-ozet {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 0 12px 6px;
  /* Zemin --surface, yazı --text: bazı temalar (ör. sarilacivert) açık
   * --text tanımlayıp --success-bg'yi ezmediğinden karanlık modda
   * --success-bg + --text okunmaz oluyordu. Yeşil vurgu kenarlıkta. */
  border: 1px solid var(--border);
  border-left: 5px solid var(--success);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  text-align: left;
}
/* istek.js hâlâ şeridin kendisini düğme olarak kullanır (Geri Al yok). */
button.sepet-ust-ozet { padding: 8px 12px; min-height: 56px; cursor: pointer; }
button.sepet-ust-ozet:active { background: var(--surface-2); }
/* Özet satırı sepete götüren düğmedir (kapsayıcı div; içinde ayrıca Geri Al
 * düğmesi var — 2026-09-17). Dokunma alanı ≥56px. */
.sepet-ust-ozet-git {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0 -12px;
  padding: 8px 12px;
  width: calc(100% + 24px);
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sepet-ust-ozet-git:active { background: var(--surface-2); }
.sepet-ust-ozet-satir {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.sepet-ust-ozet-satir .mono { font-weight: 700; font-size: 16px; }
/* EDA51 (2026-09-21): tutardaki büyüme/nabız animasyonu kaldırıldı — kayıt
 * sonucu sabit, kısa metinle bildirilir (✓ / ⏳ satırı). */
.sepet-ust-ozet .son-eklenen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--text); /* soluk değil — son ekleme kritik bilgidir */
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.sepet-ust-ozet .son-eklenen-metin { min-width: 0; overflow-wrap: anywhere; }
.sepet-ust-ozet .son-eklenen-geri { flex-shrink: 0; min-height: 44px; }
.sepet-ust-ozet .son-eklenen.bekliyor { color: var(--text-muted); }

/* ---------- Sipariş hareket günlüğü (siparisOzet) ---------- */

.hareketler { margin-top: 16px; }
.hareketler > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 0;
  list-style: none;
}
.hareketler > summary::-webkit-details-marker { display: none; }
.hareketler > summary::before { content: "▸ "; color: var(--text-muted); }
.hareketler[open] > summary::before { content: "▾ "; }
.hareket-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.hareket-ust { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hareket-urun { font-size: 13px; }
.hareket-KALEM_EKLE, .hareket-KALEM_BIRLESTIR, .hareket-OLUSTUR { border-left-color: var(--success); }
.hareket-KALEM_SIL, .hareket-IPTAL { border-left-color: var(--danger); }
.hareket-KALEM_GUNCELLE, .hareket-BASLIK_GUNCELLE { border-left-color: var(--warning); }
.hareket-GONDER { border-left-color: var(--primary); }

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.stepper button {
  border: none;
  background: var(--surface-2);
  width: 56px;
  min-height: 56px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.stepper input {
  width: 72px;
  text-align: center;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 56px;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
}

/* ---------- Totals ---------- */

.totals-card { display: flex; flex-direction: column; gap: 6px; }
.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.totals-row.grand {
  font-size: 17px;
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.totals-firma-block {
  border-top: 1px dashed var(--border);
  margin-top: 6px;
  padding-top: 6px;
}
.totals-firma-block .totals-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
/* ŞAHİN / MİKRO firma toplamları — yan yana AYRI kutular korunur (iş akışı
 * kararı), ama EDA51'de (2026-09-21) büyük renkli alan yerine sakin yüzey +
 * firmanın kendi rengiyle sol kenar çizgisi: ayırım tek bakışta hâlâ görülür.
 * .kutu-sahin/.kutu-mikro renkleri tema değişkenlerinden gelir. */
.firma-toplam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.firma-toplam-kutu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
}
.kutu-sahin { border-left-color: var(--sahin); }
.kutu-mikro { border-left-color: var(--mikro); }
.firma-toplam-baslik {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.firma-toplam-tutar { font-weight: 700; font-size: 16px; }

/* ---------- Rapor ekranları ---------- */
/* Raporlar menüsündeki satır ikonu — list-item içinde başta durar. */
.rapor-ikon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
}
.rapor-ikon svg { width: 20px; height: 20px; }
/* Fuar özeti raporunun başındaki Toplam Sipariş / Toplam Tutar kutuları —
   sepetin firma-toplam-grid deseniyle aynı yerleşim, kurumsal renklerle. */
.rapor-ozet-kutu { background: var(--primary-soft); color: var(--primary); }
.rapor-ozet-kutu--tutar { background: var(--success-bg); color: var(--success); }
.rapor-tutar { font-weight: 700; font-size: 16px; white-space: nowrap; }

/* ---------- Home tiles ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 480px) {
  .tile-grid { grid-template-columns: 1fr 1fr; }
}
.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  min-height: 108px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}
.tile .tile-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tile .tile-icon-wrap svg { width: 24px; height: 24px; }
.tile .tile-title { font-size: 17px; font-weight: 700; }
.tile .tile-sub { font-size: 13px; color: var(--text-muted); }
.tile .tile-arrow {
  position: absolute;
  top: 18px;
  right: 14px;
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* Ana aksiyon karo örneği "Sipariş Al" (bkz. js/screens/home.js) — düz
 * lacivert (EDA51 2026-09-21: gradyan kaldırıldı). */
.tile-primary {
  background: var(--navy-2);
  border-color: var(--navy-2);
  color: #ffffff;
}
.tile-primary .tile-icon-wrap { background: var(--accent); color: var(--navy-1); }
.tile-primary .tile-sub { color: rgba(255, 255, 255, .78); }
.tile-primary .tile-arrow { color: var(--accent); }

/* ---------- Kurumsal bileşenler (Şahin Kırtasiye) ---------- */

/* Bölüm başlığı — küçük, sade etiket (EDA51 2026-09-21: BÜYÜK HARF ve harf
 * aralığı kaldırıldı; normal yazım küçük ekranda daha okunur). */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 2px 0 -2px;
}

/* Marka bloğu — topbar içinde monogram + kurum adı */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--navy-1);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
/* Gerçek logo ikonu kullanan varyant (ana ekran marka bloğu) */
.brand-mark--img {
  background: #000;
  object-fit: cover;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Karşılama kartı — EDA51 (2026-09-21): tek satırlık kompakt şerit. Dekor
 * (altın halka, gradyan, "Merhaba" satırı) kaldırıldı; ad + kullanıcı kodu
 * yeter. Ekran alanı işlemlere kalsın. */
.hero-card {
  background: var(--navy-2);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 12px 14px;
}
.hero-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.hero-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-kimlik { min-width: 0; }
.hero-ad {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-kod {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}

/* Aktif fuar kartı — ana sayfada, dokununca fuar seçimine gider */
.fuar-karti {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
}
.fuar-karti:active { background: var(--surface-2); }
.fuar-karti-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fuar-karti-icon svg { width: 24px; height: 24px; }
.fuar-karti-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fuar-karti-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.fuar-karti-adi {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fuar-karti-aksiyon {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
/* Fuar henüz seçilmemişse dikkat çekici amber varyant */
.fuar-karti-uyari { border-left-color: var(--warning); }
.fuar-karti-uyari .fuar-karti-icon { background: var(--warning-bg); color: var(--warning); }
.fuar-karti-uyari .fuar-karti-aksiyon { background: var(--warning-bg); color: var(--warning); }

/* Fuar seçim ekranı — başlık bloğu */
.fuar-sec-baslik {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 4px;
}
.fuar-sec-ikon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.fuar-sec-ikon svg { width: 28px; height: 28px; }
.fuar-sec-baslik h2 { margin: 4px 0 0; }

/* Radyo-kart seçim listesi — select yerine kurumsal seçim kartları */
.secim-liste {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.secim-karti {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  min-height: 64px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, background .15s ease;
}
.secim-karti input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.secim-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease;
}
.secim-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  transform: scale(0);
  transition: transform .15s ease;
}
.secim-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.secim-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secim-tik {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}
.secim-karti.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.secim-karti.selected .secim-radio {
  border-color: var(--primary);
  background: var(--primary);
}
.secim-karti.selected .secim-radio::after { transform: scale(1); }
.secim-karti.selected .secim-tik { opacity: 1; transform: scale(1); }

/* Bilgi notu — köşede altın vurgu çizgisi */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Login ekranı kurumsal marka bloğu */
.login-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(18, 40, 74, .3), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

/* Gerçek logo görseli kullanan varyant — logonun kendi siyah zemini kartla
   aynı olduğundan padding alanıyla sorunsuz kaynaşır */
.login-logo--img {
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: #000;
}
.login-logo--img img {
  display: block;
  width: 200px;
  height: auto;
}

/* ---------- Empty / error states ---------- */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state .emoji { font-size: 40px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ---------- Toasts ---------- */

.toast-root {
  position: fixed;
  top: calc(10px + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 12px;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: 100%;
  animation: toast-in .15s ease;
}
.toast.error { background: var(--danger); color: white; }
.toast.success { background: var(--success); color: white; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Güncelleme bandı (js/guncelleme.js) ---------- */

/* Toast'un aksine kapanmayacak bildirim — altta sabit durur, sipariş
   formunu kapatmaz. */
.guncelleme-bant,
.pwa-yukle-bant {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  animation: toast-in .15s ease;
}
.guncelleme-mesaj,
.pwa-yukle-mesaj {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.guncelleme-yenile,
.pwa-yukle-yukle {
  border: none;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.guncelleme-kapat,
.pwa-yukle-kapat {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
/* İki bant aynı anda açık olursa (nadir: yüklü olmayan tarayıcı sekmesinde
   yeni sürüm de çıktıysa) güncelleme bandı üstte kalsın. */
.pwa-yukle-bant { z-index: 89; }

/* ---------- Ana ekran sürüm etiketi (screens/home.js) ---------- */

/* Saha desteği için: telefonda hangi sürümün çalıştığı tek bakışta görünsün.
   user-select:all → dokununca tamamı seçilir, desteye kopyalanabilir. */
.surum-etiket {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 10px 0 2px;
  user-select: all;
}

/* ---------- Loading ---------- */

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal / popup (ör. ürün ekleme, bkz. js/ui.js::modalAc) ----------
 * Kullanıcı kararı: popup alttan menü gibi DEĞİL ekranın ortasında açılır. */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 190;
  padding: 16px;
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding-bottom: var(--safe-bottom);
}
/* Ufak popup (ürün ekleme, bkz. urunEklePopupAc): yalnızca miktar + fiyat
 * sorulur — dar ve kısa tutulur (kullanıcı kararı). */
.modal-kucuk {
  max-width: 320px;
}
.urun-miktar-modali { align-items: flex-end; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.urun-miktar-modali .modal { max-width: 480px; max-height: 85dvh; }
.urun-miktar-modali summary { padding: 12px 0; cursor: pointer; }
#kayit-durumu { margin-top: 12px; }
.urun-ekle-screen { padding-bottom: calc(150px + var(--safe-bottom)); }
.urun-ekle-screen #sepet-alt-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 720px);
  padding: 10px 12px calc(10px + var(--safe-bottom));
  flex-direction: row;
}
.urun-ekle-screen #sepet-alt-bar .btn { flex: 1; width: auto; }
.modal-kucuk .modal-body {
  padding: 12px 16px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 16px;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere; /* popup başlığında uzun ürün adı taşmasın, sarssın */
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
}
.modal-footer {
  flex-shrink: 0;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.modal-header .icon-btn {
  width: 44px;
  height: 44px;
  background: var(--surface-2);
}

/* ---------- Barcode scanner overlay ---------- */

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: black;
  display: flex;
  flex-direction: column;
}
.scanner-overlay video {
  flex: 1;
  width: 100%;
  object-fit: cover;
  background: black;
}
.scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  max-width: 340px;
  aspect-ratio: 5 / 3;
  border: 3px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.45);
}
.scanner-top {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  z-index: 2;
}
.scanner-top .icon-btn { background: rgba(0,0,0,.35); color: white; }
.scanner-hint {
  position: absolute;
  bottom: calc(24px + var(--safe-bottom));
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 14px;
  padding: 0 20px;
}

/* ---------- Tek elle kullanım: alt aksiyon barı ----------
 * Ana aksiyon butonları (Siparişi Tamamla, Siparişi Gönder, …) ekranın
 * altına sabitlenir — başparmağın doğal erişim bölgesi. İçerik altında
 * kayarken buton yerinde kalır. */
.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: 12px;
  padding: 10px 0 2px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: calc(8px + var(--safe-bottom));
}
.bottom-bar .bottom-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 2px;
}
.bottom-bar .bottom-bar-info .mono { font-weight: 700; color: var(--text); font-size: 16px; }

/* EDA51 sepet alt barı (2026-09-21): üç üst üste büyük düğme yerine
 * "Tamamla" (birincil) + yan yana iki hafif düğme — dikey alan kazancı,
 * silme işleminin kırmızı ağırlığı azalır (onay akışı korunur). */
.alt-bar-satir { display: flex; gap: 8px; }
.alt-bar-satir .btn { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }
.alt-bar-satir .btn-tekil { flex: 0 0 auto; }

/* Hafif düğme varyantları — ikincil işlemler için: zemin yok, yalnız yazı
 * rengi (mavi = işlem, kırmızı = silme). Renk kuralları korunur. */
.btn-hafif { background: transparent; border-color: transparent; color: var(--primary); }
.btn-hafif:active { background: var(--surface-2); }
.btn-hafif-tehlike { background: transparent; border-color: transparent; color: var(--danger); }
.btn-hafif-tehlike:active { background: var(--danger-bg); }

/* Ana ekrandaki "Diğer İşlemler" satırları — .list-item bir <button> olduğunda
 * tarayıcı varsayılanlarını sıfırla (home.js). */
button.list-item { appearance: none; font: inherit; color: inherit; cursor: pointer; }
button.list-item:active { background: var(--surface-2); }

/* Ürün Ekle'deki katlanabilir kullanım yardımı — sürekli görünün yönerge
 * paragrafının yerine (urunEkle.js). */
.hizli-yardim { font-size: 13px; color: var(--text-muted); }
.hizli-yardim summary { cursor: pointer; padding: 6px 2px; list-style: none; }
.hizli-yardim summary::-webkit-details-marker { display: none; }
.hizli-yardim summary::before { content: "▸ "; color: var(--text-muted); }
.hizli-yardim[open] summary::before { content: "▾ "; }
.hizli-yardim p { margin: 0 2px 4px; }

/* ---------- Misc ---------- */

.divider { height: 1px; background: var(--border); border: none; margin: 4px 0; }

.result-list { display: flex; flex-direction: column; gap: 8px; max-height: 100%; overflow-y: auto; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 0;
}

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

.print-only { display: none; }

@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body, .app { background: white; color: black; }
}

/* ---------- Temalar (js/tema.js, <html data-tema="...">) ----------
   Öznitelik seçicisi (0,2,0) hem :root'u hem de yukarıdaki
   prefers-color-scheme bloğunu ezer; her tema kendi color-scheme'ini
   bildirir ki form denetimleri/kaydırma çubukları da uysun.
   navy-1..3 = topbar / hero / birincil kart gradyanı (üstünde beyaz yazı var,
   koyu tutulmalı). accent = altın vurgu çizgisi ve ikon zemini. */

/* Açık temalar için semantik renkler (danger/success/warning/sahin/mikro):
 * cihaz karanlık moddayken prefers-color-scheme bloğu bunları koyu
 * değerlere çeker; açık temalar --text'i koyu tanımladığından koyu zemin +
 * koyu yazı oluşuyordu (ör. sarilacivert'te sepet özeti ve "sepette var"
 * satırları okunmuyordu — 2026-09-15). Koyu temalar (gece, kehribar,
 * siyahbeyaz) kendi değerlerini zaten bildiriyor. */
:root[data-tema="zumrut"],
:root[data-tema="bordo"],
:root[data-tema="okyanus"],
:root[data-tema="sarilacivert"],
:root[data-tema="sarikirmizi"] {
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --sahin: #7c3aed;
  --sahin-bg: #ede9fe;
  --mikro: #0891b2;
  --mikro-bg: #cffafe;
}

:root[data-tema="zumrut"] {
  color-scheme: light;
  --bg: #f2f7f3;
  --surface: #ffffff;
  --surface-2: #e8f1ea;
  --border: #d3e2d7;
  --text: #14261b;
  --text-muted: #5b6f62;
  --primary: #166534;
  --primary-text: #ffffff;
  --primary-dark: #14532d;
  --primary-soft: #e3f1e7;
  --accent: #f59e0b;
  --accent-soft: #fdf1d9;
  --navy-1: #0f3d22;
  --navy-2: #14532d;
  --navy-3: #1d6b3a;
  --shadow: 0 1px 2px rgba(20, 60, 35, 0.06), 0 1px 3px rgba(20, 60, 35, 0.08);
}

:root[data-tema="bordo"] {
  color-scheme: light;
  --bg: #faf5f3;
  --surface: #ffffff;
  --surface-2: #f4ebe8;
  --border: #e6d6d1;
  --text: #2a1518;
  --text-muted: #7a5c60;
  --primary: #9f1239;
  --primary-text: #ffffff;
  --primary-dark: #7f1d1d;
  --primary-soft: #f9e5ea;
  --accent: #d4a017;
  --accent-soft: #f8f0d6;
  --navy-1: #5e1220;
  --navy-2: #7f1d1d;
  --navy-3: #9f2a3a;
  --shadow: 0 1px 2px rgba(80, 20, 30, 0.06), 0 1px 3px rgba(80, 20, 30, 0.08);
}

:root[data-tema="okyanus"] {
  color-scheme: light;
  --bg: #f0f7f9;
  --surface: #ffffff;
  --surface-2: #e4f0f4;
  --border: #cfe1e8;
  --text: #0f2530;
  --text-muted: #517080;
  --primary: #0e7490;
  --primary-text: #ffffff;
  --primary-dark: #155e75;
  --primary-soft: #dff2f7;
  --accent: #f97316;
  --accent-soft: #ffe9d9;
  --navy-1: #0b4a5c;
  --navy-2: #0e7490;
  --navy-3: #1590ad;
  --shadow: 0 1px 2px rgba(10, 60, 80, 0.06), 0 1px 3px rgba(10, 60, 80, 0.08);
}

:root[data-tema="gece"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #131b2e;
  --surface-2: #1b2540;
  --border: #283552;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-text: #061423;
  --primary-dark: #0ea5e9;
  --primary-soft: #16304a;
  --accent: #38bdf8;
  --accent-soft: #0f2d40;
  --navy-1: #0f172a;
  --navy-2: #172554;
  --navy-3: #1e3a8a;
  --danger: #f87171;
  --danger-bg: #3f1d1d;
  --success: #4ade80;
  --success-bg: #14301f;
  --warning: #fbbf24;
  --warning-bg: #3a2c0e;
  --sahin: #a78bfa;
  --sahin-bg: #2c2350;
  --mikro: #22d3ee;
  --mikro-bg: #0e3238;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}

:root[data-tema="kehribar"] {
  color-scheme: dark;
  --bg: #141210;
  --surface: #1c1917;
  --surface-2: #292420;
  --border: #3b332c;
  --text: #f5efe6;
  --text-muted: #a8998a;
  --primary: #f59e0b;
  --primary-text: #1c1206;
  --primary-dark: #d97706;
  --primary-soft: #3a2a10;
  --accent: #fbbf24;
  --accent-soft: #3a2c0e;
  --navy-1: #1c1917;
  --navy-2: #3b2a14;
  --navy-3: #6b4312;
  --danger: #f87171;
  --danger-bg: #3f1d1d;
  --success: #4ade80;
  --success-bg: #14301f;
  --warning: #fbbf24;
  --warning-bg: #3a2c0e;
  --sahin: #c4b5fd;
  --sahin-bg: #2c2350;
  --mikro: #67e8f9;
  --mikro-bg: #0e3238;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Takım renkleri */
:root[data-tema="sarilacivert"] {
  color-scheme: light;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #eceef7;
  --border: #d9dcec;
  --text: #141c3d;
  --text-muted: #5b6285;
  --primary: #1b2a6b;
  --primary-text: #ffffff;
  --primary-dark: #131f52;
  --primary-soft: #e6e9f7;
  --accent: #ffe600;
  --accent-soft: #fff9c2;
  --navy-1: #101a4a;
  --navy-2: #1b2a6b;
  --navy-3: #26398f;
  --shadow: 0 1px 2px rgba(20, 30, 80, 0.06), 0 1px 3px rgba(20, 30, 80, 0.08);
}

:root[data-tema="siyahbeyaz"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #171717;
  --surface-2: #232323;
  --border: #333333;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --primary: #f5f5f5;
  --primary-text: #0a0a0a;
  --primary-dark: #d4d4d4;
  --primary-soft: #2a2a2a;
  --accent: #f5f5f5;
  --accent-soft: #2e2e2e;
  --navy-1: #000000;
  --navy-2: #161616;
  --navy-3: #2b2b2b;
  --danger: #f87171;
  --danger-bg: #3f1d1d;
  --success: #4ade80;
  --success-bg: #14301f;
  --warning: #fbbf24;
  --warning-bg: #3a2c0e;
  --sahin: #c4b5fd;
  --sahin-bg: #2c2350;
  --mikro: #67e8f9;
  --mikro-bg: #0e3238;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
}
/* Siyah topbar'da altın vurgu çizgisi beyaz olsun diye accent beyaz; ama
   beyaz zeminli ikon kutusunda ikon siyah kalır (navy-1). */

:root[data-tema="sarikirmizi"] {
  color-scheme: light;
  --bg: #fbf6f3;
  --surface: #ffffff;
  --surface-2: #f6ece7;
  --border: #ead8d0;
  --text: #2b1014;
  --text-muted: #7d5a5f;
  --primary: #a90432;
  --primary-text: #ffffff;
  --primary-dark: #85032a;
  --primary-soft: #fbe4ea;
  --accent: #fdb912;
  --accent-soft: #fff1cc;
  --navy-1: #7a0a22;
  --navy-2: #a90432;
  --navy-3: #c8102e;
  --shadow: 0 1px 2px rgba(120, 10, 30, 0.06), 0 1px 3px rgba(120, 10, 30, 0.08);
}

/* Tema seçici (Ayarlar ekranı) */
.tema-secici {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 480px) {
  .tema-secici { grid-template-columns: repeat(6, 1fr); }
}
.tema-secenek {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.tema-secenek:active { transform: scale(.97); }
.tema-secenek--aktif {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.tema-ornek {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 0 1px var(--border);
}
.tema-secenek--aktif .tema-ornek { box-shadow: 0 0 0 2px var(--primary); }
.tema-ad {
  font-size: 12px;
  font-weight: 600;
}

/* Ayarlar ekranı — etiket/değer satırları */
.ayar-satir {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ayar-satir:first-child { padding-top: 0; }
.ayar-etiket { color: var(--text-muted); font-size: 14px; }
.ayar-deger { font-weight: 600; }
.card .ayar-satir + .btn { margin-top: 14px; }

/* ---------- Yönetici paneli (admin.js / adminSiparis.js) ---------- */

/* Canlı sekmesi: son 10 dk içinde dokunulan sipariş — yanıp sönen nokta. */
.canli-nokta {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
  vertical-align: middle;
  animation: canli-nabiz 1.6s ease-in-out infinite;
}
@keyframes canli-nabiz {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* .btn'nin display:inline-flex'i [hidden]'ı ezer (sepette-rozeti ile aynı
   sorun) — "Daha fazla yükle" gizlenebilsin. */
.btn[hidden] { display: none; }

/* Log satırı: hareket gövdesi list-item içinde, dokununca detay açılır. */
.log-satir .hareket-row { padding: 0; border: none; background: transparent; }
.log-satir .list-item-sub { margin-bottom: 2px; }

/* Kalem düzenleme kutuları — tek satıra sığmazsa sarar. */
.admin-kalem-duzenle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.admin-kalem-duzenle label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.admin-kalem-duzenle input {
  width: 84px;
  min-height: 38px;
  padding: 4px 8px;
}
.admin-kalem-duzenle .kalem-actions { margin-left: auto; }

/* ---------- Linkler ekranı (hazır paylaşım linkleri) ---------- */

.link-karti {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.link-ikon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
}
.link-karti .link-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.link-karti .link-baslik { font-weight: 700; }
.link-karti .link-aciklama {
  font-size: 13px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* Yönetici paneli — Linkler sekmesi satırı */
.admin-link-karti .admin-link-adres {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------
 * Ana ekran "Açık müşterilerim" kartları (2026-09-17, plasiyer
 * kolaylıkları Faz 1/3): müşteri adı en büyük öğe; tek dokunuşla ilgili
 * siparişin Ürün Ekle ekranına dönülür. Dokunma alanı ≥56px, kart arası
 * boşluk açık; durum yalnız renkle değil yazıyla ("Bekleyen ekleme var").
 * ------------------------------------------------------------------- */
.acik-musteri-baslik {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.acik-musteri-baslik .btn-sm { min-height: 36px; padding: 4px 10px; text-transform: none; letter-spacing: 0; }
.acik-musteri-katla {
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px 0;
  min-height: 44px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}
.acik-musteri-ok-ikon { display: inline-block; width: 1em; }
.acik-musteri-liste { display: grid; gap: 10px; margin-top: 8px; }
.acik-musteri-liste[hidden] { display: none; } /* display:grid, [hidden]'ı ezmesin */
.acik-musteri-karti {
  appearance: none;
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "adi ok" "alt ok" "rozet rozet";
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  box-shadow: var(--shadow);
  font: inherit;
  cursor: pointer;
}
.acik-musteri-karti:active { background: var(--surface-2); }
.acik-musteri-karti:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.acik-musteri-adi {
  grid-area: adi;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.acik-musteri-alt {
  grid-area: alt;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.acik-musteri-rozet { grid-area: rozet; justify-self: start; }
.acik-musteri-ok {
  grid-area: ok;
  align-self: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* Aktif müşteri şeridi — Ürün Ekle ve Sepet'te müşteri adı büyük ve
 * sürekli görünür (eskiden soluk/küçük satırdı). */
.aktif-musteri {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
}
.aktif-musteri-etiket {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.aktif-musteri-adi {
  flex-basis: 100%;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.aktif-musteri-alt { font-size: 13px; color: var(--text-muted); }
.aktif-musteri .gecmis-rozetleri { flex-basis: 100%; }

/* Ürün popup'ı — birim seçici + büyük miktar + üç sayı (2026-09-17,
 * plasiyer kolaylıkları Faz 1/2). Birim düğmeleri ≥56px; altındaki küçük
 * yazı dilim içeriğidir ("30 adet"). */
.birim-secici button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 56px;
  padding: 6px 4px;
  line-height: 1.15;
}
.birim-secici button small { font-size: 11px; font-weight: 600; opacity: .85; }
.stepper-buyuk button { width: 64px; min-height: 60px; font-size: 28px; }
.stepper-buyuk input { flex: 1; min-width: 0; min-height: 60px; font-size: 24px; }
.miktar-ozeti { margin: 4px 0 10px; }
.miktar-ozeti-donusum { font-size: 16px; margin-bottom: 6px; }
.miktar-ozeti-satirlar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
  color: var(--text-muted);
}
.miktar-ozeti-satirlar strong { color: var(--text); font-size: 16px; }

/* Okunabilirlik (2026-09-17): arama sonucunda ürün adı ve kodu "…" ile
 * kırpılmaz, satır sarar — plasiyer benzer adlı ürünleri ayırt edebilsin.
 * Sepette rozeti ve firma etiketi satır içinde kalır. */
.hizli-satir .list-item-title,
.hizli-satir .list-item-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.hizli-satir .list-item-title { font-size: 16px; line-height: 1.3; }

/* ---------- Hareket azaltma (EDA51 tavsiyeleri 2026-09-21) ----------
 * Kullanıcı işletim sisteminden "hareketi azalt" tercihinde bulunmuşsa
 * süsleme amaçlı animasyon/geçişler iptal edilir; durum bildirimleri
 * zaten metinseldir. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
