/* Shelfshoot portal — extends the landing brand (ink / paper / orange, Inter). */
:root {
  --ink: #0b1220;
  --ink-strong: #020617;
  --ink-soft: #1e293b;
  --paper: #fafaf9;
  --paper-strong: #ffffff;
  --paper-muted: #f1f5f9;
  --line: #e2e8f0;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --green: #16a34a;
  --blue: #2563eb;
  --text-muted: #64748b;
  --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.10);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.03em; font-size: 19px; color: var(--ink-strong); text-decoration: none; }
.brand .dot { width: 13px; height: 13px; border-radius: 4px; background: var(--orange); box-shadow: 0 4px 12px rgba(249,115,22,.45); }

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 520px at 50% -8%, #ffffff 0%, var(--paper) 62%);
}
.auth-card {
  width: 100%; max-width: 408px; background: var(--paper-strong);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-soft);
  padding: 40px 34px;
}
.auth-card h1 { font-size: 25px; letter-spacing: -0.03em; margin: 22px 0 4px; }
.auth-card p.sub { color: var(--text-muted); margin: 0 0 26px; font-size: 15px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 11px; background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(249,115,22,.14); background: #fff; }
.btn {
  width: 100%; padding: 13px 16px; font-size: 15px; font-weight: 700; font-family: inherit;
  color: #fff; background: var(--orange); border: 0; border-radius: 11px; cursor: pointer;
  box-shadow: 0 12px 26px rgba(249,115,22,.30); transition: transform .12s, background .15s;
}
.btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 13px; font-size: 14px; margin-bottom: 16px; display: none; }
.error.show { display: block; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---------- Dashboard v3: dark sidebar shell ---------- */
.app { background: var(--paper); }
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column;
  padding: 26px 18px 20px; color: #cbd5e1;
  background: radial-gradient(640px 360px at -10% -8%, rgba(249,115,22,.20) 0%, transparent 58%), linear-gradient(178deg, var(--ink) 0%, var(--ink-strong) 78%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand { color: #fff; font-size: 19px; padding: 0 10px 6px; }
.sidebar .brand-mark { width: 26px; height: 30px; flex: none; filter: drop-shadow(0 4px 10px rgba(249,115,22,.4)); }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
.nav-i {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: #94a3b8;
  background: none; border: 0; padding: 11px 12px; border-radius: 11px; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav-i svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-i:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.nav-i.on { color: #fff; background: rgba(249,115,22,.16); box-shadow: inset 2px 0 0 var(--orange); }
.nav-i.on svg { stroke: var(--orange); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 6px; }
.side-foot .langtog { align-self: flex-start; border-color: rgba(255,255,255,.14); }
.side-foot .langtog button { background: transparent; color: #94a3b8; }
.side-foot .langtog button.on { background: var(--orange); color: #fff; }
.side-foot .logout { font-size: 13.5px; font-weight: 600; color: #cbd5e1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); padding: 9px 14px; border-radius: 10px; text-align: center; text-decoration: none; transition: background .15s; }
.side-foot .logout:hover { background: rgba(255,255,255,.12); }

.content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 26px 40px 20px; background: rgba(250,250,249,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 26px; letter-spacing: -0.035em; margin: 0 0 3px; }
.page-head p { color: var(--text-muted); margin: 0; font-size: 14.5px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-soft); background: var(--paper-strong); border: 1px solid var(--line); padding: 7px 13px 7px 8px; border-radius: 99px; box-shadow: 0 4px 14px rgba(15,23,42,.05); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(150deg, var(--orange), var(--orange-dark)); text-transform: uppercase; }
.panel { padding: 30px 40px 80px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { position: relative; background: var(--paper-strong); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 8px 24px rgba(15,23,42,.04); transition: transform .18s, box-shadow .18s, border-color .18s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(15,23,42,.09); border-color: #cdd6e2; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .045em; }
.stat .ic { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; }
.stat .ic svg { width: 16px; height: 16px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-orange { background: #fff1e6; } .ic-orange svg { stroke: var(--orange-dark); }
.ic-blue { background: #eaf1ff; } .ic-blue svg { stroke: var(--blue); }
.ic-green { background: #e7f8ef; } .ic-green svg { stroke: var(--green); }
.ic-ink { background: var(--paper-muted); } .ic-ink svg { stroke: var(--ink-soft); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; line-height: 1.05; }
.stat .v.sm { font-size: 22px; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.stat .meter { height: 7px; border-radius: 99px; background: var(--paper-muted); margin-top: 14px; overflow: hidden; }
.stat .meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-dark)); border-radius: 99px; transition: width .6s cubic-bezier(.22,1,.36,1); }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; }
.pill.on { background: #ecfdf5; color: #047857; }
.pill.off { background: #fff7ed; color: var(--orange-dark); }
.pill .led { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.card { background: var(--paper-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15,23,42,.04); margin-bottom: 24px; overflow: hidden; }
.card .hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card .hd h2 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.card .hd .muted { font-size: 13px; color: var(--text-muted); }
.card .bd { padding: 18px 22px; }
.select { font-family: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; padding: 12px 22px; border-bottom: 1px solid var(--line); background: #fcfcfb; }
td { padding: 12px 22px; border-bottom: 1px solid var(--paper-muted); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fdf8f3; }
tr:last-child td { border-bottom: 0; }
td.code { font-variant-numeric: tabular-nums; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--paper-muted); color: var(--ink-soft); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.tag.ok { background: #ecfdf5; color: #047857; }
.tag.err { background: #fef2f2; color: #b91c1c; }
.empty { text-align: center; color: var(--text-muted); padding: 44px 22px; font-size: 15px; }
.skeleton { color: var(--text-muted); padding: 28px 22px; font-size: 14px; }

/* ---------- Integration: Shopify "use our app" card ---------- */
.shopify-card { border-color: #d6e6da; background: linear-gradient(180deg, #f4fbf6 0%, var(--paper-strong) 60%); }
.shopify-row { display: flex; gap: 16px; align-items: flex-start; }
.shopify-mark { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #5e8e3e, #4a7a2f); box-shadow: 0 6px 16px rgba(74,122,47,.3); }
.shopify-mark svg { width: 26px; height: 26px; }
.shopify-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.shopify-actions .btn { width: auto; padding: 11px 20px; background: #4a7a2f; box-shadow: 0 10px 22px rgba(74,122,47,.28); text-decoration: none; display: inline-block; }
.shopify-actions .btn:hover { background: #3d6627; }
.badge { font-size: 13px; font-weight: 600; color: #4a7a2f; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 14px 18px; gap: 6px 18px; }
  .sidebar .brand { padding: 0; margin-right: auto; }
  .nav { flex-direction: row; margin-top: 0; flex-wrap: wrap; gap: 4px; order: 3; flex-basis: 100%; }
  .nav-i.on { box-shadow: inset 0 -2px 0 var(--orange); }
  .side-foot { margin: 0; flex-direction: row; align-items: center; }
  .topbar, .panel { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 640px) { th, td { padding-left: 16px; padding-right: 16px; } .hide-sm { display: none; } .stats { grid-template-columns: repeat(2, 1fr); } .nav-i span { display: none; } }

/* ---------- Portal v3: forms, lang, panels ---------- */
.langtog { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; font-size: 12px; font-weight: 700; }
.langtog button { border: 0; background: var(--paper-strong); color: var(--text-muted); padding: 6px 10px; cursor: pointer; font-family: inherit; }
.langtog button.on { background: var(--ink-strong); color: #fff; }
.panel { display: none; animation: fade-in .26s ease both; }
.panel.on { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.frm { max-width: 460px; }
.frm .field label { color: var(--ink-soft); }
.frm .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.frm .btn { width: auto; padding: 11px 22px; margin-top: 4px; }
.connect-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 460px; margin-top: 6px; }
.msg { font-size: 14px; margin-top: 12px; min-height: 18px; }
.msg.ok { color: #047857; } .msg.err { color: #b91c1c; }
.hint { font-size: 13px; color: var(--text-muted); margin: -2px 0 16px; line-height: 1.5; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--paper-muted); display: inline-block; vertical-align: middle; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(15,23,42,.06); transition: transform .15s, box-shadow .15s; }
tbody tr:hover .thumb { transform: scale(1.06); box-shadow: 0 6px 16px rgba(15,23,42,.16); }
.thumb.noimg { background: var(--paper-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Crect x='2' y='3' width='14' height='12' rx='2'/%3E%3Ccircle cx='6.5' cy='7' r='1.3'/%3E%3Cpath d='M2 12l4-3 3 2 3-3 4 4'/%3E%3C/svg%3E") center/18px no-repeat; }
td:first-child { width: 56px; }

/* ---------- Login v2: split-screen ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login .showcase {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 520px at 18% -10%, rgba(249,115,22,.35) 0%, transparent 55%), linear-gradient(160deg, #0b1220 0%, #020617 70%);
}
.login .showcase .brand { color: #fff; }
.login .showcase .brand .dot { box-shadow: 0 6px 18px rgba(249,115,22,.6); }
.login .showcase .pitch { max-width: 440px; }
.login .showcase h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.04; letter-spacing: -0.04em; margin: 0 0 14px; font-weight: 800; }
.login .showcase h2 .accent { color: var(--orange); }
.login .showcase p { color: #cbd5e1; font-size: 17px; line-height: 1.6; margin: 0; }
.login .showcase .hero-img { position: absolute; right: -40px; bottom: -30px; width: 62%; max-width: 460px; filter: drop-shadow(0 30px 60px rgba(0,0,0,.55)); pointer-events: none; }
.login .showcase .foot { font-size: 13px; color: #94a3b8; position: relative; z-index: 1; }
.login .showcase .marks { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; font-weight: 600; color: #cbd5e1; opacity: .85; flex-wrap: wrap; }
.login .form-side { display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 480px at 50% -10%, #ffffff 0%, var(--paper) 60%); }
.login .form-inner { width: 100%; max-width: 384px; }
.login .form-inner > .brand { display: none; margin-bottom: 18px; }
.login .form-inner h1 { font-size: 27px; letter-spacing: -0.03em; margin: 6px 0 4px; }
.login .form-inner p.sub { color: var(--text-muted); margin: 0 0 26px; font-size: 15px; }
.login .topright { display: flex; justify-content: flex-end; margin-bottom: 8px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login .showcase { display: none; }
  .login .form-inner > .brand { display: inline-flex; }
}

/* ---------- Scan-station launcher (ITG-684) — additive only ---------- */
.scan-card { border-color: #f3d9bf; background: linear-gradient(180deg, #fff7ef 0%, var(--paper-strong) 60%); }
.scan-row { display: flex; gap: 16px; align-items: flex-start; }
.scan-mark { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(150deg, var(--ink), var(--ink-strong)); box-shadow: 0 6px 16px rgba(11,18,32,.3); }
.scan-mark svg { width: 26px; height: 30px; }
.scan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.scan-actions .btn { text-decoration: none; }
.scan-actions .btn.ghost { background: var(--paper-strong); color: var(--ink-soft); border: 1px solid var(--line); box-shadow: none; }
.scan-actions .btn.ghost:hover { background: var(--paper-muted); }
.scan-qr { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scan-qr-img { width: 200px; height: 200px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-soft); }
.scan-qr-img svg { width: 100%; height: 100%; display: block; }
.scan-qr-hint { margin: 0; text-align: center; }

/* Watermark logo (ITG-687) — Account tab. Additive only. */
.wm-row { display: flex; align-items: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.wm-preview { width: 132px; height: 132px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 1px dashed var(--line); background:
  linear-gradient(45deg, var(--paper-muted) 25%, transparent 25%) 0 0 / 16px 16px,
  linear-gradient(-45deg, var(--paper-muted) 25%, transparent 25%) 0 0 / 16px 16px,
  var(--paper-strong); overflow: hidden; }
.wm-img { max-width: 108px; max-height: 108px; object-fit: contain; display: block; }
.wm-empty { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-align: center; padding: 0 10px; }
.wm-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.wm-controls .btn { width: auto; padding: 11px 22px; }
.wm-controls .btn.ghost { background: var(--paper-strong); color: var(--ink-soft); border: 1px solid var(--line); box-shadow: none; }
.wm-controls .btn.ghost:hover { background: var(--paper-muted); transform: none; }

/* Sidebar nav labels — always legible (ITG-689). Rasmus reported bare icons with no
   text at narrow widths. The ≤640px rule above hid `.nav-i span`; restore the labels and
   keep the horizontal nav readable (slightly tighter padding/scroll instead of icon-only). */
@media (max-width: 640px) {
  .nav-i span { display: inline !important; }
  .sidebar .nav { gap: 4px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-i { padding: 9px 11px; font-size: 14px; gap: 9px; white-space: nowrap; }
}

/* Image-log actions + full-size lightbox (ITG-689) */
.thumb-click { cursor: zoom-in; }
.act-cell { white-space: nowrap; }
.btn-sm { font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 8px; border: 0; background: var(--orange); color: #fff; cursor: pointer; box-shadow: 0 4px 12px rgba(249,115,22,.28); transition: background .15s, transform .15s; }
.btn-sm:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn-sm:disabled { opacity: .65; cursor: default; transform: none; }
.btn-sm.err { background: #b91c1c; box-shadow: none; }
.muted.small { font-size: 12px; color: var(--text-muted); }
.lightbox { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 32px; background: rgba(2,6,23,.82); backdrop-filter: blur(4px); cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 90vh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); background: #fff; }

/* Portal footer — developed by ITGo + help/links (ITG-690) */
.portal-foot { margin: 44px 0 6px; padding: 22px 4px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.pf-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pf-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.pf-links a:hover { color: var(--ink); }
.pf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; }
.pf-meta a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.pf-meta a:hover { color: var(--orange-dark); }
.pf-dot { opacity: .5; }

/* Compact scan launcher in the sidebar (ITG-693) */
.side-scan { margin: 22px 6px 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; align-items: center; }
.side-scan-t { margin: 0 0 12px; align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; padding-left: 6px; }
.side-scan .scan-qr { margin: 0; display: block; }
.side-scan .scan-qr-img { width: 138px; height: 138px; padding: 9px; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.side-scan .scan-qr-img svg { width: 100%; height: 100%; display: block; }
.side-scan-hint { margin: 10px 0 0; font-size: 11px; line-height: 1.4; color: #64748b; text-align: center; padding: 0 4px; }
.side-scan .btn { width: 100%; margin-top: 12px; padding: 10px; font-size: 13.5px; }
.side-scan .msg { margin-top: 8px; }
@media (max-width: 900px) { .side-scan { display: none; } }
