/* Depo sahası: raf mavisi + kiriş turuncusu, etiket kodları mono */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --line: #d9dfe7;
  --fg: #16202c;
  --muted: #5d6b7c;
  --rack: #1f4e8c;
  --rack-soft: #e4ecf7;
  --beam: #e8641c;
  --beam-soft: #fdeadf;
  --good: #1d7a4a;
  --good-soft: #e1f2e8;
  --warn: #a5650a;
  --warn-soft: #fbefd8;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151d; --surface: #17202b; --line: #2a3644; --fg: #e8edf3; --muted: #93a2b4;
    --rack: #6fa3e8; --rack-soft: #1b2c44; --beam: #ff8a4c; --beam-soft: #3a2316;
    --good: #5fcf92; --good-soft: #15301f; --warn: #f0b45a; --warn-soft: #36290f;
    --bad: #ff8a80; --bad-soft: #3a1a18;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.45 var(--f-body);
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--f-display); letter-spacing: .01em; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
a { color: var(--rack); }
.mono, code { font-family: var(--f-mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* Üst bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--rack); color: #fff;
}
.brand { font-family: var(--f-display); font-size: 1.4rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .04em; }
.brand span { color: #ffb38a; }
.who { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.topbar .link { color: #fff; }

.view { max-width: 980px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* Alt menü */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 10px; font-size: .75rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--rack); }
.tabbar a.primary { color: var(--beam); }
.tabbar a.primary.on { color: var(--beam); }

/* Yapı taşları */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%; min-width: 0;
}
input[type=checkbox] { width: 20px; height: 20px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--rack); outline-offset: 1px; }
input[readonly] { opacity: .75; }

