/* Seller portal — sell-to-Pallet workspace */
:root {
  --ink: #101820;
  --blue: #246BFE;
  --blue-dark: #1A56D6;
  --blue-tint: #EBF1FF;
  --fog: #F4F6F8;
  --white: #FFFFFF;
  --line: rgba(16, 24, 32, 0.1);
  --muted: rgba(16, 24, 32, 0.58);
  --s2: #1B9E62;
  --s3: #E08A1E;
  --s5: #E5484D;
  --radius: 14px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { overflow-x: hidden; }
body.seller-app {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(36, 107, 254, 0.08), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(27, 158, 98, 0.06), transparent 50%),
    var(--fog);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ---------- chrome ---------- */
.seller-top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.seller-top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.seller-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  line-height: 1;
}
.seller-brand img { width: 28px; height: 28px; display: block; }
.seller-brand > span {
  display: block;
  line-height: 1;
  font-size: 16px;
}
.seller-brand em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  margin-left: 2px;
  height: 22px;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.seller-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.seller-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.seller-nav a:hover { color: var(--ink); background: rgba(16, 24, 32, 0.04); }
.seller-nav a.active { color: var(--blue); background: var(--blue-tint); }
.seller-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.seller-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- buttons ---------- */
.sbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.sbtn:active { transform: translateY(1px); }
.sbtn-primary { background: var(--blue); color: #fff; }
.sbtn-primary:hover { background: var(--blue-dark); }
.sbtn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.sbtn-ghost:hover { background: rgba(16, 24, 32, 0.04); }
.sbtn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.sbtn[disabled] { opacity: .55; pointer-events: none; }
.sbtn-mark {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.sbtn-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}
/* .sbtn { display: inline-flex } must not beat the hidden attribute */
.sbtn[hidden],
a.sbtn[hidden],
button.sbtn[hidden],
.seller-step:not(.active) { display: none !important; }

/* ---------- layout ---------- */
.seller-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 22px 72px;
}
.seller-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.seller-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.seller-help-panel {
  padding: 22px;
  max-width: 560px;
  margin-bottom: 28px;
}
.seller-help-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.seller-help-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.seller-help-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.seller-help-topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
  max-width: 900px;
}
.seller-help-topics h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.seller-help-topics p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .seller-help-topics { grid-template-columns: 1fr; }
}
.seller-hero p {
  margin: 10px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.seller-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.seller-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.seller-stat span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.seller-stat strong {
  font-size: 26px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.seller-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.seller-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.seller-panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.seller-panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.seller-empty {
  padding: 48px 24px;
  text-align: center;
}
.seller-empty strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.seller-empty span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

.seller-table { width: 100%; border-collapse: collapse; }
.seller-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.65);
}
.seller-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
.seller-table tr:last-child td { border-bottom: 0; }
.seller-table .t-title { font-weight: 700; letter-spacing: -0.01em; }
.seller-table .t-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-gray { background: rgba(16, 24, 32, 0.08); color: var(--ink); }
.badge-amber { background: rgba(224, 138, 30, 0.14); color: #9a5a0a; }
.badge-green { background: rgba(27, 158, 98, 0.14); color: #0f6b40; }
.badge-red { background: rgba(229, 72, 77, 0.14); color: #b42318; }
.badge-blue { background: var(--blue-tint); color: var(--blue-dark); }

/* ---------- auth pages ---------- */
.seller-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
}
.seller-auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--white);
}
.seller-auth-inner { width: 100%; max-width: 420px; }
.seller-auth-inner .seller-brand { margin-bottom: 28px; }
.seller-auth-inner h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.seller-auth-inner .lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.seller-auth-side {
  background:
    linear-gradient(160deg, rgba(16, 24, 32, 0.92), rgba(16, 24, 32, 0.78)),
    radial-gradient(800px 500px at 20% 10%, rgba(36, 107, 254, 0.45), transparent 60%),
    var(--ink);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.seller-auth-side h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.04em;
  font-weight: 800;
  line-height: 1.1;
  max-width: 16ch;
}
.seller-auth-side p {
  margin: 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.55;
}
.seller-auth-side ul {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.seller-auth-side li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
}
.seller-auth-side li::before {
  content: '';
  width: 8px; height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}

