:root {
    --forest: #173f35;
    --forest-2: #24584a;
    --forest-3: #397466;
    --mint: #dcece6;
    --mint-soft: #edf5f2;
    --cream: #f7f3ea;
    --paper: #fffefa;
    --coral: #ee754e;
    --coral-dark: #cf5c39;
    --amber: #f2b84b;
    --blue: #7698ad;
    --ink: #1d2925;
    --muted: #64736e;
    --line: #dce5e1;
    --danger: #bd4439;
    --shadow-sm: 0 2px 12px rgba(22, 51, 43, .06);
    --shadow: 0 16px 45px rgba(22, 51, 43, .10);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --content: 1220px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: #f4f7f5;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.12; }
form { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled { opacity: .72; }

.page-container { width: min(calc(100% - 40px), var(--content)); margin: 0 auto; padding: 44px 0 70px; }
.eyebrow { margin: 0 0 7px; color: var(--forest-3); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #bcd8cf; }
.muted { color: var(--muted); }
.span-full { grid-column: 1 / -1; }
.align-right { text-align: right !important; }

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    align-items: center;
    min-height: 76px;
    padding: 0 max(24px, calc((100vw - var(--content)) / 2));
    border-bottom: 1px solid rgba(23, 63, 53, .11);
    background: rgba(255, 254, 250, .94);
    box-shadow: 0 2px 15px rgba(23, 63, 53, .03);
    backdrop-filter: blur(16px);
}
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 11px; margin-right: 40px; }
.brand-mark { display: grid; width: 48px; height: 48px; overflow: hidden; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; }
.brand-mark img { width: 41px; height: 41px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; color: var(--forest); line-height: 1.05; }
.brand-copy strong { font-size: 14px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; flex: 1; align-items: center; gap: 4px; }
.main-nav > a { position: relative; padding: 27px 11px 25px; color: #596762; font-size: 13px; font-weight: 650; }
.main-nav > a::after { position: absolute; right: 11px; bottom: 0; left: 11px; height: 3px; border-radius: 3px 3px 0 0; background: var(--coral); content: ""; opacity: 0; transform: scaleX(.4); transition: .2s; }
.main-nav > a:hover, .main-nav > a.active { color: var(--forest); }
.main-nav > a.active::after { opacity: 1; transform: scaleX(1); }
.nav-user { display: flex; align-items: center; gap: 9px; margin-left: auto; padding-left: 18px; border-left: 1px solid var(--line); }
.nav-user > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.2; }
.nav-user strong { font-size: 12px; }
.nav-user small { color: var(--muted); font-size: 10px; }
.avatar { display: inline-grid; flex: 0 0 auto; width: 34px; height: 34px; color: white; place-items: center; border-radius: 50%; background: var(--forest); font-size: 12px; font-weight: 800; }
.avatar.small { width: 31px; height: 31px; background: var(--mint); color: var(--forest); }
.avatar.tiny { width: 25px; height: 25px; font-size: 9px; }
.nav-signout { margin-left: 6px; padding: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.nav-signout:hover { color: var(--danger); }
.nav-toggle { display: none; margin-left: auto; padding: 8px; border: 0; background: none; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 4px; background: var(--forest); }

.flash-stack { position: fixed; z-index: 100; top: 88px; right: 22px; display: grid; width: min(390px, calc(100vw - 44px)); gap: 9px; }
.flash { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); font-size: 13px; animation: slide-in .25s ease both; }
.flash-icon { display: grid; width: 28px; height: 28px; color: white; place-items: center; border-radius: 50%; background: var(--forest-3); font-weight: 900; }
.flash-error .flash-icon { background: var(--danger); }
.flash button { padding: 2px 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 21px; }
.flash.is-leaving { animation: slide-out .2s ease both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(25px); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(25px); } }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 750; line-height: 1.2; transition: border-color .18s, background .18s, transform .18s, box-shadow .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(238, 117, 78, .24); outline-offset: 1px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { color: white; background: var(--forest); box-shadow: 0 7px 18px rgba(23, 63, 53, .18); }
.button-primary:hover:not(:disabled) { background: var(--forest-2); box-shadow: 0 9px 22px rgba(23, 63, 53, .24); }
.button-secondary { border-color: #b9ccc5; color: var(--forest); background: white; }
.button-secondary:hover { border-color: var(--forest-3); background: var(--mint-soft); }
.button-ghost { color: var(--forest-2); background: var(--mint-soft); }
.button-coral { color: white; background: var(--coral); box-shadow: 0 7px 18px rgba(238, 117, 78, .22); }
.button-coral:hover { background: var(--coral-dark); }
.button-large { min-height: 50px; padding: 13px 23px; font-size: 14px; }
.button-small { min-height: 36px; padding: 8px 13px; font-size: 12px; }
.button-full { width: 100%; }
.button-text-danger { min-height: auto; border: 0; color: var(--danger); background: transparent; }

input, textarea, select { width: 100%; border: 1px solid #cddbd6; border-radius: 10px; background: white; transition: border-color .18s, box-shadow .18s; }
input { min-height: 44px; padding: 9px 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--forest-3); outline: none; box-shadow: 0 0 0 3px rgba(57, 116, 102, .10); }
label > span:first-child { display: block; margin-bottom: 6px; color: #34463f; font-size: 12px; font-weight: 750; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

/* Sign in */
.login-page { min-height: 100vh; background: var(--paper); }
.login-page .flash-stack { top: 20px; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(430px, .95fr) minmax(500px, 1.05fr); }
.login-brand-panel { position: relative; display: flex; overflow: hidden; align-items: center; justify-content: center; padding: 60px; color: white; background: var(--forest); }
.login-brand-panel::before { position: absolute; width: 540px; height: 540px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; content: ""; }
.login-art-orb { position: absolute; border-radius: 50%; filter: blur(.2px); }
.orb-one { top: -100px; left: -130px; width: 330px; height: 330px; background: rgba(238, 117, 78, .93); }
.orb-two { right: -130px; bottom: -80px; width: 390px; height: 390px; border: 65px solid rgba(91, 148, 132, .22); }
.login-brand-content { position: relative; z-index: 1; width: min(100%, 510px); }
.login-logo-wrap { display: grid; width: 96px; height: 96px; margin-bottom: 38px; overflow: hidden; place-items: center; border-radius: 50%; background: white; box-shadow: 0 18px 35px rgba(4, 29, 22, .25); }
.login-logo-wrap img { width: 88px; height: 88px; object-fit: contain; }
.login-brand-content h1 { margin: 0 0 20px; color: white; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5.2vw, 72px); font-weight: 500; letter-spacing: -.05em; }
.login-brand-content h1 em { color: #ffc09f; font-weight: 400; }
.login-brand-content > p:not(.eyebrow) { max-width: 440px; color: #d4e5df; font-size: 17px; }
.login-feature-row { display: flex; gap: 30px; margin-top: 48px; padding-top: 25px; border-top: 1px solid rgba(255, 255, 255, .16); }
.login-feature-row span { display: flex; align-items: center; gap: 8px; color: #e5f0ec; font-size: 12px; font-weight: 750; }
.login-feature-row i { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; color: #ffc09f; font-size: 9px; font-style: normal; }
.login-form-panel { display: flex; align-items: center; justify-content: center; padding: 60px; background: var(--paper); }
.login-form-wrap { width: min(100%, 430px); }
.login-form-wrap h2 { margin: 0 0 11px; color: var(--forest); font-family: Georgia, serif; font-size: 42px; font-weight: 500; }
.form-intro { margin-bottom: 34px; color: var(--muted); }
.stacked-form { display: grid; gap: 19px; }
.login-form label > span { font-size: 12px; }
.input-with-icon { position: relative; }
.input-with-icon svg { position: absolute; top: 14px; left: 14px; width: 18px; height: 18px; fill: none; stroke: #80908b; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; pointer-events: none; }
.input-with-icon input { min-height: 49px; padding-right: 58px; padding-left: 42px; }
.password-toggle { position: absolute; top: 0; right: 5px; height: 49px; padding: 0 9px; border: 0; background: none; color: var(--forest-3); cursor: pointer; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.login-form .button { margin-top: 7px; }
.login-help { margin: 28px 0 0; padding: 15px; border-radius: 10px; color: var(--muted); background: var(--mint-soft); font-size: 11px; text-align: center; }
.timezone-note { margin: 26px 0 0; color: #85918d; font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.mobile-login-brand { display: none; }

/* Shared headings and panels */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 35px; margin-bottom: 30px; }
.page-heading h1 { margin: 0 0 8px; color: var(--forest); font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 500; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.heading-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 23px 25px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.panel-heading a { color: var(--forest-3); font-size: 12px; font-weight: 750; }
.panel-heading > small { color: var(--muted); }
.date-chip, .timezone-badge { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 99px; color: var(--forest); background: var(--mint-soft); font-size: 11px; font-weight: 750; }

/* Student ordering */
.student-page { background: linear-gradient(180deg, #f8f5ee 0, #f4f7f5 420px); }
.student-hero { display: grid; align-items: center; grid-template-columns: 1fr 330px; gap: 50px; margin: 10px 0 34px; }
.student-hero h1 { max-width: 720px; margin: 0 0 12px; color: var(--forest); font-family: Georgia, serif; font-size: clamp(38px, 5vw, 56px); font-weight: 500; }
.student-hero h1 em { color: var(--coral); font-weight: 400; }
.student-hero > div:first-child > p:last-child { max-width: 670px; margin: 0; color: var(--muted); font-size: 16px; }
.window-card { position: relative; overflow: hidden; padding: 20px 22px; border: 1px solid #bcd4ca; border-radius: var(--radius); background: rgba(255, 255, 255, .8); box-shadow: var(--shadow-sm); }
.window-card::after { position: absolute; top: -50px; right: -48px; width: 115px; height: 115px; border-radius: 50%; background: var(--mint); content: ""; }
.window-status-row { display: flex; position: relative; z-index: 1; align-items: center; gap: 9px; margin-bottom: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #30a36e; box-shadow: 0 0 0 5px rgba(48, 163, 110, .12); }
.window-closed .status-dot { background: #89948f; box-shadow: 0 0 0 5px rgba(137, 148, 143, .12); }
.window-upcoming .status-dot { background: var(--amber); box-shadow: 0 0 0 5px rgba(242, 184, 75, .15); }
.window-card small { display: block; color: var(--muted); font-size: 11px; }
.countdown-value { display: block; margin-top: 11px; color: var(--forest); font-family: Georgia, serif; font-size: 19px; font-weight: 700; }
.current-order-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; padding: 13px 17px; border: 1px solid #bad7cc; border-radius: 13px; background: var(--mint-soft); }
.check-badge { display: grid; width: 34px; height: 34px; color: white; place-items: center; border-radius: 50%; background: var(--forest-3); font-weight: 900; }
.current-order-banner > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; }
.current-order-banner small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.current-order-date { margin-left: auto; color: var(--muted); font-size: 11px; }
.section-heading { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading > span:first-child { display: flex; align-items: center; gap: 11px; color: var(--forest); font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.section-heading > span:first-child > span:last-child { display: flex; flex-direction: column; }
.section-heading small { color: var(--forest-3); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.step-number { display: grid; width: 36px; height: 36px; color: white; place-items: center; border-radius: 50%; background: var(--forest); font-size: 13px; }
.selection-helper { color: var(--muted); font-size: 11px; }
.meal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 19px; }
.meal-card { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.meal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.meal-card.selected { border-color: var(--forest-3); box-shadow: 0 13px 35px rgba(23, 63, 53, .15); }
.meal-card > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.meal-image { display: block; position: relative; height: 210px; overflow: hidden; background: var(--cream); }
.meal-image > img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.meal-card:hover .meal-image > img { transform: scale(1.035); }
.meal-placeholder { display: grid; width: 100%; height: 100%; place-items: center; background: radial-gradient(circle at 64% 20%, rgba(255,255,255,.6) 0 12%, transparent 13%), linear-gradient(135deg, #d5e6dd, #90b5a6); }
.meal-placeholder span { display: grid; width: 74px; height: 74px; color: rgba(255,255,255,.92); place-items: center; border: 2px solid rgba(255,255,255,.65); border-radius: 50%; font-family: Georgia, serif; font-size: 27px; font-weight: 700; }
.placeholder-1 { background: linear-gradient(135deg, #efd5ad, #db9c69); }
.placeholder-2 { background: linear-gradient(135deg, #cbd8e3, #7999ad); }
.meal-check { display: grid; position: absolute; top: 13px; right: 13px; width: 29px; height: 29px; color: white; place-items: center; border: 2px solid white; border-radius: 50%; background: var(--forest); box-shadow: 0 3px 10px rgba(0,0,0,.2); opacity: 0; transform: scale(.65); transition: .2s; }
.meal-card.selected .meal-check { opacity: 1; transform: scale(1); }
.meal-copy { display: flex; min-height: 164px; flex-direction: column; padding: 19px 20px; }
.meal-copy > strong { margin-bottom: 7px; color: var(--forest); font-family: Georgia, serif; font-size: 21px; }
.meal-copy > small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.choose-label { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 17px; color: var(--forest-3); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.choose-label i { font-size: 17px; font-style: normal; }
.note-section { margin-top: 36px; }
.note-field { position: relative; }
.note-field textarea { min-height: 92px; padding-right: 68px; background: var(--paper); }
.character-count { position: absolute; right: 13px; bottom: 11px; color: #89948f; font-size: 10px; }
.character-count strong { color: var(--forest-3); }
.order-actions { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.locked-message { margin: 0; color: var(--muted); font-size: 12px; }
.history-strip { margin-top: 65px; padding-top: 35px; border-top: 1px solid var(--line); }
.history-strip h2 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.history-list { display: grid; margin-top: 17px; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.history-item { display: grid; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.history-date { color: var(--forest-3); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.history-item strong { margin-top: 3px; font-size: 13px; }
.history-item small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

/* Admin dashboard */
.metrics-grid { display: grid; margin-bottom: 22px; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 14px; }
.metric-card { display: flex; position: relative; min-height: 132px; overflow: hidden; align-items: center; gap: 14px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.metric-featured { color: white; border-color: var(--forest); background: var(--forest); }
.metric-shape { position: absolute; right: -26px; bottom: -62px; width: 140px; height: 140px; border: 27px solid rgba(255,255,255,.06); border-radius: 50%; }
.metric-icon { display: grid; flex: 0 0 auto; width: 45px; height: 45px; color: var(--forest); place-items: center; border-radius: 13px; background: var(--mint); font-size: 18px; }
.metric-icon.green { background: var(--mint); }
.metric-icon.coral { color: #a94529; background: #fde4db; }
.metric-icon.blue { color: #496e84; background: #e2edf3; }
.metric-card > div { display: flex; flex-direction: column; }
.metric-card small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric-featured small, .metric-featured span { color: #bad5cc; }
.metric-card strong { margin: 2px 0; color: var(--forest); font-family: Georgia, serif; font-size: 32px; line-height: 1; }
.metric-featured strong { color: white; }
.metric-card .metric-word { font-size: 22px; }
.metric-card span { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 20px; }
.portion-list { padding: 4px 25px; }
.portion-row { display: grid; align-items: center; grid-template-columns: 30px minmax(140px, 1fr) minmax(80px, 1.2fr) 36px; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.portion-rank { color: #9aa6a2; font-size: 10px; font-weight: 800; }
.portion-row > div { display: flex; flex-direction: column; }
.portion-row > div strong { font-size: 13px; }
.portion-row > div small { color: var(--muted); font-size: 10px; }
.portion-bar { height: 6px; overflow: hidden; border-radius: 99px; background: var(--mint-soft); }
.portion-bar i { display: block; height: 100%; border-radius: inherit; background: var(--coral); }
.portion-count { color: var(--forest); font-family: Georgia, serif; font-size: 19px; text-align: right; }
.summary-total { display: flex; align-items: center; justify-content: space-between; padding: 18px 25px; color: white; border-radius: 0 0 var(--radius) var(--radius); background: var(--forest); }
.summary-total span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.summary-total strong { font-family: Georgia, serif; font-size: 25px; }
.activity-list { padding: 4px 25px; }
.activity-row { display: grid; align-items: start; grid-template-columns: 32px 1fr auto; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border: 0; }
.activity-row > div { display: flex; flex-direction: column; }
.activity-row strong { font-size: 12px; }
.activity-row span { color: var(--muted); font-size: 11px; }
.activity-row small { overflow: hidden; max-width: 250px; margin-top: 2px; color: var(--forest-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-row time { color: #8c9994; font-size: 8px; white-space: nowrap; }
.empty-state { display: flex; min-height: 250px; align-items: center; justify-content: center; flex-direction: column; padding: 35px; text-align: center; }
.empty-state.compact { min-height: 250px; }
.empty-state > span { margin-bottom: 9px; font-size: 31px; }
.empty-state h3 { margin: 0 0 5px; color: var(--forest); font-size: 18px; }
.empty-state p { max-width: 330px; margin: 0; color: var(--muted); font-size: 12px; }
.quick-actions { display: grid; margin-top: 20px; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick-actions a { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.68); transition: .2s; }
.quick-actions a:hover { border-color: #b8ccc4; background: white; transform: translateY(-2px); }
.quick-icon { display: grid; width: 39px; height: 39px; color: var(--forest); place-items: center; border-radius: 11px; background: var(--mint); font-size: 19px; }
.quick-actions a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.quick-actions strong { font-size: 12px; }
.quick-actions small { color: var(--muted); font-size: 10px; }
.quick-actions i { color: var(--coral); font-style: normal; }

/* Tables and filters */
.filter-bar { margin-bottom: 20px; padding: 18px 20px; }
.filter-bar form { display: flex; align-items: flex-end; gap: 10px; }
.filter-bar label { width: 210px; }
.date-shortcuts { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); overflow-x: auto; }
.date-shortcuts a { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 10px; }
.date-shortcuts a strong { display: grid; width: 22px; height: 22px; color: var(--forest); place-items: center; border-radius: 50%; background: var(--mint); }
.date-shortcuts a.active { color: white; border-color: var(--forest); background: var(--forest); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 16px; color: #71807b; background: #f3f7f5; font-size: 9px; font-weight: 800; text-align: left; text-transform: uppercase; letter-spacing: .09em; }
.data-table td { padding: 13px 16px; border-top: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfdfc; }
.date-link { color: var(--forest-3); font-weight: 750; }
.user-cell { display: inline-flex; align-items: center; gap: 8px; }
.note-pill { display: inline-block; max-width: 330px; padding: 5px 8px; overflow: hidden; border-radius: 7px; color: #6f442e; background: #fff0e9; text-overflow: ellipsis; white-space: nowrap; }
.table-action { padding: 5px 8px; border: 0; color: var(--forest-3); background: none; cursor: pointer; font-size: 10px; font-weight: 750; }
.credentials-table code { padding: 4px 7px; border-radius: 5px; color: var(--forest); background: var(--mint-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

/* Meal management and dialog */
.admin-meal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.admin-meal-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.admin-meal-card.is-hidden { opacity: .68; }
.admin-meal-image { position: relative; height: 190px; overflow: hidden; background: var(--cream); }
.admin-meal-image > img { width: 100%; height: 100%; object-fit: cover; }
.availability-badge { display: inline-flex; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.admin-meal-image .availability-badge { position: absolute; top: 12px; left: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.availability-badge.available { color: #17653f; background: #d9f3e4; }
.availability-badge.hidden { color: #707975; background: #ebeeec; }
.admin-meal-body { padding: 18px; }
.meal-title-row { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.meal-title-row h2 { margin: 0 0 7px; color: var(--forest); font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.sort-chip { padding: 3px 7px; border-radius: 6px; color: var(--muted); background: var(--mint-soft); font-size: 9px; }
.admin-meal-body > p { min-height: 38px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.admin-meal-body > small { color: #8a9692; font-size: 9px; }
.weekday-summary { display: flex; gap: 5px; margin: 11px 0; }
.weekday-summary span { display: grid; min-width: 31px; height: 24px; padding: 0 5px; color: #9aa5a1; place-items: center; border: 1px solid #e2e8e5; border-radius: 7px; background: #f3f6f4; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.weekday-summary span.enabled { color: white; border-color: var(--forest-2); background: var(--forest-2); }
.card-actions { display: flex; gap: 7px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-actions form { flex: 1; }
.card-actions .button { width: 100%; }
.app-dialog { width: min(620px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 30px 90px rgba(12, 39, 31, .28); }
.app-dialog::backdrop { background: rgba(13, 35, 29, .62); backdrop-filter: blur(4px); }
.dialog-form { display: grid; gap: 16px; padding: 25px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 4px; }
.dialog-heading h2 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.dialog-heading button { padding: 0 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 27px; }
.file-field small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.weekday-field { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f7faf8; }
.weekday-field legend { padding: 0 5px; color: #34463f; font-size: 12px; font-weight: 750; }
.weekday-field > small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.weekday-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.weekday-picker label { cursor: pointer; }
.weekday-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.weekday-picker span { display: grid; min-height: 36px; margin: 0; padding: 5px; color: var(--muted); place-items: center; border: 1px solid #cedbd6; border-radius: 8px; background: white; font-size: 9px; font-weight: 750; text-align: center; transition: .16s; }
.weekday-picker input:checked + span { color: white; border-color: var(--forest); background: var(--forest); box-shadow: 0 5px 12px rgba(23, 63, 53, .14); }
.weekday-picker input:focus-visible + span { outline: 3px solid rgba(238, 117, 78, .24); outline-offset: 1px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 5px -25px -25px; padding: 17px 25px; border-top: 1px solid var(--line); background: #f8faf9; }

/* Accounts */
.accounts-layout { display: grid; margin-bottom: 20px; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.generator-card { position: relative; overflow: hidden; padding: 30px; color: white; border-color: var(--forest); background: var(--forest); }
.generator-card::after { position: absolute; right: -70px; bottom: -110px; width: 280px; height: 280px; border: 55px solid rgba(255,255,255,.05); border-radius: 50%; content: ""; }
.generator-icon { display: grid; width: 49px; height: 49px; margin-bottom: 21px; color: var(--forest); place-items: center; border-radius: 14px; background: #bcd8cf; font-size: 21px; }
.generator-card h2 { margin: 0 0 9px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.generator-card > p:not(.eyebrow) { max-width: 530px; color: #c7dbd4; font-size: 12px; }
.generator-card form { display: grid; position: relative; z-index: 1; align-items: end; margin-top: 22px; grid-template-columns: 160px 270px; gap: 12px; }
.generator-card label > span { color: white; }
.generator-card input { border-color: rgba(255,255,255,.25); color: white; background: rgba(255,255,255,.1); }
.privacy-note { display: block; position: relative; z-index: 1; margin-top: 18px; color: #99bdb1; font-size: 9px; }
.account-stats-card { overflow: hidden; }
.large-stat { display: flex; align-items: baseline; gap: 11px; padding: 24px 25px 17px; }
.large-stat strong { color: var(--forest); font-family: Georgia, serif; font-size: 45px; line-height: 1; }
.large-stat span { color: var(--muted); font-size: 11px; }
.split-stats { display: grid; padding: 0 25px 20px; grid-template-columns: 1fr 1fr; gap: 9px; }
.split-stats div { display: flex; flex-direction: column; padding: 11px; border-radius: 10px; background: var(--mint-soft); }
.split-stats strong { color: var(--forest); font-size: 18px; }
.split-stats span { color: var(--muted); font-size: 9px; }
.info-callout { display: flex; align-items: start; gap: 10px; padding: 13px 15px; border-radius: 11px; color: var(--muted); background: #edf4f7; font-size: 10px; }
.account-stats-card .info-callout { margin: 0 25px 23px; }
.info-callout > span { display: grid; flex: 0 0 auto; width: 20px; height: 20px; color: #4c7489; place-items: center; border-radius: 50%; background: #d6e6ed; font-weight: 800; }
.info-callout p { margin: 0; }

/* Settings */
.settings-form { display: grid; gap: 16px; }
.settings-card { display: grid; align-items: center; grid-template-columns: 65px 1fr auto; gap: 22px; padding: 24px; }
.settings-icon { display: grid; width: 58px; height: 58px; color: var(--forest); place-items: center; border-radius: 17px; background: var(--mint); font-family: Georgia, serif; font-size: 17px; font-weight: 700; }
.settings-icon.monday { color: #9c482d; background: #fee6dc; }
.settings-copy h2 { margin: 0 0 5px; color: var(--forest); font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.settings-copy > p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.time-range { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: 13px; background: #f4f8f6; }
.time-range label { width: 145px; }
.time-range label > span { margin-bottom: 4px; font-size: 10px; }
.time-range input { min-height: 39px; }
.time-range small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; text-align: center; text-transform: uppercase; }
.range-arrow { color: var(--coral); font-size: 18px; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 6px; }
.settings-footer .info-callout { max-width: 670px; }

/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.report-card { overflow: hidden; }
.report-illustration { display: flex; position: relative; height: 165px; overflow: hidden; align-items: center; justify-content: center; color: white; background: var(--forest); }
.report-illustration::before, .report-illustration::after { position: absolute; width: 190px; height: 190px; border: 35px solid rgba(255,255,255,.06); border-radius: 50%; content: ""; }
.report-illustration::before { top: -100px; left: -70px; }
.report-illustration::after { right: -70px; bottom: -115px; }
.report-illustration > span { display: grid; z-index: 1; width: 68px; height: 83px; align-items: end; padding: 11px; border-radius: 4px 13px 4px 4px; color: var(--forest); background: var(--paper); box-shadow: 0 13px 25px rgba(0,0,0,.22); font-size: 13px; font-weight: 900; }
.report-illustration > i { position: absolute; z-index: 2; width: 35px; height: 3px; margin-left: -12px; background: #bfd4cd; }
.report-illustration > i:nth-of-type(1) { margin-top: -25px; }.report-illustration > i:nth-of-type(2) { margin-top: -8px; }.report-illustration > i:nth-of-type(3) { margin-top: 9px; }
.report-illustration.csv { background: #d76b47; }
.report-illustration.csv > span { color: #a44a2c; }
.report-illustration.csv > b { position: absolute; z-index: 3; margin: -8px 0 0 25px; color: #e16b44; font-size: 27px; }
.report-copy { padding: 25px; }
.report-copy h2 { margin: 0 0 8px; color: var(--forest); font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.report-copy > p:not(.eyebrow) { min-height: 58px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.report-form { display: grid; gap: 13px; padding-top: 17px; border-top: 1px solid var(--line); }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-explainer { display: grid; align-items: center; margin-top: 30px; padding: 23px 26px; border: 1px dashed #bed0c9; border-radius: var(--radius); grid-template-columns: 1fr auto 1fr auto 1fr; gap: 22px; }
.export-explainer > div { display: flex; align-items: center; gap: 12px; }
.export-explainer > div > span { display: grid; flex: 0 0 auto; width: 32px; height: 32px; color: white; place-items: center; border-radius: 50%; background: var(--forest); font-size: 10px; font-weight: 800; }
.export-explainer p { display: flex; margin: 0; color: var(--muted); flex-direction: column; font-size: 10px; }
.export-explainer strong { color: var(--ink); font-size: 11px; }
.export-explainer > i { color: var(--coral); font-style: normal; }

/* Browser report */
.report-view-page { background: #e8eeeb; }
.print-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.print-toolbar > a { color: var(--forest); font-size: 12px; font-weight: 750; }
.print-toolbar > div { display: flex; gap: 8px; }
.web-order-sheet { width: min(100%, 900px); margin: auto; padding: 45px 50px; background: white; box-shadow: 0 18px 50px rgba(22, 51, 43, .12); }
.sheet-header { display: grid; align-items: center; padding-bottom: 25px; border-bottom: 3px solid var(--forest); grid-template-columns: 80px 1fr auto; gap: 20px; }
.sheet-header img { width: 75px; height: 75px; object-fit: contain; }
.sheet-header h1 { margin: 0 0 4px; color: var(--forest); font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.sheet-header p:last-child { margin: 0; color: var(--muted); }
.sheet-total { display: flex; align-items: flex-end; flex-direction: column; }
.sheet-total strong { color: var(--coral); font-family: Georgia, serif; font-size: 43px; line-height: 1; }
.sheet-total span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.sheet-summary, .sheet-notes { margin-top: 30px; }
.sheet-summary h2, .sheet-notes > h2 { color: var(--forest); font-size: 17px; }
.sheet-summary > div { display: flex; justify-content: space-between; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.sheet-summary > div:nth-child(even) { background: #f5f8f7; }
.sheet-summary .sheet-grand-total { color: white; background: var(--forest); font-weight: 800; }
.sheet-meal-group { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; page-break-inside: avoid; }
.sheet-meal-group > header { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; background: var(--mint-soft); }
.sheet-meal-group h3 { margin: 0; color: var(--forest); font-size: 14px; }
.sheet-meal-group header span { font-size: 10px; font-weight: 750; }
.sheet-meal-group table { width: 100%; border-collapse: collapse; }
.sheet-meal-group th, .sheet-meal-group td { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 10px; text-align: left; }
.sheet-meal-group th { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.sheet-meal-group th:first-child, .sheet-meal-group td:first-child { width: 26%; }
.no-notes { margin: 0; padding: 11px 13px; color: var(--muted); font-size: 10px; }
.web-order-sheet > footer { margin-top: 35px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: center; }

.error-page { display: flex; min-height: 65vh; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.error-page > span { color: var(--coral); font-family: Georgia, serif; font-size: 90px; }
.error-page h1 { color: var(--forest); }

@media (max-width: 1080px) {
    .main-nav > a { padding-right: 7px; padding-left: 7px; font-size: 11px; }
    .brand { margin-right: 20px; }
    .brand-copy { display: none; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .student-hero { grid-template-columns: 1fr 290px; }
    .settings-card { grid-template-columns: 60px 1fr; }
    .settings-card .time-range { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 820px) {
    .page-container { width: min(calc(100% - 28px), var(--content)); padding-top: 28px; }
    .topbar { min-height: 66px; padding: 0 15px; }
    .brand-mark { width: 42px; height: 42px; }
    .brand-copy { display: flex; }
    .nav-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 66px; right: 10px; left: 10px; align-items: stretch; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); flex-direction: column; }
    .main-nav.open { display: flex; }
    .main-nav > a { padding: 10px 12px; border-radius: 8px; font-size: 12px; }
    .main-nav > a.active { background: var(--mint-soft); }
    .main-nav > a::after { display: none; }
    .nav-user { margin: 5px 0 0; padding: 10px 5px 4px; border-top: 1px solid var(--line); border-left: 0; }
    .nav-signout { width: 100%; margin: 0; text-align: left; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
    .login-form-panel { min-height: 100vh; padding: 38px 24px; }
    .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 45px; }
    .mobile-login-brand img { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--line); border-radius: 50%; }
    .mobile-login-brand > span { display: flex; color: var(--forest); flex-direction: column; font-size: 13px; font-weight: 800; }
    .mobile-login-brand small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
    .student-hero { grid-template-columns: 1fr; gap: 22px; }
    .meal-grid, .admin-meal-grid { grid-template-columns: repeat(2, 1fr); }
    .meal-image { height: 180px; }
    .dashboard-grid, .accounts-layout, .report-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
    .heading-actions { width: 100%; }
    .heading-actions .button { flex: 1; }
    .generator-card form { grid-template-columns: 140px 1fr; }
    .export-explainer { grid-template-columns: 1fr; }
    .export-explainer > i { display: none; }
}

@media (max-width: 560px) {
    .brand-copy strong { font-size: 12px; }
    .page-heading h1 { font-size: 35px; }
    .student-hero h1 { font-size: 38px; }
    .meal-grid, .admin-meal-grid, .metrics-grid, .history-list { grid-template-columns: 1fr; }
    .meal-image { height: 210px; }
    .form-grid.two { grid-template-columns: 1fr; }
    .current-order-banner { align-items: flex-start; }
    .current-order-date { display: none; }
    .section-heading { align-items: flex-start; }
    .selection-helper { display: none; }
    .order-actions { align-items: stretch; flex-direction: column; }
    .order-actions .button { width: 100%; }
    .heading-actions { flex-direction: column; }
    .filter-bar form { align-items: stretch; flex-direction: column; }
    .filter-bar label { width: 100%; }
    .generator-card { padding: 23px; }
    .generator-card form { grid-template-columns: 1fr; }
    .settings-card { grid-template-columns: 52px 1fr; gap: 13px; padding: 18px; }
    .settings-icon { width: 50px; height: 50px; }
    .time-range { display: grid; width: 100%; grid-template-columns: 1fr auto 1fr; padding: 10px; }
    .time-range label { width: auto; }
    .settings-footer { align-items: stretch; flex-direction: column; }
    .report-actions { grid-template-columns: 1fr; }
    .print-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
    .print-toolbar > div { flex-direction: column; }
    .web-order-sheet { padding: 24px 18px; }
    .sheet-header { grid-template-columns: 55px 1fr; }
    .sheet-header img { width: 50px; height: 50px; }
    .sheet-total { grid-column: 1 / -1; align-items: flex-start; }
    .dialog-form { padding: 19px; }
    .dialog-actions { margin: 5px -19px -19px; padding: 14px 19px; }
    .weekday-picker { grid-template-columns: repeat(3, 1fr); }
}

@media print {
    body { background: white; }
    .topbar, .flash-stack, .print-toolbar { display: none !important; }
    .page-container { width: 100%; padding: 0; }
    .web-order-sheet { width: 100%; padding: 8mm; box-shadow: none; }
}
