/* admin.css - admin panel only (admin.html). Load after base.css.
   Sections follow the panel: shared pieces first, then each tab.

   Contents - search for the marker, e.g. "== ADMIN: base ==":
     == ADMIN: look ==  glass tokens (light/dark), the soft background light
     == ADMIN: base ==  hide rule, buttons, page width, cards and form fields, login
     == ADMIN: controls ==  add/remove buttons, hints, empty states, image previews
     == ADMIN: dialogs ==  confirm dialog and the AI dish-photo dialog
     == ADMIN: tabs ==  tab row, settings gear, new-orders badge, save toolbar
     == ADMIN: dashboard ==  stats, mini order lists, trend chart, content reminders
     == ADMIN: orders ==  filters, order cards, edit form, notes, prep, print, call-me-back badge
     == ADMIN: customers ==  customer rows and badges, the customer card (shares the open order's place)
     == ADMIN: calendar ==  orders date-range picker; the calendar tab (month with names, week + "מה להכין", day time line panel)
     == ADMIN: menu editor ==  dish cards and filters, the open dish panel (shared by settings), stock switch, reorder mode, site preview, options, gallery
     == ADMIN: menu category bar ==  the menu + categories pill that sticks over the dishes while scrolling
     == ADMIN: settings ==  store switch, "מחכים לך", settings groups and rows, panel head/footer, business details, closures, upsells, carousel images, FAQ, packages
     == ADMIN: assistant ==  the AI assistant floating in the corner (waves once, no chat yet)
*/

/* == ADMIN: look == */
/* The panel's look: soft warm light behind frosted-glass cards, in the site's
   colors. Blur (backdrop-filter) only on the few big surfaces - top bar, tabs,
   stat bubbles, cards, the open order, dialogs. Long lists (order rows, menu
   items) use plain translucent white, which looks the same over the soft
   background without making phones redraw blur for every row. */
:root {
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-soft: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 10px 34px rgba(138, 74, 28, 0.09);
  --glass-blur: blur(22px) saturate(150%);
  --field-bg: rgba(255, 255, 255, 0.82);
  --tint: rgba(211, 203, 171, 0.2);
  --radius-lg: 24px;
  --primary: #8a4a1c; /* white text on it stays >=4.5:1 in both themes */
  /* Chart colors (site traffic card): checked for color-blind readers on this
     background - dataviz validate_palette.js. In this order, never cycled. */
  --chart-1: #c9702f; --chart-2: #009b85; --chart-3: #b8860b; --chart-4: #8a4a1c;
  --chart-grid: rgba(58, 53, 47, 0.1);
  --chart-track: rgba(58, 53, 47, 0.08);
}
:root[data-theme="dark"] {
  --glass: rgba(38, 35, 31, 0.62);
  --glass-strong: rgba(38, 35, 31, 0.88);
  --glass-soft: rgba(38, 35, 31, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --field-bg: rgba(0, 0, 0, 0.22);
  --tint: rgba(0, 0, 0, 0.2);
  --chart-1: #d27a38; --chart-2: #1fa58f; --chart-3: #b8891c; --chart-4: #b84862;
  --chart-grid: rgba(240, 236, 227, 0.12);
  --chart-track: rgba(240, 236, 227, 0.1);
}
.admin-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.admin-bg span { position: absolute; border-radius: 50%; filter: blur(110px); }
.admin-bg span:nth-child(1) { top: -160px; right: -120px; width: 560px; height: 560px; background: var(--accent-warm); opacity: 0.26; }
.admin-bg span:nth-child(2) { top: 40%; left: -180px; width: 520px; height: 520px; background: var(--tan); opacity: 0.5; }
.admin-bg span:nth-child(3) { bottom: -220px; right: 30%; width: 480px; height: 480px; background: var(--accent); opacity: 0.16; }
:root[data-theme="dark"] .admin-bg span { opacity: 0.12; }

#topbar {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(58, 53, 47, 0.06);
}
/* Narrow phones: the handwritten business name (base.css .wordmark) is wider
   than the old round logo, so the side buttons move out a little. */
@media (max-width: 400px) { #topbar { padding-inline: 8px; } }
button#logo-home { padding: 0; border: none; background: none; cursor: pointer; }
button#logo-home:active { opacity: 0.7; }

/* The admin's primary button (base.css's orange .hero-cta is the site's). */
.hero-cta {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(138, 74, 28, 0.25);
}
.hero-cta:hover { box-shadow: 0 12px 24px rgba(138, 74, 28, 0.3); }

/* == ADMIN: base == */
/* One rule for every element the admin-*.js files show/hide with the "hidden" class.
   (This file loads only on admin.html, and nothing here animates in/out the
   way the customer side menu/cart do.) !important so it beats each element's
   own display (flex, inline-flex...) - the old per-id list kept missing new
   elements, e.g. the "0" new-orders badge and the image-remove buttons. */
.hidden { display: none !important; }

/* Mobile Safari sometimes treats a tap on a button as the start of a text
   selection instead of a click, silently swallowing the click event. */
button {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; /* Safari still needs the prefix */
  user-select: none;
  -webkit-touch-callout: none;
}

#logout-btn {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
}

/* "האתר": a house icon over a small label, like the phone tab bar. */
.view-site-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
}
.view-site-btn:active { background: var(--bg); }
@media (max-width: 400px) { .view-site-btn { padding-inline: 3px; } }

.admin-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
/* Form-heavy tabs read better narrower than the dashboard/orders. */

.admin-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.admin-card h1, .admin-card h2 { margin-top: 0; }

.admin-card label {
  display: block;
  margin: 12px 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-card input, .admin-card textarea, .admin-main select, .admin-main input[type="search"], .admin-main input[type="date"],
.item-block input, .item-block textarea, .menus-card input[type="text"], .customer-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-main input:focus, .admin-main textarea:focus, .admin-main select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(251, 142, 40, 0.15);
  outline: none;
}

.admin-card textarea { min-height: 60px; resize: vertical; }

/* These hold URLs/emails - mostly Latin text - so bidi reordering inside an
   RTL field (e.g. the trailing "/" of a URL jumping to the start) makes an
   otherwise-valid value look wrong. Force LTR reading order, keep the field
   itself right-aligned with the rest of the form. */
#biz-instagram-input, #biz-facebook-input, #biz-email-input {
  direction: ltr;
  text-align: right;
}

/* Login: one glass card in the middle; the Google button (styled by
   .google-connect-btn below) fills it. */
#login-screen { max-width: 440px; margin: 10vh auto 0; padding: 34px 28px; text-align: center; }
#login-screen h1 { font-size: 2rem; margin-bottom: 8px; }
.google-login-btn { width: 100%; justify-content: center; margin-top: 16px; height: 50px; }

.admin-link-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
  padding: 6px;
}

