:root{
  --bg: #ffffff;
  --panel: #ffffff;
  --panel2: #f8f9fa;
  --text: #2d3748;
  --muted: #718096;
  --border: rgba(0,0,0,.08);
  --accent: #f472b6;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --focus: #ec4899;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 16px;
  --radius2: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --space-xs: clamp(4px, 1vw, 8px);
  --space-sm: clamp(8px, 1.5vw, 12px);
  --space-md: clamp(12px, 2.5vw, 20px);
  --space-lg: clamp(14px, 3vw, 24px);
  --space-xl: clamp(20px, 4vw, 32px);
  --touch: clamp(40px, 10vw, 48px);
  
  /* Pastel section colors - soft, premium pastels */
  --pastel-daily: linear-gradient(135deg, #fff5f7 0%, #fce7f3 100%);
  --pastel-allergens: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
  --pastel-production: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  --pastel-availability: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  --pastel-orders: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f5d0fe 100%);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; overflow-x: hidden; }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(135deg, #fff5f7 0%, #f8f4ff 25%, #f0fdf4 50%, #fffbeb 75%, #fff5f7 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  min-height: 100vh;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

a{ color: inherit; }

[hidden]{
  display: none !important;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 999;
}
.skip-link:focus{ left: 12px; top: 12px; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.topbar__inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.brand__logo{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f472b6, #fb923c);
  color: #ffffff;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.brand__name{ font-weight: 850; letter-spacing: .2px; }
.brand__tag{ font-size: 12px; color: var(--muted); margin-top: 1px; }

.topbar__actions{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.account-menu{
  position: relative;
}
.account-button{
  appearance: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--panel2);
  color: var(--muted);
  box-shadow: var(--shadow);
  transition: transform .05s ease, box-shadow .15s ease, color .15s ease;
}
.account-button:hover{
  color: var(--text);
}
.account-button:hover{
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  color: var(--text);
}
.account-button:focus{
  outline: none;
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .25), var(--shadow-lg);
}
.account-menu__panel{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  width: min(300px, 82vw);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-lg);
}
.account-menu__eyebrow{
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.account-menu__email{
  margin-top: 3px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.account-menu__signout{
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(239,68,68,.07);
  color: var(--danger);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}
.account-menu__signout:hover{
  background: rgba(239,68,68,.12);
}
.account-menu__signout:disabled{
  cursor: wait;
  opacity: .7;
}
.account-menu__signout-icon{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(239,68,68,.12);
  flex-shrink: 0;
}

.sync-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.sync-dot--synced{
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(34,197,94,.2);
}
.sync-dot--saving{
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245,158,11,.2);
  animation: syncPulse 0.8s ease-in-out infinite;
}
.sync-dot--offline{
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239,68,68,.2);
}
@keyframes syncPulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.45; }
}

input[type="date"]{
  appearance: none;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
input[type="date"]:focus{
  border-color: rgba(244, 114, 182, .5);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .15);
}

.btn{
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow);
}
.btn:hover{ 
  background: rgba(255,255,255,1);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(1px); }
.btn:focus{
  outline: none;
  border-color: rgba(244, 114, 182, .5);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .15);
}
.btn--primary{
  background: linear-gradient(135deg, rgba(244,114,182,.18), rgba(251,146,60,.18));
  border-color: rgba(244,114,182,.35);
}
.btn--danger{
  border-color: rgba(255,110,110,.35);
  background: rgba(255,110,110,.12);
}
.btn--tiny{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.btn--icon{
  padding: var(--space-sm);
  min-width: var(--touch);
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.copy-icon{
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
}
.copy-icon::before,
.copy-icon::after{
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  background: rgba(255,255,255,.65);
}
.copy-icon::before{
  left: 2px;
  top: 1px;
  opacity: .55;
}
.copy-icon::after{
  left: 5px;
  top: 4px;
}
.menu-icon{
  display: block;
  width: 22px;
  height: 18px;
  background: linear-gradient(
    to bottom,
    currentColor 0 2px,
    transparent 2px 7px,
    currentColor 7px 9px,
    transparent 9px 15px,
    currentColor 15px 17px
  );
  border-radius: 2px;
}

.banner-area{
  max-width: 1200px;
  margin: var(--space-md) auto 0;
  padding: 0 var(--space-md);
  display: grid;
  gap: var(--space-sm);
}
.banner{
  border: 1px solid rgba(244,114,182,.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(244,114,182,.16), rgba(251,146,60,.16));
  box-shadow: var(--shadow);
  padding: 12px 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 100%;
  overflow: hidden;
}
.banner__text{ color: var(--text); flex: 1; min-width: 0; }
.banner__title{ font-weight: 800; margin-bottom: 2px; word-wrap: break-word; }
.banner__meta{ color: var(--muted); font-size: 13px; word-wrap: break-word; }
.banner__action-btn{ min-width: 8.5rem; text-align: center; }
.banner__actions{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.banner--warn{ border-color: rgba(245,158,11,.32); }
.banner--danger{ border-color: rgba(239,68,68,.32); }
.banner--ok{ border-color: rgba(16,185,129,.28); }
.banner__dismiss{
  flex-shrink: 0;
  margin-left: auto;
  background: transparent;
  border-color: transparent;
  font-weight: 700;
  font-size: 1.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  padding: 0.25rem;
  box-sizing: border-box;
}
.banner__dismiss:hover{ background: rgba(0,0,0,.06); }

@media (max-width: 768px){
  .banner{
    flex-wrap: nowrap !important;
    padding: 10px 8px !important;
    gap: 8px !important;
  }
  .banner__text{
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-right: 0 !important;
  }
  .banner__actions{
    flex: 0 1 auto !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }
  .banner__dismiss{
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.125rem !important;
    padding: 0 !important;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
  }
}

.layout{
  max-width: min(100%, 1200px);
  margin: 0 auto;
  padding: var(--space-md);
  display: grid;
  grid-template-columns: minmax(min(200px, 100%), 260px) minmax(0, 600px);
  gap: var(--space-md);
}
.sidebar{
  position: sticky;
  top: 70px;
  align-self: start;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: var(--space-sm);
  box-shadow: var(--shadow);
  pointer-events: auto;
}
.navlink{
  display: block;
  padding: var(--space-sm);
  border-radius: var(--radius2);
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .15s ease;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.navlink:hover{ 
  background: rgba(139,92,246,.08);
  transform: translateX(4px);
}
.navlink.is-active{
  background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(236,72,153,.15));
  border-color: rgba(139,92,246,.3);
  box-shadow: 0 2px 8px rgba(139,92,246,.15);
}
.sidebar__divider{
  height: 1px;
  background: var(--border);
  margin: 10px 6px;
}

.sidebar-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 90;
  transition: opacity .2s ease;
}
.sidebar-overlay[aria-hidden="false"]{
  display: block;
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 700px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.95);
  padding: var(--space-md);
  padding-left: max(var(--space-md), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-md), env(safe-area-inset-right, 0px));
  padding-bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
}
@media (min-width: 981px){
  .main { max-width: 600px; align-self: start; }
}
@media (max-width: 980px){
  .main { max-width: 100%; }
}
.page-head{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.page-title{ font-size: clamp(18px, 4vw, 24px); margin: 0; letter-spacing: .2px; }
.page-subtitle{ color: var(--muted); font-size: 13px; }

.grid{
  display: grid;
  gap: var(--space-md);
}
.cards{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
  min-width: 0;
  margin-top: var(--space-lg);
}
.card{
  grid-column: span 12;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.dashboard-section-card{ cursor: pointer; }
.dashboard-section-card--daily{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,114,182,.08), rgba(251,146,60,.08));
  border-color: rgba(244,114,182,.18);
}
.dashboard-section-card--allergens{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(129,140,248,.09));
  border-color: rgba(129,140,248,.18);
}
.dashboard-section-card--production{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(16,185,129,.09));
  border-color: rgba(16,185,129,.18);
}
.dashboard-section-card--orders{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(251,146,60,.08), rgba(244,114,182,.07));
  border-color: rgba(251,146,60,.18);
}
.dashboard-section-card--availability{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(14,165,233,.08), rgba(251,191,36,.06));
  border-color: rgba(14,165,233,.16);
}
.dashboard-section-card--fsa{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(245,158,11,.08));
  border-color: rgba(245,158,11,.16);
}
/* Soft conditional status for dashboard cards */
.dashboard-status{
  font-weight: 400;
  font-size: 0.85em;
  color: var(--muted);
}
.dashboard-status--warn{
  color: #b45309;
}
.card--summary{ margin-top: var(--space-xl); }
.attention-card{ margin-top: 0; }
.attention-card__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.attention-date-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.attention-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.attention-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  touch-action: pan-y;
  transition: transform .16s ease, opacity .16s ease;
}
.attention-row__actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.attention-empty{
  color: var(--muted);
  padding: 8px 0;
}
.attention-empty--done{
  color: var(--ok);
  font-weight: 600;
  padding: 8px 0;
}
.empty-state{
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.6);
}
.empty-state__title{ font-weight: 700; }
.empty-state__hint{ color: var(--muted); line-height: 1.45; }
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card__title-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.card__title-row .card__title{ margin-bottom: 0; margin-right: auto; }

