:root {
  --oat: #efe7d8;
  --crust: #3c2a1e;
  --crust-soft: #5c4432;
  --crumb: #fbf7ef;
  --gold: #c98a3b;
  --gold-deep: #a86b24;
  --slate: #4c6b7a;
  --slate-deep: #345260;
  --wheat: #8a6d3b;
  --line: #ddd0b8;
  --ink: #2b211b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--oat);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

.masthead {
  background: var(--crust);
  color: var(--crumb);
  padding: 2rem 1.5rem 1.75rem;
}

.masthead-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.masthead h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.today {
  font-size: 0.95rem;
  color: #d9c9b3;
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0;
  color: var(--crust);
}

.stock-section { margin-bottom: 3rem; }

.stock-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stock-tile {
  background: var(--crumb);
  padding: 1.25rem 1.25rem 1.1rem;
  border-left: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stock-tile.dough_ball { border-left-color: var(--slate); }

.stock-tile-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--crust-soft);
}

.stock-tile-total {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.stock-breakdown {
  display: flex;
  gap: 1.1rem;
  font-size: 0.85rem;
  color: var(--crust-soft);
}

.stock-breakdown span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.fresh { background: var(--gold); }
.dot.frozen { background: var(--slate); }
.dot.white { background: var(--gold); }
.dot.whole-wheat { background: var(--wheat); }

.btn-primary, .btn-quiet {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 3px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--crumb);
}
.btn-primary:hover { background: var(--gold-deep); }

.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--crust-soft);
}
.btn-quiet:hover { border-color: var(--crust-soft); }

.batch-form-wrap {
  margin-bottom: 1.25rem;
  background: var(--crumb);
  border: 1px solid var(--line);
  padding: 1.25rem;
}
.batch-form-wrap.hidden { display: none; }

.batch-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.batch-date-label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.35rem;
  color: var(--crust-soft);
  max-width: 220px;
}

.batch-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.batch-row-product { flex: 1; min-width: 0; }
.batch-row-count { width: 4.5rem; text-align: center; }

.batch-row-label {
  font-size: 0.9rem;
  color: var(--crust-soft);
  white-space: nowrap;
}

.batch-row-remove {
  background: transparent;
  border: none;
  color: var(--crust-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.batch-row-remove:hover { color: var(--gold-deep); }

#batch-add-row { align-self: flex-start; }

.batch-form select, .batch-form input, .task-form input {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--crumb);
  color: var(--ink);
}

.form-actions { display: flex; gap: 0.6rem; }

.task-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.task-form input[type="text"] { flex: 1; }

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.task-item.done { color: #a3937c; text-decoration: line-through; }

.task-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--crust-soft);
}

.empty-note {
  color: var(--crust-soft);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.doughball-section { margin-bottom: 3rem; }

.history-section { margin-bottom: 3rem; }

.history-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.history-day {
  background: var(--crumb);
  padding: 0.7rem 0.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.history-day.is-today { background: #fdf9f0; }

.history-day-label {
  font-size: 0.7rem;
  color: var(--crust-soft);
}

.history-day-count {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--ink);
}

.history-day-count.zero { color: var(--crust-soft); font-weight: 400; }

.ship-date-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--crust-soft);
}

.ship-date-label input {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--crumb);
  color: var(--ink);
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.location-card {
  background: var(--crumb);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.location-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--crust);
}

.location-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.location-input-row label {
  font-size: 0.85rem;
  color: var(--crust-soft);
  flex: 1;
}

.loc-input {
  width: 4.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: center;
}

.loc-boxes {
  font-size: 0.78rem;
  color: var(--crust-soft);
  width: 4.5rem;
  text-align: right;
}

.location-total {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  border-top: 1px dashed var(--line);
  padding-top: 0.6rem;
}

.dough-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.dough-summary-col {
  background: var(--crumb);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dough-summary-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--crust);
  margin-bottom: 0.2rem;
}

.dough-summary .breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--crust-soft);
}

.dough-summary .breakdown-item span:last-child {
  font-weight: 600;
  color: var(--ink);
}

.weekly-order-status {
  font-size: 0.85rem;
  color: var(--crust-soft);
  align-self: center;
}