button, .btn {
  font: 600 1rem var(--f-body); border: 0; border-radius: 8px; padding: 12px 16px; cursor: pointer;
  background: var(--rack); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.alt, .btn.alt { background: var(--rack-soft); color: var(--rack); }
button.go, .btn.go { background: var(--beam); color: #fff; }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; padding: 0; color: var(--rack); font-weight: 600; }
button.block, .btn.block { width: 100%; }

.scan { display: flex; gap: 8px; }
.scan input { font-family: var(--f-mono); }
.scan .cam { flex: 0 0 auto; padding: 0 14px; background: var(--beam); }
.scan .cam svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hint { font-size: .88rem; padding: 8px 10px; border-radius: 8px; }
.hint.ok { background: var(--good-soft); color: var(--good); }
.hint.warn { background: var(--warn-soft); color: var(--warn); }
.hint.bad { background: var(--bad-soft); color: var(--bad); }

/* Raf adresi etiketi: rafta asılı plakanın küçüğü */
.addr {
  display: inline-block; font-family: var(--f-mono); font-weight: 600; font-size: .85rem;
  background: var(--rack-soft); color: var(--rack); border-left: 3px solid var(--beam);
  padding: 2px 8px; border-radius: 4px; text-decoration: none; white-space: nowrap;
}
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.GIRIS { background: var(--good-soft); color: var(--good); }
.chip.CIKIS { background: var(--bad-soft); color: var(--bad); }
.chip.TASIMA { background: var(--rack-soft); color: var(--rack); }
.chip.SAYIM { background: var(--warn-soft); color: var(--warn); }
.chip.low { background: var(--bad-soft); color: var(--bad); }
.chip.soon { background: var(--warn-soft); color: var(--warn); }

/* Hızlı işlem düğmeleri */
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(4, 1fr); } }
.action {
  --c: var(--rack); --cs: var(--rack-soft);
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 12px;
  text-decoration: none; color: var(--fg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 32, 56, .05); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.action:hover { transform: translateY(-2px); border-color: var(--c); box-shadow: 0 10px 24px -14px rgba(16, 32, 56, .45); }
.action strong { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.15; }
.action > span:not(.a-ico):not(.a-go) { font-size: .84rem; color: var(--muted); }
.action .a-ico { width: 44px; height: 44px; border-radius: 11px; background: var(--cs); color: var(--c); display: grid; place-items: center; margin-bottom: 10px; }
.action .a-go { position: absolute; top: 14px; right: 16px; font-size: 1.5rem; line-height: 1; color: var(--line); transition: color .15s, transform .15s; }
.action:hover .a-go { color: var(--c); transform: translateX(3px); }
.action.GIRIS { --c: var(--good); --cs: var(--good-soft); }
.action.CIKIS { --c: var(--bad); --cs: var(--bad-soft); }
.action.TASIMA { --c: var(--rack); --cs: var(--rack-soft); }
.action.SAYIM { --c: var(--warn); --cs: var(--warn-soft); }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Panel: karşılama alanı */
.hero {
  position: relative; overflow: hidden; border-radius: 14px; padding: 22px 22px 20px; color: #fff;
  background: linear-gradient(135deg, #1f4e8c 0%, #173d6e 100%);
  box-shadow: 0 16px 34px -22px rgba(16, 40, 80, .7);
  display: flex; flex-direction: column; gap: 18px;
}
.hero-rack { position: absolute; inset: 0; pointer-events: none; opacity: .13;
  background: repeating-linear-gradient(90deg, transparent 0 70px, #fff 70px 75px), repeating-linear-gradient(180deg, transparent 0 46px, #ff8a4c 46px 51px);
  -webkit-mask-image: linear-gradient(100deg, transparent 45%, #000 100%); mask-image: linear-gradient(100deg, transparent 45%, #000 100%); }
.hero-head { position: relative; display: flex; flex-direction: column; gap: 2px; }
.hero-date { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #ffb38a; }
.hero h1 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.1; }
.hero-search { position: relative; }
.hero-search label { color: #dbe6f5; font-size: .85rem; letter-spacing: .02em; }
.hero-search input { background: #fff; color: #16202c; border: 0; padding: 15px 14px; font-size: 1.05rem; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.hero-search input::placeholder { color: #7a8796; }
.hero-search .cam { padding: 0 18px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.hero #araInfo:not(:empty) { margin-top: 10px; background: var(--surface); color: var(--fg); border-radius: 10px; padding: 4px 14px; }
.hero #araInfo .hint { margin: 10px 0; }

/* Panel: sayılar */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--fg); border-left: 4px solid var(--beam); transition: border-color .15s; }
.stat:hover { border-color: var(--beam); }
.stat-n { font-family: var(--f-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-t { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Panel: kutular */
.p-card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 32, 56, .05); }
.p-head { display: flex; align-items: center; gap: 10px; }
.p-head h3 { flex: 1; }
.p-head .ico { width: 20px; height: 20px; color: var(--muted); }
.p-head .ico.c-bad { color: var(--bad); }
.p-head .ico.c-warn { color: var(--warn); }
.p-count { min-width: 30px; height: 26px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center;
  font: 700 .9rem var(--f-body); background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.p-count.low { background: var(--bad-soft); color: var(--bad); }
.p-count.soon { background: var(--warn-soft); color: var(--warn); }
#panelBody { grid-template-columns: 1fr; }
@media (min-width: 640px) { #panelBody { grid-template-columns: 1fr 1fr; } }
.p-link { white-space: nowrap; font-weight: 600; text-decoration: none; font-size: .92rem; }
.p-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 8px 10px; }
.p-empty strong { font-size: 1rem; }
.p-empty span { color: var(--muted); font-size: .88rem; }
.p-empty-ico { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--good-soft); color: var(--good); stroke-width: 2.4; margin-bottom: 6px; }

/* Listeler */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--fg); min-width: 0;
}
.item:first-child { border-top: 0; }
.item .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .main strong { overflow-wrap: anywhere; }
.item .side { text-align: right; flex: 0 0 auto; }
.qty { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 20px 8px; text-align: center; color: var(--muted); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
td.r, th.r { text-align: right; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { background: var(--rack-soft); color: var(--rack); padding: 8px 12px; font-size: .9rem; }
.seg button.on { background: var(--rack); color: #fff; }

/* Tarayıcı penceresi */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 10, 18, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--surface); border-radius: var(--r); padding: 16px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
#qAdet { font: 700 2.2rem var(--f-display); text-align: center; padding: 10px; }
.step-done { opacity: .6; }
#reader { width: 100%; min-height: 220px; border-radius: 8px; overflow: hidden; background: #000; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; max-width: calc(100% - 32px);
}
.toast.bad { background: var(--bad); color: #fff; }

/* Giriş ekranı: sayfanın ortasında tek kart */
.view:has(.login-wrap) { min-height: calc(100dvh - 140px); justify-content: center; }
.login { max-width: 380px; margin: 8vh auto 0; }
.login-wrap {
  display: grid; grid-template-columns: 1fr; width: 100%; max-width: 440px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 40px -24px rgba(16, 32, 56, .35);
}
.login-brand {
  position: relative; background: var(--rack); color: #fff; padding: 36px 32px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; min-height: 420px; overflow: hidden;
}
/* Raf dikmeleri ve turuncu kirişler */
.lb-rack { position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 86px, #fff 86px 92px),
    repeating-linear-gradient(180deg, transparent 0 74px, #ff8a4c 74px 82px); }
.lb-rack span { display: none; }
.lb-rack { -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 70%); mask-image: linear-gradient(to bottom, #000 25%, transparent 70%); }
@media (max-width: 720px) { .lb-rack { -webkit-mask-image: linear-gradient(to right, #000 0%, transparent 60%); mask-image: linear-gradient(to right, transparent 55%, #000 100%); opacity: .2; } }
.lb-text { position: relative; display: flex; flex-direction: column; gap: 14px; }
.lb-kicker { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #ffb38a; }
.login-brand h1 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.05; color: #fff; }
.lb-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .95rem; }
.lb-list li { display: flex; align-items: center; gap: 10px; color: #dbe6f5; }
.lb-list .addr { background: rgba(255, 255, 255, .14); color: #fff; min-width: 64px; text-align: center; }
.login-form { padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0; }
.login-form h2 { font-size: 1.9rem; }
.login-form p { margin: 4px 0 0; }
.login-form input { padding: 14px 14px; font-size: 1.05rem; }
.pw { position: relative; }
.pw input { padding-right: 84px; }
.pw-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 12px; font-size: .85rem;
  background: var(--rack-soft); color: var(--rack); }
.lg-btn { padding: 15px; font-size: 1.1rem; margin-top: 4px; }
.lg-help { margin: 0; text-align: center; }
@media (max-width: 720px) {
  .login-wrap { border-radius: 12px; }
  .login-brand { min-height: 0; padding: 26px 22px; gap: 0; }
  .lb-list { display: none; }
  .login-brand h1 { font-size: 1.7rem; }
  .login-form { padding: 26px 22px 28px; }
}

/* Etiketler */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.label {
  background: #fff; color: #000; border: 1px dashed #999; border-radius: 4px; padding: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; break-inside: avoid; page-break-inside: avoid;
}
.label .big { font-family: var(--f-mono); font-weight: 600; font-size: 1.6rem; }
.label .name { font-weight: 600; font-size: .9rem; text-align: center; line-height: 1.2; }
.label svg { max-width: 100%; height: auto; }
.labels.raf .label { padding: 14px 8px; }
.labels.raf .label .big { font-size: 2.4rem; }

@media print {
  body { background: #fff; padding: 0; }
  .topbar, .tabbar, .noprint, .toast { display: none !important; }
  .view { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  .label { border: 1px solid #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.pager button:disabled { opacity: .4; cursor: default; }
#whoName { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.who-unvan { font-size: .72rem; opacity: .75; font-weight: 600; letter-spacing: .02em; }
