:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #343137;
  background: #f3f2f4;
  font-synthesis: none;
  --forest: #4b4055;
  --forest-dark: #39323f;
  --forest-soft: #eee9f2;
  --gold: #6c4f83;
  --gold-soft: #f2edf4;
  --ink: #343137;
  --muted: #716b75;
  --line: #dedbe2;
  --paper: #ffffff;
  --danger: #9d3f45;
  --shadow: 0 10px 30px rgba(41,35,48,.08);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f3f2f4; }
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.loading-screen { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.loading-mark, .app-symbol, .brand-icon { display: grid; place-items: center; background: #6c4f83; color: #fff; border: 2px solid rgba(255,255,255,.22); font-weight: 900; letter-spacing: -.35px; }
.loading-mark { width: 58px; height: 58px; border-radius: 16px; font-size: 10px; }

.login-page { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 10% 10%, #ece9ee 0, transparent 42%), linear-gradient(145deg, #f7f6f7, #ebe8ed); }
.login-shell { width: min(100%, 1010px); min-height: 590px; display: grid; grid-template-columns: 1.15fr .85fr; border-radius: 22px; overflow: hidden; box-shadow: 0 28px 80px rgba(41,35,48,.16); border: 1px solid #dedbe2; }
.brand-panel { position: relative; padding: 70px 62px; color: white; background: linear-gradient(145deg, rgba(75,64,85,.97), rgba(57,50,63,.98)); overflow: hidden; }
.brand-panel::after { content: ""; position: absolute; width: 350px; height: 350px; border-radius: 50%; border: 70px solid rgba(108,79,131,.14); right: -155px; bottom: -160px; }
.brand-kicker { font-size: 11px; letter-spacing: 1.7px; font-weight: 800; color: #d8d0de; }
.brand-panel h1 { max-width: 560px; margin: 28px 0 20px; font-size: clamp(38px, 5vw, 57px); line-height: 1.05; letter-spacing: -1.8px; }
.brand-panel p { max-width: 460px; margin: 0; color: #ded9e2; line-height: 1.7; font-size: 17px; }
.date-window { margin-top: 95px; display: flex; align-items: center; gap: 15px; color: #fff; }
.date-window strong { padding: 10px 12px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; font-size: 12px; letter-spacing: .7px; }
.date-window span { color: var(--gold); font-weight: 900; }
.login-card { padding: 62px 50px; background: #fff; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.app-symbol { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 8px; font-size: 9px; }
.login-card h2 { margin: 4px 0 6px; font-size: 30px; letter-spacing: -.6px; }
.eyebrow { font-size: 10px; font-weight: 900; letter-spacing: 1.4px; color: #6c4f83; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; }
label { display: flex; flex-direction: column; gap: 7px; color: #57515b; font-size: 12px; font-weight: 750; }
input { width: 100%; border: 1px solid #cfcbd2; border-radius: 9px; background: #fff; padding: 12px 13px; color: var(--ink); outline: 0; transition: border .15s, box-shadow .15s; }
input:focus { border-color: #6c4f83; box-shadow: 0 0 0 3px rgba(108,79,131,.13); }
.form-error { padding: 10px 12px; border-radius: 8px; background: #f9e8e8; color: #8a3838; font-size: 12px; border: 1px solid #efd0d0; }
.primary-button, .secondary-button, .logout-button, .icon-button, .danger-button { border: 0; border-radius: 9px; cursor: pointer; font-weight: 800; }
.primary-button { width: 100%; padding: 13px 16px; background: var(--forest); color: #fff; box-shadow: 0 7px 18px rgba(86,60,107,.22); }
.primary-button:hover { background: var(--forest-dark); }
.primary-button.compact { width: auto; padding: 11px 16px; }
.secondary-button { padding: 10px 14px; background: #fff; border: 1px solid #cfcbd2; color: #544d59; }
.privacy-note { text-align: center; color: #8a858d; font-size: 10px; line-height: 1.5; }

.topbar { position: sticky; top: 0; z-index: 30; background: rgba(75,64,85,.98); color: white; box-shadow: 0 3px 14px rgba(41,35,48,.18); backdrop-filter: blur(10px); }
.topbar-inner { width: min(calc(100% - 36px), 1320px); min-height: 74px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.brand-button { border: 0; background: transparent; color: white; display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; padding: 0; width: fit-content; }
.brand-icon { width: 39px; height: 39px; border-radius: 10px; background: #6c4f83; color: #fff; font-size: 7px; }
.brand-button strong, .brand-button small { display: block; }
.brand-button strong { font-size: 13px; }
.brand-button small { margin-top: 2px; color: #d2ccd5; font-size: 10px; }
.main-nav { display: flex; align-self: stretch; }
.main-nav button { position: relative; min-width: 95px; padding: 0 16px; border: 0; background: transparent; color: #d8d2dc; cursor: pointer; font-size: 12px; font-weight: 800; }
.main-nav button.active { color: #fff; }
.main-nav button.active::after { content: ""; position: absolute; height: 3px; left: 16px; right: 16px; bottom: 0; border-radius: 3px 3px 0 0; background: var(--gold); }
.account-zone { justify-self: end; display: flex; align-items: center; gap: 14px; }
.account-text { text-align: right; }
.account-text strong, .account-text small { display: block; }
.account-text strong { font-size: 11px; }
.account-text small { margin-top: 2px; color: #cfc8d3; font-size: 9px; }
.logout-button { padding: 8px 10px; background: rgba(255,255,255,.08); color: #f2edf4; font-size: 10px; }

.content-shell { width: min(calc(100% - 36px), 1280px); margin: 0 auto; padding: 42px 0 70px; }
.hero-block { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 6px 2px 25px; }
.hero-block h1, .page-heading h1 { margin: 8px 0 8px; color: var(--ink); font-size: clamp(31px, 4vw, 45px); line-height: 1.08; letter-spacing: -1.25px; }
.hero-block p, .page-heading p { margin: 0; max-width: 720px; color: var(--muted); line-height: 1.6; }
.hero-stats { display: flex; gap: 10px; }
.hero-stats > div { min-width: 118px; padding: 13px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font-size: 25px; color: var(--forest); }
.hero-stats span { margin-top: 2px; font-size: 10px; color: var(--muted); }
.progress-panel { margin-bottom: 38px; padding: 17px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.progress-panel > div:first-child, .progress-split { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.progress-panel strong { font-size: 13px; }
.progress-panel span { color: var(--muted); font-size: 10px; }
.progress-track { height: 8px; margin: 12px 0 9px; background: #ece9ee; border-radius: 999px; overflow: hidden; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #563c6b, #6c4f83); }
.month-section + .month-section { margin-top: 44px; }
.month-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 15px 2px; }
.month-title h2 { margin: 0; text-transform: capitalize; color: #4b4055; font-size: 19px; }
.month-title span { color: #8a858d; font-size: 10px; }
.meal-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.meal-card { overflow: hidden; border-radius: 15px; background: #fff; border: 1px solid var(--line); box-shadow: 0 5px 18px rgba(41,35,48,.05); }
.meal-card-head { min-height: 88px; padding: 14px 16px; display: grid; grid-template-columns: 58px 1fr auto; gap: 13px; align-items: center; border-bottom: 1px solid #ece9ee; }
.date-tile { width: 58px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid #dedbe2; text-align: center; background: #fbfafb; }
.date-tile span { display: block; padding: 5px 0 4px; background: var(--forest); color: #f2edf4; font-size: 8px; font-weight: 900; letter-spacing: .8px; }
.date-tile strong { display: block; padding-top: 5px; color: var(--forest); font-size: 23px; line-height: 1; }
.date-copy h3 { margin: 0; font-size: 15px; color: #343137; }
.date-copy small { display: block; margin-top: 4px; color: #8a858d; font-size: 9px; }
.icon-button { background: #f3f2f4; color: #716b75; padding: 7px 9px; font-size: 9px; border: 1px solid #dedbe2; }
.meal-slot { padding: 15px 16px 16px; }
.meal-slot + .meal-slot { border-top: 1px solid #ece9ee; }
.slot-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 11px; }
.slot-line > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.slot-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #343137; font-size: 13px; }
.slot-tag { flex: 0 0 auto; min-width: 54px; padding: 4px 7px; border-radius: 99px; text-align: center; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.slot-tag.main { color: #563c6b; background: #eee9f2; }
.slot-tag.dessert { color: #6c4f83; background: #f2edf4; }
.custom-pill { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; background: #f2edf4; color: #6c4f83; font-size: 8px; font-weight: 800; }
.signup-button { width: 100%; min-height: 54px; border: 1px dashed #cfcbd2; border-radius: 10px; padding: 9px 11px; background: #fbfafb; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; }
.signup-button:hover { background: #f8f7f8; border-color: #6c4f83; }
.signup-button span { color: #6c4f83; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.signup-button strong { color: #4b4055; font-size: 11px; }
.signup-button b { font-size: 16px; color: #76687e; }
.volunteer-box { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 10px; background: #f8f7f8; border: 1px solid #ece9ee; }
.volunteer-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #eee9f2; color: #6c4f83; font-size: 10px; font-weight: 900; }
.volunteer-info { min-width: 0; }
.volunteer-info > strong { display: block; color: #4b4055; font-size: 11px; }
.volunteer-info > div { margin-top: 3px; display: flex; align-items: center; gap: 5px; min-width: 0; color: #8a858d; font-size: 9px; }
.volunteer-info a { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.admin-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.admin-actions button { border: 0; background: transparent; color: #6c4f83; cursor: pointer; padding: 2px 3px; font-size: 8px; font-weight: 800; }
.admin-actions button.danger { color: var(--danger); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; display: grid; place-items: center; background: rgba(41,35,48,.66); backdrop-filter: blur(4px); }
.modal-card { width: min(620px,100%); max-height: calc(100vh - 40px); overflow: auto; padding: 27px; background: #fff; border: 1px solid #dedbe2; border-radius: 16px; box-shadow: 0 25px 80px rgba(41,35,48,.35); }
.modal-card.small { width: min(540px,100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-header h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -.6px; }
.close-button { border: 0; background: transparent; color: #8a858d; font-size: 29px; line-height: 1; cursor: pointer; padding: 0; }
.slot-summary { margin: 16px 0 20px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; border-left: 4px solid var(--gold); border-radius: 7px; background: #f8f7f8; }
.slot-summary strong { font-size: 12px; color: #4b4055; }
.slot-summary span { font-size: 10px; color: #837d87; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid + .form-grid { margin-top: 13px; }
.dessert-choice { margin: 0 0 20px; padding: 0; border: 0; }
.dessert-choice legend { margin-bottom: 9px; color: #57515b; font-size: 11px; font-weight: 800; }
.choice { margin-bottom: 8px; padding: 10px 11px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; border: 1px solid #dedbe2; border-radius: 10px; background: #fff; cursor: pointer; }
.choice.active { border-color: #6c4f83; background: #faf8fb; }
.choice input { width: auto; }
.choice span strong, .choice span small { display: block; }
.choice span strong { color: #4b4055; font-size: 11px; }
.choice span small { margin-top: 2px; color: #8a858d; font-size: 9px; }
.other-dessert { margin-top: 11px; }
.mail-info { margin-top: 17px; padding: 11px 12px; border-radius: 9px; border: 1px solid #dedbe2; background: #f7f6f7; color: #716b75; font-size: 10px; line-height: 1.55; }
.modal-actions { margin-top: 20px; padding-top: 17px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #e8e5e9; }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: 430px; padding: 12px 14px; border-radius: 9px; background: #6c4f83; color: white; box-shadow: 0 10px 35px rgba(41,35,48,.22); font-size: 11px; }
.toast.warning { background: #76687e; }
.toast.error { background: #8a3e42; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.history-summary { display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.history-summary > div { padding: 16px 18px; }
.history-summary > div + div { border-left: 1px solid var(--line); }
.history-summary strong, .history-summary span { display: block; }
.history-summary strong { font-size: 23px; color: var(--forest); }
.history-summary span { margin-top: 2px; font-size: 9px; color: var(--muted); }
.history-table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.history-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.history-table th { padding: 10px 12px; text-align: left; background: #f8f7f8; color: #716b75; font-size: 8px; text-transform: uppercase; letter-spacing: .7px; border-bottom: 1px solid var(--line); }
.history-table td { padding: 11px 12px; color: #4b4055; font-size: 10px; border-bottom: 1px solid #ece9ee; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.history-table td strong, .history-table td small { display: block; }
.history-table td small { margin-top: 2px; color: #8a858d; font-size: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.status-pill { display: inline-flex; padding: 4px 7px; border-radius: 99px; font-size: 8px; font-weight: 900; }
.status-pill.good { color: #563c6b; background: #eee9f2; }
.status-pill.bad { color: #893e43; background: #f8e7e8; }
.status-pill.neutral { color: #716b75; background: #ece9ee; }
.empty-table { text-align: center; padding: 30px !important; color: #8a858d !important; }


.admin-notice { margin: -6px 0 24px; padding: 13px 16px; display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; background: #eee9f2; border: 1px solid #d8d0de; border-left: 4px solid var(--gold); border-radius: 10px; color: #4b4055; }
.admin-notice strong { font-size: 11px; color: #563c6b; }
.admin-notice span { font-size: 10px; line-height: 1.5; color: #716b75; }
.user-actions { display: flex; align-items: center; justify-content: flex-end; }
.user-actions button { border: 1px solid #cfcbd2; border-radius: 7px; background: #fff; color: #6c4f83; cursor: pointer; padding: 6px 8px; font-size: 8px; font-weight: 800; }
.user-actions button:hover { background: #f2edf4; border-color: #cbb0dc; }
.danger-button { padding: 11px 14px; background: #9d3f45; color: #fff; box-shadow: 0 3px 10px rgba(157,63,69,.16); }
.danger-button:hover { background: #833b41; }
.danger-button:disabled { opacity: .6; cursor: default; }
.cancel-copy { margin: 0 0 18px; color: #716b75; font-size: 11px; line-height: 1.65; }

@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; max-width: 620px; }
  .brand-panel { padding: 44px 42px; }
  .date-window { margin-top: 42px; }
  .login-card { padding: 44px 42px; }
  .topbar-inner { grid-template-columns: 1fr auto; }
  .main-nav { grid-row: 2; grid-column: 1/-1; justify-content: center; min-height: 42px; border-top: 1px solid rgba(255,255,255,.07); }
  .account-zone { grid-column: 2; grid-row: 1; }
  .meal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .login-page { padding: 12px; }
  .brand-panel { padding: 35px 26px; }
  .brand-panel h1 { font-size: 37px; }
  .login-card { padding: 35px 26px; }
  .content-shell { width: min(calc(100% - 22px),1280px); padding-top: 28px; }
  .topbar-inner { width: calc(100% - 22px); }
  .brand-button small, .account-text { display: none; }
  .hero-block { align-items: flex-start; flex-direction: column; }
  .hero-stats { width: 100%; }
  .hero-stats > div { flex: 1; min-width: 0; }
  .progress-panel > div:first-child, .progress-split { align-items: flex-start; flex-direction: column; gap: 3px; }
  .meal-card-head { grid-template-columns: 54px 1fr; }
  .icon-button { grid-column: 2; width: fit-content; }
  .volunteer-box { grid-template-columns: 36px 1fr; }
  .admin-actions { grid-column: 2; flex-direction: row; justify-content: flex-start; }
  .form-grid.two { grid-template-columns: 1fr; }
  .modal-card { padding: 21px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  .history-summary { grid-template-columns: 1fr; }
  .history-summary > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .page-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 450px) {
  .date-window { flex-wrap: wrap; }
  .slot-line { align-items: flex-start; flex-direction: column; }
  .slot-line > div { width: 100%; }
  .slot-line strong { white-space: normal; }
  .signup-button { grid-template-columns: 1fr auto; }
  .signup-button span { grid-column: 1/-1; }
  .volunteer-info > div { align-items: flex-start; flex-direction: column; }
  .volunteer-info > div span { display: none; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
