:root {
  background: #f7f8fb;
  color: #111827;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --line: #e5e7eb;
  --muted: #64748b;
  --ink: #111827;
  --orange: #ee4d2d;
  --orange-soft: #fff1ec;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #2563eb;
  --purple: #7c3aed;
  --purple-deep: #4c1d95;
  --purple-soft: #f3e8ff;
  --shadow: 0 10px 34px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
label[for] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.seller-console {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.seller-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  padding: 14px;
}

.seller-utility {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  line-height: 1.2;
}

.seller-utility-spacer {
  flex: 1;
}

.shopee-lockup {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 46px;
}

.shopee-logo {
  align-items: center;
  color: var(--orange);
  display: flex;
  gap: 8px;
  font-size: 22px;
}

.bag-mark {
  align-items: center;
  background: var(--orange);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.seller-search-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
}

.seller-search-shell span,
.panel-heading span,
.panel-heading-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.seller-search-shell strong {
  color: #334155;
  font-size: 12px;
  line-height: 1.25;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.mode-nav {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 13px;
  text-align: left;
  width: 100%;
}

.mode-nav strong {
  font-size: 15px;
}

.mode-nav span {
  color: var(--muted);
  font-size: 12px;
}

.mode-nav.active,
.mode-nav:hover {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange);
}

.mode-nav.active span,
.mode-nav:hover span {
  color: #9a431a;
}

.seller-main {
  min-width: 0;
}

.global-bar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 24px;
}

.brand-area,
.store-area,
.openai-pill,
.page-head,
.panel-heading,
.panel-heading-actions,
.approval-actions {
  align-items: center;
  display: flex;
}

.brand-area {
  gap: 10px;
}

.adapt-mark {
  background: var(--orange);
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.openai-pill {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
}

.openai-pill strong {
  font-size: 12px;
}

.openai-logo {
  border: 2px solid #111827;
  border-radius: 50%;
  height: 16px;
  position: relative;
  width: 16px;
}

.openai-logo::before,
.openai-logo::after {
  background: #111827;
  content: "";
  height: 2px;
  left: 3px;
  position: absolute;
  top: 6px;
  width: 8px;
}

.openai-logo::after {
  transform: rotate(90deg);
}

.dashboard-content {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.page-head {
  justify-content: space-between;
}

.page-head h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 8px;
}

.page-head p {
  color: var(--muted);
  margin: 0;
  max-width: 760px;
}

.analysis-view {
  display: grid;
  gap: 18px;
}

.pre-workspace {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 16px;
  margin: 0;
}

.panel-heading-actions,
.approval-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.pre-input-panel {
  position: sticky;
  top: 18px;
}

.pre-form {
  display: grid;
  gap: 12px;
}

.pre-form label {
  color: #334155;
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 6px;
}

.pre-form input,
.pre-form select,
.pre-form textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  outline: none;
  padding: 9px 10px;
  width: 100%;
}

.pre-form textarea {
  line-height: 1.4;
  resize: vertical;
}

.pre-form input:focus,
.pre-form select:focus,
.pre-form textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.14);
}

.pre-form label.ai-filled-field {
  background: var(--purple-soft);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 8px;
  color: var(--purple-deep);
  padding: 8px;
  position: relative;
}

.pre-form label.ai-filled-field::after {
  background: var(--purple);
  border-radius: 999px;
  color: #ffffff;
  content: "OpenAI";
  font-size: 10px;
  font-weight: 850;
  padding: 3px 7px;
  position: absolute;
  right: 8px;
  top: 6px;
}

.pre-form label.ai-filled-field input,
.pre-form label.ai-filled-field select,
.pre-form label.ai-filled-field textarea {
  background: #ffffff;
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.form-pair {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.edit-hint,
.panel-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
}

.primary-cta,
.panel-action-button,
.cancel-product-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  min-height: 38px;
  padding: 0 14px;
}

.primary-cta {
  background: var(--orange);
  color: #ffffff;
}

.primary-cta.purple {
  background: var(--purple);
}

.panel-action-button {
  background: var(--orange-soft);
  color: var(--orange);
}

.panel-action-button.secondary,
.cancel-product-button {
  background: #f1f5f9;
  color: #334155;
}

.empty-state-panel {
  min-height: 520px;
}

.ai-draft-panel {
  align-self: start;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  border: 0;
  color: #ffffff;
  min-height: 260px;
}

.ai-draft-panel .panel-heading {
  margin-bottom: 12px;
}

.ai-draft-panel .panel-heading span {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #ffffff;
  padding: 6px 10px;
}

