:root {
  /* Loop renkleri: #FFD800 sarı + siyah */
  --yellow: #ffd800; --black: #0a0a0a;
  --bg: #f4f4f2; --card: #fff; --ink: #0a0a0a; --muted: #5f5f5a; --line: #e4e4de;
  --brand: var(--black); --accent: var(--yellow); --accent-ink: var(--black); --own: #fff3a6;
  --warn-bg: #fff6c2; --warn-ink: #3d3300; --err: #b91c1c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--brand); color: #fff; }
.bar h1 { margin: 0; font-size: 20px; letter-spacing: .3px; color: var(--yellow); }
.who { display: flex; gap: 10px; align-items: center; font-size: 15px; opacity: .9; }
main { max-width: 560px; margin: 0 auto; padding: 16px; padding-bottom: 48px; }
.view { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; }
.grow { flex: 1; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
input, select { font: inherit; font-size: 20px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; }
input:focus, select:focus { outline: 3px solid var(--yellow); border-color: var(--black); }
button, .btn-like { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 16px; cursor: pointer;
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-direction: row; }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { background: #e5e7eb; color: var(--ink); }
.link { background: none; color: #fff; text-decoration: underline; padding: 4px; min-height: 0; }
.big-btn { min-height: 120px; font-size: 24px; border-radius: 16px; flex-direction: row; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.big-btn .ico { font-size: 36px; }
.err { color: var(--err); margin: 0; font-weight: 600; }
.banner { background: #fee2e2; padding: 12px; border-radius: 10px; margin-top: 12px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; border-radius: 10px; margin: 0; font-weight: 600; }
.query-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; align-self: flex-start; }

.product { display: flex; flex-direction: column; gap: 12px; }
.p-head { display: flex; gap: 12px; }
.p-img { width: 112px; height: 112px; object-fit: cover; border-radius: 10px; background: #e5e7eb; flex: none; }
.p-img.none, .prow-img.none { background: repeating-linear-gradient(45deg, #ececea, #ececea 6px, #f7f7f5 6px, #f7f7f5 12px); }
.p-info { min-width: 0; }
.p-name { font-size: 18px; margin: 0 0 4px; }
.p-variant { margin: 0; color: var(--muted); }
.p-price { margin: 6px 0 0; font-size: 22px; font-weight: 700; }
.barcode { width: 100%; background: var(--black); color: var(--yellow); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(20px, 7.4vw, 34px); white-space: nowrap; letter-spacing: .5px; padding: 14px 8px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.barcode:active { background: #2a2a2a; }
.stock { width: 100%; border-collapse: collapse; font-size: 16px; }
.stock td { padding: 6px 4px; border-top: 1px solid var(--line); }
.stock td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stock tr.own td { background: var(--own); font-weight: 700; }
.stock tr.zero td:last-child { color: var(--muted); }
.variants summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.variant-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.variant-list .product { box-shadow: none; border: 1px solid var(--line); }
.variant-list .p-img { width: 80px; height: 80px; }
.variant-list .barcode { font-size: clamp(18px, 6.2vw, 28px); }

.scanner { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner button { position: relative; }
.busy { position: fixed; inset: 0; background: rgba(255,255,255,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 30; }
.spinner { width: 48px; height: 48px; border: 5px solid #e5e7eb; border-top-color: var(--black); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--black); color: var(--yellow);
  padding: 10px 18px; border-radius: 999px; z-index: 40; font-weight: 600; }

/* butonlarda siyah çerçeve: sarı beyaz zeminde de seçilsin */
.primary { border: 2px solid var(--black); }
.big-btn.primary { box-shadow: 0 3px 0 var(--black); }
.link { color: var(--yellow); }
.who { color: #fff; }
.warn.info { background: #f0f0ea; color: var(--ink); }
.muted { color: var(--muted); margin: 0; font-size: 15px; }

/* ofis sekmeleri */
.tabs { position: sticky; top: 52px; z-index: 4; display: flex; gap: 4px; padding: 6px 12px; background: var(--black);
  border-top: 1px solid #222; justify-content: center; }
.tabs button { min-height: 40px; background: transparent; color: #ddd; border-radius: 999px; padding: 8px 18px; }
.tabs button.on { background: var(--yellow); color: var(--black); }

.p-firm { display: inline-block; background: var(--black); color: var(--yellow); font-size: 12px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-bottom: 4px; }

/* ofis ürün listesi */
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; gap: 12px; background: var(--card); border-radius: 12px; padding: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.prow-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: #eee; flex: none; }
.prow-img.none { background: repeating-linear-gradient(45deg, #eee, #eee 6px, #f6f6f6 6px, #f6f6f6 12px); }
.prow-info { min-width: 0; flex: 1; }
.prow-name { font-size: 16px; margin: 0 0 2px; }
.prow-code { background: none; padding: 0; min-height: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.prow-meta { margin: 4px 0; color: var(--muted); font-size: 15px; }
.prow-meta b { color: var(--ink); }
.prow-meta b.zero { color: var(--err); }
.prow-detail summary { cursor: pointer; font-size: 14px; color: var(--muted); }

/* özet */
.sum h2 { margin: 0 0 10px; font-size: 20px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--black); color: #fff; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.kpi b { color: var(--yellow); font-size: 22px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: #ccc; }
.stock th { text-align: left; font-size: 13px; color: var(--muted); padding: 4px; }
.stock th:not(:first-child), .sum .stock td:not(:first-child) { text-align: right; }
@media (min-width: 720px) { main { max-width: 820px; } .kpis { grid-template-columns: repeat(4, 1fr); } }
