/* Seller Console — indigo-dye palette with a running-stitch setup thread */
:root {
  --ink: #1E2B4F;
  --ink-hover: #2A3A66;
  --side-text: #C8D1E5;
  --paper: #F3F5F8;
  --surface: #FFFFFF;
  --line: #DCE1E9;
  --text: #182031;
  --muted: #555F73;
  --focus: #2F5BD3;
  --turmeric: #F2C14E;
  --ok-bg: #E2F1E7;  --ok-text: #245A3A;
  --wait-bg: #FBF0D4; --wait-text: #6E5005;
  --off-bg: #ECEFF4;  --off-text: #475166;
  --bad-bg: #FBE6E3;  --bad-text: #8E2A22;
  --danger: #A3342B;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 2px rgba(24, 32, 49, .06);
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--ink); }
code { font-size: .875em; background: var(--off-bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 248px, transparent 248px); }
.side {
  background: var(--ink);
  color: var(--side-text);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand, .auth-brand { display: flex; align-items: center; gap: 12px; }
.brand { padding: 0 8px 28px; }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  background: url("/favicon.svg") center / contain no-repeat;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: #fff; font-weight: 600; font-size: .95rem; }
.brand-text span { font-size: .8125rem; }
.auth-brand .brand-text strong { color: var(--text); }
.auth-brand .brand-text span { color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--side-text); text-decoration: none; font-weight: 500; font-size: .9375rem;
}
.nav-link:hover { background: var(--ink-hover); color: #fff; }
.nav-link.is-active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--turmeric); }
.ico { width: 20px; height: 20px; flex: none; }

