/* WENA Return Depo — cargo-manifest aesthetic */
:root {
  --paper: #eef1f6;
  --card: #ffffff;
  --ink: #1a1f2e;
  --ink-2: #5b6472;
  --line: #e3e7ee;
  --line-soft: #eef1f5;
  --accent: #e8541d;          /* brand orange */
  --accent-ink: #fff;
  --accent-soft: #fdeee7;
  --ok: #16a34a;
  --bad: #dc2626;
  --pending: #d97706;
  --warehouse: #2563eb;
  --resold: #7c3aed;
  --local: #0d9488;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --disp: 'Barlow Condensed', var(--sans);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 500px at 50% -200px, rgba(232, 84, 29, .05), transparent 70%),
    radial-gradient(900px 500px at 100% 0, rgba(37, 99, 235, .04), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}
.mono, .mono-in { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.strong { font-weight: 600; }
.pre { white-space: pre-line; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  background: var(--ink); color: #eee;
  padding: 0 22px; height: 58px;
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark { color: var(--accent); font-size: 24px; line-height: 1; }
.brand-mark.big { font-size: 40px; }
.brand-text { font-family: var(--disp); font-weight: 700; font-size: 21px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.brand-text small { display: block; font-family: var(--sans); font-weight: 400; font-size: 10px; letter-spacing: .12em; color: #9aa0a6; text-transform: uppercase; margin-top: 3px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  font-family: var(--disp); font-size: 17px; letter-spacing: .05em; text-transform: uppercase;
  color: #c8cdd2; text-decoration: none; padding: 7px 14px; border-radius: 4px;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mainnav a.on { color: #fff; background: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.langsw a { color: #9aa0a6; text-decoration: none; font-family: var(--mono); font-size: 12px; padding: 4px 7px; border: 1px solid #3a3f44; }
.langsw a:first-child { border-right: none; }
.langsw a.on { color: var(--ink); background: #eee; }
.who { font-size: 13px; color: #c8cdd2; }
.logout { color: #9aa0a6; font-size: 13px; }

.flash {
  background: var(--ok); color: #fff; padding: 10px 22px;
  font-weight: 500; animation: fadein .3s;
}
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 26px 22px 80px; }
.page.narrow { max-width: 760px; }
.pagetitle { font-family: var(--disp); font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 14px; }
.hint { color: var(--ink-2); margin: 4px 0 16px; max-width: 70ch; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(25, 28, 31, .04), 0 6px 20px rgba(25, 28, 31, .05);
  transition: box-shadow .18s ease;
}
.action-card:hover { box-shadow: 0 2px 4px rgba(25, 28, 31, .06), 0 10px 30px rgba(232, 84, 29, .08); }
.card h3 { font-family: var(--disp); font-size: 21px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.action-card { border-left: 5px solid var(--accent); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 18px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden;
  transition: transform .12s;
}
.stat:hover { transform: translateY(-2px); }
.stat b { font-family: var(--disp); font-size: 34px; font-weight: 700; line-height: 1; }
.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.s-pending::before { background: var(--pending); }
.s-warehouse::before { background: var(--warehouse); }
.s-resold::before { background: var(--resold); }
.s-shipped::before { background: var(--ok); }
.s-local::before { background: var(--local); }

/* ---------- store summary ---------- */
.store-summary { margin-bottom: 22px; }
.ss-title { font-family: var(--disp); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 0 0 10px; }
.ss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ss-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 1px 2px rgba(25,28,31,.04); transition: transform .12s, box-shadow .12s; border-left: 4px solid var(--warehouse);
}
.ss-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(25,28,31,.08); }
.ss-name { font-family: var(--disp); font-size: 17px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ss-metrics { display: flex; flex-wrap: wrap; gap: 3px 14px; align-items: baseline; }
.ss-metrics b { font-family: var(--disp); font-size: 22px; color: var(--accent); line-height: 1; }
.ss-metrics em { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-right: 8px; }

/* ---------- toolbar/tabs ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; background: #e9edf3; border-radius: 6px; padding: 3px; }
.tabs a {
  font-family: var(--disp); font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-2); text-decoration: none; padding: 6px 14px; border-radius: 4px;
}
.tabs a.on { background: var(--ink); color: #fff; }
.search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search input[type=search] {
  font-family: var(--sans); font-size: 14px; padding: 9px 14px; width: 260px; max-width: 60vw;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
}
.store-filter {
  font-family: var(--sans); font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); cursor: pointer;
}
.weight-form { display: inline-flex; align-items: center; gap: 6px; }
.weight-form input { width: 90px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  font-family: var(--disp); font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  text-align: left; color: var(--ink-2); background: #f1f4f9;
  padding: 11px 13px; border-bottom: 2px solid var(--line); white-space: nowrap;
  position: sticky; top: 58px; z-index: 5;
}
table.grid td { padding: 11px 13px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: none; }
tr.rowlink { cursor: pointer; transition: background .12s; }
tr.rowlink:hover { background: #f6f8fb; }
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); display: inline-block; }
.thumb.none { display: inline-flex; align-items: center; justify-content: center; color: #9aa3b2; background: #f1f4f9; }
.vars { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.empty { text-align: center; color: var(--ink-2); padding: 60px 0; font-size: 15px; }

/* ---------- chips ---------- */
.chip {
  display: inline-block; font-family: var(--disp); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.chip.lg { font-size: 15px; padding: 5px 14px; }
.c-pending { background: var(--pending); }
.c-warehouse { background: var(--warehouse); }
.c-resold { background: var(--resold); }
.c-shipped { background: var(--ok); }
.c-local_sold { background: var(--local); }
.c-bad { background: var(--bad); }

/* ---------- or divider + local sold box ---------- */
.or-divider { display: flex; align-items: center; text-align: center; margin: 20px 0 16px; color: var(--ink-2); }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.or-divider span { padding: 0 14px; font-family: var(--disp); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.local-sold-box { background: #f0fbf8; border: 1px solid #bfe9e0; border-radius: 10px; padding: 16px 18px; }
.local-sold-box h4 { font-family: var(--disp); font-size: 18px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 6px; color: var(--local); }
.local-sold-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.local-sold-form label { flex: 1; min-width: 160px; margin-bottom: 0; }
.timeline li.sold::before { background: var(--local); border-color: var(--local); }

/* ---------- forms ---------- */
.form label, .auth-card label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form label.req::after { content: ' *'; color: var(--accent); }
.form input[type=text], .form input[type=date], .form input[type=email], .form input[type=password],
.form select, .form textarea, .auth-card input, .inline-form input, .note-form input {
  display: block; width: 100%; margin-top: 5px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus, .auth-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.form input[type=file] { margin-top: 6px; font-size: 13px; }
.mono-in { font-family: var(--mono) !important; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.frow > label { margin-bottom: 14px; }
fieldset { border: 1px dashed var(--line); border-radius: 8px; margin: 0 0 14px; padding: 12px 14px 2px; }
legend { font-family: var(--disp); font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 0 6px; }
.varrow { grid-template-columns: 180px 1fr; margin-bottom: 10px; }
.varrow input { margin-top: 0 !important; }
.factions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--disp); font-size: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; text-decoration: none; text-align: center;
  padding: 9px 20px; border-radius: 6px; border: 1px solid var(--ink); cursor: pointer;
  background: var(--card); color: var(--ink); transition: filter .1s, transform .1s;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.sm { font-size: 14px; padding: 6px 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  border-top: 6px solid var(--accent); padding: 34px 34px 26px;
  box-shadow: 0 10px 40px rgba(25, 28, 31, .12);
  animation: rise .35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { font-family: var(--disp); font-size: 27px; text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 2px; }
.auth-brand p { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.auth-lang { text-align: center; margin-top: 16px; font-size: 13px; }
.code-input { font-family: var(--mono) !important; font-size: 26px !important; letter-spacing: .35em; text-align: center; }
.err { background: #fbe9e7; color: var(--bad); border: 1px solid #f0c4c0; border-radius: 6px; padding: 9px 13px; margin-bottom: 14px; font-size: 14px; }
.qr-box { text-align: center; margin: 10px 0; }
.qr-box img { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.secret-line { text-align: center; font-size: 12px; color: var(--ink-2); word-break: break-all; margin: 4px 0 16px; }

/* ---------- detail ---------- */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-head .pagetitle { margin: 0; }
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-bottom: 14px; }
.kv > div { border-bottom: 1px dotted var(--line); padding-bottom: 7px; }
.kv .span2 { grid-column: span 2; }
.kv dt { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); margin: 0 0 2px; }
.kv dd { margin: 0; font-size: 15px; }
.photos { display: flex; gap: 14px; flex-wrap: wrap; }
.photos figure { margin: 0; }
.photos img { width: 190px; height: 190px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photos figcaption { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-top: 5px; text-align: center; }
.checks3 { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
label.check { display: flex !important; align-items: center; gap: 10px; font-size: 15px !important; font-weight: 500 !important; color: var(--ink) !important; background: #f6f8fb; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; cursor: pointer; margin: 0 !important; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.label-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=file] { width: auto; font-size: 12px; }
.note-form { display: flex; gap: 8px; margin-bottom: 14px; }
.note-form input { flex: 1; margin-top: 0; }
.notelist { list-style: none; margin: 0; padding: 0; }
.notelist li { border-left: 3px solid var(--line); padding: 6px 12px; margin-bottom: 8px; }
.note-meta { display: block; font-size: 11px; color: var(--ink-2); margin-bottom: 2px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -8px; top: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--line);
}
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline b { display: block; font-family: var(--disp); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.timeline span { display: block; font-size: 12px; color: var(--ink-2); }
.checkline { margin-top: 2px; }

/* ---------- ship queue ---------- */
.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
.ship-card { display: flex; flex-direction: column; margin-bottom: 0; border-top: 4px solid var(--resold); }
.ship-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ship-card-head a { color: var(--ink); font-size: 17px; text-decoration: none; }
.ship-card-body { display: flex; gap: 14px; flex: 1; }
.ship-card-body h3 { margin: 0 0 4px; font-size: 18px; }
.ship-photo { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }
.shipto { background: #f6f8fb; border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; font-size: 13.5px; margin-top: 8px; line-height: 1.55; }
.ship-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1f5; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.plainlist { list-style: none; margin: 0 0 16px; padding: 0; }
.plainlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--line); }
.plainlist li.inactive { opacity: .45; }
.taglist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.taglist li { display: inline-flex; align-items: center; gap: 6px; background: #f1f4f9; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 13px; font-size: 13.5px; }
.taglist li.inactive { opacity: .4; text-decoration: line-through; }
.taglist form { display: inline; }
.taglist button { border: none; background: #dfe4ec; border-radius: 50%; width: 20px; height: 20px; line-height: 1; cursor: pointer; font-size: 12px; }
.plainlist li form { display: inline; }
.rolehelp { list-style: none; margin: 0 0 14px; padding: 12px 14px; background: #f6f8fb; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.rolehelp li { padding: 3px 0; }
.rolehelp b { color: var(--ink); }
.edit-photo { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.edit-photo img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.edit-photo small { color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .cols, .settings-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mainnav a { padding: 7px 9px; font-size: 15px; }
  .frow { grid-template-columns: 1fr; }
  .ship-grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}

/* tablet + telefon: topbar tek satira sigmayinca sarsin */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px 14px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; gap: 2px; -webkit-overflow-scrolling: touch; }
  .mainnav a { white-space: nowrap; }
  .topbar-right { margin-left: auto; }
  .page { padding: 18px 14px 60px; }
  .pagetitle { font-size: 25px; }
  .search input[type=search] { flex: 1; min-width: 0; max-width: none; }
  .store-filter { flex: 1; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { overflow-x: auto; }

  /* dashboard tablosunu karta cevir */
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr {
    margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
    padding: 6px 4px; box-shadow: 0 1px 3px rgba(25,28,31,.05);
  }
  table.grid td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 8px 14px; border-bottom: 1px solid #f1f4f9; text-align: right;
  }
  table.grid tr td:last-child { border-bottom: none; }
  table.grid td::before {
    content: attr(data-label); font-family: var(--disp); font-size: 12px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--ink-2); text-align: left; flex-shrink: 0;
  }
  .table-wrap { border: none; background: transparent; overflow: visible; }
  .vars { text-align: right; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat b { font-size: 28px; }
  .kv { grid-template-columns: 1fr; }
  .kv .span2 { grid-column: span 1; }
  .photos img { width: 100%; height: auto; max-height: 260px; }
  .factions { flex-direction: column-reverse; }
  .factions .btn { width: 100%; }
  .detail-head { gap: 8px; }
  .detail-head .btn { order: -1; }
}

/* dokunmatik hedefler yeterince buyuk olsun */
@media (hover: none) {
  .btn { padding: 11px 20px; }
  .btn.sm { padding: 9px 15px; }
  input, select, textarea { font-size: 16px !important; } /* iOS zoom engelle */
}
