:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #647084;
  --line: #d9dee7;
  --accent: #087f5b;
  --accent-dark: #056449;
  --warn: #8a4b00;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px clamp(16px, 4vw, 56px) 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header.compact {
  padding-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: 0;
}

main {
  padding: 22px clamp(16px, 4vw, 56px) 48px;
}

.operator-link,
button,
.file-button span,
.cta {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
}

button.primary,
.cta {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button:hover,
.operator-link:hover,
.file-button span:hover {
  border-color: var(--accent);
}

button.primary:hover,
.cta:hover {
  background: var(--accent-dark);
}

.toolbar,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.search-field,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: #b42318;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.product-card,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-card {
  overflow: hidden;
}

.product-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: #eef1f5;
}

.product-media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-placeholder {
  color: var(--muted);
  font-weight: 800;
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.badge {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.product-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(280px, 1fr);
  gap: 16px;
}

.editor-panel {
  padding: 16px;
}

.wide-panel {
  grid-column: 1 / -1;
}

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

.wide {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td input {
  min-width: 92px;
}

@media (max-width: 820px) {
  .site-header,
  .toolbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
