/* ELO Upload — one stylesheet for the whole page. Light, calm, one accent. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e6e8ec;
  --line-strong: #d5d9e0;
  --text: #141821;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef0ff;
  --ok: #067647;        --ok-soft: #e7f6ee;
  --warn: #b54708;      --warn-soft: #fff3e2;
  --bad: #b42318;       --bad-soft: #fdecea;
  --idle: #475467;      --idle-soft: #eef1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.hidden { display: none !important; }
.offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* ── frame ── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--idle); font-weight: 550; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-dark); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.tokens { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tokens b { font-size: 20px; letter-spacing: -.01em; }
.addr { display: block; word-break: break-all; margin: 4px 0 8px; font-weight: 600; }
.addr-key { font-size: 15px; letter-spacing: 0; }
.meter { height: 6px; border-radius: 99px; background: var(--idle-soft); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.main { padding: 28px 36px 60px; max-width: 1240px; width: 100%; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin-top: 4px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: inline-block; }

/* ── basics ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.btn { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { border-color: transparent; color: var(--accent-dark); padding-inline: 8px; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

label.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=email], select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 190px; line-height: 1.6; }
textarea.short { min-height: 110px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ready { background: var(--ok-soft); color: var(--ok); }
.chip.review { background: var(--warn-soft); color: var(--warn); }
.chip.failed { background: var(--bad-soft); color: var(--bad); }
.chip.idle { background: var(--idle-soft); color: var(--idle); }
.chip.work { background: var(--accent-soft); color: var(--accent-dark); }
.chip-x { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0 0 0 4px; line-height: 1; }
.reason .btn { margin-left: 6px; }
.chip.work::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .chip-x { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0 0 0 4px; line-height: 1; }
.reason .btn { margin-left: 6px; }
.chip.work::before { animation: none; } }

.note { border-radius: 10px; padding: 12px 14px; font-size: 14px; background: var(--accent-soft); color: var(--accent-dark); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(16, 24, 40, .25); z-index: 50; }

/* ── sign in ── */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin .card { width: 100%; max-width: 400px; padding: 32px; }
.code-input { letter-spacing: .5em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── batches list ── */
.batch { display: grid; grid-template-columns: 1.1fr 1.6fr auto; gap: 20px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.batch:last-child { border-bottom: 0; }
.batch:hover { background: #fafbfc; }
.shop-name { font-weight: 650; }
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--idle-soft); }
.bar i { display: block; height: 100%; }
.bar .s-ready { background: #12b76a; }
.bar .s-review { background: #f79009; }
.bar .s-failed { background: #f04438; }
.bar .s-idle { background: #98a2b3; }
.bar .s-work { background: #a5b4fc; }
.counts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.counts b { color: var(--text); font-weight: 650; }

/* ── new batch ── */
.shops-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pick { border: 1.5px solid var(--line-strong); border-radius: 11px; padding: 14px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit; display: grid; gap: 2px; }
.pick:hover { border-color: var(--faint); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 11px; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 11px; padding: 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }

/* ── batch ── */
.progress { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: center; }
.progress .big { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--idle); cursor: pointer; }
.tab b { color: var(--faint); font-weight: 650; margin-left: 4px; }
.tab.on { background: var(--text); border-color: var(--text); color: #fff; }
.tab.on b { color: #cfd4dc; }

.rows { display: grid; }
.item { display: grid; grid-template-columns: 64px 1fr 150px; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: start; }
.item:last-child { border-bottom: 0; }
.thumb { width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fff center/contain no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 11px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.amazon { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 8px; }
.title-edit { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.title-edit textarea { font-weight: 600; font-size: 14px; padding: 8px 10px; min-height: 0; line-height: 1.4; resize: none; overflow: hidden; display: block; }
.count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.count.over { color: var(--bad); font-weight: 700; }
.reason { font-size: 13px; color: var(--warn); margin-top: 6px; }
.reason.err { color: var(--bad); }
.reason.info { color: var(--muted); }
.side-actions { display: grid; gap: 8px; justify-items: end; }

.send { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sendcard { border: 1px solid var(--line); border-radius: 11px; padding: 16px; display: grid; gap: 12px; }
.sendcard.done { background: #fafbfc; }
.sendcard pre { margin: 0; background: var(--bg); border-radius: 8px; padding: 10px; font-size: 12px; line-height: 1.55; max-height: 88px; overflow: hidden; color: var(--idle); white-space: pre; }

/* ── tables (shops, sign-ins) ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td select { width: auto; padding: 6px 10px; }
.form-grid { display: grid; grid-template-columns: 1.2fr 1.4fr .7fr .9fr auto; gap: 12px; align-items: end; }
.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .12em; background: var(--bg); border-radius: 10px; padding: 12px 14px; word-break: break-all; }

/* ── phone ── */
.topbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); z-index: 20; }
  .side .brand, .side-foot { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 14px 96px; }
  h1 { font-size: 21px; }
  .batch { grid-template-columns: 1fr; gap: 12px; }
  .progress { grid-template-columns: 1fr 1fr; gap: 14px; }
  .progress > :first-child { grid-column: 1 / -1; }
  .item { grid-template-columns: 52px 1fr; gap: 12px; padding: 14px; }
  .thumb { width: 52px; height: 52px; }
  .side-actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; justify-items: start; align-items: center; }
  .summary { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 12px 14px; }
  .hide-phone { display: none; }
  .toast { bottom: 84px; }
}
