:root {
  color-scheme: light;
  --ink: #211f1f;
  --muted: #6c6360;
  --paper: #fffaf4;
  --panel: #ffffff;
  --line: #e7ded4;
  --accent: #9b2545;
  --accent-dark: #6f1930;
  --mint: #2f7d6d;
  --gold: #b77b2b;
  --shadow: 0 18px 50px rgba(59, 41, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  align-items: stretch;
  overflow: hidden;
  background: #2d2320;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(45, 35, 32, 0.92) 0%, rgba(45, 35, 32, 0.74) 38%, rgba(45, 35, 32, 0.12) 72%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(28px, 5vw, 58px);
  color: #fffaf6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: #f1c887;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  line-height: 0.94;
}

h2 {
  font-size: 1.05rem;
}

.hero-totals {
  display: grid;
  gap: 4px;
}

.hero-totals span {
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 800;
}

.hero-totals small {
  color: #f0d9c4;
}

.hero-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(330px, 0.85fr) minmax(420px, 1.15fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.hidden {
  display: none !important;
}

.customer-view {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.customer-panel {
  box-shadow: var(--shadow);
}

.step-label {
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.choice-button {
  min-height: 76px;
  border-radius: 8px;
  border-color: #d9cec3;
  font-size: 1.05rem;
  font-weight: 800;
}

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

.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.customer-grid label {
  margin-bottom: 0;
}

.pastry-order-rows {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.pastry-order-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
}

.pastry-order-row label {
  margin-bottom: 0;
}

.small-add,
.remove-pastry {
  min-height: 34px;
  margin-top: 10px;
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.remove-pastry {
  color: var(--accent-dark);
}

.add-pastry-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.35fr);
  gap: 12px;
  margin-top: 14px;
}

.add-pastry-form label {
  margin-bottom: 0;
}

.customer-summary {
  display: grid;
  gap: 16px;
}

.customer-summary .step-label {
  color: var(--mint);
}

.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.inline-price strong {
  font-size: clamp(2rem, 5vw, 4rem);
  white-space: nowrap;
}

.inline-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #2f7d6d;
  color: #fff;
  font-weight: 800;
}

.inline-price span {
  color: #d9fff3;
}

.primary-action {
  min-height: 46px;
  margin-top: 14px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

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

.contact-form label {
  margin-bottom: 0;
}

.contact-form .primary-action,
.form-status {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--mint);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-access {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 20;
  min-height: 28px;
  padding: 0 8px;
  opacity: 0.28;
  font-size: 0.72rem;
}

.admin-access:hover {
  opacity: 1;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d5c8bb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

select:focus,
input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(155, 37, 69, 0.14);
}

.price-lines {
  display: grid;
  gap: 10px;
}

.price-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eee5dc;
}

.price-line small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.price-line strong {
  color: var(--accent-dark);
}

.total-row,
.pastry-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #f6efe8;
  color: var(--accent-dark);
  font-weight: 800;
}

.total-row strong,
.pastry-total strong {
  font-size: 1.35rem;
}

#source-badge {
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
}

.recipe-meta {
  color: var(--muted);
  margin-bottom: 12px;
  min-height: 22px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee5dc;
  text-align: left;
}

th {
  background: #f6efe8;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td:nth-child(2),
td:nth-child(3),
th:nth-child(2),
th:nth-child(3) {
  text-align: right;
}

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

.admin-top-panel {
  grid-column: 1 / -1;
}

.pastry-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.pastry-grid label {
  margin-bottom: 0;
}

.empty-state {
  color: var(--muted);
  padding: 14px 0;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-panel,
  .pastries-panel {
    grid-column: 1 / -1;
  }

  .pastry-grid,
  .customer-grid,
  .pastry-order-row {
    grid-template-columns: 1fr 1fr;
  }

  .add-pastry-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    min-height: 260px;
  }

  .hero-image {
    position: absolute;
    inset: 0;
    min-height: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .customer-view {
    padding: 12px;
  }

  .panel {
    padding: 14px;
  }

  .pastry-grid,
  .customer-grid,
  .pastry-order-row,
  .add-pastry-form,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .customer-summary,
  .contact-head {
    align-items: flex-start;
  }

  .contact-head,
  .inline-price {
    flex-direction: column;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }
}
