:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #1e2528;
  --muted: #667277;
  --line: #dce2df;
  --accent: #176a5e;
  --accent-dark: #0f4f46;
  --amber: #bd6b17;
  --red: #b33a32;
  --blue: #2d5b9a;
  --shadow: 0 16px 38px rgba(30, 37, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

a {
  color: var(--accent-dark);
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.panel-heading,
.results-toolbar,
.vendoo-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
}

h2 {
  font-size: 1.25rem;
}

.vendoo-link,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.vendoo-link,
.secondary-button {
  background: #e7ece9;
  color: var(--ink);
  padding: 10px 14px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.import-panel,
.results-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.import-panel {
  padding: 18px;
}

.status-pill {
  border-radius: 999px;
  background: #edf0ed;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

.status-pill.ready {
  background: #ddf0e8;
  color: var(--accent-dark);
}

.status-pill.error {
  background: #f7dedb;
  color: var(--red);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 156px;
  margin: 18px 0 14px;
  border: 2px dashed #b8c4bf;
  border-radius: 8px;
  background: #fbfcfa;
  cursor: pointer;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #eef8f3;
}

.drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop-title {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.drop-meta,
.paste-label,
.vendoo-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.paste-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  color: var(--ink);
}

.api-import {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.api-import label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.api-import input {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.api-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.full-button {
  width: 100%;
}

.inline-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.inline-message.error {
  color: var(--red);
  font-weight: 800;
}

.secondary-button {
  margin-top: 10px;
}

.vendoo-note {
  min-height: 118px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mapping-grid label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.summary-strip > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.summary-strip span {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.summary-strip p {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.summary-strip .highlight {
  border-color: rgba(189, 107, 23, 0.35);
  background: #fff6ea;
  color: var(--amber);
}

.results-area {
  overflow: hidden;
}

.results-toolbar {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, auto));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented-control button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(280px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: 0;
}

.table-wrap {
  overflow: auto;
  max-height: 58vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9faf8;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

td:first-child {
  font-weight: 900;
}

.empty-row td {
  color: var(--muted);
  padding: 32px 14px;
  text-align: center;
}

.stock-zero {
  color: var(--red);
  font-weight: 900;
}

.price-cell {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 20px, 680px);
    padding-top: 18px;
  }

  .topbar,
  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .import-grid,
  .summary-strip,
  .mapping-grid,
  .api-row {
    grid-template-columns: 1fr;
  }

  .vendoo-link,
  .primary-button,
  .secondary-button {
    text-align: center;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .segmented-control button {
    padding-inline: 6px;
  }
}