.sfield { display: grid; gap: 6px; margin-bottom: 14px; }
.sfield label { font-size: 13px; font-weight: 700; }
.sfield .hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.sinput, .sselect, .stextarea,
.seller-app .pallet-select-trigger {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.sinput, .sselect,
.seller-app .pallet-select-trigger {
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.stextarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
  font-size: 14px;
  font-weight: 500;
}
.sselect {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 5.8L8 10.4L12.5 5.8' stroke='%233D4754' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}
.sinput:hover, .sselect:hover,
.seller-app .pallet-select-trigger:hover {
  background: var(--white);
  border-color: rgba(16, 24, 32, 0.18);
}
.sinput:focus, .sselect:focus, .stextarea:focus,
.seller-app .pallet-select-trigger:focus,
.seller-app .pallet-select-trigger:focus-visible,
.seller-app .pallet-select-trigger[aria-expanded="true"] {
  background: var(--white);
  border-color: rgba(36, 107, 254, 0.55);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.12);
}

/* Custom PalletSelect — same chrome as .sselect / .sinput */
.seller-app .pallet-select { width: 100%; min-width: 0; }
.seller-app .pallet-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}
.seller-app .pallet-select-trigger::after {
  content: "";
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: 0.72;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 5.8L8 10.4L12.5 5.8' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 5.8L8 10.4L12.5 5.8' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.seller-app .pallet-select-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.srow-3 { grid-template-columns: 1fr 1fr 1fr; }
.seller-error {
  background: rgba(229, 72, 77, 0.1);
  color: #b42318;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.seller-notice {
  background: var(--blue-tint);
  color: var(--blue-dark);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.seller-auth-foot {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.seller-auth-foot a { color: var(--blue); font-weight: 700; }

/* ---------- submit wizard ---------- */
.seller-wizard {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.75fr);
  gap: 20px;
  align-items: start;
}
.seller-step { display: none; }
.seller-step.active { display: block; }
.seller-step h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.seller-step .lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.seller-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.seller-side {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  position: sticky;
  top: 84px;
}
.seller-side .side-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.seller-side-steps { display: grid; gap: 10px; }
.seller-side-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  opacity: 0.45;
}
.seller-side-step.on { opacity: 1; }
.seller-side-step .num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: var(--fog);
  border: 1px solid var(--line);
}
.seller-side-step.on .num {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.seller-side-step strong { display: block; font-size: 13px; font-weight: 700; }
.seller-side-step span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.seller-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 4px;
}
.seller-upload {
  border: 1.5px dashed rgba(16, 24, 32, 0.18);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  background: rgba(244, 246, 248, 0.65);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.seller-upload:hover, .seller-upload.drag {
  border-color: var(--blue);
  background: var(--blue-tint);
}
.seller-upload strong { display: block; font-size: 14px; margin-bottom: 4px; }
.seller-upload span { font-size: 12px; color: var(--muted); }
.seller-files { display: grid; gap: 8px; margin-top: 12px; }
.seller-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fog);
  font-size: 13px;
}
.seller-file button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.seller-file button:hover { color: var(--s5); }

.seller-review {
  background: var(--fog);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.seller-review div { display: flex; justify-content: space-between; gap: 12px; }
.seller-review span { color: var(--muted); }
.seller-review strong { text-align: right; font-weight: 700; }

.seller-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 80;
}
.seller-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- mobile bottom nav (app shell) ---------- */
.seller-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.seller-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  padding: 6px 4px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-align: center;
}
.seller-bottom-nav a span { line-height: 1.15; }
.seller-bottom-nav a.active {
  color: var(--blue);
  background: var(--blue-tint);
}
.seller-bottom-nav a.is-cta {
  color: #fff;
  background: var(--blue);
}
.seller-bottom-nav a.is-cta.active {
  background: var(--blue-dark);
  color: #fff;
}

@media (max-width: 900px) {
  .seller-auth {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    min-height: 100svh;
  }
  .seller-auth-side { display: none; }
  .seller-auth-form {
    flex: 1;
    width: 100%;
    align-items: flex-start;
    padding: 28px 20px calc(32px + env(safe-area-inset-bottom, 0));
  }
  .seller-auth-inner {
    max-width: 440px;
    margin: 0 auto;
  }
  .seller-auth-inner h1 { font-size: clamp(28px, 7vw, 34px); }
  .seller-wizard { grid-template-columns: 1fr; }
  .seller-upload-grid { grid-template-columns: 1fr; }
  .seller-side { position: static; }
  .seller-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seller-hero { flex-direction: column; align-items: stretch; }
  .seller-hero > .sbtn { width: 100%; }
  .seller-nav { display: none; }
  .seller-bottom-nav { display: grid; }
  .seller-user { display: none; }
  .seller-top-right .sbtn-primary { display: none; }
  .seller-brand em {
    height: 20px;
    min-height: 20px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 7px;
  }
  .seller-main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0));
  }
  .srow, .srow-3 { grid-template-columns: 1fr; }
  .sinput, .sselect, .stextarea,
  .seller-app .pallet-select-trigger {
    font-size: 16px;
    min-height: 48px;
    height: 48px;
  }
  .stextarea { min-height: 120px; height: auto; }
  .sbtn { min-height: 48px; }
  .sbtn-sm { min-height: 40px; }
  .seller-actions {
    flex-wrap: wrap;
  }
  .seller-actions .sbtn {
    flex: 1 1 auto;
    min-width: 120px;
  }
  .seller-toast {
    left: 16px;
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0));
    transform: translateY(12px);
    text-align: center;
  }
  .seller-toast.show {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .seller-top-inner { padding: 12px 14px; gap: 12px; }
  .seller-main { padding: 22px 14px calc(104px + env(safe-area-inset-bottom, 0)); }
  .seller-stats { grid-template-columns: 1fr; gap: 10px; }
  .seller-stat { padding: 14px 16px; }
  .seller-stat strong { font-size: 22px; }
  .seller-panel-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  .seller-empty { padding: 36px 18px; }
  .seller-empty .sbtn { width: 100%; }

  .seller-table thead { display: none; }
  .seller-table,
  .seller-table tbody,
  .seller-table tr,
  .seller-table td {
    display: block;
    width: 100%;
  }
  .seller-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  .seller-table tr:last-child { border-bottom: 0; }
  .seller-table td {
    padding: 3px 0;
    border: 0;
  }
  .seller-table td:first-child { margin-bottom: 6px; }
  .seller-table td:nth-child(2) { margin-bottom: 4px; }
  .seller-review div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .seller-review strong { text-align: left; }
  .seller-file {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .seller-upload-grid { grid-template-columns: 1fr; }
  .seller-upload { padding: 18px 14px; min-height: 112px; }
}