.admin-error { color: #c0392b; font-size: 0.9rem; margin-top: 10px; }

/* == ADMIN: controls == */
.admin-add-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: var(--glass-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
/* Only applies where the button isn't the default full-width:100% block
   (i.e. everywhere it carries an inline width:auto override, so it's
   sharing a row with other elements) - prevents it from being squeezed to
   the point its own label wraps or the row pushes it out of the card. The
   full-width standalone buttons ("+ הוספת...") keep normal wrapping, which
   is fine since they're alone on their own line either way. */
.admin-add-btn[style*="width:auto"] { flex-shrink: 0; white-space: nowrap; }
.admin-add-btn:hover { background: var(--card); border-color: var(--accent); }

.admin-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #c0392b;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-remove-btn:hover { background: rgba(192,57,43,0.1); }

.admin-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.admin-hint { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }

/* Item image upload */
.item-image-preview {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.upload-status { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.admin-info-text { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin: 8px 0; }
.admin-info-text code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

/* == ADMIN: dialogs == */
/* Custom confirm dialog, replacing window.confirm() */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 10, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.confirm-modal {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(25, 18, 10, 0.25);
}
.confirm-modal p {
  margin: 0 0 20px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.confirm-modal-actions .admin-add-btn { width: auto; }
.confirm-modal-actions .hero-cta { width: auto; padding: 10px 24px; }

/* AI dish photo dialog - reuses the confirm dialog's overlay and box */
.ai-photo-modal { max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; }
.ai-photo-modal h2 { margin: 0 0 8px; }
.ai-photo-modal label { display: block; margin: 12px 0; font-size: 0.9rem; font-weight: 600; }
.ai-photo-modal input[type="file"] { display: block; width: 100%; margin-top: 4px; }
.ai-dish-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 8px 0; }
.ai-dish-list .admin-empty { grid-column: 1 / -1; padding: 12px 0; margin: 0; }
.ai-photo-modal .ai-dish { position: relative; margin: 0; cursor: pointer; }
.ai-dish input { position: absolute; opacity: 0; }
.ai-dish img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 3px solid var(--border); }
.ai-dish input:checked + img { border-color: var(--accent); }
.ai-dish input:focus-visible + img { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
#ai-result-img { width: 100%; border-radius: 10px; margin: 12px 0 0; }
.ai-history { margin-top: 12px; }
.ai-history-list { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; }
.ai-history-list button { position: relative; flex: none; padding: 0; border: 3px solid var(--border); border-radius: 12px; background: none; cursor: pointer; overflow: hidden; }
.ai-history-list button[aria-pressed="true"] { border-color: var(--accent); }
.ai-history-list img { display: block; width: 72px; height: 72px; object-fit: cover; }
.ai-history-badge { position: absolute; inset: auto 0 0 0; padding: 2px; background: rgba(46, 125, 91, 0.92); color: #fff; font-size: 0.65rem; font-weight: 700; text-align: center; }
.ai-photo-modal .confirm-modal-actions { flex-wrap: wrap; }

/* == ADMIN: tabs == */
/* Tabs: a floating glass pill under the top bar (stays while scrolling);
   on phones a glass bar fixed at the bottom, icon over label. */
.admin-tabs {
  position: sticky;
  top: 70px;
  z-index: 20;
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 26px;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow-x: auto;
}
.admin-tab {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tab .icon { width: 18px; height: 18px; }
.admin-tabs .admin-tab.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(138, 74, 28, 0.25); }

/* Settings tab lives in the topbar as a gear icon, not in the tab row */
.admin-tab.settings-icon-btn { padding: 8px; border-radius: 12px; }
.admin-tab.settings-icon-btn.active { background: rgba(251, 142, 40, 0.18); color: var(--accent-dark); }

@media (max-width: 639.98px) {
  .admin-tabs {
    position: fixed;
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 55;
    width: auto;
    margin: 0;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    border-radius: 24px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }
  .admin-tabs .admin-tab {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 8px 2px;
    border-radius: 18px;
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
  .admin-tabs .admin-tab .icon { width: 22px; height: 22px; }
  .admin-tabs .admin-tab.active { background: rgba(251, 142, 40, 0.18); color: var(--accent-dark); box-shadow: none; }
  .admin-tabs .tab-badge { position: absolute; top: 4px; left: calc(50% - 24px); }
  .admin-main { padding-bottom: 120px; }
}

.tab-badge {
  background: #c0392b;
  color: #fff;
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
/* Smaller on phones - after the base rule so it wins. */
@media (max-width: 639.98px) {
  .tab-badge { font-size: 0.6rem; min-width: 15px; height: 15px; }
}

.admin-toolbar {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  row-gap: 8px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  margin-bottom: 16px;
}
#save-btn, #save-settings-btn { border: none; cursor: pointer; font-size: 0.95rem; padding: 10px 22px; }
#save-status, #save-settings-status { font-size: 0.85rem; color: var(--muted); }

/* New-order badge pulse */
.badge-pulse { animation: badge-pulse 0.5s ease 3; }
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* == ADMIN: dashboard == */
.dash-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dash-hero h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.1; }
.dash-subtitle { margin: 6px 0 0; color: var(--muted); }
.dash-hero .hero-cta { padding: 12px 24px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.stat-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 2.2rem; line-height: 1; font-weight: 700; font-family: "Frank Ruhl Libre", serif; color: var(--ink); }

/* Sections: glass cards in a grid that becomes one column on phones. */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.dash-wide { grid-column: 1 / -1; }
.dashboard-section {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 20px;
}
.dashboard-section h2 { font-size: 1.25rem; margin: 0 0 12px; }

/* "Needs attention" rows open that order (buttons); the calendar day list uses divs. */
.mini-order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--glass-soft);
  font: inherit;
  font-size: 0.92rem;
  color: inherit;
  text-align: inherit;
}
button.mini-order-row { cursor: pointer; }
button.mini-order-row:hover { border-color: var(--accent); }
.mini-order-row:last-child { margin-bottom: 0; }
/* Status chips - same palette as the order list (.order-pill). Default (done /
   cancelled / deleted, and any future status): neutral. */
.mini-order-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--border);
  color: var(--ink);
  flex-shrink: 0;
}
.mini-order-status.status-new { background: #fde7d3; color: #8a4a1c; }
.mini-order-status.status-preparing { background: #fff1c9; color: #6b4e00; }
.mini-order-status.status-ready { background: #dff1e6; color: #1f5e3f; }
.mini-order-name { flex: 1; font-weight: 600; }
.mini-order-time { color: var(--muted); font-size: 0.82rem; }

.mini-list-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.mini-list-row:last-child { border-bottom: none; }
.mini-list-count { color: var(--accent-dark); font-weight: 700; }

/* Trend chart */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 140px;
  padding: 10px 0 0;
}
.trend-bar-wrap {
  flex: 1;
  min-width: 0; /* 14 days must fit the card, whatever the label widths */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.trend-bar {
  width: 100%;
  max-width: 22px;
  background: rgba(201, 112, 47, 0.32);
  border-radius: 8px 8px 4px 4px;
  min-height: 3px;
}
.trend-bar-wrap:last-child .trend-bar { background: var(--accent); } /* today */
.trend-bar-label {
  font-size: 0.6rem;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.content-reminders {
  background: rgba(251, 142, 40, 0.12);
  border: 1px solid rgba(251, 142, 40, 0.35);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.content-reminders ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.content-reminders .admin-link-btn { display: inline; width: auto; margin: 0; padding: 0 4px; font-size: 0.85em; text-decoration: underline; }

/* Site traffic card (renderSiteStats in admin-dashboard.js). */
.traffic-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.traffic-num { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--glass-soft); border: 1px solid var(--border); border-radius: 16px; }
.traffic-num span { color: var(--muted); font-size: 0.82rem; }
.traffic-num b { font-size: 1.7rem; line-height: 1; font-family: "Frank Ruhl Libre", serif; color: var(--ink); }
.traffic-num small { font-size: 0.78rem; font-weight: 600; }
.traffic-num .up { color: #2e7d32; }
.traffic-num .down, .traffic-error { color: #c0392b; }
:root[data-theme="dark"] .traffic-num .up { color: #81c784; }
:root[data-theme="dark"] .traffic-num .down, :root[data-theme="dark"] .traffic-error { color: #ef9a9a; }
#dashboard-traffic { position: relative; display: grid; gap: 14px; }
#dashboard-traffic h3 { margin: 0 0 2px; font-size: 1rem; }
.traffic-sub { margin: 0 0 10px; color: var(--muted); font-size: 0.8rem; }
.traffic-box { min-width: 0; padding: 14px 16px; background: var(--glass-soft); border: 1px solid var(--border); border-radius: 16px; }
.traffic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .chart-value { fill: var(--ink); font-weight: 600; }
.chart .chart-center { fill: var(--ink); font: 700 23px "Frank Ruhl Libre", serif; }
.chart-hit line { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart-hit circle { fill: var(--chart-1); stroke: var(--card); stroke-width: 2; }
.chart-hit:not(:hover) :is(line, circle) { opacity: 0; }
.traffic-donut { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.chart-legend { display: grid; gap: 6px; font-size: 0.85rem; }
.chart-legend div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 4px; }
.chart-legend small, .traffic-bar small { color: var(--muted); }
.traffic-bar { padding: 5px 0; font-size: 0.88rem; }
.traffic-bar-text { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.traffic-bar-track { height: 10px; border-radius: 4px; background: var(--chart-track); overflow: hidden; }
.traffic-bar-track div { height: 100%; background: var(--chart-1); border-radius: 4px; }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  padding: 4px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--ink); color: var(--card); font-size: 0.82rem;
}
@media (max-width: 700px) { .traffic-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .traffic-donut { grid-template-columns: 1fr; justify-items: center; }
  .traffic-donut svg { max-width: 140px; }
  .traffic-donut .chart-legend { width: 100%; }
}
.traffic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.traffic-actions .admin-add-btn { width: auto; margin: 0; text-decoration: none; }
.traffic-note { margin: 8px 0 0; color: var(--muted); font-size: 0.82rem; }

/* == ADMIN: orders == */
.orders-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
.orders-filter select { width: auto; }

/* Order list: each order is a compact row (.order-summary); its details
   (.order-details) show only when it is open - beside the list on a wide
   screen, as a sheet from the bottom on a phone. */
.order-card { margin-bottom: 10px; }
.order-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(138, 74, 28, 0.05);
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.order-summary:hover { border-color: var(--accent); }
.order-card.status-done .order-summary, .order-card.status-cancelled .order-summary, .order-card.status-deleted .order-summary { opacity: 0.7; }
.order-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(251, 142, 40, 0.18);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}
.order-summary-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.order-summary-name { font-weight: 600; }
.order-summary-date { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-summary-total { font-size: 0.9rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 479.98px) {
  .order-summary { gap: 10px; padding: 10px 12px; }
  .order-avatar { width: 38px; height: 38px; }
}

.order-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--border);
  color: var(--ink);
}
.order-pill.status-new { background: #fde7d3; color: #8a4a1c; }
.order-pill.status-preparing { background: #fff1c9; color: #6b4e00; }
.order-pill.status-ready { background: #dff1e6; color: #1f5e3f; }
.order-pill.status-cancelled, .order-pill.status-deleted { background: #fdecea; color: #b42318; }

:root[data-theme="dark"] .order-pill.status-new, :root[data-theme="dark"] .mini-order-status.status-new { background: rgba(255, 171, 94, 0.16); color: #ffab5e; }
:root[data-theme="dark"] .order-pill.status-preparing, :root[data-theme="dark"] .mini-order-status.status-preparing { background: rgba(243, 217, 139, 0.16); color: #f3d98b; }
:root[data-theme="dark"] .order-pill.status-ready, :root[data-theme="dark"] .mini-order-status.status-ready { background: rgba(143, 212, 173, 0.16); color: #8fd4ad; }
:root[data-theme="dark"] .order-pill.status-cancelled, :root[data-theme="dark"] .order-pill.status-deleted { background: rgba(255, 120, 110, 0.14); color: #ff9d93; }
:root[data-theme="dark"] .order-total-warning { background: rgba(255, 120, 110, 0.14); color: #ff9d93; }

.order-card:not(.is-open) .order-details { display: none; }
.order-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(251, 142, 40, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 6px rgba(251, 142, 40, 0.06), 0 20px 50px rgba(58, 53, 47, 0.16);
}
/* Sticky, so the ✕ stays at the top while the order scrolls (like .settings-panel-head). */
.order-details-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -12px -20px 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.order-details-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.order-details-title h3 { margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.6rem; line-height: 1.15; }
.order-time { font-size: 0.85rem; color: var(--muted); }
.order-close-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.order-close-btn .icon { width: 18px; height: 18px; }

.order-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.order-stepper li { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.order-stepper li::before { content: ""; height: 4px; border-radius: 999px; background: var(--border); }
.order-stepper li.done { color: var(--accent-dark); font-weight: 600; }
.order-stepper li.done::before { background: var(--accent); }

.order-display { display: flex; flex-direction: column; gap: 14px; }
.order-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.order-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass-soft);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.order-chip-btn .icon { width: 18px; height: 18px; }
.order-chip-btn:hover { border-color: var(--accent); }

.order-lines { display: flex; flex-direction: column; gap: 9px; padding: 14px 16px; border-radius: 18px; background: var(--tint); }
.order-line { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.order-line-choice { color: var(--muted); }
.order-line-price { white-space: nowrap; font-weight: 500; }
.order-line-sep { height: 1px; background: var(--border); }
.order-total { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.order-total-ok { font-size: 0.85rem; font-weight: 600; color: #1f5e3f; }
:root[data-theme="dark"] .order-total-ok { color: #8fd4ad; }
.order-notes { font-size: 0.9rem; color: var(--muted); white-space: pre-line; line-height: 1.55; }

/* Under the note: status + the main next-step button in one box, then quiet
   links (edit, print, delete at the far end). */
.order-status-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--tint); }
.order-status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.9rem; font-weight: 600; }
.order-status-line select { width: auto; padding: 8px 12px; }
.order-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.order-links button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.order-links button:hover { background: var(--tint); }
.order-links .icon { width: 18px; height: 18px; }
.order-links .danger { margin-inline-start: auto; color: #c0392b; }
.order-links .danger:hover { background: rgba(192, 57, 43, 0.1); }
.order-links-dot { color: var(--border); }

/* Wide screens: the open order's details sit fixed on the left; the whole tab
   (toolbar, filters, list) moves over to make room for them. Its row stays in
   the list, filled like the chosen tab, to show which order is open; the same
   for the open customer's row. */
@media (min-width: 1024px) {
  #tab-orders:has(#orders-list.has-open), #tab-customers:has(#customer-card:not(.hidden)) { padding-left: 436px; }
  #orders-list .order-card.is-open .order-summary, .customer-row.is-open { background: var(--primary); border-color: transparent; opacity: 1; }
  :is(#orders-list .order-card.is-open .order-summary, .customer-row.is-open) :is(.order-summary-name, .order-summary-total) { color: #fff; }
  :is(#orders-list .order-card.is-open .order-summary, .customer-row.is-open) .order-summary-date { color: rgba(255, 255, 255, 0.8); }
  :is(#orders-list .order-card.is-open .order-summary, .customer-row.is-open) .order-avatar { background: rgba(255, 255, 255, 0.2); color: #fff; }
  #orders-list .order-card.is-open .order-details, #customer-card {
    position: fixed;
    z-index: 15;
    top: 138px;
    left: max(20px, calc((100vw - 1180px) / 2 + 20px));
    width: 412px;
    max-height: calc(100vh - 158px);
    overflow-y: auto;
    margin: 0;
    border-radius: var(--radius-lg);
  }
  /* The details scroll by themselves here: the head sticks to their very top. */
  #orders-list .order-card.is-open .order-details { padding-top: 0; }
  #orders-list .order-card.is-open .order-details-head { margin-top: 0; padding-top: 20px; background: var(--card); }
}
/* Phones and tablets: the open order is a sheet that slides up from the bottom. */
.order-sheet-backdrop { display: none; }
@media (max-width: 1023.98px) {
  .order-card.is-open .order-summary { display: none; }
  #orders-list .order-card.is-open, #customer-card {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 28px 28px 0 0;
    animation: order-sheet-up 0.28s ease;
  }
  #orders-list .order-card.is-open .order-details, #customer-card .order-details {
    border-radius: 28px 28px 0 0;
    border-bottom: 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  #orders-list .order-card.is-open .order-details::before, #customer-card .order-details::before {
    content: "";
    align-self: center;
    width: 44px;
    height: 5px;
    margin-top: -6px;
    border-radius: 999px;
    background: var(--border);
  }
  .order-sheet-backdrop { position: fixed; inset: 0; z-index: 69; background: rgba(25, 18, 10, 0.45); }
  #tab-orders:has(.order-card.is-open) .order-sheet-backdrop, #tab-customers:has(#customer-card:not(.hidden)) .order-sheet-backdrop { display: block; }
  body:has(#tab-orders:not(.hidden) .order-card.is-open), body:has(#tab-customers:not(.hidden) #customer-card:not(.hidden)) { overflow: hidden; }
}
@keyframes order-sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #orders-list .order-card.is-open, #customer-card { animation: none; } }

/* Orders toolbar */
.orders-toolbar { flex-wrap: wrap; row-gap: 10px; }
#orders-search { width: auto; flex: 1; min-width: 160px; }

/* The visible "מ-" / "עד" controls are .date-field-btn buttons (Calendars
   section below); the two input[type=date] here are hidden value holders. */
.date-range-filters { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; flex-shrink: 0; }
@media (max-width: 480px) {
  /* Both date fields on one row without clipping the "מ-" label */
  .date-range-filters { width: 100%; gap: 8px; }
  .date-range-filters .orders-filter { flex: 1 1 0; min-width: 0; gap: 4px; white-space: nowrap; }
}

/* Quick date filters */
.quick-date-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.quick-date-filters button {
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.quick-date-filters button:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Order full edit form */
.order-edit-form { margin: 8px 0; }
.order-edit-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.order-edit-form input, .order-edit-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--field-bg);
  color: var(--ink);
}
.order-edit-form textarea { min-height: 50px; resize: vertical; }
.order-edit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Order discounts / extra charges (orderAdjustFormHtml) */
.order-adjust-line { color: var(--accent-dark); }
.order-adjust-remove {
  margin-inline-start: 4px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px;
  background: none; color: var(--muted); font: inherit; line-height: 1.4; cursor: pointer;
}
.order-adjust-remove:hover { border-color: var(--accent); color: var(--ink); }
.order-adjust summary, .order-invoice summary { cursor: pointer; width: fit-content; font-weight: 600; font-size: 0.9rem; color: var(--accent-dark); }
.order-adjust-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px 14px; border-radius: 16px; background: var(--tint); }
.order-adjust-kind { display: flex; gap: 16px; font-size: 0.9rem; }
.order-adjust-amount { display: flex; gap: 8px; }
.order-adjust-form input[type="number"], .order-adjust-form input[type="text"], .order-adjust-form input[type="email"], .order-adjust-form select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px;
  font-family: inherit; font-size: 0.9rem; background: var(--field-bg); color: var(--ink);
}
.order-adjust-amount input { flex: 1; min-width: 0; }
.order-adjust-amount select { width: auto; }
.order-adjust-hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.order-adjust-form .admin-add-btn { align-self: flex-start; margin-top: 0; }

/* Tax document from Morning (orderInvoiceHtml) - the form reuses the adjust form's look */
.order-invoice .order-adjust-kind { flex-wrap: wrap; gap: 8px 16px; }
.order-invoice-done {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-radius: 16px; background: var(--tint); font-weight: 600; font-size: 0.9rem;
}
.order-invoice-done a:not(.order-chip-btn) { color: var(--accent-dark); }
.order-invoice-meta { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }

/* Order admin note */
.admin-note-label {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.admin-note-label textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--field-bg);
  color: var(--ink);
  margin-top: 6px;
  resize: vertical;
}
/* The note's own "שמירה" sits inside the field (clear of the resize corner)
   and fills in while there is an unsaved note. */
.order-note { position: relative; }
.order-note textarea { min-height: 92px; padding-bottom: 46px; }
.order-note-save {
  position: absolute;
  bottom: 8px;
  inset-inline-end: 22px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.order-note:has([data-unsaved]) .order-note-save { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Prep summary panel */
#prep-summary { margin-bottom: 16px; }
.prep-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prep-table th { padding: 0 2px 8px; text-align: start; font-weight: 600; font-size: 0.82rem; color: var(--muted); }
.prep-table td { padding: 10px 2px; border-top: 1px solid var(--border); vertical-align: top; }
.prep-table :is(th, td):not(:first-child) { width: 1%; padding-inline-start: 24px; text-align: center; white-space: nowrap; }
.prep-table td:not(:first-child) { color: var(--accent-dark); font-weight: 700; }
@media (max-width: 640px) { .prep-table :is(th, td):not(:first-child) { padding-inline-start: 12px; } }

/* Order status quick-advance button */
.order-advance-btn {
  width: 100%;
  height: 48px;
  background: var(--primary); /* white text needs >=4.5:1; var(--accent) is ~3.6:1 */
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(138, 74, 28, 0.22);
}

/* Print area: hidden on screen, shown only for window.print(). One A4 page
   per order (buildPrintableOrderHtml), black on white with explicit colors so
   the panel's dark mode doesn't print light text, and no backgrounds. */
#print-area { display: none; }
@page { size: A4; margin: 14mm; }
@media print {
  html, body { background: #fff !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
}
.print-order { color: #111; font-size: 14px; line-height: 1.5; }
.print-order + .print-order { break-before: page; }
.print-order p { margin: 0; }
.print-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid #111; }
.print-head img { width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(1.08); }
.print-biz { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: #444; }
.print-biz strong { font-family: "Frank Ruhl Libre", serif; font-size: 24px; color: #111; }
.print-num { display: flex; flex-direction: column; text-align: left; }
.print-num b { font-family: "Frank Ruhl Libre", serif; font-size: 36px; line-height: 1; }
.print-num small { margin-top: 4px; font-size: 12px; color: #555; }
.print-label { font-size: 11px; font-weight: 600; color: #555; }
/* Joined boxes: each box draws its top/start line, pulled 1px out so the
   outer frame (overflow: hidden) clips the ones on its edge. */
.print-info { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0; border: 1px solid #bbb; border-radius: 10px; overflow: hidden; }
.print-info div { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; margin-top: -1px; margin-inline-start: -1px; border-top: 1px solid #ddd; border-inline-start: 1px solid #ddd; }
.print-info b { font-size: 15px; }
.print-info .wide { grid-column: span 2; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table tr { break-inside: avoid; }
.print-table th { padding: 8px 6px; border-bottom: 1.5px solid #111; text-align: start; font-size: 12px; font-weight: 600; color: #555; }
.print-table td { padding: 9px 6px; border-bottom: 1px solid #ddd; font-size: 15px; }
.print-table .num { width: 84px; text-align: left; white-space: nowrap; }
.print-table .qty { width: 60px; text-align: center; }
.print-choice { color: #555; }
.print-totals { width: 300px; margin-top: 14px; margin-inline-start: auto; display: flex; flex-direction: column; gap: 4px; }
.print-totals div { display: flex; justify-content: space-between; padding: 0 6px; }
.print-totals .grand { margin-top: 6px; padding-top: 8px; border-top: 2px solid #111; font-size: 19px; font-weight: 700; }
.print-box { margin-top: 20px; padding: 12px 16px; border: 1px solid #bbb; border-radius: 10px; break-inside: avoid; }
.print-box p { margin-top: 4px; white-space: pre-line; }
.print-box.internal { border-style: dashed; }
.print-order .print-foot { margin-top: 28px; text-align: center; font-size: 12px; color: #555; }
.order-total-warning { padding: 8px 12px; border-radius: 12px; background: #fdecea; color: #b42318; font-weight: 600; font-size: 0.88rem; }

/* "Call me back" requests in the orders list */
.lead-badge { display: inline-block; background: #2e7d5b; color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }

/* == ADMIN: customers == */
/* The rows are .order-summary and the card is .order-details (orders above);
   only what's new for a customer is here. */
#customers-search { width: auto; flex: 1; min-width: 160px; }
.customer-row { margin-bottom: 10px; }
.customer-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.tag-star { background: #fff1c9; color: #6b4e00; }
.tag-new { background: #dff1e6; color: #1f5e3f; }
.tag-sleep { background: #ece7f6; color: #4b3a7a; }
.tag-lead { background: #fde7d3; color: #8a4a1c; }
:root[data-theme="dark"] .tag-star { background: rgba(243, 217, 139, 0.16); color: #f3d98b; }
:root[data-theme="dark"] .tag-new { background: rgba(143, 212, 173, 0.16); color: #8fd4ad; }
:root[data-theme="dark"] .tag-sleep { background: rgba(190, 170, 240, 0.16); color: #cbbcf5; }
:root[data-theme="dark"] .tag-lead { background: rgba(255, 171, 94, 0.16); color: #ffab5e; }
@media (max-width: 639.98px) { .customer-tag, .customer-row-phone { display: none; } }

/* "מחכים לשיחה" above the list (renderLeadsBox), and the requests in a customer's card. */
.leads-box { margin: 0 0 16px; }
.leads-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1.15rem; }
.leads-box > p { margin: 0 0 12px; font-size: 0.85rem; color: var(--muted); }
.lead-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; margin-bottom: 8px; padding: 12px 14px; border-radius: 16px; background: var(--glass-soft); border: 1px solid var(--border); }
.lead-card-who { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; border: none; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.lead-card-who small { margin-inline-start: 4px; font-size: 0.8rem; color: var(--muted); }
.lead-card-who:hover b { color: var(--accent-dark); }
.lead-card-msg { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--tint); font-size: 0.88rem; white-space: pre-line; }
.lead-card-msg.empty { padding: 0; background: none; font-size: 0.8rem; color: var(--muted); }
.lead-card-actions { display: flex; flex-wrap: wrap; gap: 6px; grid-row: 1; grid-column: 2; }
.lead-card-actions .order-chip-btn { height: 36px; padding: 0 12px; font-size: 0.85rem; }
.order-chip-btn.lead-done-btn { background: var(--primary); border-color: transparent; color: #fff; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
@media (max-width: 639.98px) {
  .lead-card { grid-template-columns: 1fr; }
  .lead-card-actions { grid-row: auto; grid-column: 1; flex-wrap: nowrap; gap: 5px; }
  .lead-card-actions .order-chip-btn { flex: 1 1 0; min-width: 0; justify-content: center; gap: 4px; padding: 0 6px; font-size: 0.8rem; }
  .lead-card-actions .order-chip-btn .icon { width: 15px; height: 15px; }
}
.customer-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.customer-lead-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.88rem; font-weight: 600; }
.customer-lead-when .order-pill { height: 24px; padding: 0 10px; font-size: 0.72rem; }
.customer-lead .lead-card-msg { align-self: stretch; }
.customer-lead .lead-done-btn { height: 36px; }

.customer-card .order-details-head { align-items: center; }
.customer-card .order-details-head .order-avatar { width: 52px; height: 52px; font-size: 1.3rem; }
.customer-new-order { background: var(--primary); border-color: transparent; color: #fff; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.customer-new-order:hover { border-color: transparent; box-shadow: 0 8px 18px rgba(138, 74, 28, 0.25); }
.customer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.customer-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: var(--tint); text-align: center; }
.customer-stats b { font-family: "Frank Ruhl Libre", serif; font-size: 1.1rem; line-height: 1.15; white-space: nowrap; }
.customer-stats span { font-size: 0.74rem; color: var(--muted); }
@media (max-width: 479.98px) { .customer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.customer-section h4 { margin: 0 0 8px; font-size: 0.95rem; }
/* "פרטים אישיים" (customerInfoHtml) and its form. */
.customer-info-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.customer-info-head h4 { margin: 0; }
.customer-info-head .admin-link-btn { width: auto; margin: 0; padding: 4px 0; }
.customer-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: 0.9rem; }
.customer-info dt { color: var(--muted); }
.customer-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.customer-info a { color: var(--accent-dark); }
.customer-section .admin-hint { margin: 6px 0 0; }
.customer-form label { display: block; margin-bottom: 10px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.customer-form input { display: block; margin: 3px 0 0; }
.customer-form-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.customer-form-actions .admin-link-btn { width: auto; margin: 0; }
.customer-dishes { display: flex; flex-wrap: wrap; gap: 6px; }
.customer-dishes span { padding: 5px 11px; border-radius: 999px; background: var(--glass-soft); border: 1px solid var(--border); font-size: 0.84rem; }
.customer-dishes b { color: var(--accent-dark); }
.customer-history { display: flex; flex-direction: column; }
.customer-order { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; color: inherit; font: inherit; font-size: 0.9rem; text-align: inherit; cursor: pointer; }
.customer-order:last-child { border-bottom: 0; }
.customer-order:hover { background: var(--tint); }
.customer-order-num { width: 44px; flex-shrink: 0; font-size: 0.8rem; color: var(--muted); }
.customer-order-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-order-total { font-weight: 600; white-space: nowrap; }
.customer-order .order-pill { height: 24px; padding: 0 10px; font-size: 0.72rem; }

/* == ADMIN: calendar == */
/* Calendars (calendar tab + the orders "מ-"/"עד" range picker): the site's
   look - beige page, white cards, orange accent, serif titles. */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calendar-nav button {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 40px;
  padding: 8px 14px;
  font-size: 1rem;
  color: var(--accent-dark);
  cursor: pointer;
}
.calendar-nav button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.calendar-nav h2 { margin: 0; font-size: 1.1rem; font-family: "Frank Ruhl Libre", serif; font-weight: 700; color: var(--ink); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.calendar-day {
  aspect-ratio: 1;
  min-width: 0;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}
/* var(--card), not #fff: white behind the light dark-mode text was unreadable. */
.calendar-day:hover { background: var(--card); border-color: var(--accent); }
.calendar-day.empty { visibility: hidden; cursor: default; }
.calendar-day.today { border: 2px solid var(--accent-warm); }
/* in-range before range-edge: the chosen edge day is also in range, and must
   keep the solid orange (its text is white). */
.calendar-day.in-range { background: rgba(201,112,47,0.16); }
.calendar-day.selected, .calendar-day.range-edge { background: linear-gradient(180deg, var(--accent-warm), var(--accent)); color: #fff; border-color: transparent; }
.calendar-day-num { font-size: 0.9rem; font-weight: 600; }
/* Fixed dark orange in both themes: white text needs >=4.5:1, and
   --accent-dark turns light orange in dark mode (see .order-advance-btn). */
.calendar-day-count {
  background: #8a4a1c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.calendar-day.selected .calendar-day-count { background: #fff; color: #8a4a1c; }
@media (max-width: 480px) {
  .calendar-grid { gap: 4px; }
  .calendar-day { padding: 4px; gap: 2px; }
  .calendar-day-num { font-size: 0.8rem; }
}

/* Orders date-range picker (day cells: see "Calendars" above) */
.range-picker {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 16px;
  margin: 10px 0 14px;
  box-shadow: var(--glass-shadow);
  max-width: 420px;
}
.range-picker .calendar-grid { margin-bottom: 12px; }
.range-picker-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.range-picker-summary { font-size: 0.9rem; color: var(--muted); }
.range-picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.range-picker .hero-cta:disabled { opacity: 0.5; cursor: not-allowed; }

.date-field-btn {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--accent-dark);
  font-weight: 600;
  cursor: pointer;
  min-width: 96px;
}
.date-field-btn:hover, .date-field-btn[aria-expanded="true"] { border-color: var(--accent); }
#range-picker { position: relative; z-index: 15; }

/* Google Calendar: Google's own "sign in" look - white, grey border, the
   coloured G - so it reads as "connect my Google account" in both themes. */
.google-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.google-connect-btn::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.google-connect-btn:hover { background: #f8f9fa; border-color: #c6c9cc; }
.google-connect-btn:disabled { opacity: 0.6; cursor: wait; }
.google-connected-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.push-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.push-actions .admin-add-btn { width: auto; }

/* Calendar tab: the month with names in the days, or the week in columns
   with "מה להכין"; a day opens on a time line in .cal-day-panel (the shared
   side panel / phone sheet - rules under "ADMIN: menu editor"). The
   .calendar-* rules above are the orders range picker's. */
.cal-toolbar { gap: 10px; }
.cal-toolbar .admin-add-btn { width: auto; margin: 0; }
.cal-toolbar .hero-cta { padding: 10px 18px; border: 0; font-size: 0.9rem; }
.cal-toolbar-gap { flex: 1; }
.cal-nav { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); }
.cal-nav button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--accent-dark); font-size: 1.2rem; cursor: pointer; }
.cal-nav button:hover { background: var(--tint); }
.cal-nav h2 { margin: 0 8px; min-width: 130px; text-align: center; font-family: "Frank Ruhl Libre", serif; font-size: 1.25rem; }
.cal-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tint); }
.cal-seg button { padding: 7px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.cal-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(58, 53, 47, 0.08); }

.cal-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 12px; border-radius: var(--radius-lg); background: var(--glass-soft); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.cal-weekday { padding-bottom: 4px; text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.cal-cell {
  min-width: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell:focus-visible, .cal-week-head:focus-visible, .cal-week-order:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cal-cell.past { opacity: 0.7; }
.cal-cell.closed, .cal-week-day.closed { background: repeating-linear-gradient(135deg, var(--glass) 0 8px, rgba(211, 203, 171, 0.32) 8px 16px); }
.cal-cell.selected { opacity: 1; background: var(--card); border: 2px solid var(--accent); box-shadow: 0 8px 20px rgba(201, 112, 47, 0.2); }
.cal-cell-top { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 0.9rem; font-weight: 600; }
.cal-cell.today .cal-num, .cal-week-day.today .cal-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-warm); color: #2a1d08; font-weight: 700; }
.cal-closed { font-size: 0.68rem; color: var(--muted); }
.cal-chip { display: block; padding: 3px 7px; border-radius: 8px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.status-new { background: rgba(251, 142, 40, 0.18); color: #8a4a1c; }
.cal-chip.status-preparing { background: rgba(224, 181, 74, 0.26); color: #6b4e00; }
.cal-chip.status-ready { background: rgba(46, 125, 91, 0.15); color: #1f5e3f; }
.cal-chip.status-done { background: rgba(103, 101, 96, 0.12); color: var(--muted); }
:root[data-theme="dark"] .cal-chip.status-new { color: #ffab5e; }
:root[data-theme="dark"] .cal-chip.status-preparing { color: #f3d98b; }
:root[data-theme="dark"] .cal-chip.status-ready { color: #8fd4ad; }
.cal-more { font-size: 0.72rem; font-weight: 600; color: var(--accent-dark); }
.cal-count { display: none; }

.cal-board.is-week { align-items: stretch; }
.cal-week-day { min-width: 0; min-height: 420px; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); }
.cal-week-day.today { border-color: var(--accent-warm); }
.cal-week-day.selected { border: 2px solid var(--accent); }
.cal-week-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0 8px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--ink); font: inherit; font-size: 0.78rem; cursor: pointer; }
.cal-week-head .cal-num { font-family: "Frank Ruhl Libre", serif; font-size: 1.35rem; font-weight: 700; }
.cal-week-sum { font-size: 0.7rem; font-weight: 600; color: var(--accent-dark); }
.cal-week-order { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 0; border-inline-start: 4px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer; box-shadow: 0 4px 12px rgba(138, 74, 28, 0.07); }
.cal-week-order.status-new { border-inline-start-color: var(--accent-warm); }
.cal-week-order.status-preparing { border-inline-start-color: #e0b54a; }
.cal-week-order.status-ready { border-inline-start-color: #2e7d5b; }
.cal-week-order b { font-size: 0.75rem; }
.cal-week-name { font-size: 0.82rem; font-weight: 700; }
.cal-week-items { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.72rem; color: var(--muted); line-height: 1.35; }

.cal-prep { margin-top: 14px; padding: 16px 18px; border-radius: 22px; background: var(--glass-soft); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.cal-prep-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-prep-head h2 { margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.3rem; }
.cal-prep-head span { font-size: 0.85rem; color: var(--muted); }
.cal-prep-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-prep-list span { padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-size: 0.85rem; }
.cal-prep-list b { color: var(--accent-dark); }

.cal-day-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 12px; background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border); }
.cal-day-head > div { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cal-day-weekday { font-size: 0.82rem; color: var(--muted); }
.cal-day-head h2 { margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.8rem; }
.cal-day-sum { padding: 4px 10px; border-radius: 999px; background: rgba(251, 142, 40, 0.14); color: var(--accent-dark); font-size: 0.78rem; font-weight: 600; }
.cal-day-closed { font-size: 0.78rem; color: var(--muted); }
.cal-day-panel .cal-day-body { margin: 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.cal-timeline { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cal-tl-row { display: flex; gap: 10px; }
.cal-tl-time { flex: 0 0 46px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 12px; font-size: 0.95rem; font-weight: 700; }
.cal-tl-time::after { content: ""; flex: 1; width: 2px; border-radius: 2px; background: var(--border); }
.cal-tl-card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(138, 74, 28, 0.06); }
.cal-tl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-tl-top b { font-size: 0.98rem; }
.cal-tl-items { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.cal-tl-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-tl-foot > b { flex: 1; font-size: 0.92rem; }
.cal-tl-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 0; border-radius: 999px; background: var(--tint); color: var(--ink); font: inherit; font-size: 0.78rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.cal-tl-btn .icon { width: 14px; height: 14px; }
.cal-tl-btn.is-wa { background: rgba(46, 125, 91, 0.12); color: var(--ok); }
.cal-close-box { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 16px; background: var(--tint); }
.cal-close-box .admin-hint { margin: 0; }
.cal-close-day { height: 44px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.cal-close-day:hover { border-color: var(--accent); }
.cal-close-day.is-reopen { border-color: var(--ok); color: var(--ok); }
.cal-close-until { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 0.82rem; color: var(--muted); }
.cal-close-until input { width: auto; margin: 0; }
.cal-add-manual { width: 100%; height: 44px; border: 1px dashed var(--accent); border-radius: 14px; background: transparent; color: var(--accent-dark); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }

/* The manual order form (admin-calendar.js renderManualOrder): the menu and
   the order side by side - the day panel widens over the calendar for it -
   and on a phone the menu on top, the order (foldable) under it. */
.cal-day-panel.is-ordering { display: flex; flex-direction: column; overflow: hidden; }
.cal-day-panel.is-ordering .cal-day-body { flex: 1; min-height: 0; display: flex; padding: 0; }
.cal-day-panel.is-ordering .cal-day-body > :not(.mo) { display: none; }
.mo { flex: 1; min-height: 0; display: flex; }
.mo-menu { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.admin-card .mo-menu input[type="search"] { flex: none; padding: 9px 12px; }
.mo-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-cats:empty { display: none; }
.mo-cat { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; font-size: 0.8rem; cursor: pointer; }
.mo-cat[aria-pressed="true"] { background: var(--accent-warm); border-color: var(--accent-warm); color: #fff; font-weight: 600; }
.mo-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 700; }
.mo-cat[aria-pressed="true"] .mo-count { background: #fff; color: #8a4a1c; }
/* dense: the cards after a picked dish fill its row, and its chooser
   (.mo-pick, a full row) comes right under that row. */
.mo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); grid-auto-flow: row dense; gap: 10px; }
.mo-dish { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 5px 5px 8px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: pointer; box-shadow: 0 4px 12px rgba(138, 74, 28, 0.06); }
.mo-dish:hover { box-shadow: 0 6px 16px rgba(138, 74, 28, 0.12); }
.mo-dish.in-order { box-shadow: inset 0 0 0 1.5px var(--primary); }
.mo-dish.is-picking { box-shadow: inset 0 0 0 2px var(--accent-warm); }
.mo-dish img, .mo-dish .mo-nophoto { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; object-fit: cover; }
.mo-nophoto { display: grid; place-items: center; background: var(--tint); font-size: 1.2rem; }
.mo-dish b { margin: 5px 3px 0; font-size: 0.82rem; line-height: 1.3; }
.mo-dish-price { margin: 0 3px; font-size: 0.75rem; color: var(--muted); }
.mo-dish-badge { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 15px; background: var(--card); color: var(--accent-dark); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); direction: ltr; }
.mo-dish.in-order .mo-dish-badge { background: var(--primary); color: #fff; font-size: 0.8rem; }
.mo-pick { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--accent-warm); }
.mo-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mo-pick-head .settings-panel-close { width: 32px; height: 32px; font-size: 0.8rem; }
.mo-group { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid transparent; }
.mo-group.is-missing { border-color: var(--accent-warm); background: rgba(251, 142, 40, 0.07); }
.mo-group-title { font-size: 0.82rem; font-weight: 600; }
.mo-group-title small { font-weight: 400; color: var(--muted); }
.mo-group-title em { padding: 1px 7px; border-radius: 999px; background: rgba(251, 142, 40, 0.16); color: var(--accent-dark); font-size: 0.7rem; font-style: normal; }
.mo-group.is-missing em { background: var(--accent-warm); color: #fff; }
.mo-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mo-opt { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; font-size: 0.8rem; cursor: pointer; }
.mo-opt[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.mo-opt:disabled { opacity: 0.45; cursor: not-allowed; }
.mo-pick-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.mo-pick-foot .hero-cta { flex: 1; min-height: 40px; padding: 8px 14px; font-size: 0.88rem; }
.mo-pick-foot .hero-cta:disabled { background: var(--tint); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.mo-step { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); }
.mo-step button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--tint); color: var(--accent-dark); font: inherit; font-weight: 600; cursor: pointer; }
.mo-step button:disabled { opacity: 0.4; cursor: not-allowed; }
.mo-step b { min-width: 20px; text-align: center; font-size: 0.86rem; }
.mo-receipt { display: flex; flex-direction: column; min-height: 0; background: var(--glass-soft); }
.mo-receipt-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 6px; }
.mo-receipt-head b { font-family: "Frank Ruhl Libre", serif; font-size: 1.25rem; }
.mo-receipt-head span { flex: 1; font-size: 0.78rem; color: var(--muted); }
.mo-receipt-toggle { display: none; padding: 4px 10px; border: 0; border-radius: 999px; background: var(--tint); color: var(--accent-dark); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.mo-receipt-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 8px; }
.mo-receipt-body label:first-child { margin-top: 0; }
.mo-customer { position: relative; }
.mo-customer-list { position: absolute; z-index: 5; inset-inline: 0; top: 100%; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: 0 10px 24px rgba(58, 53, 47, 0.18); }
.mo-customer-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.88rem; text-align: start; cursor: pointer; }
.mo-customer-list button:hover { background: var(--tint); }
.mo-lines { margin-top: 12px; }
.mo-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 0.84rem; }
.mo-line img, .mo-line .mo-nophoto { flex: none; width: 36px; height: 36px; border-radius: 9px; object-fit: cover; font-size: 0.9rem; }
.mo-line-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mo-line-name small { font-size: 0.74rem; color: var(--muted); }
.mo-line-price { min-width: 48px; text-align: left; font-weight: 600; white-space: nowrap; }
.mo-empty { margin: 8px 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.mo-free { display: flex; gap: 6px; margin-top: 10px; }
.admin-card .mo-free input { padding: 9px 10px; font-size: 0.85rem; }
.admin-card .mo-free input[type="number"] { flex: 0 0 76px; }
.mo-free .admin-add-btn { width: auto; margin: 0; padding: 8px 12px; }
.mo-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0 16px; padding-top: 8px; border-top: 2px solid var(--ink); }
.mo-total b { font-size: 1.35rem; }
.mo-actions { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
.mo-actions .admin-add-btn { width: auto; margin: 0; }
.mo-actions .hero-cta { flex: 1; padding: 11px 18px; font-size: 0.95rem; }
#manual-order-status { padding: 0 16px 8px; font-size: 0.82rem; color: var(--muted); }
#manual-order-status:empty { display: none; }
@media (min-width: 1024px) {
  .cal-day-panel.is-ordering { width: min(820px, calc(100vw - 40px)); height: calc(100vh - 158px); }
  .mo-receipt { flex: 0 0 320px; border-inline-start: 1px solid var(--border); }
}
@media (max-width: 1023.98px) {
  .cal-day-panel.is-ordering { height: 92vh; }
  .mo { flex-direction: column; }
  .mo-receipt { flex: none; max-height: 55%; border-radius: 22px 22px 0 0; box-shadow: 0 -12px 30px rgba(58, 53, 47, 0.14); }
  .mo-receipt-toggle { display: block; }
  .mo-receipt.is-folded .mo-receipt-body { display: none; }
}

/* Phones: dots for the orders in the month, the week as rows. */
@media (max-width: 639.98px) {
  .cal-toolbar-gap { display: none; }
  .cal-nav { flex: 1 1 100%; justify-content: space-between; }
  .cal-board { gap: 4px; padding: 8px; }
  .cal-weekday { font-size: 0; }
  .cal-weekday::after { content: attr(data-short); font-size: 0.75rem; }
  .cal-cell { min-height: 54px; align-items: center; padding: 5px 2px; gap: 3px; }
  .cal-cell-top { justify-content: center; }
  .cal-closed, .cal-more, .cal-chip { display: none; }
  .cal-count { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #8a4a1c; color: #fff; font-size: 0.7rem; font-weight: 700; }
  .cal-board.is-week { grid-template-columns: minmax(0, 1fr); }
  .cal-week-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .cal-week-head { flex: 0 0 64px; border-bottom: 0; border-inline-end: 1px solid var(--border); padding: 4px 6px 4px 0; }
  .cal-week-order { flex: 1 1 140px; }
}

/* == ADMIN: menu editor == */
/* Dishes as cards like on the site; a click opens the dish's editor beside
   the cards (computer) or as a sheet from the bottom (phone) - the same
   pattern as the open order. "⇅ שינוי סדר" turns one category into a list
   of small tiles to sort. "תצוגה מקדימה" shows the real site full screen. */
:root { --ok: #1f5e3f; --bad: #b42318; }
:root[data-theme="dark"] { --ok: #7fd0a6; --bad: #ff8a80; }

.menu-toolbar #menu-search { flex: 1 1 220px; width: auto; margin: 0; padding: 11px 16px; border-radius: 999px; }
.menu-toolbar .admin-add-btn { width: auto; margin: 0; }
.menu-toolbar .admin-link-btn { width: auto; margin: 0; }
/* Phones: the search on its own row, then "+ קטגוריה", "הורדת גיבוי" and the save button on one row. */
@media (max-width: 639.98px) {
  .menu-toolbar { padding: 10px 12px; gap: 8px; }
  .menu-toolbar #menu-search { flex-basis: 100%; padding: 10px 16px; }
  .menu-toolbar .admin-add-btn, .menu-toolbar #save-btn { padding: 8px 10px; font-size: 0.85rem; }
  .menu-toolbar .admin-link-btn { padding: 6px 2px; }
  .menu-toolbar #save-btn { margin-inline-start: auto; }
  .menu-toolbar #save-status:empty { display: none; }
}
#tab-menu.is-reordering .menu-toolbar, #tab-menu.is-reordering .menu-filters, #tab-menu.is-reordering .menus-bar { display: none; }

/* "התפריטים באתר" (renderMenusBar): the site's menus, + a new one, and the
   chosen one's name and delete button. */
.menus-bar { position: relative; display: flex; flex-direction: column; gap: 10px; margin: -4px 0 14px; }
.menus-bar-title { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.menus-bar-hint { font-size: 0.8rem; color: var(--muted); }
/* The menus as on the site ("בחרו תפריט"): a round icon over each name, then "+". */
.menus-circles { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.menus-circle { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 84px; margin: 0; padding: 6px 0 0; border: none; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.menus-ring { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(201, 112, 47, 0.12); color: var(--accent); font-size: 2rem; font-weight: 300; line-height: 1; transition: background 0.2s ease; }
.menus-ring > svg { width: 30px; height: 30px; }
.menus-circle:hover .menus-ring { background: rgba(201, 112, 47, 0.22); }
.menus-circle-name { font-size: 0.85rem; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.menus-circle small { font-size: 0.72rem; color: var(--muted); }
.menus-circle.is-on .menus-ring { background: var(--accent-dark); color: #fff; box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--accent-warm); }
.menus-circle.is-on .menus-circle-name { color: var(--accent-dark); }
.menus-circle.is-soon .menus-ring > svg { opacity: 0.5; }
.menus-add .menus-ring { background: none; border: 2px dashed var(--accent); color: var(--accent-dark); }
.menu-soon { position: absolute; top: -6px; inset-inline-end: -12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-dark); color: #fff; font-size: 0.66rem; font-weight: 600; line-height: 1.5; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); }
.menus-bar-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 0.85rem; }
.menus-bar-picked .admin-link-btn { width: auto; margin: 0; }
/* Phones: smaller circles, so the regular menu, three more and "+" fit in one row. */
@media (max-width: 639.98px) {
  .menus-circles { gap: 10px 6px; }
  .menus-circle { width: 64px; }
  .menus-ring { width: 54px; height: 54px; font-size: 1.7rem; }
  .menus-ring > svg { width: 26px; height: 26px; }
  .menus-circle-name { font-size: 0.78rem; }
  .menu-soon { inset-inline-end: -8px; font-size: 0.6rem; padding: 1px 6px; }
}
/* "עריכת תפריטים": the far (left) end of the circles' row - on a phone, beside the title.
   It opens every circle into a card: the name, "פתוח"/"בקרוב" and the bin (not for the regular menu). */
.menus-edit-all { display: inline-flex; align-items: center; gap: 7px; align-self: center; margin: 0; margin-inline-start: auto; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 999px; background: var(--card); color: var(--accent-dark); font: inherit; font-size: 0.86rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.menus-edit-all svg { width: 16px; height: 16px; }
.menus-edit-all.is-on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.menus-card { width: 132px; padding: 10px 8px; gap: 8px; border: 1px solid var(--border); border-radius: 18px; background: var(--glass-soft); cursor: default; }
.menus-card:hover .menus-ring { background: rgba(201, 112, 47, 0.12); }
.menus-card.is-on:hover .menus-ring { background: var(--accent-dark); }
.menus-card input[type="text"] { padding: 6px 8px; font-size: 0.85rem; font-weight: 600; text-align: center; }
.menus-card-remove { position: absolute; top: -6px; inset-inline-start: -10px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; background: var(--card); color: #c0392b; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); cursor: pointer; }
.menus-card-remove svg { width: 16px; height: 16px; }
.menus-card-live { margin: 0; gap: 8px; font-size: 0.74rem; }
.menus-bar > .admin-hint { margin: 0; }
@media (max-width: 639.98px) {
  .menus-edit-all { position: absolute; top: -8px; left: 0; padding: 6px 12px; font-size: 0.8rem; }
  .menus-card { width: calc((100% - 12px) / 3); padding: 8px 5px; }
}

/* A category's menu (renderCategories, only when there are added menus). */
.cat-menu-pick { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.admin-main .cat-menu-pick select { width: auto; margin: 0; padding: 5px 10px; border-radius: 999px; font-size: 0.82rem; }

/* The open dish's "מופיעה בתפריטים" (only when there are added menus). */
.dish-menus { margin: 10px 0 0; padding: 0; border: none; }
.dish-menus legend { padding: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.item-block .dish-menus label { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; margin-inline-end: 16px; font-size: 0.92rem; font-weight: 500; color: var(--ink); cursor: pointer; }
.dish-menus input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

.menu-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 16px; }
.menu-chip {
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--ink);
  cursor: pointer;
}
.menu-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.category-block {
  background: var(--glass-soft);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 6px 22px rgba(138, 74, 28, 0.06);
  padding: 6px 16px 16px;
  margin-bottom: 14px;
}
.category-block-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; row-gap: 6px; padding: 10px 0 12px; }
/* The name with a pencil after it; the pencil turns it into a field (setupCategoryTitle). */
.cat-title-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.cat-title { margin: 0; padding: 4px 2px; font-family: "Frank Ruhl Libre", serif; font-size: 1.25rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cat-pencil {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--accent-dark);
  cursor: pointer;
}
.cat-pencil:hover { border-color: var(--accent); }
.cat-pencil svg { width: 16px; height: 16px; }
.category-block-header .cat-title-input {
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--field-bg);
  font-family: "Frank Ruhl Libre", serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.cat-done { flex: none; padding: 7px 14px; border: none; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: 0.85rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.category-item-count { font-size: 0.8rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.category-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.category-actions button { width: auto; margin: 0; padding: 7px 12px; font-size: 0.85rem; }
.category-actions .menu-add-dish { background: rgba(251, 142, 40, 0.16); color: var(--accent-dark); border-color: transparent; font-weight: 600; }

/* The cards: photo, first tag, name, price - like the site's menu. */
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 639.98px) {
  .category-block { padding: 4px 10px 12px; }
  .cat-title-wrap { flex-basis: 100%; }
  .menu-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px; }
  .menu-chip { flex: none; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.dish-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(138, 74, 28, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dish-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(138, 74, 28, 0.12); }
.dish-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dish-card.is-open { border: 2px solid var(--accent); box-shadow: 0 10px 26px rgba(201, 112, 47, 0.26); }
.dish-card-photo { position: relative; display: block; aspect-ratio: 1; background: var(--tint); }
.dish-card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dish-card.is-out img { filter: grayscale(0.85); opacity: 0.75; }
.dish-card-nophoto {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 600;
  background: repeating-linear-gradient(135deg, rgba(211, 203, 171, 0.18) 0 12px, rgba(211, 203, 171, 0.34) 12px 24px);
}
.dish-card-tag { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--accent); color: #8a4a1c; font-size: 0.7rem; font-weight: 600; }
.dish-card-out { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 999px; background: #b42318; color: #fff; font-size: 0.72rem; font-weight: 700; }
.dish-card-name { padding: 10px 10px 2px; font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
.dish-card-price { padding: 0 10px 12px; font-size: 0.85rem; font-weight: 700; color: var(--accent-dark); }

/* The open dish (and the open setting - .settings-panel, and the calendar day - .cal-day-panel). */
.dish-panel, .settings-panel, .cal-day-panel {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 60px rgba(58, 53, 47, 0.16);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 1024px) {
  #tab-menu.has-dish, #tab-settings.has-panel, #tab-calendar.has-day { padding-left: 436px; }
  .dish-panel, .settings-panel, .cal-day-panel {
    position: fixed;
    z-index: 15;
    top: 138px;
    left: max(20px, calc((100vw - 1180px) / 2 + 20px));
    width: 412px;
    max-height: calc(100vh - 158px);
    border-radius: var(--radius-lg);
  }
}
.dish-sheet-backdrop, .settings-sheet-backdrop, .cal-sheet-backdrop { display: none; }
@media (max-width: 1023.98px) {
  .dish-panel, .settings-panel, .cal-day-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    max-height: 92vh;
    border-radius: 28px 28px 0 0;
    animation: order-sheet-up 0.28s ease;
  }
  /* The open dish doesn't slide up: its photo flies in from the card (flyDishPhoto in admin-menu.js). */
  .dish-panel { animation: none; }
  #tab-menu.has-dish .dish-sheet-backdrop { animation: sheet-fade 0.2s ease-out; }
  #tab-menu.has-dish .dish-sheet-backdrop, #tab-settings.has-panel .settings-sheet-backdrop, #tab-calendar.has-day .cal-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(25, 18, 10, 0.45); }
  body:has(#tab-menu.has-dish:not(.hidden)), body:has(#tab-settings.has-panel:not(.hidden)), body:has(#tab-calendar.has-day:not(.hidden)) { overflow: hidden; }
}
@keyframes sheet-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dish-panel, .settings-panel, .cal-day-panel, #tab-menu.has-dish .dish-sheet-backdrop { animation: none; } }

/* Sticky: scrolling down leaves the bottom strip of the photo (name + ✕) at the top. */
.dish-panel-head { position: sticky; top: -108px; z-index: 2; height: 180px; background: var(--tint); }
.dish-panel-head img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dish-panel-nophoto { display: grid; place-items: center; height: 100%; font-size: 2rem; opacity: 0.5; }
.dish-panel-close {
  position: absolute;
  z-index: 1;
  bottom: 17px;
  left: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #3a352f;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.dish-panel-title { position: absolute; inset: auto 0 0 0; padding: 34px 18px 12px 62px; background: linear-gradient(transparent, rgba(30, 20, 10, 0.68)); color: #fff; }
.dish-panel-title span { font-size: 0.78rem; opacity: 0.85; }
/* One line, so the strip that stays is always the same height (the full name is in the field below). */
.dish-panel-title h2 { margin: 2px 0 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.6rem; color: #fff; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Field styles (also the option groups and photos inside the editor). */
.item-block { padding: 14px 16px 0; }
.item-block label {
  font-size: 0.78rem;
  text-transform: none;
  color: var(--muted);
  font-weight: 600;
  margin: 10px 0 3px;
}
.item-block input[data-role="name"] { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.item-block .field-row { display: flex; gap: 10px; }
.item-block .field-row > * { flex: 1; }
.item-block .field-row input[data-role="price"] { color: var(--accent-dark); font-weight: 700; }

.dish-stock {
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(46, 125, 91, 0.08);
  border: 1px solid rgba(46, 125, 91, 0.28);
}
.item-block .dish-stock { margin: 0 0 14px; }
.dish-stock b { display: block; font-size: 0.92rem; color: var(--ok); }
.dish-stock small { display: block; margin-top: 2px; font-size: 0.76rem; font-weight: 400; color: var(--muted); }
.stock-toggle.dish-stock input { width: 48px; height: 28px; }
.stock-toggle.dish-stock input::before { width: 24px; height: 24px; }
.stock-toggle.dish-stock input:checked { background: #2e7d5b; }
.stock-toggle.dish-stock input:checked::before { transform: translateX(-20px); }
.dish-stock.is-out { background: rgba(180, 35, 24, 0.06); border-color: rgba(180, 35, 24, 0.28); }
.dish-stock.is-out b { color: var(--bad); }

.dish-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 4px; border-radius: 14px; background: var(--tint); }
.dish-tabs button {
  flex: 1;
  padding: 9px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.dish-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(58, 53, 47, 0.08); }
/* Ingredients/allergens: chips to tick from the list, and "+ רכיב חדש". */
.ingredient-picker { margin: 10px 0 3px; }
.ingredient-picker-title { display: block; margin-bottom: 6px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.ingredient-picker-title small { font-weight: 400; }
.ingredient-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ingredient-chips button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px 4px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--field-bg); color: var(--ink); font-family: inherit; font-size: 0.88rem; cursor: pointer; }
.ingredient-chips button .icon { width: 22px; height: 22px; color: var(--muted); }
.ingredient-chips button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--field-bg)); color: var(--accent-dark); font-weight: 600; }
.ingredient-chips button[aria-pressed="true"] .icon { color: var(--accent); }
.ingredient-add { margin-top: 8px; }
.ingredient-add summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--accent-dark); }
.ingredient-add > input { margin-top: 8px; }
.ingredient-remove { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ingredient-remove select { flex: 1; min-width: 0; }
.ingredient-remove .admin-remove-btn { flex: none; margin: 0; }
.ingredient-icon-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item-block .ingredient-icon-pick label { position: relative; display: grid; place-items: center; width: 40px; height: 40px; margin: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--field-bg); color: var(--muted); cursor: pointer; }
.item-block .ingredient-icon-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.ingredient-icon-pick label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--field-bg)); }
.ingredient-icon-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ingredient-icon-pick .icon { width: 28px; height: 28px; }

.dish-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.dish-photo-actions .admin-add-btn { width: auto; margin: 0; }

.dish-panel-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border);
}
.dish-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: 1.5px solid var(--accent-dark);
  border-radius: 999px;
  background: rgba(251, 142, 40, 0.1);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.dish-preview-btn .icon { width: 19px; height: 19px; }
.dish-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dish-panel-actions .hero-cta { flex: 1; padding: 11px 18px; font-size: 0.95rem; }
.dish-panel-actions .admin-add-btn { width: auto; margin: 0; }

.stock-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.stock-toggle input {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.stock-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.stock-toggle input:checked { background: var(--accent); }
.stock-toggle input:checked::before { transform: translateX(-18px); }

/* ▲▼ buttons (hero photos in the settings tab) */
.reorder-btns { display: flex; gap: 2px; flex-shrink: 0; }
.reorder-btns button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.75rem;
}
.reorder-btns button:disabled { opacity: 0.3; cursor: not-allowed; }
.reorder-btns button:not(:disabled):hover { color: var(--accent-dark); border-color: var(--accent); }

/* "⇅ שינוי סדר" */
.reorder-banner {
  position: sticky;
  top: 136px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(58, 53, 47, 0.95);
  color: #fdf6ef;
  box-shadow: 0 14px 34px rgba(58, 53, 47, 0.25);
}
.reorder-banner-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(251, 142, 40, 0.22); color: #fb8e28; font-size: 1.2rem; font-weight: 700; }
.reorder-banner-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.reorder-banner-text span { font-size: 0.85rem; color: #d8ccb9; }
.reorder-cancel, .reorder-save { padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.reorder-cancel { border: 1px solid rgba(253, 246, 239, 0.4); background: transparent; color: #fdf6ef; }
.reorder-save { border: 0; background: #fb8e28; color: #2a1d08; font-weight: 700; }
.reorder-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0 14px; }
.reorder-head h2 { flex: 1; margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.3rem; }
.reorder-cat-move { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.reorder-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--accent-dark); font-size: 0.78rem; font-weight: 700; }
.reorder-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.reorder-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
}
.reorder-tile img, .reorder-thumb { flex: none; width: 50px; height: 50px; border-radius: 12px; object-fit: cover; background: var(--tint); }
.reorder-name { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle { padding: 10px 4px; color: var(--muted); font-size: 1.1rem; letter-spacing: -3px; cursor: grab; touch-action: none; user-select: none; }
.reorder-tile.is-dragging { z-index: 5; border: 2px solid var(--accent); box-shadow: 0 20px 40px rgba(58, 53, 47, 0.25); cursor: grabbing; }
.reorder-tile.is-drop-target { outline: 2px dashed var(--accent-warm); outline-offset: 3px; background: rgba(251, 142, 40, 0.08); }
.reorder-arrows { display: flex; gap: 4px; }
.reorder-arrows button, .reorder-cat-move button, .reorder-cat-row button[data-cat-move] {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--accent-dark);
  font: inherit;
  cursor: pointer;
}
.reorder-block button:disabled, .reorder-others button:disabled { opacity: 0.35; cursor: not-allowed; }
.arrow-list { display: none; }
.reorder-others { padding: 14px 16px; border-radius: 22px; background: var(--glass-soft); border: 1px solid var(--glass-border); }
.reorder-others h3 { margin: 0 0 4px; font-size: 0.9rem; color: var(--muted); }
.reorder-cat-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.reorder-switch { padding: 7px 12px; border: 0; border-radius: 999px; background: rgba(251, 142, 40, 0.14); color: var(--accent-dark); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
@media (max-width: 639.98px) {
  .reorder-banner { top: 68px; }
  .reorder-list { grid-template-columns: minmax(0, 1fr); }
  .arrow-grid { display: none; }
  .arrow-list { display: inline; }
  .reorder-cat-row { flex-wrap: wrap; }
  .reorder-cat-row .reorder-name { flex-basis: 50%; }
}

/* "תצוגה מקדימה" - full screen, above everything but dialogs. */
.menu-preview { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #2f2a25; color: #fdf6ef; }
body:has(.menu-preview:not(.hidden)) { overflow: hidden; }
.menu-preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px; }
.menu-preview-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-preview-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(251, 142, 40, 0.2); color: #fb8e28; }
.menu-preview-icon .icon { width: 20px; height: 20px; }
.menu-preview-title strong { display: block; font-family: "Frank Ruhl Libre", serif; font-size: 1.15rem; }
.menu-preview-title small { display: block; font-size: 0.8rem; color: #d8ccb9; }
.menu-preview-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preview-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.preview-seg button { padding: 7px 14px; border: 0; border-radius: 999px; background: transparent; color: #d8ccb9; font: inherit; font-size: 0.82rem; cursor: pointer; }
.preview-seg button[aria-pressed="true"] { background: #fdf6ef; color: #3a352f; font-weight: 600; }
.preview-back, .preview-save { padding: 9px 16px; border-radius: 999px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.preview-back { border: 1px solid rgba(253, 246, 239, 0.4); background: transparent; color: #fdf6ef; }
.preview-save { border: 0; background: #fb8e28; color: #2a1d08; font-weight: 700; }
.menu-preview-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 0 20px 20px; }
#menu-preview-frame { width: 100%; height: 100%; border: 0; border-radius: 16px; background: #fdf6ef; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); transition: width 0.25s ease; }
.menu-preview.is-phone #menu-preview-frame { width: 390px; max-width: 100%; }
@media (max-width: 639.98px) {
  .menu-preview-bar { padding: 10px 12px; }
  .preview-size { display: none; }
  .menu-preview-stage { padding: 0; }
  #menu-preview-frame, .menu-preview.is-phone #menu-preview-frame { width: 100%; border-radius: 16px 16px 0 0; }
}

.option-editor { display: grid; gap: 6px; margin-bottom: 8px; }
.option-row { display: grid; grid-template-columns: minmax(0,1fr) 90px auto auto; gap: 6px; align-items: center; }
.option-image { position: relative; }
.option-row .option-image .admin-remove-btn { position: absolute; top: -6px; inset-inline-end: -6px; padding: 0 4px; font-size: 0.7rem; line-height: 1.4; }
.option-image-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 1px dashed var(--border); border-radius: 8px; cursor: pointer; overflow: hidden; font-size: 1.1rem; }
.option-image-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-image-btn img { width: 100%; height: 100%; object-fit: cover; }
.option-row input { padding: 8px; }
.option-row .admin-remove-btn { padding: 6px 8px; }

.option-section { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 8px; }
.option-section-title { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }

.option-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin: 8px 0; background: var(--bg); }
.option-group-head { display: flex; gap: 8px; align-items: center; }
.option-group-head input { flex: 1; }
.option-group-settings { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 8px 0; font-size: 0.9rem; }
.option-group-settings label { display: flex; align-items: center; gap: 6px; }
/* Sizes and their prices (renderSizes): a small table at the top of "מחיר ואפשרויות". */
.sizes { margin: 10px 0 4px; }
.sizes-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sizes-title b { font-size: 0.9rem; }
.sizes-title small { font-size: 0.76rem; color: var(--muted); }
.sizes-box { border: 1px solid var(--border); border-radius: 14px; background: var(--glass-soft); overflow: hidden; }
.sizes-head, .size-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 34px; gap: 8px; align-items: center; padding: 8px 10px; }
.sizes-head { padding-block: 7px; background: var(--tint); font-size: 0.74rem; font-weight: 600; color: var(--muted); }
.size-row + .size-row { border-top: 1px solid var(--border); }
.item-block .size-row input { padding: 9px 10px; }
.size-price { position: relative; }
.item-block .size-price input { padding-inline-end: 28px; color: var(--accent-dark); font-weight: 700; }
.size-price i { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }
.size-row .admin-remove-btn { padding: 6px 8px; }
.sizes-add { display: block; width: 100%; padding: 10px; border: 0; border-top: 1px dashed var(--border); background: transparent; color: var(--accent-dark); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.sizes-add:hover { background: var(--tint); }
.sizes-extra { margin-top: 10px; }
.sizes-site { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--tint); font-size: 0.82rem; color: var(--muted); }
.sizes-site b { color: var(--accent-dark); }
.sizes-site .sizes-missing { color: var(--bad); }
.add-size-link { margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--accent-dark); font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.option-price-preview { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--border); font-size: 0.88rem; display: grid; gap: 4px; }

/* Extra item photos (gallery) */
.item-gallery { margin: 12px 0; font-size: 0.9rem; font-weight: 600; }
.item-gallery-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.item-gallery-thumb { position: relative; }
.item-gallery-thumb .item-image-preview { width: 90px; height: 90px; margin: 0; }
.item-gallery-thumb .admin-remove-btn { position: absolute; top: 4px; inset-inline-end: 4px; padding: 2px 7px; }
/* The dish's AI photo history (photos tab): a click makes one the main photo. */
.photo-history-pick { display: block; padding: 0; border: 3px solid transparent; border-radius: 12px; background: none; cursor: pointer; overflow: hidden; }
.photo-history-pick:not(:disabled):hover { border-color: var(--accent); }
.photo-history-pick:disabled { cursor: default; }
.photo-history-pick img { display: block; width: 90px; height: 90px; object-fit: cover; }
.item-gallery-thumb.is-main .photo-history-pick { border-color: #2e7d5b; }
.photo-history-badge { position: absolute; top: 6px; inset-inline-end: 6px; padding: 2px 8px; border-radius: 999px; background: #2e7d5b; color: #fff; font-size: 0.7rem; font-weight: 700; }

/* == ADMIN: menu category bar == */
/* renderCategoryBar: a glass pill like the tab row, stuck under it (under the
   topbar on a phone) once the dishes reach it - the shown menu, whose list
   opens under it, then the categories, the current one marked. The nav
   itself is 0 high, so it takes no room above the dishes before it sticks,
   and it is as wide as the list (beside the open dish too). */
#menu-cat-bar { position: sticky; top: 142px; z-index: 18; height: 0; }
#tab-menu.is-reordering #menu-cat-bar { display: none; }
.cat-bar-strip {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
#menu-cat-bar.is-shown .cat-bar-strip { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.2s ease; }
.cat-bar-cats { flex: 1; min-width: 0; display: flex; gap: 2px; padding: 0 4px; overflow-x: auto; scrollbar-width: none; }
.cat-bar-cats::-webkit-scrollbar { display: none; }
.cat-bar-cats button { flex: none; padding: 8px 15px; border: none; border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: 0.88rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.cat-bar-cats button.active { background: var(--primary); color: #fff; font-weight: 600; }
.cat-bar-menu { position: relative; flex: none; display: flex; align-items: center; align-self: stretch; padding-inline-end: 6px; border-inline-end: 1px solid var(--border); }
.cat-bar-menu-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px; border: none; border-radius: 999px; background: rgba(201, 112, 47, 0.12); color: var(--accent-dark); font: inherit; font-size: 0.9rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.cat-bar-menu-btn > svg:first-child { width: 22px; height: 22px; flex: none; }
.cat-bar-chevron { width: 16px; height: 16px; flex: none; transition: transform 0.2s ease; }
.cat-bar-menu-btn[aria-expanded="true"] .cat-bar-chevron { transform: rotate(180deg); }
/* Solid: a blur inside the glass pill wouldn't see the page behind it. */
.cat-bar-menus { position: absolute; top: calc(100% + 10px); inset-inline-start: 0; min-width: 230px; padding: 6px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 18px 40px rgba(58, 53, 47, 0.18); }
.cat-bar-menus button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: none; border-radius: 12px; background: none; color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 600; text-align: start; cursor: pointer; }
.cat-bar-menus button:hover { background: rgba(201, 112, 47, 0.08); }
.cat-bar-menus button[aria-current="true"] { background: rgba(201, 112, 47, 0.14); color: var(--accent-dark); }
.cat-bar-menu-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(201, 112, 47, 0.12); color: var(--accent); }
.cat-bar-menu-icon svg { width: 20px; height: 20px; }
.cat-bar-menus small { margin-inline-start: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent-dark); color: #fff; font-size: 0.68rem; font-weight: 600; }
:root[data-theme="dark"] .cat-bar-menus small { color: var(--bg); }
@media (max-width: 639.98px) {
  #menu-cat-bar { top: 66px; }
  /* Only the menu's icon (its name is in the list it opens), so more categories fit. */
  .cat-bar-menu-btn { padding: 7px 7px 7px 9px; gap: 4px; }
  .cat-bar-menu-btn > span { display: none; }
  .cat-bar-menu-btn > svg:first-child { width: 20px; height: 20px; }
  .cat-bar-chevron { width: 14px; height: 14px; }
  .cat-bar-cats { padding: 0 2px; }
  .cat-bar-cats button { padding: 7px 12px; font-size: 0.82rem; }
}
@media (prefers-reduced-motion: reduce) { .cat-bar-strip, #menu-cat-bar.is-shown .cat-bar-strip { transform: none; transition: none; } }

/* == ADMIN: settings == */
/* Settings tab: the "האתר פתוח להזמנות" switch, "מחכים לך", then the
   settings in four group bubbles (two even rows of two), each row with a
   summary. A row opens its form in .settings-panel - the same side panel /
   phone sheet as the open dish (rules shared under "ADMIN: menu editor"). */
.settings-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.settings-head h1 { margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 2.2rem; }
.stock-toggle.settings-store { margin: 0; gap: 14px; padding: 10px 14px; border-radius: 18px; background: rgba(46, 125, 91, 0.1); border: 1px solid rgba(46, 125, 91, 0.3); }
.settings-store b { display: block; font-size: 0.95rem; color: var(--ok); }
.settings-store small { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.stock-toggle.settings-store input { width: 50px; height: 30px; }
.stock-toggle.settings-store input::before { width: 26px; height: 26px; }
.stock-toggle.settings-store input:checked { background: #2e7d5b; }
.stock-toggle.settings-store input:checked::before { transform: translateX(-20px); }
.settings-store.is-closed { background: rgba(180, 35, 24, 0.08); border-color: rgba(180, 35, 24, 0.3); }
.settings-store.is-closed b { color: var(--bad); }

.settings-waiting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 14px; border-radius: 18px; background: rgba(251, 142, 40, 0.1); border: 1px solid rgba(251, 142, 40, 0.35); }
.settings-waiting > b { font-size: 0.85rem; color: var(--accent-dark); }
.settings-waiting button { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.settings-waiting button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-warm); }

.settings-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.settings-group { padding: 8px; border-radius: 22px; background: var(--glass-soft); border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgba(138, 74, 28, 0.07); }
.settings-group h2 { margin: 6px 10px; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent-dark); }
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.settings-row:hover { background: var(--tint); }
.settings-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.settings-row.is-open { background: rgba(251, 142, 40, 0.12); box-shadow: inset 0 0 0 1.5px var(--accent); }
.settings-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(251, 142, 40, 0.12); color: var(--accent-dark); }
.settings-icon svg { width: 19px; height: 19px; }
.settings-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.settings-row-text b { font-size: 0.92rem; }
.settings-row-text small { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-row-text small.warn { color: var(--accent-dark); font-weight: 600; }
.settings-row-chevron { color: var(--muted); font-size: 1.2rem; }
@media (max-width: 639.98px) {
  .settings-head h1 { font-size: 1.8rem; }
  .stock-toggle.settings-store { flex: 1 1 100%; justify-content: space-between; }
  .settings-groups { grid-template-columns: minmax(0, 1fr); }
}

.settings-panel-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--border); }
.settings-panel-group { font-size: 0.75rem; color: var(--muted); }
.settings-panel-head h2 { margin: 0; font-family: "Frank Ruhl Libre", serif; font-size: 1.35rem; }
.settings-panel-close { margin-inline-start: auto; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--card); color: var(--ink); font-size: 0.95rem; cursor: pointer; }
.settings-panel .settings-panel-body { margin: 0; padding: 4px 18px 18px; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.settings-page > .blocked-dates:first-child, .settings-page > .delivery-tiers:first-child { border-top: 0; }
.settings-panel-footer { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--border); }
.settings-panel-footer .hero-cta { flex: 1; padding: 11px 18px; border: 0; font-size: 0.95rem; }
.settings-panel-footer small { flex-basis: 100%; font-size: 0.75rem; color: var(--muted); }

/* "מחשבון כמויות" page (admin-settings.js renderCalcEditor). Its labels hold
   a switch, so they're rows - not the block labels of .admin-card forms. */
/* "לפי מספר אורחים" tab: the calculator / ready-made menus switch. */
.guests-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.calc-save-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 12px; }
.calc-save-top .hero-cta { padding: 10px 22px; }
.calc-save-top span { font-size: 0.85rem; }
.admin-card .calc-live { display: flex; justify-content: space-between; gap: 14px; margin: 4px 0 14px; padding: 10px 14px; border-radius: 16px; background: var(--tint); }
.calc-live b { display: block; font-size: 0.92rem; }
.calc-live small { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.calc-nums { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px; gap: 8px 10px; align-items: center; max-width: 520px; margin: 8px 0 4px; }
.calc-nums > span { font-size: 0.9rem; font-weight: 600; }
.calc-nums > span:nth-child(-n+3) { font-size: 0.78rem; color: var(--muted); text-align: center; }
.calc-nums small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.calc-nums input { text-align: center; font-weight: 700; }
/* Classic and "מפנק" side by side when there's room (a computer), one under the other on a phone. */
.calc-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 520px)); gap: 16px 48px; }
.calc-nums > span.calc-tier { font-size: 0.9rem; font-weight: 700; color: var(--accent-dark); text-align: start; }
.calc-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 0 6px; }
.calc-group-title { margin: 0; font-family: inherit; font-size: 0.9rem; }
.calc-group-head span { color: var(--accent-dark); font-size: 0.8rem; font-weight: 700; }
/* Photo tiles: a tap picks the dish (orange frame and ✓), the rest look faded. */
.calc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: start; }
.calc-tile { overflow: hidden; border: 2px solid transparent; border-radius: 16px; background: var(--field-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
.calc-tile.on { border-color: var(--accent-warm); }
.calc-tile-pick { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.calc-tile-pick:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.calc-tile-pick img, .calc-tile-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--tint); opacity: 0.7; filter: saturate(0.6); }
.calc-tile.on .calc-tile-pick img { opacity: 1; filter: none; }
.calc-tile-name { display: block; padding: 6px 8px 8px; font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.calc-tile.on .calc-tile-pick::after { content: "✓"; position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-warm); color: #2a1d08; font-weight: 800; line-height: 26px; text-align: center; }
.calc-tile .calc-need { padding: 0 8px; }
.calc-tile .calc-dish-choice { padding: 0 8px 8px; }
.calc-need { display: block; color: var(--accent-dark); font-size: 0.75rem; font-weight: 600; }
.admin-card .calc-dish-choice label { margin: 4px 0 0; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.admin-main .calc-dish-choice select { margin-top: 2px; padding: 6px 8px; font-size: 0.85rem; }
.calc-chips-title { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }
.calc-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.admin-card .calc-chips label { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--field-bg); color: var(--ink); font-size: 0.8rem; }
.admin-card .calc-chips input { width: auto; margin: 0; padding: 0; accent-color: var(--primary); }
.calc-chips label:has(:disabled) { opacity: 0.5; }
.calc-skipped { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }

/* FAQ editor */
.faq-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.blocked-dates { margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.blocked-dates-title { font-weight: 600; font-size: 0.95rem; }
.blocked-dates-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.blocked-dates-add input[type="date"] { width: auto; }
.blocked-date-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; margin: 4px 0 0; margin-inline-end: 4px; font-size: 0.9rem; }
.blocked-date-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }

.closure-add { display: grid; gap: 8px; margin: 8px 0; }
.closure-add label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.closure-add input[type="date"] { width: auto; max-width: 100%; }
.closure-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 6px 0; background: var(--bg); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.closure-item p { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); white-space: pre-line; }
.upsell-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--bg); display: grid; gap: 8px; }
.upsell-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.closed-weekdays { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; }

/* Home-page carousel images */
.hero-image-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin: 6px 0; background: var(--bg); }
.hero-image-row .item-image-preview { width: 120px; height: 72px; margin: 0; }
.hero-image-row .admin-remove-btn { margin-inline-start: auto; }

/* Menus by number of guests */
.package-editor { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 10px 0; background: var(--bg); }
.package-editor .field-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.package-editor .field-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.package-editor .field-row label:first-child { flex: 1 1 200px; }
.package-lines { margin: 10px 0; display: grid; gap: 8px; }
.package-line { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--card); }
.package-line-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.package-line-top select { flex: 1 1 200px; min-width: 0; }
.package-line-top label { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; }
.package-line-price { font-weight: 700; color: var(--accent-dark); min-width: 60px; }
.package-line-group { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; font-size: 0.85rem; }
.package-line-group > span { font-weight: 600; }
.package-editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }

/* == ADMIN: assistant == */
/* The AI assistant (coming soon, no chat yet): floats bottom-left on every tab, like
   the customer site's WhatsApp button (the right side holds the RTL headings).
   assets/assistant-wave.webp plays once and stops on her standing pose; a click waves
   again (setupAssistant). Reduced motion gets assets/assistant.webp. A bare button: no
   frame, no hover change (the id beats base.css's darker hover), a ring only for the keyboard.
   z-index 10: under the open side panels (15) and phone sheets (69); on phones she
   sits above the bottom tab bar. */
#assistant-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 10;
  width: 130px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(25, 18, 10, 0.25));
}
#assistant-btn img { display: block; width: 100%; height: auto; }
@media (max-width: 639.98px) {
  #assistant-btn { left: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); width: 88px; }
}