.ai-draft-panel p {
  color: #f5f3ff;
  line-height: 1.55;
  margin: 0 0 18px;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.manual-entry-button {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  min-height: 38px;
  padding: 0 14px;
}

.ai-draft-panel .cancel-product-button {
  background: #ffffff;
  color: var(--purple-deep);
}

.empty-state {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #334155;
  display: grid;
  gap: 12px;
  height: 100%;
  justify-items: center;
  min-height: 480px;
  padding: 28px;
  text-align: center;
}

.empty-state:hover {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.upload-input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.empty-icon {
  align-items: center;
  background: var(--orange-soft);
  border-radius: 999px;
  color: var(--orange);
  display: flex;
  font-size: 34px;
  font-weight: 700;
  height: 74px;
  justify-content: center;
  width: 74px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
  line-height: 1.5;
  max-width: 480px;
}

.image-upload-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: min(100%, 270px);
  padding: 14px;
}

.image-upload-card strong {
  color: var(--orange);
}

.image-upload-card span {
  color: var(--muted);
  font-size: 13px;
}

.pre-results {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pre-results .panel,
.pre-metrics-panel,
.competitor-match-panel,
.listing-readiness-panel,
.pre-actions-panel,
.listing-publish-panel {
  box-shadow: none;
}

.pre-decision-panel,
.comparison-panel,
.pre-metrics-panel,
.competitor-match-panel,
.listing-publish-panel {
  grid-column: 1 / -1;
}

.decision-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px;
}

.decision-card span,
.insight-box span,
.pre-metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.decision-card strong {
  display: block;
  font-size: 34px;
  margin-top: 5px;
}

.decision-card p,
.insight-box p,
.pre-metric p {
  color: var(--muted);
  line-height: 1.4;
  margin: 8px 0 0;
}

.score-ring {
  align-items: center;
  background: conic-gradient(var(--orange) 0deg, var(--orange) 0deg, #eef0f4 0deg);
  border-radius: 50%;
  color: var(--ink);
  display: flex;
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 900;
  height: 104px;
  justify-content: center;
  width: 104px;
}

.comparison-cards,
.pre-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.insight-box,
.pre-metric {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 14px;
}

.insight-box strong,
.pre-metric strong {
  display: block;
  font-size: 22px;
  margin-top: 8px;
}

.charts-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 1.3fr) minmax(260px, 0.7fr);
}

.chart-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 280px;
  padding: 12px;
}

canvas {
  display: block;
  height: auto;
  width: 100%;
}

.competitor-match-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.competitor-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.7fr) 0.7fr 0.7fr 0.7fr 0.8fr 0.6fr;
  padding: 12px;
}

.competitor-row:first-child {
  border-top: 0;
}

.competitor-row.head {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.competitor-row strong {
  color: var(--orange);
}

.competitor-row em {
  color: #334155;
  font-style: normal;
  font-weight: 850;
}

.readiness-list,
.risk-list,
.check-list,
.action-plan {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.readiness-list li,
.risk-list li,
.check-list li,
.action-plan li {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  padding: 10px 12px;
}

.readiness-list li {
  display: grid;
  gap: 4px;
}

.readiness-list li strong {
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
}

.readiness-list li.missing strong {
  color: var(--red);
}

.readiness-list li p {
  color: var(--muted);
  margin: 0;
}

.action-plan {
  counter-reset: actions;
}

.action-plan li {
  counter-increment: actions;
  line-height: 1.45;
}

.action-plan li::before {
  align-items: center;
  background: var(--orange-soft);
  border-radius: 50%;
  color: var(--orange);
  content: counter(actions);
  display: inline-flex;
  font-weight: 850;
  height: 24px;
  justify-content: center;
  margin-right: 10px;
  width: 24px;
}

.risk-list li {
  border-color: rgba(239, 68, 68, 0.22);
}

.region-panel {
  display: grid;
  gap: 14px;
}

.region-mini-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.region-tile {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
}

.region-tile.best {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.45);
}

.region-tile strong {
  font-size: 13px;
}

.region-tile span {
  color: var(--muted);
  font-size: 12px;
}

.region-score-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.region-score-bar i {
  background: var(--green);
  display: block;
  height: 100%;
}

.region-details {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.region-details h3 {
  margin: 0 0 8px;
}

.region-details p {
  color: var(--muted);
  margin: 0 0 12px;
}

@media (max-width: 1180px) {
  .seller-console,
  .pre-workspace {
    grid-template-columns: 1fr;
  }

  .seller-sidebar,
  .pre-input-panel {
    min-height: 0;
    position: static;
  }

  .comparison-cards,
  .pre-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-content,
  .global-bar,
  .seller-sidebar {
    padding: 16px;
  }

  .global-bar,
  .page-head,
  .decision-card {
    align-items: flex-start;
    display: grid;
  }

  .pre-results,
  .comparison-cards,
  .pre-metrics,
  .charts-grid,
  .region-mini-grid,
  .form-pair,
  .competitor-row {
    grid-template-columns: 1fr;
  }

  .empty-state-panel {
    min-height: 360px;
  }

  .empty-state {
    min-height: 330px;
  }
}
