:root {
  color-scheme: dark;
  --bg: #10130f;
  --panel: #191f19;
  --panel-2: #20281f;
  --line: #303a30;
  --text: #f1ead8;
  --muted: #b6ad99;
  --green: #62c777;
  --green-2: #2f8f55;
  --amber: #dcae54;
  --red: #e36e5f;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

button,
input,
select {
  font: inherit;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #6c5430;
  background: #2a2116;
  color: var(--amber);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

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

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

nav a.active,
nav a:hover {
  color: var(--text);
  background: #222a21;
}

main {
  padding: 26px;
  min-width: 0;
}

.topbar,
.section-title,
.status-grid,
.ingredient-hero,
.progress-label,
.sheet-tools,
.item-cell,
.card-foot {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 7px;
  font-size: 28px;
}

.event-chip {
  min-width: 138px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: right;
}

.event-chip span,
.event-chip strong {
  display: block;
}

.event-chip span,
.status-grid span,
.item-cell span,
.sheet-status {
  color: var(--muted);
  font-size: 13px;
}

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

.status-grid article,
.panel,
.inventory-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 42px var(--shadow);
}

.status-grid article {
  padding: 16px;
}

.status-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.panel {
  padding: 18px;
  border-radius: 8px;
  min-width: 0;
  margin-bottom: 18px;
}

.section-title {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title select {
  flex: 0 1 420px;
  max-width: 100%;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #43503f;
  border-radius: 7px;
  background: #10150f;
  color: var(--text);
  padding: 0 11px;
}

.ingredient-hero {
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
}

.ingredient-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.item-sprite {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #806132;
  background: #15120c;
  overflow: hidden;
  flex: 0 0 auto;
}

.item-sprite.large {
  width: 76px;
  height: 76px;
}

.item-sprite img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
}

.item-sprite.large img {
  width: 48px;
  height: 48px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.delivered-control {
  max-width: 340px;
  margin-bottom: 18px;
}

.progress-wrap {
  margin-bottom: 4px;
}

.progress-label {
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.progress-label strong {
  color: var(--text);
}

.progress-track {
  height: 14px;
  background: #0f150f;
  border: 1px solid #384435;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  transition: width 180ms ease;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #071007;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.ghost-button {
  border: 1px solid #52614e;
  background: transparent;
  color: var(--text);
}

.sheet-tools {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sheet-tools button {
  min-height: 36px;
}

.sheet-status {
  min-height: 18px;
  margin-bottom: 12px;
}

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

.inventory-card {
  border-radius: 8px;
  box-shadow: none;
  display: grid;
  gap: 12px;
  padding: 14px;
  min-width: 0;
}

.item-cell {
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-cell strong,
.item-cell span {
  display: block;
}

.card-foot {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  min-width: 74px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-ready {
  background: rgba(98, 199, 119, 0.16);
  color: #8ee69e;
}

.status-low {
  background: rgba(220, 174, 84, 0.15);
  color: #f0c16b;
}

.status-critical {
  background: rgba(227, 110, 95, 0.14);
  color: #ff998d;
}

.guide-section {
  margin-top: 18px;
}

.guide-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-grid .panel {
  box-shadow: none;
  margin-bottom: 0;
}

.guide-grid h3 {
  font-size: 18px;
}

.guide-grid p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.site-footer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 22px;
  padding: 18px 0 4px;
  text-align: center;
}

@media (max-width: 1100px) {
  .inventory-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .topbar,
  .section-title,
  .ingredient-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .inventory-grid,
  .guide-grid,
  nav {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
