/* === Filter popup: small-screen "Filter" trigger + bottom-sheet panel === */
.filter-popup-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.filter-popup-trigger:active { transform: scale(.97); }
.filter-popup-summary { color: var(--muted); font-weight: 700; }
.filter-popup-summary::before { content: "\00b7"; margin-right: 6px; }

.filter-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(12, 27, 20, .55);
  backdrop-filter: blur(4px);
}
.filter-popup-backdrop[hidden] { display: none; }

.filter-popup-head { display: none; }

/* Kitchen history combines the period pills and the station tabs into one
   panel; keep the station-tab row on its own line instead of wrapping
   mid-row with the pill buttons. */
.page-actions .kitchen-toolbar { flex-basis: 100%; margin: 2px 0 0; }

@media (max-width: 760px) {
  .filter-popup-trigger { display: inline-flex; }

  .filter-popup-panel {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 150;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 50px rgba(7, 25, 16, .28);
    padding: 4px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform .28s cubic-bezier(.2, .9, .3, 1.08);
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    width: auto !important;
  }
  .filter-popup-panel.open { transform: translateY(0); }
  .filter-popup-panel.page-actions,
  .filter-popup-panel.kitchen-toolbar,
  .filter-popup-panel.report-filter,
  .filter-popup-panel.filter-toolbar { flex-direction: column; align-items: stretch; }
  .filter-popup-panel .btn { width: 100%; justify-content: center; }
  .filter-popup-panel .field,
  .filter-popup-panel .select,
  .filter-popup-panel .bs-date-field { width: 100%; }

  .filter-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 -16px;
    padding: 14px 16px 10px;
    background: var(--surface);
  }
  .filter-popup-head strong { font-size: 15px; }
}

/* === Nepali (BS) date picker ============================================ */
.bs-date-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bs-date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bs-date-trigger i { color: var(--brand); font-size: 11px; }
.bs-date-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.bs-date-mode-toggle {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}
.bs-date-mode-toggle:hover { color: var(--brand); }

.bs-date-popover {
  position: fixed;
  z-index: 160;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(7, 25, 16, .22);
  padding: 12px;
}
.bs-date-popover[hidden] { display: none; }
.bs-date-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.bs-date-month-label { font-size: 13px; }
.bs-date-nav {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.bs-date-nav:hover { color: var(--brand); }
.bs-date-weekdays, .bs-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.bs-date-weekdays span {
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--muted);
  padding-bottom: 4px;
}
.bs-date-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.bs-date-day:hover { background: var(--surface-2); }
.bs-date-day.today { color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.bs-date-day.selected { background: var(--brand); color: #fff; }
.bs-date-pad { visibility: hidden; }
.bs-date-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 11px; padding: 20px 0; }
.bs-date-popover-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 500px) {
  .bs-date-field { width: 100%; }
  .bs-date-trigger { flex: 1 1 auto; }
}
