:root {
  color-scheme: light;
  --ink: #162019;
  --muted: #5d6b61;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #d8ded5;
  --accent: #23645a;
  --accent-strong: #163f39;
  --ready: #1d6d3b;
  --wait: #945e19;
  --endorsed: #325ea8;
  --danger: #9d2f2f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

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

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.full-button {
  width: 100%;
}

.danger-button {
  background: transparent;
  color: var(--danger);
  border: 1px solid #e6c8c8;
}

.danger-button:hover {
  background: #fff2f2;
}

.login-page {
  background:
    linear-gradient(120deg, rgba(35, 100, 90, 0.14), transparent 45%),
    var(--paper);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px;
  box-shadow: 0 24px 80px rgba(22, 32, 25, 0.08);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 0.96;
  margin-bottom: 16px;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.login-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 16px 0 0;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.form-error {
  background: #fff2f2;
  border: 1px solid #e6c8c8;
  border-radius: 8px;
  color: var(--danger);
  font-weight: 800;
  padding: 12px;
}

.form-success {
  background: #eff8f0;
  border: 1px solid #c9e5cf;
  border-radius: 8px;
  color: var(--ready);
  font-weight: 800;
  padding: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 64px;
  display: grid;
  gap: 24px;
}

.entry-panel,
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.item-form {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 18px;
}

legend {
  color: var(--ink);
  font-weight: 900;
  padding: 0 6px;
}

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

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 520px;
  color: var(--muted);
  margin: 0;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.item-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--wait);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.item-card.ready {
  border-top-color: var(--ready);
}

.item-card.endorsed {
  border-top-color: var(--endorsed);
}

.item-card.purchased {
  opacity: 0.68;
}

.item-card-header,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.item-card h3 {
  font-size: 1.28rem;
  line-height: 1.2;
  margin: 0;
}

.price {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0;
}

.notes {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

dl {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin: 0;
  padding-top: 12px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

@media (max-width: 720px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .user-menu {
    justify-content: space-between;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .login-panel {
    padding: 28px;
  }
}
