:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #65706c;
  --line: #d9dfdc;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --leaf: #2f6b4f;
  --leaf-dark: #214936;
  --tomato: #c7493a;
  --rice: #f3efe2;
  --gold: #d99732;
  font-family: "Segoe UI", "Noto Sans TC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(47, 107, 79, 0.12), transparent 35%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 3;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 19px;
}

.eyebrow,
.category {
  color: var(--tomato);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-link,
.secondary-button {
  color: var(--leaf-dark);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  padding: 32px clamp(18px, 5vw, 56px) 56px;
  align-items: start;
}

.menu-section,
.records-page {
  min-width: 0;
}

.records-page {
  padding: 32px clamp(18px, 5vw, 56px) 56px;
}

.login-panel {
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(32, 33, 36, 0.06);
  padding: 24px;
}

.login-panel h2 {
  margin-bottom: 18px;
}

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

.record-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hint {
  color: var(--muted);
  line-height: 1.6;
}

.day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.day-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--leaf-dark);
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.day-tabs button.active {
  background: var(--leaf);
  color: #fff;
  border-color: var(--leaf);
}

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

.menu-card,
.checkout,
.order-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(32, 33, 36, 0.06);
}

.menu-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
  padding: 20px;
}

.menu-card p {
  color: var(--muted);
  line-height: 1.55;
}

.menu-card .category {
  color: var(--gold);
  margin-bottom: 10px;
}

.menu-card h3 {
  margin-bottom: 8px;
}

.menu-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.stepper {
  display: grid;
  grid-template-columns: 40px 42px 40px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.stepper button {
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--rice);
  color: var(--leaf-dark);
  font-size: 20px;
  cursor: pointer;
}

.stepper span {
  text-align: center;
  font-weight: 700;
}

.checkout {
  position: sticky;
  top: 116px;
  padding: 22px;
}

.cart-items {
  display: grid;
  gap: 10px;
  min-height: 74px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.cart-items.empty,
.empty-state {
  color: var(--muted);
  align-content: center;
}

.cart-row,
.total-row,
.order-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.total-row {
  padding: 18px 0;
  font-size: 20px;
}

.order-form {
  display: grid;
  gap: 14px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.submit-button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  background: var(--leaf);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.submit-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-message {
  min-height: 24px;
  color: var(--leaf-dark);
  line-height: 1.5;
}

.orders-list {
  display: grid;
  gap: 14px;
}

.order-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-items span {
  background: var(--rice);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--leaf-dark);
  font-weight: 700;
}

.note {
  color: var(--muted);
}

small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

  .checkout {
    position: static;
  }
}

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

  .topbar {
    gap: 14px;
  }

  .admin-link,
  .secondary-button {
    width: 100%;
    text-align: center;
  }
}