@media (max-width: 980px) {
  .allergen-card-wrap .card__title-row{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .allergen-card-wrap .card__title-row .btn{
    flex: 1 1 auto;
    min-width: 120px;
  }
}

.saved-indicator{
  opacity: 0;
  color: var(--ok);
  font-size: 14px;
  transition: opacity .2s ease;
  pointer-events: none;
}
.saved-indicator.saved-indicator--visible{
  opacity: 1;
}

/*
 * Daily-page saved indicator: a floating bottom-right pill that flashes for ~2s after
 * every persistDaily success. Lives outside the form flow so it never jumps the
 * scroll position or steals focus while the user is mid-edit.
 */
#page > .saved-indicator{
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--ok);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  z-index: 80;
}
#page > .saved-indicator::after{ content: " Saved"; }

.allergen-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.allergen-toolbar .input{ flex: 1; min-width: 160px; }
.allergen-toolbar .saved-indicator{ margin-left: 4px; }
.allergen-toolbar{ position: sticky; top: 60px; z-index: 10; background: rgba(255,255,255,.95); padding: var(--space-sm) 0; margin: calc(var(--space-sm) * -1) 0 var(--space-md); border-radius: var(--radius); }
.allergen-howto{
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(139,92,246,.18);
  border-radius: var(--radius2);
  background: rgba(139,92,246,.07);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.allergen-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.allergen-card{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 14px;
  background: rgba(255,255,255,.8);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  text-align: left;
}
.allergen-card:hover, .allergen-card:focus{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}
.allergen-card__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.allergen-card__title{ font-weight: 700; font-size: 15px; margin-bottom: 6px; margin-top: 4px; color: var(--text); }
.allergen-card__title:first-child{ margin-top: 0; }
.allergen-card__print{
  flex: 0 0 auto;
  min-width: 52px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.allergen-card__print:hover,
.allergen-card__print:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
  outline: none;
}
.allergen-card__contains{ font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 6px; }
.label-print-popup .field{ margin-bottom: 10px; }
.label-print-overlay{
  align-items: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.label-print-popup{
  max-width: min(420px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.label-print-status{
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 4px 0;
}

.allergen-popup-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}
.allergen-popup-modal{
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.allergen-popup-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.allergen-popup-title{ margin: 0; font-size: 18px; flex: 1; }
.allergen-popup-close{
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  color: var(--muted);
}
.allergen-popup-close:hover{ color: var(--text); }
.allergen-popup-body{ padding: 16px; }
.allergen-popup-body .field:first-of-type{ margin-bottom: 16px; }
.allergen-popup-section{ margin-bottom: 16px; margin-top: 12px; }
.allergen-popup-body .allergen-popup-section .label{ margin-bottom: 10px; }
.allergen-popup-checks{
  columns: 2 200px;
  column-gap: 16px;
}
.allergen-popup-check{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  break-inside: avoid;
  margin-bottom: 8px;
}
.allergen-popup-check input{ width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--accent); cursor: pointer; }
.allergen-popup-check label{ cursor: pointer; font-size: 13px; user-select: none; line-height: 1.4; }
.allergen-popup-disclaimer{
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(245,158,11,.08);
  border-top: 1px solid rgba(245,158,11,.15);
  line-height: 1.4;
}
.allergen-popup-footer{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.daily-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-wrap: wrap;
}

.daily-head__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.daily-completion {
  font-size: 0.9rem;
  color: var(--muted, #666);
}

.daily-jump-calendar-btn {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  user-select: none;
}

.daily-jump-date-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.daily-card-chooser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  position: sticky;
  top: 52px;
  z-index: 20;
  background: var(--bg, #fff);
  padding: 12px 0 14px;
  margin-left: 0;
  margin-right: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  box-shadow: 0 2px 0 rgba(0,0,0,.04);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.daily-card-chooser__label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text, #1f2937);
  flex-basis: 100%;
  margin-bottom: 2px;
}

.daily-card-chooser .btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--touch);
  padding: var(--space-sm) var(--space-md);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-card-chooser .btn.is-active {
  font-weight: 600;
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.daily-content-panel {
  min-height: 200px;
  position: relative;
}

.daily-section-content {
  padding: 16px 0;
  max-width: 100%;
}

/* 16px inputs avoid iOS zoom on focus; single column, no horizontal scroll */
.daily-content-panel input,
.daily-content-panel textarea,
.daily-content-panel select {
  font-size: 16px;
  max-width: 100%;
}

/* Fanned card stack for daily tasks */
.daily-stack-container {
  position: relative;
  min-height: clamp(400px, 80vw, 600px);
  margin: clamp(16px, 4vw, 30px) 0;
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.daily-stack {
  position: relative;
  width: 100%;
  max-width: min(100%, 500px);
  min-height: clamp(400px, 80vw, 600px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(16px, 4vw, 30px);
}

.daily-stack-card {
  position: absolute;
  width: min(96%, 480px);
  border-radius: clamp(16px, 4vw, 24px);
  padding: clamp(20px, 5vw, 40px) clamp(16px, 4vw, 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  border: 2px solid rgba(255,255,255,.9);
  backdrop-filter: blur(20px);
  overflow: hidden;
  min-height: clamp(200px, 50vw, 280px);
}

/* Stacked/fanned effect - each card slightly offset with more vertical spacing */
.daily-stack-card:nth-child(1) {
  z-index: 3;
  transform: translateY(0) rotate(-2deg) scale(1);
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
}

.daily-stack-card:nth-child(2) {
  z-index: 2;
  transform: translateY(45px) rotate(1.5deg) scale(0.96);
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  opacity: 0.92;
}

.daily-stack-card:nth-child(3) {
  z-index: 1;
  transform: translateY(90px) rotate(-1deg) scale(0.92);
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  opacity: 0.88;
}

/* When card is clicked/expanded */
.daily-stack-card.expanded {
  z-index: 10 !important;
  transform: translateY(0) rotate(0deg) scale(1.05) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  opacity: 1 !important;
  cursor: default;
  max-height: 85vh;
  overflow-y: auto;
  width: min(98%, 520px);
  padding: clamp(20px, 5vw, 40px) clamp(16px, 4vw, 32px);
  min-height: auto;
}

.daily-stack-card--incomplete {
  border-left: 4px solid rgba(217, 119, 6, 0.7);
}

.daily-stack-card .close-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: clamp(28px, 7vw, 36px);
  height: clamp(28px, 7vw, 36px);
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: all .2s ease;
  z-index: 20;
}

.daily-stack-card.expanded .close-btn {
  display: flex;
}

.daily-stack-card .close-btn:hover {
  background: rgba(255,255,255,1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* No hover previews: cards stay static until user taps (no guessing) */
.daily-stack-card:nth-child(1):hover:not(.expanded) {
  transform: translateY(0) rotate(-2deg) scale(1);
}
.daily-stack-card:nth-child(2):hover:not(.expanded) {
  transform: translateY(45px) rotate(1.5deg) scale(0.96);
  z-index: 2;
}
.daily-stack-card:nth-child(3):hover:not(.expanded) {
  transform: translateY(90px) rotate(-1deg) scale(0.92);
  z-index: 1;
}

.daily-stack-card .card-content {
  display: none;
  margin-top: 16px;
}

.daily-stack-card.expanded .card-content {
  display: block;
}


/* SFFB-style diary rows and boxes */
.diary-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  background: rgba(255,255,255,.7);
  border-radius: var(--radius2);
  border: 1px solid var(--border);
}

.diary-row__label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-row__input {
  display: flex;
  gap: 6px;
  align-items: center;
}

.diary-row__input .input {
  flex: 1;
  margin: 0;
  min-height: 38px;
  font-size: 14px;
}

.diary-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.diary-row label {
  user-select: none;
}

.diary-box {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  min-height: clamp(60px, 15vw, 80px);
}

.diary-box__label {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diary-box textarea {
  width: 100%;
  min-height: 60px;
  border: none;
  background: transparent;
  resize: vertical;
  font-size: 14px;
  padding: 0;
}

@media (max-width: 768px) {
  .diary-row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
}

/* SFFB 4-weekly review checklist styles */
.review-section-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(139,92,246,.2);
}

.review-prompt {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.review-question {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.4;
}

.review-question-with-options {
  margin-bottom: 16px;
}

.review-question-with-options input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.review-checklist-item {
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: transform .15s ease, box-shadow .15s ease;
}

.review-checklist-item--simple {
  padding: 12px 14px;
}

.review-checklist-item--tristate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.review-checklist-tristate-label {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

.review-checklist-tristate-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.review-tristate-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  user-select: none;
}

.review-checklist-item--tristate input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.review-checklist-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.review-checklist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.review-checklist-header input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.review-checklist-header label {
  user-select: none;
  line-height: 1.4;
}

.review-checklist-notes {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
}

.review-checklist-notes textarea {
  min-height: 70px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .review-checklist-item--tristate {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .review-checklist-tristate-label {
    min-width: 0;
  }

  .review-question-with-options .review-question {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .review-checklist-header {
    flex-wrap: wrap;
  }
  
  .review-checklist-header label {
    font-size: 13px;
  }
  
  .review-checklist-notes {
    grid-template-columns: 1fr;
  }
  
  .review-checklist-notes textarea {
    min-height: 60px;
  }
}

.swipe-dots{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 6px 0 2px;
}
.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.dot.is-active{
  background: rgba(255,255,255,.30);
  border-color: rgba(255,255,255,.35);
}

.card-sub{
  border: 1px dashed rgba(139,92,246,.2);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(10px);
}
.card-sub__title{
  font-weight: 850;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.checklist{
  display: grid;
  gap: 10px;
}
.checkrow{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
  padding: 12px;
  display: grid;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.checkrow:hover{
  transform: translateX(4px);
  box-shadow: var(--shadow);
}
.checkrow__main{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 650;
}
.checkrow__main input[type="checkbox"]{
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.checkrow__label{
  line-height: 1.25;
}
.checkrow__notes{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

/* Pastel themes for Daily swipe cards */
.pastel-a{
  background: var(--pastel-daily);
  border-color: rgba(236,72,153,.12);
}
.pastel-b{
  background: var(--pastel-allergens);
  border-color: rgba(139,92,246,.2);
}
.pastel-c{
  background: var(--pastel-production);
  border-color: rgba(16,185,129,.2);
}
.pastel-d{
  background: var(--pastel-availability);
  border-color: rgba(59,130,246,.2);
}

/* Availability Calendar */
.availability-card{ padding: var(--space-lg); min-width: 0; }
.availability-nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.availability-month-title{ margin: 0; font-size: 20px; }
.availability-calendar{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.availability-calendar__weekday{
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
}
.availability-calendar__day{
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  transition: transform .1s ease, box-shadow .1s ease;
}
.availability-calendar__day:hover{ transform: scale(1.05); }
.availability-calendar__day--available{ background: #10b981; color: #fff; }
.availability-calendar__day--limited{ background: #f59e0b; color: #fff; }
.availability-calendar__day--booked{ background: #ef4444; color: #fff; }
.availability-calendar__day--blocked{ background: #9ca3af; color: #fff; }
.availability-calendar__day--other{ opacity: 0.4; }
.availability-calendar__day--empty{ visibility: hidden; }
.availability-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}
.availability-legend__item{ display: flex; align-items: center; gap: 6px; }
.availability-legend__dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.availability-legend__item--available .availability-legend__dot{ background: #10b981; }
.availability-legend__item--limited .availability-legend__dot{ background: #f59e0b; }
.availability-legend__item--booked .availability-legend__dot{ background: #ef4444; }
.availability-legend__item--blocked .availability-legend__dot{ background: #9ca3af; }
.availability-actions{ display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.availability-share{ margin-top: 8px; }
.availability-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.availability-modal{
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.availability-modal h3{ margin: 0 0 16px; }
.availability-modal .field{ margin-bottom: 12px; }
.availability-modal .field label{ display: block; margin-bottom: 4px; font-size: 13px; }
.availability-modal-actions{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.availability-modal-hint{ margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.availability-export-formats{ display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.availability-export-format-option{ display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.availability-recurring-days{ display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cake-care-modal .cake-care-modal__textarea{ width: 100%; min-height: 120px; resize: vertical; }
.availability-recurring-days label{ display: flex; align-items: center; gap: 6px; cursor: pointer; }
.availability-default-blocked{ display: flex; flex-wrap: wrap; gap: 8px; }
.availability-default-blocked label{ display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.pastel-availability{
  background: var(--pastel-availability);
  border-color: rgba(59,130,246,.2);
}

/* Temp warning modal: orange/amber, white text, once per day only */
.temp-warning-modal{
  background: #d97706;
  color: #fff;
  border: none;
}
.temp-warning-modal .temp-warning-modal__icon{ font-size: 1.5rem; margin-bottom: 8px; }
.temp-warning-modal .temp-warning-modal__title{ margin: 0 0 8px; font-size: 1.125rem; color: #fff; }
.temp-warning-modal .temp-warning-modal__message{ margin: 0 0 16px; font-size: 0.9375rem; color: #fff; opacity: 0.95; }
.temp-warning-modal .btn--primary{ background: #fff; color: #b45309; }
.temp-warning-modal .btn--secondary{ background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.5); }

@media (max-width: 768px){
  .availability-nav{ flex-wrap: wrap; }
  .availability-month-title{ font-size: 18px; }
  .availability-calendar{ gap: 3px; margin-bottom: 12px; min-width: 0; }
  .availability-calendar__weekday{ font-size: 10px; padding: 2px 0; }
  .availability-calendar__day{ min-height: 36px; font-size: 13px; border-radius: 8px; }
  .availability-legend{ gap: 8px 16px; margin-bottom: 12px; font-size: 12px; }
  .availability-legend__dot{ width: 8px; height: 8px; }
  .availability-actions{ gap: 6px; margin-bottom: 10px; }
}
@media (max-width: 480px){
  .availability-card{ overflow-x: auto; min-width: 0; }
  .availability-month-title{ font-size: 16px; }
  .availability-calendar{ gap: 2px; margin-bottom: 10px; }
  .availability-calendar__weekday{ font-size: 9px; }
  .availability-calendar__day{ min-height: 32px; font-size: 12px; border-radius: 6px; aspect-ratio: 1; }
  .availability-legend{ gap: 6px 12px; font-size: 11px; }
  .availability-legend__dot{ width: 6px; height: 6px; }
}

.pastel-orders{
  background: var(--pastel-orders);
  border-color: rgba(139,92,246,.15);
}
.pastel-suppliers{
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fef3c7 100%);
  border-color: rgba(234,179,8,.12);
}
.pastel-stock{
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%);
  border-color: rgba(139,92,246,.15);
}
.pastel-suppliers:hover,
.pastel-stock:hover{
  transform: none;
}

/* Customer Orders: fully fluid responsive */
#page{ width: 100%; overflow-x: hidden; max-width: 650px; box-sizing: border-box; }
@media (max-width: 980px){
  #page{ max-width: 100%; }
}
.orders-card{
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
}
/* Orders filter bar - horizontal pill buttons */
.orders-toolbar-row{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.orders-filter-bar{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.orders-filter-bar::-webkit-scrollbar{ display: none; }
/* Mobile/tablet: wrap pills into rows, no scroll (avoids swipe conflict) */
@media (max-width: 980px){
  .orders-filter-bar{
    flex-wrap: wrap;
    overflow-x: visible;
  }
}
.orders-filter-pill{
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
/* Slightly smaller pills on mobile for better fit */
@media (max-width: 980px){
  .orders-filter-pill{
    padding: 5px 12px;
    font-size: 12px;
  }
}
.orders-filter-pill:hover{
  border-color: var(--accent);
  color: var(--accent);
}
.orders-filter-pill--active{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.orders-filter-pill--active:hover{
  background: var(--accent);
  color: #fff;
}
/* Today summary - quiet, informative */
.orders-today-summary{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-style: italic;
}
/* No results message */
.orders-no-results{
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 14px;
  overflow-x: hidden;
  padding: 4px;
}
@media (min-width: 481px) and (max-width: 980px){
  .orders-card{
    padding-left: 12px;
  }
}

/* Customer Orders: card layout */
.orders-card .card__title-row{ display: flex; align-items: center; justify-content: space-between; gap: clamp(0.5rem, 2vw, 1rem); flex-wrap: wrap; min-width: 0; }
.orders-card .card__title-row .card__title{ margin-bottom: 0; }
/* Tappable Add order card */
.order-card--add{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 1vw, 0.5rem);
  min-height: clamp(5rem, 20vw, 7.5rem);
  padding: clamp(0.5rem, 2vw, 1.5rem);
  border: 2px dashed var(--border);
  background: rgba(255,255,255,.6);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background .15s ease, border-color .15s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.order-card--add:hover{ background: rgba(236,72,153,.08); border-color: rgba(236,72,153,.4); }
.order-card--add:focus{ outline: none; box-shadow: none; }
.order-card--add__plus{ font-size: clamp(24px, 6vw, 32px); font-weight: 700; line-height: 1; color: var(--focus); }
.order-card--add__label{ font-size: clamp(13px, 2.5vw, 15px); font-weight: 600; color: var(--muted); }
.orders-summary{
  background: rgba(0,0,0,.06);
  border-radius: var(--radius2);
  padding: clamp(0.5rem, 2vw, 1rem);
  font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  font-weight: 500;
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
}
.orders-empty{
  text-align: center;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(0.5rem, 2vw, 1rem);
  color: var(--muted);
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
}
.orders-list{
  display: grid;
  gap: clamp(0.5rem, 2vw, 1rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 480px){
  .orders-list{
    grid-template-columns: 1fr;
  }
}
.orders-list--empty{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 2vw, 1rem);
}
.orders-list--empty .order-card--add{
  flex: 1 1 auto;
  min-width: 100%;
  max-width: min(100%, 37.5rem);
}
.orders-list--single{
  grid-template-columns: 1fr;
  min-width: 0;
}

/* Order card: collapsible */
.order-card{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: #ffffff;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
/* Order card tiers - no colored borders, clean look */
.order-card--nodate,
.order-card--future,
.order-card--today{
  border-left-color: transparent;
}
/* Collected orders: visually done, muted but accessible */
.order-card--collected{
  border-left-color: var(--ok);
  background: #f0fdf4;
  opacity: 0.8;
}
.order-card--collected .order-card__title{
  text-decoration: line-through;
  color: var(--muted);
}
body.dark .order-card--collected{
  background: rgba(34,197,94,.08);
  border-left-color: var(--ok);
}

/* Past-due cards: shrunk, greyed, faded - de-emphasize completed work */
.order-card--pastdue{
  border-left-color: transparent;
  background: #f3f4f6;
  opacity: 0.75;
  transform: scale(0.97);
  transform-origin: top center;
}
body.dark .order-card--pastdue{
  background: rgba(255,255,255,.04);
}
.order-card--pastdue .order-card__header{
  padding-top: clamp(0.375rem, 1.5vw, 0.625rem);
  padding-bottom: clamp(0.375rem, 1.5vw, 0.625rem);
  min-height: clamp(2.25rem, 8vw, 2.5rem);
}
.order-card--pastdue .order-card__title{
  color: var(--muted);
}
.order-card--pastdue .order-card__chevron{
  opacity: 0.5;
}
/* Date pill styling - moved to after base .pill for proper cascade */
.orders-section-title{ grid-column: 1 / -1; font-size: clamp(0.75rem, 2vw, 0.8125rem); font-weight: 600; color: var(--muted); margin: clamp(0.25rem, 1vw, 0.5rem) 0; padding-top: clamp(0.25rem, 1vw, 0.5rem); border-top: 1px solid var(--border); }
.order-card__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 1rem);
  padding: clamp(0.5rem, 2vw, 1rem);
  cursor: pointer;
  min-height: clamp(2.75rem, 10vw, 3rem);
  min-width: 0;
  flex-wrap: wrap;
  transition: background .15s ease;
}
@media (min-width: 481px) and (max-width: 980px){
  .order-card__header{
    padding-left: 14px;
    padding-right: 14px;
  }
}
.order-card__header:hover{ background: rgba(0,0,0,.03); }
.order-card__header:focus{ outline: none; box-shadow: none; }
.order-card__header{ -webkit-tap-highlight-color: transparent; }
/* Hide pink focus when parent card is selected or during multi-select */
.multi-select-selected .order-card__header,
.multi-select-selected .order-card__header:focus,
.multi-select-selected .order-card__header:hover,
.multi-select-selected .order-card__header:active{
  box-shadow: none !important;
  background: transparent !important;
}
.order-card__title{ font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card__header-actions{ display: flex; align-items: center; gap: clamp(0.25rem, 1vw, 0.5rem); flex-wrap: wrap; min-width: 0; }
.order-card__ordernum{ font-size: clamp(0.6875rem, 1.5vw, 0.6875rem); color: var(--muted); }
@media (min-width: 481px) and (max-width: 980px){
  .order-card__ordernum{
    margin-right: 8px;
  }
}
.order-card__x{
  width: clamp(2rem, 5vw, 2.25rem);
  height: clamp(2rem, 5vw, 2.25rem);
  min-width: clamp(2rem, 5vw, 2.25rem);
  min-height: clamp(2rem, 5vw, 2.25rem);
  padding: 0;
  font-size: clamp(1rem, 4vw, 1.25rem);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.order-card__chevron{ color: var(--muted); font-size: clamp(0.75rem, 2vw, 0.75rem); }
.order-card__body{
  padding: clamp(0.5rem, 2vw, 1rem);
  padding-top: clamp(0.5rem, 2vw, 0.75rem);
  border-top: 1px solid var(--border);
}
/* Use neutral focus color inside order cards */
.order-card .input:focus,
.order-card textarea:focus{
  border-color: var(--border);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
.order-card__row{ display: grid; gap: clamp(0.5rem, 2vw, 1rem); margin-bottom: clamp(0.5rem, 2vw, 1rem); }
.order-card__row:last-of-type{ margin-bottom: 0; }
.order-card__suggestions{ display: flex; flex-direction: column; gap: clamp(0.25rem, 1vw, 0.5rem); }
.order-card__suggestions-label{ font-size: clamp(0.75rem, 2vw, 0.75rem); color: var(--muted); }
.order-card__suggestion-chips{ display: flex; flex-wrap: wrap; gap: clamp(0.25rem, 1vw, 0.5rem); }
.order-card__suggestion-chip{
  font-size: clamp(0.75rem, 2vw, 0.75rem);
  padding: clamp(0.375rem, 1.5vw, 0.625rem) clamp(0.5rem, 2vw, 0.625rem);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.order-card__suggestion-chip:hover{ background: rgba(236,72,153,.1); border-color: rgba(236,72,153,.3); }
.order-card__actions{ display: flex; flex-wrap: wrap; gap: clamp(0.5rem, 2vw, 1rem); }
@media (max-width: 980px){
  .order-card__actions{
    justify-content: flex-end;
  }
}
.order-card__footer{
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.02);
}
.order-card__share-cake-care{
  font-size: 13px;
  font-weight: 500;
}
.order-card__row--grid2{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.order-card__row--grid3{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.card__title{
  font-weight: 850;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card__hint{
  color: var(--muted);
  font-size: 13px;
  margin-top: -2px;
  margin-bottom: 10px;
}

.form{
  display: grid;
  gap: 10px;
}
.row{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
.field{
  display: grid;
  gap: 6px;
}
.label{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  padding-left: 2px;
}
.input, textarea{
  width: 100%;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 42px;
  font-family: var(--font);
  font-size: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, textarea:focus{
  border-color: rgba(244, 114, 182, .5);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .15);
  background: rgba(255,255,255,1);
}
textarea{ min-height: 110px; }
.input:focus, textarea:focus{
  border-color: rgba(244, 114, 182, .5);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .15);
}
.assist{
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
}
.pill b{ color: var(--text); }

/* Date pill colors for order status */
.pill.pill--nodate{
  background: #9ca3af;
  color: #fff;
  border-color: #9ca3af;
}
.pill.pill--nodate b{ color: #fff; }

.pill.pill--future{
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.pill.pill--future b{ color: #fff; }

.pill.pill--today{
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.pill.pill--today b{ color: #fff; }

.pill.pill--pastdue{
  background: #6b7280;
  color: #fff;
  border-color: #6b7280;
}
.pill.pill--pastdue b{ 
  color: #fff; 
  text-decoration: line-through;
}
.pill.pill--collected{
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}
.pill.pill--collected b{ color: #fff; }

.fsa-alerts-list{
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.fsa-alert-item{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: var(--space-md);
  background: rgba(255,255,255,.9);
}
.fsa-alert-item--relevant{
  border-left: 4px solid var(--danger);
  background: rgba(239,68,68,.06);
}
.fsa-alert-pill--relevant{
  background: rgba(239,68,68,.2);
  color: var(--danger);
}
.fsa-alert-item__meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fsa-alert-item__title{
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

.table-wrap{
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
table{
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: rgba(0,0,0,.12);
}
th, td{
  border-bottom: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
}
th{
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  position: sticky;
  top: 0;
}
td .input, td textarea{ min-height: 38px; padding: 9px 10px; border-radius: 10px; }
td textarea{ min-height: 80px; }

.footer{
  padding: 16px 14px 26px;
  color: var(--muted);
}
.footer__inner{
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.muted{ color: var(--muted); font-size: 13px; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    border-radius: 0;
    border-right: 1px solid var(--border);
  }
  .sidebar.is-open{
    transform: translateX(0);
  }
  .sidebar-overlay[aria-hidden="false"]{
    display: block;
  }
  #menuBtn{ display: inline-flex; }
  .topbar__inner{ flex-wrap: wrap; }
  .brand{ min-width: auto; }
  .topbar__actions{ flex: 1; }
  .account-menu{ margin-left: auto; }
}

@media (min-width: 981px){
  #menuBtn{ display: none; }
  .sidebar-overlay{ display: none !important; }
}

/* Stock item: date pill design (no colored sidebar), FSA highlight only */
.stock-item-card{
  border-left-width: 0;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border-radius: var(--radius2);
  overflow: hidden;
}
.stock-item-card.stock-item--urgent,
.stock-item-card.stock-item--soon,
.stock-item-card.stock-item--fresh,
.stock-item-card.stock-item--expired{ border-left-color: transparent; }
.stock-item-actions{ display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.stock-item-actions .btn{ min-height: 44px; }

/* Production: entry cards (two sections) */
.production-entry-cards{
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 4px;
  box-sizing: border-box;
}
@media (max-width: 980px){
  .production-entry-cards{
    max-width: 600px;
  }
}
.production-entry-card{
  cursor: pointer;
  padding: 18px 20px;
  min-height: 44px;
  min-width: 0;
  transition: transform .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}
.production-entry-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.production-entry-card:focus{ outline: none; box-shadow: 0 0 0 3px rgba(139,92,246,.35); }
.production-entry__title{ font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.production-entry__hint{ color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Production: section view (Suppliers or Stock only) */
.production-section{ display: flex; flex-direction: column; gap: 16px; padding-left: 12px; padding-right: 12px; }
.production-list{ display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stock-item-card,
.supplier-card{ width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.production-section-header{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.production-section-title{ margin: 0; font-size: 18px; flex: 1; }
.production-section-actions{ display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.production-close-btn{
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
@media (max-width: 980px){
  .production-list{ min-width: 0; }
  .stock-item-card,
  .supplier-card{ min-width: 0; max-width: 100%; }
}

/* Supplier card: collapsible */
.supplier-card{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  margin-bottom: 0;
  background: #ffffff;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.supplier-card__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  min-height: 44px;
  transition: background .15s ease;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.supplier-card__header:hover{ background: rgba(0,0,0,.03); }
.supplier-card__header:focus{ outline: none; box-shadow: none; }
.supplier-card__header{ -webkit-tap-highlight-color: transparent; }
.supplier-card__title{ font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-card .input:focus,
.supplier-card textarea:focus{
  border-color: var(--border);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
.supplier-card .btn:focus,
.stock-item-card .btn:focus{
  outline: none;
  box-shadow: none;
}
.supplier-card__header-actions{ display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.supplier-card__expand-handle{ color: var(--muted); font-size: 0.85rem; }
.supplier-card__chevron{ color: var(--muted); font-size: 12px; }
.supplier-card__last-reviewed{ font-size: 0.85rem; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.supplier-card__body{
  padding: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.supplier-card__row{ display: grid; gap: 8px; margin-bottom: 10px; max-width: 100%; box-sizing: border-box; }
.supplier-card__row:last-of-type{ margin-bottom: 0; }
.supplier-card__actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.supplier-card__row--grid2{ grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/*
 * Stock product card: all batches of one product live in a single collapsible card.
 * Header (name · count · earliest-expiry pill) → product-level fields → compact batch
 * rows → "add another batch". Replaces the old one-card-per-batch sprawl.
 */
.stock-product-card{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.stock-product-card--fsa-unseen{
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger), 0 2px 12px rgba(0,0,0,.08);
}
.stock-product-card__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  min-height: 48px;
  font-weight: 700;
  transition: background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.stock-product-card__header:hover{ background: rgba(0,0,0,.03); }
.stock-product-card__header:focus{ outline: none; box-shadow: none; }
.stock-product-card__title{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-product-card__header-actions{ display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.stock-product-card__count{ font-size: 0.85rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.stock-product-card__chevron{ color: var(--muted); font-size: 12px; }
.stock-product-card__body{
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.stock-product-card__product-fields{
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px);
  padding: 12px 0;
}
.stock-product-card__batches{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stock-product-card__add-batch{
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

/* Compact batch row inside a product card */
.stock-batch{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.015);
  box-shadow: none;
  overflow: hidden;
  position: relative;
}
.stock-batch--urgent{ border-left: 4px solid var(--danger, #ef4444); }
.stock-batch--soon{ border-left: 4px solid var(--warn, #f59e0b); }
.stock-batch--expired{ border-left: 4px solid var(--danger, #ef4444); }
.stock-batch--fresh{ border-left: 4px solid var(--ok, #22c55e); }
.stock-batch__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}
.stock-batch__header:focus{ outline: none; box-shadow: none; }
.stock-batch__summary{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.stock-batch__header-actions{ display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.stock-batch__chevron{ color: var(--muted); font-size: 12px; }
.stock-batch__body{
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
}
.stock-batch__edit-grid{
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(120px, 1.2fr) minmax(118px, 1fr) minmax(118px, 1fr) 72px 70px minmax(120px, 1.3fr);
  align-items: center;
}
.stock-batch__input{
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.stock-batch__input[type="date"]{ min-width: 0; }
.stock-batch__actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

@media (max-width: 860px){
  .stock-product-card__product-fields,
  .stock-batch__edit-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stock-batch__edit-grid .field:last-child{ grid-column: 1 / -1; }
}

@media (max-width: 480px){
  .stock-product-card__product-fields,
  .stock-batch__edit-grid{
    grid-template-columns: 1fr;
  }
  .stock-product-card__header,
  .stock-batch__header{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .stock-product-card__header-actions,
  .stock-batch__header-actions{ justify-content: space-between; }
}

/* Mobile: show full supplier name - stack title above actions */
@media (max-width: 480px){
  .supplier-card__header{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .supplier-card__title{
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
  }
  .supplier-card__header-actions{
    align-self: stretch;
    gap: 6px;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .supplier-card__last-reviewed{
    white-space: normal;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
  }
  .supplier-card__expand-handle{
    font-size: 0.8rem;
  }
}

/* Tablet and desktop: match supplier card compact size (must come after base rules) */
@media (min-width: 481px){
  /* Remove .card outer padding so header/body control all spacing (matches supplier) */
  .order-card.card{
    padding: 0;
    transform: none;
  }
  .order-card.card:hover{
    transform: none;
  }
  .order-card__header{
    padding: 12px 14px;
    min-height: 44px;
    gap: 10px;
  }
  .order-card__body{
    padding: 14px;
    padding-top: 8px;
  }
  .order-card__row{ gap: 8px; margin-bottom: 10px; }
  .order-card__row:last-of-type{ margin-bottom: 0; }
  .order-card__actions{ gap: 8px; margin-top: 12px; }
  .order-card__suggestions{ gap: 0.5rem; }
  .order-card__suggestion-chips{ gap: 0.5rem; }
  .order-card__suggestion-chip{ font-size: 0.75rem; padding: 6px 10px; }
  .order-card__chevron{ font-size: 12px; }
}

@media (min-width: 720px){
  .row{ grid-template-columns: 1fr 1fr; }
  .card--half{ grid-column: span 6; }
  .card--third{ grid-column: span 4; }
}

/* Multi-select mode for bulk delete */
.multi-select-bar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 1100;
}
.multi-select-count{
  font-weight: 600;
  font-size: 15px;
}
.multi-select-actions{
  display: flex;
  gap: 8px;
}
.multi-select-actions .btn{
  min-height: 36px;
  padding: 8px 14px;
}

/* Mobile: move multi-select to bottom-right */
@media (max-width: 980px){
  .multi-select-bar--mobile{
    position: fixed;
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
    width: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    z-index: 1100;
  }
  .multi-select-bar--mobile .multi-select-count{
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
  }
  .multi-select-bar--mobile .multi-select-actions{
    display: flex;
    flex-direction: row;
    gap: 8px;
  }
  .multi-select-bar--mobile .multi-select-actions .btn{
    flex: 1;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Selected card state */
.multi-select-selected{
  outline: 3px solid var(--accent) !important;
  outline-offset: -2px;
  background: rgba(139,92,246,.08) !important;
}
.multi-select-selected::before{
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 5;
}
/* Cards need position relative for checkmark */
.stock-item-card,
.supplier-card,
.allergen-card,
.order-card{
  position: relative;
}
/* Order card specific multi-select override */
.order-card.multi-select-selected,
.order-card.multi-select-selected.order-card--nodate,
.order-card.multi-select-selected.order-card--future,
.order-card.multi-select-selected.order-card--today,
.order-card.multi-select-selected.order-card--pastdue{
  outline: 3px solid var(--accent) !important;
  outline-offset: -2px;
  background: rgba(139,92,246,.15) !important;
  border: 1px solid var(--accent) !important;
  overflow: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Hint text for multi-select */
.multi-select-hint{
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 16px 0;
  font-style: italic;
}

/* Floating action button (FAB) for mobile add actions */
.fab-add-button{
  display: flex; /* Always show when rendered - JS controls when to render */
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  border: none;
  box-shadow: 0 4px 12px rgba(139,92,246,.4);
  cursor: pointer;
  z-index: 100;
  transition: transform .2s ease, box-shadow .2s ease;
  align-items: center;
  justify-content: center;
}
.fab-add-button:hover{
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(139,92,246,.5);
}
.fab-add-button:active{
  transform: scale(0.95);
}
@media (max-width: 980px){
  /* Hide toolbar Add buttons on mobile when FAB is present */
  .hide-on-mobile{
    display: none !important;
  }
}

/* Allergen sticker scanner overlays */
.scanner-overlay{
  position: fixed;
  inset: 0;
  /* Above share/add-product modals (z-index 9999) so label-read progress is visible while ingredient products popup is open */
  z-index: 12000;
  background: rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  color: #fff;
}
.scanner-overlay h3{
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}
.scanner-overlay p{
  margin: 0 0 1rem;
  font-size: 0.95rem;
  opacity: .95;
}
.scanner-prescan-list{
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  text-align: left;
}
.scanner-prescan-list li{
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
}
.scanner-prescan-list li::before{
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
}
.scanner-prescan-actions{
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.scanner-overlay--manual{
  justify-content: flex-start;
  overflow-y: auto;
}
.scanner-manual-hint{
  margin-bottom: 1rem;
}
.scanner-manual-list{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
  text-align: left;
}
.scanner-manual-check{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius2);
  background: rgba(255,255,255,.08);
}
.scanner-manual-check:hover{
  background: rgba(255,255,255,.15);
}
.scanner-manual-check input{
  flex-shrink: 0;
}
.scanner-overlay--barcode{
  justify-content: flex-start;
  padding-top: clamp(2rem, 8vw, 4rem);
}
.scanner-overlay--barcode #barcode-reader-container,
.scanner-overlay--barcode [id^="barcode-reader-"]{
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--radius2);
  overflow: hidden;
}
.scanner-barcode-status{
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  opacity: .9;
}
.scanner-overlay--progress{
  text-align: center;
}
.scanner-progress-spinner{
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 3px solid rgba(255,255,255,.22);
  border-top-color: var(--ok, #10b981);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: scanner-progress-spin .7s linear infinite;
}
@keyframes scanner-progress-spin{
  to{ transform: rotate(360deg); }
}
.scanner-progress-bar{
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: rgba(255,255,255,.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem auto;
}
.scanner-progress-fill{
  height: 100%;
  width: 0%;
  background: var(--ok);
  border-radius: 4px;
  transition: width .3s ease;
}
.scanner-progress-text{
  font-size: 0.9rem;
  opacity: .9;
}
.scanner-result-msg{
  font-weight: 500;
}
.scanner-disclaimer{
  font-size: 0.85rem;
  opacity: .85;
}
.scanner-ocr-preview{
  font-size: 0.8rem;
  opacity: .9;
  margin: 0.5rem 0;
}
.scanner-ocr-preview cite{
  font-style: normal;
  background: rgba(255,255,255,.15);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-word;
}
.scanner-result-actions{
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Ingredient rich-text editor */
.ingredient-editor{
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.9);
}
.ingredient-toolbar{
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
}
.ingredient-toolbar__btn{
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s;
}
.ingredient-toolbar__btn:hover,
.ingredient-toolbar__btn:focus-visible{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ingredient-toolbar__btn--active{
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ingredient-toolbar__btn--text{
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

/* Share popup */
.share-popup-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.share-popup-overlay--ingredient-library{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.share-popup{
  background: var(--panel, #fff);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-lg);
}
.share-popup--ingredient-library{
  width: 100%;
  max-width: min(420px, 100%);
  height: min(80vh, 900px);
  max-height: min(80vh, 900px);
  min-height: 0;
  overflow: hidden;
  padding: 16px 16px 0;
  gap: 0;
  margin-bottom: auto;
}
.ingredient-library-popup__scroll{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin-right: -6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ingredient-library-popup__footer{
  flex-shrink: 0;
  margin-top: 12px;
  padding: 12px 0 16px;
  background: var(--panel, #fff);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.dark .ingredient-library-popup__footer{
  background: var(--panel);
}
.share-popup__title{
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}
.share-popup__btn{
  width: 100%;
  justify-content: center;
}
body.dark .share-popup{
  background: var(--panel);
  border: 1px solid var(--border);
}

/* Ingredient products library */
.ingredient-library-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 4px;
}
.ingredient-library-label-block{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.ingredient-library-label-block textarea.input{
  max-height: min(36vh, 280px);
  overflow-y: auto;
  resize: vertical;
  min-height: 4.5rem;
}
.ingredient-library-may-contain-block{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(245,158,11,.22);
  border-radius: var(--radius2);
  background: rgba(245,158,11,.06);
}
.ingredient-library-may-contain-block .input{
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.ingredient-library-may-contain-block .ingredient-library-preview-hint{
  margin-top: 0;
  font-size: 11px;
}
.ingredient-library-label-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ingredient-library-label-toolbar__label{
  margin: 0;
  font-weight: 600;
}
.ingredient-library-preview-hint{
  font-size: 12px;
  margin-top: 4px;
}
.ingredient-library-html-preview{
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  min-height: 0;
  max-height: min(28vh, 220px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
body.dark .ingredient-library-html-preview{
  background: rgba(255, 255, 255, 0.04);
}
.ingredient-library-html-preview strong{
  font-weight: 700;
}
.ingredient-library-toolbar{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}
@media (max-width: 980px){
  .ingredient-library-toolbar{
    justify-content: flex-end;
  }
}
.ingredient-library-item{
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 10px 10px 8px;
  background: rgba(255,255,255,.9);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.ingredient-library-select-cb{
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.ingredient-library-item--just-added{
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}
/* Flash shown briefly when a tapped push notification scrolls to an order/stock card. */
.deep-link-highlight{
  border-color: var(--accent, #2563eb) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18) !important;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.ingredient-library-header{
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.ingredient-library-header .input{
  flex: 1;
}
.ingredient-library-meta{
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.ingredient-library-empty{
  font-size: 13px;
  color: var(--muted);
}
.builder-hint{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.ingredient-library-intro{
  margin-bottom: 4px;
}
.ingredient-library-delete-hint{
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

/* Undo day popup */
.undo-overlay{
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.2);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 16px;
  pointer-events: auto;
}
.undo-dialog{
  width: 100%;
  max-width: 420px;
  background: var(--panel, #fff);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.undo-dialog__title{
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.undo-dialog__meta{
  font-size: 13px;
  color: var(--muted);
}
.undo-dialog__buttons{
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.undo-dialog__buttons .btn{
  flex: 1;
}
body.dark .undo-dialog{
  background: var(--panel);
  border: 1px solid var(--border);
}

/* Product care */
.product-care-btn{
  font-size: 18px;
  padding: 4px 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}
.product-care-btn:hover{
  background: rgba(139,92,246,.1);
}
.product-care-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.product-care-product-name{
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.product-care-popup{
  max-width: 400px;
}
.product-care-popup .ingredient-editable{
  min-height: 80px;
}
.ingredient-editable{
  min-height: 72px;
  padding: 10px 12px;
  border: none;
  outline: none;
  line-height: 1.5;
  font-family: var(--font);
  font-size: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ingredient-editable:empty::before{
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

/* Dark mode */
body.dark{
  --bg: #121212;
  --panel: #1e1e1e;
  --panel2: #161616;
  --text: #e8e8e8;
  --muted: #a0a0a0;
  --border: rgba(255,255,255,.1);
  --shadow: 0 4px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  --pastel-daily: linear-gradient(135deg, #2a1e2a 0%, #331f2e 100%);
  --pastel-allergens: linear-gradient(135deg, #1e1e2e 0%, #22213a 100%);
  --pastel-production: linear-gradient(135deg, #1a261a 0%, #1e2e1e 100%);
  --pastel-availability: linear-gradient(135deg, #1a2226 0%, #1c2830 100%);
  --pastel-orders: linear-gradient(135deg, #2a1e2a 0%, #2e1e2e 50%, #241826 100%);
  background: #121212;
  animation: none;
}
body.dark .pastel-stock{
  background: linear-gradient(135deg, #1e1a2e 0%, #221e36 100%);
  border-color: rgba(139,92,246,.2);
}
body.dark .topbar{
  background: rgba(30, 30, 30, .96);
  border-bottom-color: rgba(255,255,255,.06);
}
body.dark .account-button{
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--text);
}
body.dark .account-menu__panel{
  background: rgba(30,30,30,.98);
  border-color: var(--border);
  color: var(--text);
}
body.dark .account-menu__eyebrow{
  color: var(--muted);
}
body.dark .account-menu__email{
  color: var(--text);
}
body.dark .account-menu__signout{
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.28);
  color: #fca5a5;
}
body.dark .account-menu__signout:hover{
  background: rgba(239,68,68,.2);
}
body.dark .navlink{
  color: var(--muted);
}
body.dark .navlink.is-active,
body.dark .navlink:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
}
body.dark .main{
  background: var(--panel);
  border-color: var(--border);
}
body.dark .sidebar{
  background: var(--panel2);
  border-color: var(--border);
}
body.dark .card,
body.dark .supplier-card,
body.dark .stock-item-card,
body.dark .allergen-card,
body.dark .stock-product-card,
body.dark .stock-batch,
body.dark .attention-row,
body.dark .production-entry-card,
body.dark .card-sub,
body.dark .fsa-alert-item{
  background: var(--panel);
  border-color: var(--border);
}
body.dark .dashboard-section-card--daily{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(244,114,182,.12), rgba(251,146,60,.10));
  border-color: rgba(244,114,182,.22);
}
body.dark .dashboard-section-card--allergens{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(129,140,248,.13));
  border-color: rgba(129,140,248,.24);
}
body.dark .dashboard-section-card--production{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(16,185,129,.12));
  border-color: rgba(16,185,129,.22);
}
body.dark .dashboard-section-card--orders{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(251,146,60,.11), rgba(244,114,182,.09));
  border-color: rgba(251,146,60,.22);
}
body.dark .dashboard-section-card--availability{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(14,165,233,.11), rgba(251,191,36,.08));
  border-color: rgba(14,165,233,.22);
}
body.dark .dashboard-section-card--fsa{
  background: linear-gradient(135deg, rgba(30,30,30,.96), rgba(245,158,11,.11));
  border-color: rgba(245,158,11,.22);
}
body.dark .order-card{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 1px 6px rgba(0,0,0,.3);
}
body.dark .availability-modal,
body.dark .product-care-popup{
  background: var(--panel);
  color: var(--text);
}
body.dark .availability-modal h3,
body.dark .product-care-popup h3{
  color: var(--text);
}
body.dark .availability-modal-hint{
  color: var(--muted);
}
body.dark .fsa-alert-item--relevant{
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
}
body.dark .empty-state{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.12);
}
body.dark .input,
body.dark textarea,
body.dark select.input{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
}
body.dark .input:focus,
body.dark textarea:focus{
  border-color: var(--accent);
}
body.dark .btn{
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.12);
  color: var(--text);
}
body.dark .btn:hover{
  background: rgba(255,255,255,.16);
}
body.dark .daily-card-chooser{
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
body.dark .daily-card-chooser .btn{
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.18);
}
body.dark .daily-card-chooser .btn:hover{
  background: rgba(255,255,255,.2);
}
body.dark .btn--secondary{
  background: rgba(255,255,255,.08);
  color: var(--text);
}
body.dark .btn--primary{
  background: linear-gradient(135deg, rgba(244,114,182,.3), rgba(251,146,60,.25));
  border-color: rgba(244,114,182,.4);
}
body.dark .ingredient-editor{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
}
body.dark .ingredient-toolbar{
  background: rgba(255,255,255,.04);
  border-bottom-color: rgba(255,255,255,.08);
}
body.dark .ingredient-toolbar__btn{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
}
body.dark .allergen-popup-modal{
  background: var(--panel);
  color: var(--text);
}
body.dark .allergen-popup-overlay{
  background: rgba(0,0,0,.7);
}
body.dark .footer{
  background: var(--panel);
  border-top-color: rgba(255,255,255,.06);
}
body.dark .pill{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.1);
}
body.dark .banner{
  background: var(--panel);
  border-color: var(--border);
}
body.dark input[type="date"]{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: var(--text);
}

/* Add product wizard popup (recipe → match → generate) */
.ingredient-builder-popup{
  width: 100%;
  max-width: min(520px, 100%);
  height: min(85dvh, 920px);
  max-height: min(85dvh, 920px);
  min-height: 0;
  overflow: hidden;
  padding: 16px 16px 0;
  gap: 0;
}
.ingredient-builder-popup__scroll{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  margin-right: -6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.ingredient-builder-popup textarea.input{
  min-height: 14rem;
  max-height: none;
  resize: vertical;
}
.ingredient-builder-popup__footer{
  flex-shrink: 0;
  margin-top: 12px;
  padding: 12px 0 16px;
  background: var(--panel, #fff);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  bottom: 0;
}
body.dark .ingredient-builder-popup__footer{
  background: var(--panel);
}
.ingredient-builder-meta{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.ingredient-builder-map-table{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ingredient-builder-map-row{
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.6fr;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel, #fff);
}
.ingredient-builder-map-row--head{
  background: transparent;
  border: none;
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ingredient-builder-map-row--needs-pick{
  border-color: var(--warn, #d97706);
  background: rgba(217,119,6,.06);
}
.ingredient-builder-map-cell{
  min-width: 0;
}
.ingredient-builder-map-cell--line{
  font-weight: 600;
  word-break: break-word;
}
.ingredient-builder-map-cell--amount{
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.ingredient-builder-map-cell--product .ingredient-builder-select{
  width: 100%;
}
@media (max-width: 520px){
  .ingredient-builder-map-row{
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .ingredient-builder-map-row--head{
    display: none;
  }
  .ingredient-builder-map-cell--amount{
    font-size: 12px;
  }
}

/* ── Auth gate (login / consent screen) ──────────────────────────────── */
.auth-gate{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #fce7f3 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  overflow-y: auto;
}
.auth-card{
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth-card--home{
  max-width: 480px;
}
.auth-logo{
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-logo__badge{
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f472b6, #fb923c);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-logo__name{
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.auth-logo__tag{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.auth-hero{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-hero__title{
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text);
}
.auth-hero__copy{
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.auth-features{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.auth-features li{
  font-size: 14px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
}
.auth-features li::before{
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}
.auth-sync-note{
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.18);
  border-radius: var(--radius2);
  padding: 11px 12px;
}
.auth-sync-note strong{
  color: var(--text);
}
.auth-actions{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-agree{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}
.auth-agree input[type=checkbox]{
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.auth-link{
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.auth-link:hover{ opacity: 0.8; }
.auth-policy-links{
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  margin-bottom: 2px;
}
.auth-policy-sep{ color: var(--muted); }
.auth-google-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius2);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font);
}
.auth-google-btn:hover{
  background: #f8f4ff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,.1);
}
.auth-google-btn:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-google-btn__g{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-error{
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}
.auth-beta{
  font-size: 12px;
  color: var(--muted);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.auth-card__title{
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.auth-card__hint{
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
body.dark .auth-gate{
  background: linear-gradient(135deg, #1e1a2e 0%, #2a1e2a 100%);
}
body.dark .auth-card{
  background: var(--panel);
  border: 1px solid var(--border);
}
body.dark .auth-google-btn{
  background: var(--panel2);
  border-color: var(--border);
  color: var(--text);
}
body.dark .auth-google-btn:hover{
  background: rgba(139,92,246,.15);
}

.onboarding-card{
  border-left: 4px solid var(--accent);
  margin-bottom: var(--space-md);
}
.onboarding-steps{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.onboarding-step{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.onboarding-step__num{
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.onboarding-card__footer{
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}
body.dark .onboarding-step__num{
  background: var(--accent);
}

.modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-panel{
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-panel__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-panel__title{
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.modal-close{
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.modal-close:hover{ background: rgba(0,0,0,.06); color: var(--text); }
.modal-panel__body{
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.modal-panel__body p{ margin: 0 0 12px; }
.modal-panel__body p:last-child{ margin-bottom: 0; }
body.dark .modal-panel{ background: var(--panel); border: 1px solid var(--border); }
body.dark .modal-close:hover{ background: rgba(255,255,255,.08); }

.sw-update-banner{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
  flex-wrap: wrap;
  max-width: calc(100vw - 32px);
}

.ctx-hint{
  background: rgba(139,92,246,.06);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
body.dark .ctx-hint{
  background: rgba(139,92,246,.1);
}
.stock-tip{
  background: #fff;
  border-left: 3px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}
body.dark .stock-tip{
  background: rgba(255,255,255,.08);
  border-left-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
}

.temps-grid{
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 6px;
  align-items: center;
}
.temps-grid__header{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.temps-grid__row-label{
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.temps-grid__input{
  text-align: center;
  padding: 8px 6px;
  min-width: 0;
}

.dark-mode-toggle{
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background .2s, border-color .2s;
  padding: 0;
  line-height: 1;
}
.dark-mode-toggle:hover{
  background: rgba(255,255,255,.9);
}
body.dark .ingredient-library-item{
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
}
body.dark .allergen-toolbar{
  background: var(--panel2);
}
body.dark .allergen-card{
  background: var(--panel);
  border-color: var(--border);
}
body.dark .diary-row{
  background: rgba(255,255,255,.04);
}
body.dark .diary-box{
  background: rgba(255,255,255,.05);
  border-color: var(--border);
}
body.dark .review-checklist-item{
  background: rgba(255,255,255,.04);
  border-color: var(--border);
}
body.dark .checkrow{
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
}
body.dark .order-card__suggestion-chip{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
body.dark .dark-mode-toggle{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}

/* Bulk Upload Review Styles */
.bulk-review-popup {
  max-width: 800px !important;
  width: 95% !important;
  max-height: min(90vh, 850px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.bulk-review-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px;
  margin-top: 16px;
  margin-bottom: 16px;
}
@media (min-width: 680px) {
  .bulk-review-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 16px !important;
  }
}
.bulk-review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
body.dark .bulk-review-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.bulk-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.bulk-review-card-title {
  font-weight: 700;
  font-size: 15px;
}
.bulk-review-collage {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.bulk-review-photo-container {
  flex: 1;
  max-width: 180px;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.dark .bulk-review-photo-container {
  background: #1f2937;
}
.bulk-review-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.bulk-review-photo-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  text-align: center;
  pointer-events: none;
}
.bulk-review-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bulk-review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.bulk-review-badge--pending {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
body.dark .bulk-review-badge--pending {
  background: rgba(30, 64, 175, 0.2);
  color: #93c5fd;
  border-color: rgba(30, 64, 175, 0.4);
}
.bulk-review-badge--ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
body.dark .bulk-review-badge--ok {
  background: rgba(22, 101, 52, 0.2);
  color: #86efac;
  border-color: rgba(22, 101, 52, 0.4);
}
.bulk-review-badge--mismatch {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
body.dark .bulk-review-badge--mismatch {
  background: rgba(146, 64, 14, 0.2);
  color: #fcd34d;
  border-color: rgba(146, 64, 14, 0.4);
}
.bulk-review-badge--unreadable, .bulk-review-badge--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
body.dark .bulk-review-badge--unreadable, body.dark .bulk-review-badge--error {
  background: rgba(153, 27, 27, 0.2);
  color: #fca5a5;
  border-color: rgba(153, 27, 27, 0.4);
}
.bulk-review-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: bulk-spin 0.8s linear infinite;
}
@keyframes bulk-spin {
  to { transform: rotate(360deg); }
}
.bulk-review-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.bulk-review-notes {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-top: 4px;
}
body.dark .bulk-review-notes {
  background: rgba(180, 83, 9, 0.15);
  border-color: rgba(180, 83, 9, 0.3);
  color: #fcd34d;
}


