:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #65717d;
  --line: #d9ded8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --danger: #b42318;
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

p {
  color: var(--muted);
  margin-top: 6px;
}

.status-pill {
  min-width: 124px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 12px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-strong);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 660px);
  gap: 16px;
  justify-content: center;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.details-panel {
  align-self: start;
  display: grid;
  gap: 13px;
}

.products-panel {
  min-width: 0;
}

.section-title,
.card-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--accent);
}

.products-stack {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfb;
}

.card-head {
  margin-bottom: 12px;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  background: #e8eeeb;
  color: #20312f;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #f4e7e5;
  color: var(--danger);
}

.actions {
  justify-content: flex-end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  padding-top: 4px;
}

.ok {
  color: var(--accent-strong);
}

.warn {
  color: var(--warn);
}

.error {
  color: var(--danger);
}

@media (max-width: 820px) {
  .topbar,
  .form-grid,
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    width: 100%;
  }
}
