:root {
  --blue: #006b85;
  --blue-dark: #004d63;
  --turquoise: #00a4a6;
  --orange: #f45520;
  --ink: #19333d;
  --muted: #61737a;
  --line: #d8e3e6;
  --surface: #f1f6f7;
  --white: #fff;
  --success: #13795b;
  --danger: #b42318;
  --shadow: 0 14px 40px rgb(25 51 61 / 9%);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { position: relative; margin: 0; min-width: 320px; min-height: 100vh; background:
  radial-gradient(circle at 7% 8%, rgb(0 164 166 / 16%), transparent 25rem),
  radial-gradient(circle at 96% 34%, rgb(244 85 32 / 11%), transparent 22rem),
  linear-gradient(145deg, #f6fafb 0%, #edf5f6 52%, #f7fafb 100%);
  color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
body::before { content: ""; position: fixed; z-index: 0; pointer-events: none; width: 460px; height: 460px; right: -260px; bottom: -260px; border: 54px solid rgb(0 107 133 / 8%); border-radius: 50%; }
body::after { content: ""; position: fixed; z-index: 0; inset: 0; pointer-events: none; opacity: .5; background-image: repeating-linear-gradient(118deg, transparent 0 84px, rgb(0 107 133 / 3.5%) 85px, transparent 86px 170px); mask-image: linear-gradient(to bottom, transparent, black 38%, black 75%, transparent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { position: relative; z-index: 1; width: min(100% - 28px, 980px); margin: 0 auto; padding: 18px 0 110px; }
.brand-bar { display: flex; align-items: center; gap: 13px; padding: 8px 2px 22px; }
.brand-bar h1 { margin: 1px 0 0; font-size: clamp(1.35rem, 5vw, 1.8rem); line-height: 1.05; }
.brand-logo { width: 146px; height: auto; flex: 0 0 auto; mix-blend-mode: multiply; }
.brand-bar .button { margin-left: auto; }

.panel { background: rgb(255 255 255 / 91%); border: 1px solid rgb(255 255 255 / 88%); border-radius: 22px; box-shadow: var(--shadow); padding: clamp(18px, 4vw, 28px); margin-bottom: 16px; backdrop-filter: blur(10px); }
.centered { min-height: 220px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.login-panel { max-width: 480px; margin: 6vh auto 0; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 8px; font-size: clamp(1.55rem, 5vw, 2.15rem); }
h3 { margin-bottom: 14px; font-size: 1.2rem; }
.eyebrow { margin-bottom: 5px; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.intro, .deadline, .empty-state p, #save-hint { color: var(--muted); }
.stack { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; font-size: .86rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #b7cbd0; border-radius: 12px; background: #fff; color: var(--ink); padding: 12px 13px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--turquoise); box-shadow: 0 0 0 3px rgb(0 164 166 / 14%); }
textarea { resize: vertical; line-height: 1.48; }

.button { border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; transition: transform .15s, opacity .15s; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: #dff3f3; color: var(--blue-dark); }
.button-quiet { background: transparent; color: var(--blue); padding-inline: 10px; }
.form-error { min-height: 1.2em; margin: -5px 0; color: var(--danger); font-size: .86rem; }
.warning { padding: 12px; border-radius: 12px; background: #fff3dc; color: #764b00; }
.toast { position: fixed; z-index: 20; left: 50%; top: 18px; width: min(calc(100% - 28px), 520px); transform: translate(-50%, -130%); opacity: 0; padding: 13px 18px; border-radius: 999px; background: var(--ink); color: white; text-align: center; font-weight: 750; box-shadow: var(--shadow); transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--turquoise); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.welcome-row, .section-row, .week-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-actions { display: flex; align-items: center; gap: 8px; }
.section-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.welcome-row { margin: 6px 2px 18px; }
.welcome-row h2 { margin: 0; }
.status-pill { flex: 0 0 auto; border-radius: 999px; background: #dff4e9; color: var(--success); padding: 7px 10px; font-size: .75rem; font-weight: 850; }
.status-pill.closed { background: #f7e3e1; color: var(--danger); }
.week-summary h3, .week-summary p { margin-bottom: 0; }
.deadline { max-width: 340px; text-align: right; font-size: .86rem; }
.requester-heading { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 18px; }
.requester-heading h3 { margin-bottom: 2px; }
.relationship { color: var(--muted); font-size: .82rem; }
.day-card { padding: 15px 0; border-top: 1px solid var(--line); }
.day-card:first-of-type { border-top: 0; padding-top: 0; }
.day-card h4 { margin: 0 0 10px; color: var(--blue-dark); }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; font-weight: 500; line-height: 1.35; }
.option:has(input:checked) { border-color: var(--turquoise); background: #effafa; box-shadow: 0 0 0 1px var(--turquoise); }
.option input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.option-number { color: var(--blue); font-weight: 850; }
.no-lunch { color: var(--muted); }
.salad-guide summary { cursor: pointer; color: var(--blue-dark); list-style: none; }
.salad-guide summary::-webkit-details-marker { display: none; }
.salad-guide summary span { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.salad-guide summary span::after { content: "+"; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #dff3f3; font-size: 1.3rem; }
.salad-guide[open] summary span::after { content: "−"; }
.salad-guide summary small { margin-left: auto; color: var(--muted); font-weight: 500; }
.salad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.salad-card { border-radius: 14px; background: var(--surface); padding: 13px; }
.salad-card h4 { margin: 0 0 5px; color: var(--blue); }
.salad-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.salad-choice { margin: -3px 0 4px 28px; border-left: 3px solid var(--turquoise); padding: 8px 0 8px 11px; }
.salad-choice label { margin-bottom: 5px; }
.salad-choice select { padding: 9px 11px; }
.custom-ingredients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin-top: 9px; }
.ingredient-option { display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; }
.ingredient-option input { width: 16px; height: 16px; accent-color: var(--blue); }
.ingredient-counter { margin: 7px 0 0; color: var(--muted); font-size: .75rem; }
.order-notes-wrap { margin-top: 12px; color: var(--blue-dark); }
.order-notes-wrap > span { color: var(--muted); font-weight: 500; }
.order-notes { min-height: 66px; resize: vertical; font-size: .84rem; font-weight: 500; line-height: 1.4; }
.confirmation-panel { max-width: 680px; margin: 7vh auto 0; padding-block: clamp(30px, 7vw, 54px); text-align: center; }
.confirmation-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: #dff4e9; color: var(--success); font-size: 2rem; font-weight: 900; }
.confirmation-panel .intro { max-width: 540px; margin-inline: auto; line-height: 1.55; }
.confirmation-actions { display: flex; justify-content: center; margin-top: 24px; }
.sticky-actions { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 18px; padding: 12px max(18px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgb(255 255 255 / 94%); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.sticky-actions p { margin: 0; font-size: .82rem; }

.tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 16px; padding: 2px; }
.tab { white-space: nowrap; border: 0; border-radius: 999px; background: #dfe9eb; color: var(--muted); padding: 10px 15px; font-weight: 800; }
.tab.active { background: var(--blue); color: white; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.checkbox { display: flex; flex-direction: row; align-items: center; }
.checkbox input { width: 18px; }
.preview-day { padding: 12px 0; border-top: 1px solid var(--line); }
.preview-day h4 { margin: 0 0 7px; color: var(--blue); }
.preview-day ol { margin: 0; padding-left: 24px; }
.preview-day li { padding: 3px 0; }
.people-list { display: grid; gap: 9px; }
.person-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border-radius: 13px; background: var(--surface); }
.person-row.inactive { opacity: .58; }
.person-actions { display: flex; align-items: center; gap: 2px; }
.person-row p { margin: 0; }
.person-row small { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.metric { padding: 14px; border-radius: 14px; background: var(--surface); }
.metric strong { display: block; color: var(--blue); font-size: 1.6rem; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.summary-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.summary-table th, .summary-table td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: left; }
.summary-table th { white-space: nowrap; }
.detail-heading { margin-top: 30px; }
.choice-cell { min-width: 180px; line-height: 1.3; }
.choice-note { display: block; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); color: var(--muted); line-height: 1.35; }
.missing-box { margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: #fff4df; }
.missing-box h4 { margin: 0 0 6px; color: #764b00; }
.missing-box p { margin: 0; color: #765f37; }
.modal { width: min(calc(100% - 24px), 520px); border: 0; border-radius: 22px; padding: 24px; color: var(--ink); box-shadow: 0 30px 90px rgb(0 36 46 / 28%); }
.modal::backdrop { background: rgb(0 36 46 / 48%); backdrop-filter: blur(5px); }
.modal h3 { margin-bottom: 0; }
.modal small { color: var(--muted); font-weight: 500; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.5rem; line-height: 1; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 18px; }

@media (min-width: 900px) {
  #tab-orders .orders-panel { width: min(calc(100vw - 28px), 1280px); margin-left: 50%; transform: translateX(-50%); }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 20px, 980px); padding-top: 10px; }
  .brand-bar { padding-bottom: 14px; }
  .brand-logo { width: 112px; }
  .brand-bar { align-items: flex-start; flex-wrap: wrap; }
  .brand-bar > div { padding-top: 2px; }
  .brand-bar h1 { font-size: 1.4rem; }
  .brand-bar .eyebrow { max-width: 160px; }
  .panel { border-radius: 17px; }
  .welcome-row { align-items: flex-start; }
  #admin-order-button { flex: 0 0 auto; padding-inline: 13px; }
  .week-summary { display: block; }
  .deadline { margin-top: 8px; text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .sticky-actions { justify-content: space-between; }
  .sticky-actions p { display: none; }
  .sticky-actions .button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .metric { padding: 10px 8px; }
  .metric strong { font-size: 1.3rem; }
  .metric span { font-size: .72rem; }

  .person-row { align-items: flex-start; }
  .person-actions { flex-direction: column; align-items: flex-end; }
  .section-row { align-items: flex-start; }
  .section-actions { flex-direction: column-reverse; align-items: stretch; }
  .salad-grid { grid-template-columns: 1fr; }
  .salad-guide summary small { display: none; }
  .custom-ingredients { grid-template-columns: 1fr 1fr; }
}
