:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ec;
  --brand: #e8590c; --brand-ink: #fff;
  --green: #1f9d55; --green-bg: #e3f6ea; --red: #d63031; --red-bg: #fdecec;
  --amber: #b7791f; --amber-bg: #fff4dc; --blue: #2563eb; --blue-bg: #e6eefe; --gray-bg: #eceef2;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 16px; } h2 { font-size: 18px; margin: 0 0 10px; } h3 { font-size: 16px; margin: 14px 0 8px; } h4 { margin: 12px 0 4px; font-size: 14px; }

.top { display: flex; align-items: center; gap: 16px; padding: 0 16px; background: #1d2433; color: #fff; min-height: 52px; flex-wrap: wrap; }
.top .brand { color: #fff; font-weight: 700; font-size: 17px; }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { color: #c9cfdb; padding: 15px 12px; }
.top nav a.on, .top nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.top .who { font-size: 13px; color: #c9cfdb; } .top .who a { color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 460px; margin: 40px auto; }
.login h1 { text-align: center; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

button, .btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: 9px 16px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary, .btn.secondary { background: var(--gray-bg); color: var(--ink); }
button.danger { background: var(--red); }
.btn.big { font-size: 17px; padding: 12px 22px; background: var(--green); }
.sm { padding: 5px 10px; font-size: 13px; }
button.link { background: none; color: var(--blue); padding: 0; font-weight: 500; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cdd2dc; border-radius: 8px; background: #fff; color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form.inline, form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; display: flex; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 5px solid #aab; border-radius: 10px; padding: 12px 14px; color: var(--ink); display: flex; flex-direction: column; }
.tile:hover { text-decoration: none; border-color: #c8ccd6; }
.tile.on { box-shadow: 0 0 0 2px var(--ink) inset; }
.tile b { font-size: 28px; line-height: 1.1; } .tile span { color: var(--muted); font-size: 13px; }
.t-green { border-left-color: var(--green); } .t-red { border-left-color: var(--red); } .t-amber { border-left-color: #e0a100; } .t-gray { border-left-color: #8a93a6; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[name=q] { min-width: 240px; }
.sync { display: flex; gap: 10px; align-items: center; }

table { border-collapse: collapse; width: 100%; }
.grid th, .grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; }
.grid tr.late td { background: #fff7f7; }
.grid tr.done td { background: var(--green-bg); }
.grid .empty { text-align: center; color: var(--muted); padding: 30px; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 12px 5px 0; width: 40%; vertical-align: top; }
.kv td { padding: 5px 0; }
.c { text-align: center; } .r { text-align: right; } .actions { white-space: nowrap; text-align: right; }
.small { font-size: 12.5px; } .muted { color: var(--muted); } .red { color: var(--red); } .mono { font-family: ui-monospace, Consolas, monospace; }
.hidden { display: none !important; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-gray { background: var(--gray-bg); color: #4a5263; } .b-blue { background: var(--blue-bg); color: var(--blue); }
.b-amber { background: var(--amber-bg); color: var(--amber); } .b-green { background: var(--green-bg); color: var(--green); }
.b-red { background: var(--red-bg); color: var(--red); } .b-dark { background: #3b4252; color: #fff; }
.py { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--gray-bg); white-space: nowrap; }
.py-trendyol { background: #fff0e6; color: #e8590c; } .py-hepsiburada { background: #fff3e0; color: #ff6000; }
.py-n11 { background: #f3e8ff; color: #7c3aed; } .py-pazarama { background: #e6f4ff; color: #0369a1; }

p.err, .err { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 8px; }
p.ok, .ok { background: var(--green-bg); color: var(--green); padding: 10px 12px; border-radius: 8px; }
.warn-box { background: var(--amber-bg); color: #7a5200; padding: 10px 12px; border-radius: 8px; }
#zebraMsg:empty { display: none; }

/* İstasyon ekranları (paketle / teslim) */
.station { max-width: 980px; margin: 0 auto; }
.scanbox { background: #1d2433; color: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.scanbox > label { font-size: 18px; font-weight: 600; display: block; margin-bottom: 10px; }
.scanbox #scan { width: 100%; font-size: 26px; padding: 14px; font-family: ui-monospace, Consolas, monospace; border: 3px solid var(--brand); }
.scanopts { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; color: #c9cfdb; }
.scanopts .muted { color: #9aa3b5; }
.msg { font-size: 20px; font-weight: 700; padding: 16px 18px; border-radius: 10px; margin-bottom: 14px; }
.m-ok { background: var(--green); color: #fff; }
.m-warn { background: #f0b400; color: #1d2433; }
.m-err { background: var(--red); color: #fff; }
.m-alarm { background: var(--red); color: #fff; font-size: 26px; animation: flash .5s 4; }
@keyframes flash { 50% { background: #7a0000; } }
.ohead { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ohead h2 { margin: 2px 0; font-size: 22px; } .ohead .right { text-align: right; }
.progress { height: 10px; background: var(--gray-bg); border-radius: 99px; overflow: hidden; margin: 6px 0 12px; }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.lines .qty { font-size: 20px; font-weight: 700; white-space: nowrap; }
.obtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.plist { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.plist li { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid var(--line); }
.alert-card { border-color: #f0b400; border-width: 2px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li span { display: block; }
.timeline .ev-yanlis_urun, .timeline .ev-fazla_urun, .timeline .ev-teslim_engel, .timeline .ev-kontrolsuz_cikis, .timeline .ev-iptal_uyari, .timeline .ev-py_hata { color: var(--red); }
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.4); }

@media (max-width: 640px) {
  .top { gap: 0 12px; padding-top: 8px; }
  .top .who { margin-left: auto; }
  .top nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  .top nav a { padding: 10px 10px; white-space: nowrap; }
  .grid th, .grid td { padding: 7px 8px; }
  .filters input[name=q] { min-width: 0; width: 100%; }
  .ohead { flex-direction: column; } .ohead .right { text-align: left; }
}
@media print {
  .top, .noprint, .bar { display: none !important; }
  body { background: #fff; } .card { border: 0; padding: 0; }
}
/* Geçmiş siparişler */
.b-violet { background: #efe9fb; color: #5b3fa8; }
.gecmis-kutu summary { cursor: pointer; font-weight: 600; }
.gecmis-kutu .filters { margin-top: 10px; }
.gecmis-ilerle { margin-top: 10px; font-size: 13px; }
.gecmis-ilerle .cubuk { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.gecmis-ilerle .cubuk i { display: block; height: 100%; width: 0; background: #5b3fa8; transition: width .3s; }
.t-violet { border-left-color: #5b3fa8; }