.side-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .875rem; display: flex; flex-direction: column; gap: 6px; }
.side-foot form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.main { padding: 40px 48px 64px; max-width: 1040px; width: 100%; }
.page-head { margin-bottom: 28px; }
.lede { color: var(--muted); margin-top: 6px; max-width: 64ch; }
.section { margin: 32px 0; }
.section > h2 { margin-bottom: 14px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.panel > h2 { margin-bottom: 18px; }

/* ---------- setup thread ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 16px; position: relative; padding-bottom: 24px; }
.step:last-child { padding-bottom: 0; }
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px;
  border-left: 2px dashed var(--line);
}
.step-connected:not(:last-child)::before { border-left-color: #8FC2A2; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: .9375rem;
  background: var(--off-bg); color: var(--off-text); border: 2px solid var(--line);
}
.step-connected .step-num { background: var(--ok-text); color: #fff; border-color: var(--ok-text); }
.step-waiting .step-num, .step-pending .step-num { background: var(--wait-bg); color: var(--wait-text); border-color: #E8CE84; }
.step-body p { color: var(--muted); margin: 4px 0 10px; max-width: 62ch; }
.step-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: .8125rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok-text); }
.pill-wait { background: var(--wait-bg); color: var(--wait-text); }
.pill-off { background: var(--off-bg); color: var(--off-text); }

/* ---------- workspaces ---------- */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.module {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 20px; text-decoration: none; color: var(--text);
}
.module:hover { border-color: #AEB8CC; }
.module p { color: var(--muted); flex: 1; }
.module-state { font-size: .8125rem; color: var(--off-text); margin-top: 8px; }
.module-state.is-ready { color: var(--ok-text); font-weight: 500; }

/* ---------- activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.activity li:first-child { border-top: 0; padding-top: 0; }
.act-area { color: var(--muted); text-transform: capitalize; }
.activity time { color: var(--muted); font-size: .875rem; white-space: nowrap; }

/* ---------- module pages ---------- */
.empty {
  background: var(--surface); border: 1px dashed #B9C2D3; border-radius: var(--radius-m);
  padding: 32px; margin-bottom: 24px;
}
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 16px; max-width: 60ch; }
.empty p:last-child { margin-bottom: 0; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
.plan p { color: var(--muted); margin-top: 4px; }

/* ---------- connections ---------- */
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.conn > .muted { margin-bottom: 18px; }
.conn > p:not(.muted):not(.hint) { margin-bottom: 12px; max-width: 64ch; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.facts dt { font-size: .8125rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.note { color: var(--muted); font-size: .875rem; }
.warn { background: var(--wait-bg); color: var(--wait-text); padding: 12px 14px; border-radius: var(--radius-s); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-wide { max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
label, legend { font-weight: 500; font-size: .9375rem; }
input[type="text"], input[type="password"] {
  font: inherit; color: var(--text);
  padding: 10px 12px; border: 1px solid #848FA4; border-radius: var(--radius-s); background: #fff;
}
input:hover { border-color: #5F6A80; }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.hint { font-size: .8125rem; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { margin-bottom: 8px; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); font-weight: 400; cursor: pointer; }
.radio-row:has(input:checked) { border-color: var(--ink); background: #F1F4FA; }
.radio-row input { margin-top: 4px; accent-color: var(--ink); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions form { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 500; font-size: .9375rem;
  padding: 9px 16px; border-radius: var(--radius-s);
  border: 1px solid #B4BDCD; background: #fff; color: var(--text);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #F1F4F8; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); }
.btn-danger { color: var(--danger); border-color: #E2B3AE; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-small { padding: 6px 12px; font-size: .875rem; }
.btn-block { width: 100%; padding: 11px 16px; }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 24px; font-size: .9375rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--bad-bg); color: var(--bad-text); }
.flash-info { background: var(--off-bg); color: var(--off-text); }

/* ---------- auth ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 32px; box-shadow: var(--shadow);
}
.auth-brand { margin-bottom: 28px; }
.auth h1 { font-size: 1.5rem; }
.auth > .muted { margin: 6px 0 24px; }
.auth .btn { margin-top: 4px; }
.form > .btn:not(.btn-block) { align-self: flex-start; }
.url { display: block; margin-top: 6px; width: fit-content; max-width: 100%; }

/* ---------- marketplace switch ---------- */
body[data-market="amazon"] { --accent: #F2C14E; }
body[data-market="flipkart"] { --accent: #7DC4F5; }
.nav-link.is-active { box-shadow: inset 3px 0 0 var(--accent, var(--turmeric)); }
.switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(0, 0, 0, .22); border-radius: 8px; padding: 4px; margin: 0 0 20px;
}
.switch-opt {
  text-align: center; padding: 7px 8px; border-radius: 6px;
  color: var(--side-text); text-decoration: none; font-weight: 500; font-size: .875rem;
}
.switch-opt:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.switch-opt.is-on { background: #fff; color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent, var(--turmeric)); }

/* ---------- chooser ---------- */
.choose { width: 100%; max-width: 760px; }
.choose h1 { font-size: 1.75rem; margin-top: 28px; }
.choose > .muted { margin: 8px 0 28px; max-width: 60ch; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pick {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 24px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  border-top: 4px solid var(--pick-accent);
}
.pick:hover { border-color: #AEB8CC; border-top-color: var(--pick-accent); }
.pick-amazon { --pick-accent: #F2C14E; }
.pick-flipkart { --pick-accent: #7DC4F5; }
.pick-name { font-size: 1.25rem; font-weight: 600; }
.pick-text { color: var(--muted); flex: 1; }
.pick-go { font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-top: 8px; }
.choose-foot { margin-top: 24px; display: flex; gap: 8px; align-items: center; font-size: .875rem; }
.link-btn.dark { color: var(--ink); }

/* ---------- Flipkart table page ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-row form { margin: 0; }
.btn[disabled] { opacity: .6; cursor: progress; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 20px; display: flex; flex-direction: column; }
.stat-n { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.stat-l { color: var(--muted); font-size: .875rem; }
.neg { color: var(--bad-text); }
.warnc { color: var(--wait-text); }
.table-panel { padding: 20px 0 8px; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 24px; margin-bottom: 12px; }
.table-tools h2 { margin: 0; }
.search { display: flex; gap: 8px; margin: 0; }
input[type="search"] { font: inherit; color: var(--text); padding: 6px 10px; border: 1px solid #848FA4; border-radius: var(--radius-s); background: #fff; min-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 24px 14px; }
.chip { font-size: .875rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; background: #fff; }
.chip:hover { border-color: #AEB8CC; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 10px 24px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 24px; }
th { font-weight: 500; color: var(--muted); font-size: .8125rem; border-top: 0; white-space: nowrap; }
td.num, th.num { text-align: right; }
td.sku { font-weight: 500; word-break: break-word; min-width: 160px; }
.sub { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.empty-row { text-align: center; color: var(--muted); padding: 32px 24px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 24px 8px; color: var(--muted); font-size: .875rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: static; height: auto; padding: 16px; }
  .brand { padding: 0 4px 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .nav-link { white-space: nowrap; padding: 8px 10px; }
  .nav-link.is-active { box-shadow: inset 0 -3px 0 var(--accent, var(--turmeric)); }
  .side-foot { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px 4px 0; }
  .main { padding: 24px 16px 48px; }
  .modules, .plan, .facts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picks { grid-template-columns: 1fr; }
  .switch { margin-bottom: 12px; }
  .table-tools, .chips { padding-left: 16px; padding-right: 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  input[type="search"] { min-width: 0; flex: 1; }
  .search { width: 100%; }
  .activity li { grid-template-columns: 1fr; gap: 2px; }
  .panel { padding: 20px 16px; }
  .empty { padding: 24px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
