:root {
  color-scheme: light;
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-alt: #f8faf6;
  --sidebar: #0e241c;
  --sidebar-2: #16362b;
  --green: #165b41;
  --green-hover: #114732;
  --green-bright: #10b981;
  --green-soft: #e6f5ee;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --rose: #dc2626;
  --rose-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --indigo: #4f46e5;
  --indigo-soft: #e0e7ff;
  --ink: #16221c;
  --muted: #55685d;
  --border: #dfe7df;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --shadow-sm: 0 1px 2px rgba(14, 36, 28, .05), 0 4px 12px rgba(14, 36, 28, .04);
  --shadow-md: 0 10px 28px rgba(14, 36, 28, .09);
  font: 100%/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; font-family: inherit; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
.num, .metrics strong, td[data-label="Amount"], td[data-label="Balance"] { font-variant-numeric: tabular-nums; }

.layout { display: grid; min-height: 100vh; grid-template-columns: 16rem minmax(0, 1fr); }
.layout.auth-page { grid-template-columns: 1fr; align-items: center; padding: 1.5rem 1rem; }
.layout.auth-page main { max-width: 60rem; margin-inline: auto; padding: 0; }

/* Sidebar */
aside {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #e6eee8;
  padding: 1.4rem .95rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem .6rem;
  background: rgba(255, 255, 255, .96);
  border-radius: .85rem;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -.02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: transform .15s ease;
}
.brand:hover { transform: translateY(-1px); }

.brand-logo {
  height: 2.35rem;
  width: auto;
  max-width: 8.5rem;
  object-fit: contain;
  display: block;
}

.brand small { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Creative Split Auth Shell */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .65rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 58rem;
  margin: 1rem auto 2rem;
}

.auth-showcase {
  background: linear-gradient(145deg, #0e241c 0%, #164431 60%, #1d5b41 100%);
  color: #fff;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: auto -25% -25% auto;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(245, 158, 11, .18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-logo-pill {
  display: inline-flex;
  align-items: center;
  background: #fff;
  padding: .45rem .85rem;
  border-radius: .85rem;
  width: fit-content;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}

.auth-logo-pill img {
  height: 2.75rem;
  width: auto;
  max-width: 10rem;
  object-fit: contain;
  display: block;
}

.auth-showcase h2 {
  color: #fff;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  margin: 0;
  line-height: 1.18;
}

.auth-showcase p { color: #cce3d6; margin: 0; font-size: .94rem; line-height: 1.5; }

.auth-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .25rem;
}

.auth-stat {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: .75rem;
  padding: .7rem .8rem;
}

.auth-stat strong { display: block; font-size: 1.15rem; color: #bef264; font-weight: 800; }
.auth-stat span { font-size: .76rem; color: #d5e6dc; }

.auth-switch {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.auth-switch a {
  color: #e6eee8;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background .15s ease;
}

.auth-switch a:hover, .auth-switch a[aria-current] {
  background: #bef264;
  color: #0e241c;
  border-color: #bef264;
}

.auth-form-panel {
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-panel h3 { font-size: 1.3rem; margin: 0 0 .35rem; }
.auth-form-panel .muted { margin: 0 0 1.25rem; font-size: .92rem; }
.auth-form-panel button { width: 100%; margin-top: .25rem; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
}

.desktop-nav { display: grid; gap: .75rem; }
.nav-group { display: grid; gap: .15rem; }
.nav-group-label {
  margin: 0;
  padding: .2rem .75rem;
  color: #b4cbbd;
  font-size: .75rem;
  font-weight: 700;
}

.desktop-nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #cfe0d6;
  text-decoration: none;
  border-radius: .6rem;
  padding: .6rem .75rem;
  font-size: .92rem;
  font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .12s ease;
}

.desktop-nav a svg { width: 1.1rem; height: 1.1rem; flex: none; opacity: .82; }
.desktop-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.desktop-nav a[aria-current] {
  background: rgba(217, 234, 169, .16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #a3e635;
}
.desktop-nav a[aria-current] svg { opacity: 1; color: #bef264; }

.nav-badge {
  margin-left: auto;
  background: #f59e0b;
  color: #16221c;
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  line-height: 1.3;
}

.mobile-nav { display: none; }

.account {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: .9rem .45rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.account-user { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.account-avatar {
  width: 2rem; height: 2rem; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #d9eaa9;
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; flex: none;
}
.account-name { font-size: .88rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { display: block; font-size: .74rem; color: #9fc0af; }
.account form { margin: 0; }

/* Main content */
main {
  width: 100%;
  padding: 0;
}

.page-body {
  padding: .6rem clamp(.55rem, 1.2vw, .95rem) 1rem;
}

/* Top App Bar (Header) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .6rem clamp(.85rem, 2vw, 1.75rem);
  margin: 0;
  box-shadow: 0 1px 4px rgba(14, 36, 28, .05);
}

.topbar-left { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.topbar-crumb { font-size: .82rem; color: var(--muted); font-weight: 600; }
.topbar-search {
  flex: 1 1 14rem;
  max-width: 24rem;
  display: flex;
  align-items: center;
  position: relative;
}
.topbar-search svg {
  position: absolute;
  left: .65rem;
  width: .95rem;
  height: .95rem;
  color: var(--muted);
  pointer-events: none;
}
.topbar-search input {
  width: 100%;
  min-height: 2.15rem;
  padding: .3rem .75rem .3rem 2.1rem;
  font-size: .84rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.topbar-search input:focus { background: #fff; }
.topbar-right { display: flex; align-items: center; gap: .45rem; position: relative; }

.topbar-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .65rem; border-radius: .55rem;
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--ink); font-size: .82rem; font-weight: 600;
  text-decoration: none; cursor: pointer; min-height: 2.15rem;
  list-style: none;
}
.topbar-btn:hover { border-color: var(--green); color: var(--green); }
.topbar-btn::-webkit-details-marker { display: none; }
.topbar-btn svg { width: 1rem; height: 1rem; flex: none; }

.topbar-badge {
  background: var(--rose);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .08rem .4rem;
  border-radius: 999px;
  line-height: 1.25;
}

.topbar-pop { position: relative; }
.topbar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .45rem);
  width: min(21rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .85rem;
  box-shadow: var(--shadow-md);
  padding: .55rem;
  z-index: 40;
  display: grid;
  gap: .3rem;
}

.topbar-menu-head {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: .25rem .45rem;
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .5rem .6rem;
  border-radius: .55rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
}
.notif-item:hover { background: var(--surface-alt); border-color: var(--border); }
.notif-item strong { font-size: .85rem; }
.notif-item span { font-size: .78rem; color: var(--muted); }
.topbar-menu form button { width: 100%; justify-content: flex-start; }

.page-header, .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  flex-wrap: wrap;
}

.page-header { margin-bottom: .65rem; }
.page-header-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.date, .muted, .empty { color: var(--muted); }
.date { margin: 0 0 .15rem; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--green); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.45rem, 2.8vw, 1.9rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
h2 { font-size: 1.08rem; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -.015em; }
.section-head h2 { margin: 0; }
h3 { margin: 0; font-size: .96rem; font-weight: 700; }

/* Cards */
.card, .metrics article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .8rem;
  margin-bottom: .55rem;
  box-shadow: var(--shadow-sm);
}

.card > h2:first-child,
.card > .section-head:first-child {
  padding-bottom: .38rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid #edf2ed;
}

.card > h2:first-child {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card > h2:first-child::before {
  content: "";
  width: .3rem;
  height: 1.15rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green) 0%, var(--green-bright) 100%);
  flex: none;
}

.narrow { max-width: 30rem; margin-inline: auto; margin-top: 1.5rem; }

/* Hero Pulse Banner */
.hero-banner {
  background: linear-gradient(135deg, #0f2c21 0%, #194b36 55%, #1e5f44 100%);
  color: #fff;
  border-radius: .55rem;
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(163, 230, 53, .16) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #bef264;
  margin-bottom: .4rem;
}

.hero-banner h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  color: #fff;
  margin: 0 0 .35rem;
}

.hero-sub { color: #cce3d6; margin: 0 0 1rem; font-size: .95rem; max-width: 42rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.hero-actions .button, .hero-actions button {
  background: #bef264;
  color: #0e241c;
  border-color: #bef264;
  font-weight: 700;
}
.hero-actions .button.ghost, .hero-actions button.ghost {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .24);
}
.hero-actions .button.ghost:hover { background: rgba(255, 255, 255, .2); filter: none; }

.hero-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  position: relative;
  z-index: 1;
}

.ring-wrap { position: relative; width: 6.5rem; height: 6.5rem; display: grid; place-items: center; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 8; }
.ring-fg { fill: none; stroke: #bef264; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .7s ease; }
.ring-label {
  position: absolute;
  text-align: center;
  line-height: 1.1;
}
.ring-label strong { display: block; font-size: 1.35rem; font-weight: 800; color: #fff; }
.ring-label span { font-size: .7rem; color: #cce3d6; text-transform: uppercase; letter-spacing: .04em; }

/* Metrics Grid */
.metrics {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  margin-bottom: .75rem;
}

.metrics article {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--green);
  background: linear-gradient(180deg, #ffffff 0%, #fafcfa 100%);
  transition: transform .16s ease, box-shadow .16s ease;
}

.metrics article.metric-amber { border-top-color: var(--amber); }
.metrics article.metric-blue { border-top-color: var(--blue); }
.metrics article.metric-rose { border-top-color: var(--rose); }

.metrics article:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.metric-title { font-size: .84rem; font-weight: 600; color: var(--muted); }
.metric-icon {
  width: 2rem; height: 2rem; border-radius: .55rem;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green);
}
.metric-icon svg { width: 1.05rem; height: 1.05rem; }
.metric-sub { font-size: .55em; font-weight: 600; }
.sub-note { font-size: .84rem; }
.link-action { font-size: .86rem; font-weight: 600; text-decoration: none; }
.link-action:hover { text-decoration: underline; }
.map-frame {
  width: 100%;
  height: 18rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  margin-top: .75rem;
  background: var(--surface-alt);
  display: block;
}
.metric-amber .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric-blue .metric-icon { background: var(--blue-soft); color: var(--blue); }
.metric-rose .metric-icon { background: var(--rose-soft); color: var(--rose); }

.metrics strong { font-size: clamp(1.55rem, 2.5vw, 2.1rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.metrics small { color: var(--muted); font-size: .82rem; }

/* Progress Bars */
.progress-track {
  width: 100%;
  height: .45rem;
  border-radius: 999px;
  background: #e8eee8;
  overflow: hidden;
  margin-top: .15rem;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-bright) 100%);
  transition: width .65s cubic-bezier(.22, 1, .36, 1);
}
.progress-fill.amber { background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%); }
.progress-fill.blue { background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%); }

/* Dashboard 2-col Grid */
.dash-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-bottom: .75rem;
}
.dash-grid > .card { margin-bottom: 0; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }

/* 7-day Trend Chart */
.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .6rem;
  align-items: end;
  padding-top: .75rem;
  position: relative;
}

.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  justify-content: flex-end;
  position: relative;
}

.trend-bar-wrap {
  width: 100%;
  max-width: 2.6rem;
  height: 8.5rem;
  background: #f1f5f1;
  border-radius: .5rem;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform .15s ease;
}
.trend-bar-wrap:hover { transform: scaleY(1.03); }

.seg-delivered { background: #10b981; width: 100%; transition: height .5s ease; }
.seg-pending { background: #f59e0b; width: 100%; transition: height .5s ease; }
.seg-missed { background: #ef4444; width: 100%; transition: height .5s ease; }

.trend-count { font-size: .76rem; font-weight: 700; color: var(--ink); }
.trend-day { font-size: .74rem; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.15; }
.trend-col.is-today .trend-day { color: var(--green); font-weight: 700; }
.trend-col.is-today .trend-bar-wrap { box-shadow: 0 0 0 2px var(--green); }

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .85rem; padding-top: .65rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.legend-dot { width: .6rem; height: .6rem; border-radius: 999px; display: inline-block; }
.dot-delivered { background: #10b981; }
.dot-pending { background: #f59e0b; }
.dot-missed { background: #ef4444; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  background: #0e241c;
  color: #fff;
  padding: .45rem .7rem;
  border-radius: .5rem;
  font-size: .78rem;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

/* Slot Cards */
.slot-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin-top: .75rem;
}

.slot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.slot-head { display: flex; align-items: center; justify-content: space-between; }
.slot-tag {
  font-size: .76rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
}
.slot-breakfast .slot-tag { background: var(--amber-soft); color: #92400e; }
.slot-dinner .slot-tag { background: var(--indigo-soft); color: #3730a3; }
.slot-total { font-size: 1.35rem; font-weight: 800; }
.slot-stages { display: flex; flex-wrap: wrap; gap: .35rem; }

/* Rider Workload & Bar Lists */
.rider-list, .bar-list { display: grid; gap: .75rem; margin-top: .75rem; }
.rider-row, .bar-row {
  display: grid;
  gap: .35rem;
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.rider-top, .bar-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.rider-name { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.mini-avatar {
  width: 1.65rem; height: 1.65rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; font-size: .74rem; font-weight: 700; flex: none;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .58rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  background: #edf2ee;
  color: var(--ink);
  white-space: nowrap;
}
.badge-delivered, .badge-active, .badge-credited, .badge-approved, .badge-packed, .badge-pinned, .badge-default, .badge-paid {
  background: var(--green-soft); color: #115e3f;
}
.badge-pending, .badge-requested, .badge-upcoming, .badge-topack, .badge-nopin, .badge-renewaldue {
  background: var(--amber-soft); color: #92400e;
}
.badge-missed, .badge-rejected, .badge-declined, .badge-cancelled, .badge-ended {
  background: var(--rose-soft); color: #991b1b;
}
.badge-paused, .badge-skipped, .badge-scheduled, .badge-lunch, .badge-monthly {
  background: var(--blue-soft); color: #1e40af;
}
.badge-breakfast, .badge-onetime {
  background: var(--amber-soft); color: #92400e;
}
.badge-dinner {
  background: var(--indigo-soft); color: #3730a3;
}
.badge-weekly {
  background: var(--green-soft); color: #115e3f;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .22rem .58rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.chip .mini-avatar { width: 1.3rem; height: 1.3rem; font-size: .65rem; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .22rem; }
.nowrap { white-space: nowrap; }

/* Weekday Pills */
.day-pills { display: inline-flex; gap: .2rem; margin-top: .25rem; flex-wrap: wrap; }
.day-pill {
  width: 1.35rem; height: 1.35rem; border-radius: .35rem;
  display: grid; place-items: center;
  font-size: .68rem; font-weight: 700;
  background: #edf2ee; color: #8da095;
}
.day-pill.on { background: var(--green); color: #fff; }

/* Fields, Forms, Buttons */
.fields, .workflow {
  display: grid;
  gap: .55rem .75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.fields {
  background: #f8fbf8;
  border: 1px solid #e5ede5;
  border-radius: var(--radius-sm);
  padding: .65rem;
  margin-bottom: .6rem;
}
.fields label { margin-bottom: 0; }

.workflow { margin-top: .7rem; }
.workflow a {
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.workflow a { text-decoration: none; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.workflow a:hover { border-color: var(--green); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

a { color: var(--green); }
label { display: grid; gap: .3rem; margin-bottom: .7rem; font-weight: 600; font-size: .82rem; color: #36473d; letter-spacing: .01em; }

input, select, textarea {
  width: 100%; min-width: 0; padding: .48rem .72rem;
  border: 1px solid #c3d0c5; border-radius: .55rem;
  font: inherit; font-size: .9rem; background: #fff; color: var(--ink); min-height: 2.45rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #9cb3a1; }
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 91, 65, .14);
  outline: none;
}
textarea { resize: vertical; }
input[type="file"] {
  border: 1.5px dashed #9cb3a1;
  background: #f8fbf8;
  padding: .5rem;
  border-radius: .65rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #b7d7c5;
  border-radius: .45rem;
  padding: .32rem .75rem;
  margin-right: .7rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #d5eee2; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.45rem; border: 1px solid var(--green); border-radius: .55rem;
  background: linear-gradient(135deg, #165b41 0%, #1d7654 100%);
  color: #fff; padding: .44rem .95rem;
  font: inherit; font-size: .86rem; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 91, 65, .2);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, .button:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(22, 91, 65, .26); }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
button svg, .button svg { width: 1rem; height: 1rem; flex: none; }

.secondary, .quiet { color: var(--green); background: #fff; border-color: #c3d0c5; box-shadow: none; }
.secondary:hover { background: var(--surface-alt); border-color: var(--green); box-shadow: 0 2px 6px rgba(14, 36, 28, .08); }
.quiet { border-color: rgba(255, 255, 255, .25); color: #fff; background: transparent; min-height: 2.1rem; padding: .28rem .65rem; font-size: .8rem; box-shadow: none; }
.quiet:hover { background: rgba(255, 255, 255, .12); filter: none; transform: none; }

:focus-visible { outline: 3px solid #d97706; outline-offset: 2px; }

/* Tables */
.scroll { overflow-x: auto; }
.action-table td { vertical-align: top; }
.action-table td[data-label="Actions"] { min-width: 9rem; }
.action-table:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.action-dialog {
  width: min(48rem, calc(100% - 2rem));
  max-height: calc(100vh - 3.5rem);
  max-height: calc(100dvh - 3.5rem);
  margin: auto;
  padding: .75rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 48px rgba(14, 36, 28, .24);
  overflow: auto;
  overflow-wrap: anywhere;
}
.action-dialog:focus, .action-dialog:focus-visible { outline: none; }
.action-dialog::backdrop { background: rgba(14, 36, 28, .55); backdrop-filter: blur(2px); }
.action-dialog-heading {
  position: sticky;
  top: -.85rem;
  z-index: 2;
  background: var(--surface);
  align-items: center;
  padding: .65rem 0 .45rem;
  margin: -.85rem 0 .6rem;
  border-bottom: 1px solid #edf2ed;
}
.action-dialog-heading h2 { margin: 0; font-size: 1.12rem; }
.action-dialog-heading p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.action-dialog-heading button { flex: none; }
.action-dialog > form,
.action-dialog > .actions,
.action-dialog > .record { margin-bottom: .85rem; }
.action-dialog > :last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; margin-top: .4rem; }
th, td { text-align: left; padding: .42rem .55rem; border-bottom: 1px solid var(--border); font-size: .84rem; }
th { color: var(--muted); background: var(--surface-alt); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .38rem .55rem; }
tbody tr:hover td { background: #fafcfa; }
td { vertical-align: middle; }

.actions input[type="search"] { width: min(16rem, 100%); }

/* Alerts, Notices & Toasts */
.status, .notice, .alert { border-radius: var(--radius-sm); padding: .65rem .9rem; overflow-wrap: anywhere; font-weight: 500; margin-bottom: 1rem; }
.notice { color: #115e3f; background: var(--green-soft); border: 1px solid #b7e4ce; }
.status { color: #115e3f; background: var(--green-soft); font-size: .84rem; padding: .35rem .65rem; margin-bottom: 0; }
.alert { color: #991b1b; background: var(--rose-soft); border: 1px solid #fecaca; }

.toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: grid;
  gap: .65rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: .85rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(14, 36, 28, .18);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.4;
  animation: toastIn .28s cubic-bezier(.22, 1, .36, 1);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-leaving { opacity: 0; transform: translateY(-8px) scale(.98); }

.toast-icon { width: 1.25rem; height: 1.25rem; flex: none; margin-top: .1rem; }
.toast-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.toast-error { border-left: 4px solid var(--rose); color: #7f1d1d; background: #fffafa; }
.toast-error .toast-icon { color: var(--rose); }

.toast-notice { border-left: 4px solid var(--green-bright); color: #064e3b; background: #f8fdfb; }
.toast-notice .toast-icon { color: var(--green-bright); }

.toast-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 1.6rem;
  width: 1.6rem;
  padding: 0;
  border-radius: .4rem;
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}
.toast-close:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 575px) {
  .toast-stack { top: .75rem; left: .75rem; right: .75rem; width: auto; }
}

.actions { display: flex; flex-wrap: wrap; gap: .45rem; }

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green);
  padding: .35rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
summary::-webkit-details-marker { display: none; }
.record > summary::after {
  content: "+";
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
  transition: transform .15s ease, background .15s ease;
}
.record[open] > summary::after {
  content: "−";
  background: var(--green);
  color: #fff;
}

/* Master Data Hub Cards */
.master-datasets { margin-bottom: 1rem; }
.master-datasets a[aria-current] { text-decoration: underline; text-underline-offset: .2em; }
.masters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}
.masters-grid .card { margin: 0; }
.masters-links { display: grid; gap: .45rem; }
.masters-links a {
  display: flex;
  gap: .65rem;
  padding: .65rem;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.masters-links a:hover { background: var(--green-soft); }
.masters-links svg { width: 1.15rem; height: 1.15rem; flex: none; color: var(--green); }
.masters-links small { display: block; color: var(--muted); }
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: 1rem;
}
.list-pagination p, .list-pagination nav { margin: 0; }
.list-pagination a { text-decoration: none; }
.list-anchor { scroll-margin-top: 1rem; }
.master-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.master-card:hover { box-shadow: var(--shadow-sm); border-color: #b7c9bb; }
.master-card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.master-card-title { display: flex; align-items: center; gap: .6rem; }
.col-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.col-pill {
  font-size: .74rem;
  font-weight: 600;
  padding: .16rem .5rem;
  border-radius: .4rem;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
}
.master-card form { margin-top: auto; padding-top: .5rem; border-top: 1px dashed var(--border); }
.record {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3.5px solid #a8bfa9;
  border-radius: var(--radius-sm);
  padding: .42rem .75rem;
  margin-bottom: .45rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.record:hover { border-color: #9bb8a0; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.record[open] {
  background: #fff;
  border-color: var(--green);
  border-left-color: var(--green);
  box-shadow: var(--shadow-md);
  padding-bottom: .95rem;
  transform: none;
}
.record[open] > summary {
  padding-bottom: .6rem;
  margin-bottom: .65rem;
  border-bottom: 1px solid #edf2ed;
}
.record .record { margin-top: .65rem; background: var(--surface-alt); border-left-width: 2.5px; }

.date-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; }
.date-filter label { margin-bottom: 0; }
.gps { margin-bottom: .65rem; }


.kitchen-slot { margin-top: 1rem; }
.cell-note { display: block; color: var(--muted); font-size: .82rem; margin-top: .18rem; overflow-wrap: anywhere; }
.skip-link { min-height: 2.2rem; display: inline-flex; align-items: center; color: var(--green); font-size: .84rem; font-weight: 600; }

.attention a { display: flex; gap: .75rem; align-items: center; text-decoration: none; justify-content: flex-start; }
.attention strong {
  min-width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--amber-soft); color: #92400e; font-size: 1.15rem; flex: none;
}
.attention strong.is-zero { background: #edf2ee; color: var(--muted); }

/* Filter Pills */
.filter-links, .filter-pills { display: flex; flex-wrap: wrap; gap: .45rem; margin: .75rem 0 1rem; }
.filter-links a, .filter-pill {
  padding: .42rem .85rem; border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; font-size: .86rem; font-weight: 600;
  background: #fff; color: var(--ink); cursor: pointer; min-height: 2.2rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.filter-links [aria-current], .filter-pill.is-active {
  background: var(--green); color: #fff; border-color: var(--green);
}
.filter-pill:hover:not(.is-active), .filter-links a:hover:not([aria-current]) {
  background: var(--surface-alt); border-color: var(--green);
}

.service-days { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.service-days legend { padding: 0; margin: 0 0 .4rem; font-weight: 600; font-size: .88rem; }
.service-days label {
  display: flex; align-items: center; gap: .35rem; min-height: 2.5rem;
  padding: .3rem .65rem; margin: 0; border: 1px solid var(--border); border-radius: .5rem; cursor: pointer;
}
.service-days label:has(:checked) { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.service-days input[type=checkbox] { width: 1rem; height: 1rem; min-height: 0; accent-color: var(--green); }

/* Customer directory card summary */


/* Responsive */
@media (max-width: 960px) {
  .span-7, .span-5, .span-6 { grid-column: span 12; }
  .hero-banner { grid-template-columns: 1fr; }
  .hero-ring { flex-direction: row; justify-content: flex-start; gap: 1rem; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: .5rem .75rem; gap: .45rem; }
  .topbar-search { order: 3; flex: 1 0 100%; max-width: none; }
  .layout { display: block; }
  aside {
    position: sticky; top: 0; z-index: 15; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: .55rem .9rem; gap: .6rem;
    box-shadow: 0 2px 12px rgba(14, 36, 28, .22);
  }
  .brand { padding: .3rem .5rem; border-radius: .65rem; gap: .5rem; }
  .brand-logo { height: 2rem; }
  .brand small { display: none; }
  .desktop-nav { display: none; }
  .account { border-top: 0; padding: 0; margin-top: 0; gap: .5rem; }
  .account-role { display: none; }
  .account-name { max-width: 6.5rem; font-size: .82rem; }
  main { padding: 0; }
  .page-body { padding: .9rem .9rem calc(5.8rem + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed; z-index: 20; inset: auto 0 0;
    display: flex; gap: .15rem;
    padding: .35rem max(.25rem, env(safe-area-inset-right))
      calc(.35rem + env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left));
    background: var(--sidebar);
    box-shadow: 0 -4px 18px rgba(14, 36, 28, .28);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .mobile-nav > * { flex: 1; min-width: 0; }
  .mobile-nav > a, .mobile-more > summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem; min-height: 3.35rem; padding: .35rem .15rem;
    color: #cfe0d6; font-size: .7rem; font-weight: 600; text-align: center; text-decoration: none;
  }
  .mobile-nav svg, .mobile-more > summary svg { width: 1.15rem; height: 1.15rem; flex: none; }
  .mobile-nav a[aria-current], .mobile-more summary.current, .mobile-more[open] > summary {
    background: rgba(217, 234, 169, .18); color: #fff; border-radius: .6rem;
  }
  .mobile-more > summary { list-style: none; cursor: pointer; }
  .mobile-more > summary::-webkit-details-marker { display: none; }
  .mobile-more-links {
    position: absolute; right: max(.5rem, env(safe-area-inset-right)); bottom: 100%;
    width: min(17rem, calc(100% - 1rem)); max-height: 65vh; overflow: auto;
    padding: .45rem; border-radius: .85rem .85rem 0 0;
    background: var(--sidebar); box-shadow: 0 -6px 24px rgba(14, 36, 28, .35);
    display: grid; gap: .2rem;
  }
  .mobile-more-links a {
    display: flex; align-items: center; gap: .6rem;
    padding: .65rem .75rem; border-radius: .55rem;
    color: #e6eee8; font-size: .92rem; font-weight: 500; text-decoration: none;
  }
  .mobile-more-links a svg { width: 1.05rem; height: 1.05rem; opacity: .85; }
  html { scroll-padding-bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: max(16px, 1em); }
  .workflow { gap: .6rem; grid-template-columns: 1fr; }
  .page-header-actions { width: 100%; }
  .page-header-actions .button { flex: 1 1 auto; }
}

@media (max-width: 575px) {
  .fields { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .date-filter label { flex: 1 1 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions form { display: flex; }
  .hero-actions form button { width: 100%; }
  .trend-chart { gap: .3rem; }
  .scroll:not(.action-table) table, .scroll:not(.action-table) tbody { display: block; }
  .scroll:not(.action-table) thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .scroll:not(.action-table) tr { display: block; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .7rem; padding: .6rem .8rem; background: #fff; box-shadow: var(--shadow-sm); }
  .scroll:not(.action-table) td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem .6rem; border: 0; padding: .35rem 0; border-bottom: 1px dashed #edf2ed; text-align: right; }
  .scroll:not(.action-table) td:last-child { border-bottom: 0; }
  .scroll:not(.action-table) td::before { content: attr(data-label); color: var(--muted); font-weight: 600; font-size: .8rem; margin-right: auto; text-align: left; }
  .scroll:not(.action-table) td .progress-track { flex: 1 0 100%; }
}

@media (max-width: 420px) {
  .trend-day small { display: none; }
}

@media print {
  aside, .topbar, .mobile-nav, .toast-stack, .actions, form, .filter-pills, .filter-links, .page-header-actions { display: none !important; }
  .layout { display: block; }
  .page-body { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  details.record { border: 1px solid #ddd; }
}

.meal-plan-editor {
  display: grid;
  gap: .45rem;
}
.meal-plan-editor input:not([type="checkbox"]):not([type="radio"]),
.meal-plan-editor select,
.meal-plan-editor button {
  min-height: 2.05rem;
  padding: .28rem .55rem;
  font-size: .84rem;
}
.meal-plan-editor label { font-size: .78rem; gap: .18rem; margin-bottom: 0; }
.meal-summary-banner {
  background: linear-gradient(135deg, #0f2c21 0%, #194b36 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: .45rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem .6rem;
}
.meal-summary-banner small {
  display: inline;
  margin-right: .4rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #bef264;
  font-weight: 700;
}
.meal-summary-banner strong { font-size: .9rem; font-weight: 700; }
.meal-summary-banner .chip {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: .72rem;
  padding: .12rem .45rem;
}
.meal-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .6rem;
  display: grid;
  gap: .38rem;
}
.meal-section-title {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green);
  padding-bottom: .22rem;
  border-bottom: 1px solid #edf2ed;
}
.meal-section-title span {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 800;
}
.meal-plan-editor [hidden] { display: none; }
.meal-plan-top {
  display: grid;
  grid-template-columns: 1.35fr 1fr auto;
  align-items: end;
  gap: .5rem;
}
.meal-sched-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  align-items: stretch;
}
.meal-item-row, .meal-item-quantity, .meal-toggle {
  display: flex;
  align-items: flex-end;
  gap: .45rem;
}
.meal-item-row > label { flex: 1; min-width: 0; }
.meal-toggle {
  flex-direction: row;
  align-items: center;
  white-space: nowrap;
  min-height: 2.05rem;
  padding: 0 .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
}
.meal-varies .meal-toggle { border: 0; background: transparent; padding: 0; min-height: 1.9rem; }
.meal-plan-editor fieldset { min-width: 0; }
.meal-plan-editor fieldset > legend {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 0 .3rem;
}
.meal-frequency { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.meal-frequency, .meal-items, .meal-varies, .meal-weekdays {
  margin: 0;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  background: #f8fbf8;
  border-radius: var(--radius);
}
.meal-frequency label { position: relative; cursor: pointer; display: block; }
.meal-frequency input { position: absolute; opacity: 0; min-height: 0; width: 0; height: 0; }
.meal-frequency span {
  display: block;
  padding: .32rem .55rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: .8rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.meal-frequency input:checked + span {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.meal-frequency input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.meal-item-row {
  padding: .35rem .45rem;
  margin-bottom: .35rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.meal-item-quantity { align-items: flex-end; gap: .25rem; }
.meal-item-quantity input { width: 3rem; text-align: center; }
.meal-item-quantity button, .meal-remove { min-width: 2.05rem; padding-inline: .5rem; }
.meal-save { width: 100%; margin-top: .1rem; }
.meal-cycle { border: 0; padding: 0; margin: 0; }
.meal-plan-editor .meal-weekdays { margin: 0; padding: .35rem .5rem; gap: .28rem; }
.meal-plan-editor .meal-weekdays label {
  border-radius: 999px;
  min-height: 1.9rem;
  padding: .16rem .48rem;
  font-size: .76rem;
  gap: .22rem;
}
@media (max-width: 600px) {
  .meal-plan-top, .meal-sched-row { grid-template-columns: 1fr; }
}
.meal-plan-editor .meal-weekdays label:has(:checked) {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.meal-plan-editor input[type=checkbox] { accent-color: var(--green); }
@media (max-width: 520px) {
  .meal-plan-top { flex-direction: column; align-items: stretch; }
  .meal-item-row > label { flex-basis: 100%; }
  .meal-remove { margin-left: auto; }
}
.meal-plan-editor .meal-toggle input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 2.5rem;
  height: 1.4rem;
  min-height: 0;
  padding: .2rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #b5c3b8;
  cursor: pointer;
  transition: background .18s ease;
}
.meal-toggle input::before {
  content: "";
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.meal-toggle input:checked { background: var(--green); }
.meal-toggle input:checked::before { transform: translateX(1.1rem); }
.meal-toggle input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.plan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .45rem 0 .75rem;
}
.plan-toolbar .filter-links { margin: 0; }
.view-switch {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .18rem;
  gap: .18rem;
}
.view-switch button {
  min-height: 1.95rem;
  padding: .22rem .65rem;
  font-size: .8rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.view-switch button:hover { color: var(--ink); transform: none; filter: none; box-shadow: none; }
.view-switch button.is-active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 3px rgba(14, 36, 28, .12);
}

.plan-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  margin-top: .5rem;
}
.plan-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plan-card.plan-upcoming { border-top-color: var(--blue); }
.plan-card.plan-renewal { border-top-color: var(--amber); }
.plan-card.plan-ended { border-top-color: #9ca3af; opacity: .9; }

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.plan-card-meal {
  background: var(--surface-alt);
  border: 1px solid #e6eee6;
  border-radius: var(--radius-sm);
  padding: .65rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.plan-meal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.plan-meal-title { font-size: .98rem; font-weight: 700; color: var(--ink); }
.plan-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .75rem;
  font-size: .84rem;
}
.plan-meta-item small { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.plan-meta-item strong { font-size: .86rem; color: var(--ink); }
.plan-pay { display: flex; flex-direction: column; gap: .3rem; }
.plan-pay-top { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; gap: .5rem; }
.plan-card-foot {
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px solid #edf2ed;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.plan-card-foot .button { flex: 1 1 auto; font-size: .82rem; min-height: 2.15rem; padding: .3rem .65rem; }
.veg-dot {
  display: inline-flex; align-items: center; gap: .28rem;
  font-size: .74rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px;
  background: var(--green-soft); color: #115e3f;
}
.veg-dot.nonveg { background: var(--rose-soft); color: #991b1b; }

.meal-item-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.meal-item-actions button:first-child { flex: 1; }
.meal-menu-status { margin: 0; font-size: .86rem; color: var(--muted); }
.meal-menu-status:empty { display: none; }
.meal-item-row > [data-custom-item] { flex-basis: 100%; order: 1; }
