:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #647280;
  --line: #e2e8f0;
  --brand: #1f6feb;
  --brand-dark: #1858c4;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--brand); }

/* ---------- Giris ekrani ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1f6feb 0%, #15396e 100%);
}
.login-card {
  background: var(--card);
  padding: 36px 32px;
  border-radius: 12px;
  width: 340px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1 { margin: 0; font-size: 24px; text-align: center; }
.login-card .subtitle { margin: 0 0 8px; text-align: center; color: var(--muted); }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }

/* ---------- Ust bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
  padding: 0 20px;
  height: 56px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 800; font-size: 18px; color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; } /* masaüstünde gizli */
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.tab:hover { background: var(--bg); }
.tab.active { background: var(--brand); color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; color: var(--muted); }

/* ---------- Icerik ---------- */
main { padding: 24px; max-width: 1200px; margin: 0 auto; }
/* Pencere ici (popup) sayfalar: ust menu yok, kenar boslugu dar */
body.bare main { padding: 14px; max-width: none; }

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.view-head h2 { margin: 0; font-size: 20px; }
.filters { display: flex; gap: 8px; align-items: center; }

/* Kartlar / metrik kutulari */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric {
  background: var(--card);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.metric.warn .value { color: var(--warn); }

/* Tablolar */
.table-wrap { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; }
.table-wrap > table { width: max-content; min-width: 100%; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; }

/* Rozetler */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.open { background: #dbeafe; color: #1e40af; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.low { background: #fef3c7; color: #92400e; }

/* Ilerleme cubugu */
.progress { background: var(--line); border-radius: 999px; height: 8px; overflow: hidden; min-width: 90px; display: inline-block; vertical-align: middle; width: 140px; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.progress.done > span { background: var(--ok); }
.progress-cell { display: flex; align-items: center; gap: 8px; }

/* Butonlar / formlar */
button { font-family: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn-ghost { background: none; border: 1px solid transparent; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 6px 10px; text-decoration: none; }
.btn-ghost:hover { background: var(--bg); }
.btn-outline { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-weight: 600; text-decoration: none; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }

.card-box { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.error-msg { color: var(--danger); font-size: 14px; }
.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.muted { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.sub-list { margin-top: 24px; }
.sub-list h3 { font-size: 15px; margin: 0 0 8px; }

/* ====================================================================
   MOBIL / TABLET DUYARLI DUZEN
   ==================================================================== */
@media (max-width: 760px) {
  body { font-size: 15px; }

  .topbar {
    height: 52px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 14px;
  }
  .brand { flex: 1; }
  .user-box .uname { display: none; }

  /* Hamburger butonu */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink);
    font-size: 20px;
    flex: 0 0 auto;
    padding: 0;
  }

  /* Menü: varsayılan kapalı */
  .tabs {
    display: none;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-top: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    z-index: 100;
  }
  .topbar.nav-open .tabs {
    display: flex;
  }
  .tab {
    white-space: nowrap;
    flex: 0 0 auto;
    border-radius: 0;
    padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
  }
  .tab:last-child { border-bottom: none; }
  .tab.active { border-radius: 0; }

  main { padding: 14px; }

  .view-head { align-items: stretch; }
  .view-head h2 { font-size: 18px; }
  .filters { width: 100%; }
  .filters select, .filters .btn { flex: 1; }

  .form-grid { grid-template-columns: 1fr; }

  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; }
  .metric .value { font-size: 22px; }

  .btn, .btn-outline, .btn-ghost, .tab { min-height: 40px; }
  input, select, textarea { padding: 11px 12px; font-size: 16px; } /* 16px: iOS zoom engeli */
  th, td { padding: 10px 12px; }
}

@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
  .login-card { width: 100%; padding: 28px 20px; }
}

/* ====================================================================
   YENI BILESENLER (yetki, ozellik, musteri secici, modal, yedek)
   ==================================================================== */

.badge.pending { background: #fef3c7; color: #92400e; }
.danger-text { color: var(--danger); font-weight: 600; }

/* Liste arac cubugu + toplu silme */
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; border: none; padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none;
}
.btn-danger:hover { background: #b91c1c; }
th.chk, td.chk { width: 36px; text-align: center; padding-left: 8px; padding-right: 8px; }
th.chk input, td.chk input { width: auto; }

/* Bilgi izgarasi (siparis detay - musteri karti) */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 18px; }
.info-grid .full { grid-column: 1 / -1; }

/* Yetki checkbox'lari */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.perm-item { font-weight: 500 !important; }

/* Indirme tablosu (yedek) */
.dl-table td, .dl-table th { white-space: nowrap; }
.dl-table .btn-outline { margin: 2px 0; }

/* ---------- Ozellik (EAV) bolumu ---------- */
.attr-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.attr-defined { border-right: 1px solid var(--line); padding-right: 18px; }
.attr-pool { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.attr-pool-item { font-size: 14px; }
.attr-pool-item.on { color: var(--muted); }
.attr-pool-item.on { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; }
.attr-add-form {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; user-select: none;
}
.attr-add-form:hover { border-color: var(--brand); background: #f8fafc; }
.attr-add-form span { flex: 1; }
.btn-mini {
  background: var(--brand); color: #fff; border: none; border-radius: 6px;
  width: 26px; height: 26px; cursor: pointer; font-weight: 700; line-height: 1;
}
.btn-mini:hover { background: var(--brand-dark); }
.attr-table { width: 100%; border-collapse: collapse; }
.attr-table th, .attr-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: normal; }
.attr-dup-warn { font-size: 13px; color: var(--warn); margin: 4px 0 8px; }
.attr-dup-warn.err { color: var(--danger); font-weight: 600; }

/* ---------- Filtreli oneri kutusu ---------- */
.nf-suggest-box, .picker-box {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 240px; overflow: auto; margin-top: 2px;
}
.nf-suggest-item, .picker-item { padding: 8px 12px; cursor: pointer; }
.nf-suggest-item:hover, .picker-item:hover { background: #eff6ff; }

/* ---------- Musteri secici ---------- */
.picker { position: relative; display: flex; gap: 8px; align-items: stretch; }
.picker > input { flex: 1; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px;
}
.modal {
  background: #fff; border-radius: 12px; width: 520px; max-width: 100%;
  padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 80vh; display: flex; flex-direction: column; gap: 12px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; }
.modal-list { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.modal-row { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.modal-row:last-child { border-bottom: none; }
.modal-row:hover { background: #eff6ff; }

@media (max-width: 760px) {
  .attr-layout { grid-template-columns: 1fr; }
  .attr-defined { border-right: none; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 16px; }
  .perm-grid { grid-template-columns: 1fr; }
  .picker { flex-direction: column; }
}

/* ====================================================================
   YENI: siparis bildirimi (can), alt sekmeler, resimler
   ==================================================================== */

/* Tepedeki dikkat cekici siparis isareti */
.order-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  white-space: nowrap;
}
.order-bell .bell-icon { font-size: 16px; line-height: 1; }
.order-bell:hover { border-color: var(--brand); color: var(--brand); }
.order-bell.has {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  animation: bellpulse 1.4s ease-in-out infinite;
}
.order-bell.has:hover { color: #fff; background: #b91c1c; }
.order-bell .bell-count {
  background: #fff;
  color: var(--danger);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
@keyframes bellpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  50%      { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
}

/* Alt sekmeler (Stok: Hammadde/Urun, Siparis filtreleri) */
.subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 650;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}
.subtab .ic {
  width: 19px; height: 19px; flex: 0 0 auto;
  color: var(--brand);
  transition: color .14s ease, transform .14s ease;
}
.subtab:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31,111,235,.16);
}
.subtab:hover .ic { transform: scale(1.08); }
.subtab.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(31,111,235,.38);
}
.subtab.active .ic { color: #fff; }

/* Stok ekrani: iki esit genislikte segment */
.subtabs.seg .subtab { flex: 1 1 200px; justify-content: center; font-size: 15px; }

.subtab-count {
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; padding: 2px 8px; line-height: 1.4;
  box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}
.subtab.active .subtab-count { background: #fff; color: var(--danger); box-shadow: none; }

/* Liste / detay resimleri */
.thumb {
  width: 42px; height: 42px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: block;
}
.thumb-lg {
  max-width: 200px; max-height: 200px; width: auto; height: auto;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.detail-top { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.detail-top .cards { margin-bottom: 0; }
.detail-img { flex: 0 0 auto; }
.img-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.img-remove { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-weight: 500 !important; }
.img-remove input { width: auto; }

/* Mobilde yatay scrollbar görünür olsun */
.table-wrap::-webkit-scrollbar { height: 5px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.table-wrap::-webkit-scrollbar-thumb:active { background: var(--muted); }

@media (max-width: 760px) {
  .order-bell .bell-label { display: none; }
  /* Ürün tanımla: sütun ızgarası mobilde yatay kaydırılabilir */
  .udef-grid { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .udef-grid::-webkit-scrollbar { height: 5px; }
  .udef-grid::-webkit-scrollbar-track { background: transparent; }
  .udef-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
  .udef-col  { flex: 0 0 120px; }
  .udef-col-boy { flex: 0 0 90px !important; }
  .udef-col-newcol { flex: 0 0 44px !important; }
  /* Cok sekmeli filtre satiri: sikismak yerine yatay kaydirilsin */
  .subtabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
    margin-left: -2px; padding-left: 2px;
  }
  .subtabs::-webkit-scrollbar { height: 0; }
  .subtab { flex: 0 0 auto; padding: 10px 15px; }
  /* Stok ekraninin 2 segmenti ekrani esit boler */
  .subtabs.seg { flex-wrap: nowrap; }
  .subtabs.seg .subtab { flex: 1 1 0; font-size: 14px; }
  .detail-top { gap: 12px; }
  .detail-top .cards { width: 100%; }
}

/* ─── Etiket cizimi (js/label-render.js) ─────────────────────────────────── */
.nfl-sheet.nfl-a4 { display:grid; width:210mm; box-sizing:border-box; align-content:start; }
.nfl-sheet.nfl-roll { width:max-content; }
.nfl-row   { display:flex; box-sizing:border-box; }
.nfl-label { box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden; flex:0 0 auto;
             background:#fff; color:#000; font-family:Arial, Helvetica, sans-serif; line-height:1.15; }
.nfl-inner { display:flex; flex-direction:column; width:100%; min-height:0; }
.nfl-line  { white-space:pre-line; overflow-wrap:break-word; }
.nfl-bc    { display:flex; width:100%; flex:0 0 auto; }
.nfl-bc svg { width:100%; height:100%; display:block; }
.nfl-preview { outline:1px dashed #9aa4b2; outline-offset:-1px; }
.nfl-border  { border:0.3mm solid #000; }
.nfl-empty   { visibility:hidden; }
.nfl-preview.nfl-empty { visibility:visible; background:repeating-linear-gradient(45deg,#f1f3f6 0 6px,#fff 6px 12px); }
.nfl-preview.nfl-empty > * { display:none; }
@media print {
  .nfl-preview { outline:none; }
  .nfl-preview.nfl-empty { visibility:hidden; background:none; }
  .nfl-roll .nfl-row { margin-bottom:0 !important; break-after:page; page-break-after:always; }
  .nfl-roll .nfl-row:last-child { break-after:auto; page-break-after:auto; }
}

/* ---------- Siparis: acilir yazdir menusu + termin rozeti ---------- */
.pm { position: relative; display: inline-block; }
.pm summary { list-style: none; cursor: pointer; }
.pm summary::-webkit-details-marker { display: none; }
.pm-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px;
           box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 60; min-width: 210px; padding: 4px; text-align: left; }
.pm-list a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.pm-list a:hover { background: #eff6ff; color: var(--brand); }
.pm-note { color: var(--warn); font-size: 11px; }
.due { font-size: 12px; font-weight: 600; color: var(--muted); }
.due.due-soon { color: var(--warn); }
.due.due-late { color: var(--danger); }

/* ---------- Bolumlu secim dugmeleri (Tumu / Tamamlanan / Tamamlanmayan) ---------- */
.seg { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg-lbl { padding: 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.seg a { padding: 7px 12px; font-size: 13px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); }
.seg a.on { background: var(--brand); color: #fff; font-weight: 600; }
.seg a.on.ok, .seg a.on[data-f=done] { background: #16a34a; }
.seg a.on.bad, .seg a.on[data-f=todo] { background: #dc2626; }

/* ---------- Adres onerisi (ulke / il / ilce) ---------- */
.ap-box { position: fixed; z-index: 400; background: #fff; border: 1px solid var(--line); border-radius: 8px;
          box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: auto; display: none; }
.ap-box div { padding: 7px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.ap-box div:last-child { border-bottom: none; }
.ap-box div.act, .ap-box div:hover { background: #eff6ff; }
.ap-box small { color: var(--muted); margin-left: 6px; }
.ap-hint { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ---------- Uretim girisi penceresi (js/production-popup.js) ---------- */
.prd-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 500; display: none; align-items: flex-start; justify-content: center; padding: 50px 16px; }
.prd-win { background: #fff; border-radius: 12px; width: 640px; max-width: 100%; max-height: calc(100vh - 100px); overflow: auto; padding: 16px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.prd-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin-bottom: 8px; }
.prd-x { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.prd-line { font-size: 13px; margin-bottom: 10px; }
.prd-line small { color: #3730a3; font-weight: 600; }
.prd-sum { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.prd-sum div { background: var(--bg); border-radius: 8px; padding: 6px 8px; }
.prd-sum small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.prd-sum b { font-size: 15px; }
.prd-sum b.ok { color: #15803d; } .prd-sum b.bad { color: #b91c1c; }
.prd-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.prd-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; width: 150px; }
.prd-form label.grow { flex: 1; min-width: 160px; }
.prd-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; font-family: inherit; width: 100%; }
.prd-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.prd-err { color: var(--danger); font-weight: 600; font-size: 13px; margin-top: 6px; }
.prd-hist-h { font-weight: 700; font-size: 13px; margin: 14px 0 6px; }
.prd-hist table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prd-hist th, .prd-hist td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.prd-hist th { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.prd-hist .n { text-align: right; white-space: nowrap; font-weight: 700; color: #15803d; }
.prd-hist .n.neg { color: var(--danger); }
.prd-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.prd-foot { margin-top: 10px; font-size: 13px; text-align: right; }
@media (max-width: 560px) { .prd-sum { grid-template-columns: repeat(2, 1fr); } }

/* Siparis satiri not penceresi (js/note-popup.js) */
.nte-win { width: 720px; }
.nte-h { font-weight: 700; font-size: 13px; margin: 4px 0 6px; }
.nte-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nte-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.nte-chip:hover { border-color: var(--brand); background: #eff6ff; }
.nte-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.nte-add { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.nte-add .btn:disabled { opacity: .5; cursor: not-allowed; }
.nte-pick { font-size: 13px; color: var(--muted); }
.nte-new { margin-top: 10px; font-size: 13px; }
.nte-new summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.nte-new-form { display: flex; gap: 8px; margin-top: 8px; }
.nte-new-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; font-family: inherit; }
.nte-legacy { margin-top: 10px; font-size: 13px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 6px 10px; }
.nte-legacy small { color: #92400e; font-weight: 700; }
.nte-del { background: none; border: 1px solid transparent; color: var(--danger); font-size: 16px; cursor: pointer; border-radius: 5px; line-height: 1; padding: 2px 6px; }
.nte-del:hover { border-color: var(--danger); }
/* Satirdaki not dugmesi (siparis formu ve listesi) */
.note-btn { display: block; width: 100%; min-width: 120px; text-align: left; cursor: pointer; background: #fefce8; border: 1px solid #fcd34d;
            border-radius: 6px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-btn:hover { border-color: #d97706; }
.note-btn.empty { color: var(--muted); background: #fff; border-style: dashed; }
.note-btn:disabled { cursor: default; background: #f1f5f9; border-color: var(--line); color: var(--muted); }

/* ---------- Etiket: serbest yerlesim (her alan X/Y mm konumunda) ---------- */
.nfl-free .nfl-inner { position: relative; display: block; height: 100%; }
.nfl-free [data-fi] { position: absolute; box-sizing: border-box; }
.nfl-free .nfl-line { white-space: pre-line; overflow-wrap: break-word; line-height: 1.15; }
.nfl-ph { color: #94a3b8; font-style: italic; }
@media print { .nfl-ph { visibility: hidden; } }

/* ---------- Portal: ust bar firma secici (super admin) ---------- */
.company-switch { margin: 0 6px; }
.company-switch select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border, #d0d7de); font-weight: 600; max-width: 200px; }
@media (max-width: 720px) { .company-switch select { max-width: 130px; } }
