/* Shared menu availability panel — POS, Manager and Owner render identical
   markup. Sizes, radii and the ink colour follow reservations-panel.css so a
   staff screen does not change character between one panel and the next. */
.av-panel {
  display: block;
}

.av-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

/* Host pages style bare `label` and `input` with high-specificity rules, so the
   search box has to force its own geometry the same way the date field does. */
.av-panel .av-search {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  flex: 1 1 220px;
  min-width: 160px;
}

/* The placeholder already says what the box is for; the label is for screen
   readers, and taking it out of the flow stops it eating the input's width. */
.av-panel .av-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.av-panel .av-search-input {
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 1px solid rgba(15, 61, 58, 0.28) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: inherit;
  height: 38px !important;
  min-height: 38px !important;
  width: 100% !important;
  min-width: 0;
  box-sizing: border-box !important;
}

.av-panel .av-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  box-sizing: border-box;
  white-space: nowrap;
  border-radius: 8px;
  border: 1px solid rgba(15, 61, 58, 0.28);
  background: #fff;
  color: #0f3d3a;
  cursor: pointer;
}

.av-panel .av-btn.primary {
  background: #0f3d3a;
  border-color: #0f3d3a;
  color: #fff;
}

/* Segmented filter — same shape as the reservations panel's, so the two
   staff panels do not invent different controls for the same job. */
.av-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.av-panel .av-filter {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(15, 61, 58, 0.24);
  border-radius: 999px;
  background: #fff;
  color: #0f3d3a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.av-panel .av-filter.is-on {
  background: #0f3d3a;
  border-color: #0f3d3a;
  color: #fff;
}

.av-filter-count {
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(155, 44, 44, 0.14);
  color: #9b2c2c;
}

.av-panel .av-filter.is-on .av-filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* A read in flight dims the list it is about to replace, so Reload visibly
   does something even when the answer takes a moment. */
.av-panel.is-loading .av-list {
  opacity: 0.55;
  transition: opacity 120ms ease-out;
}

.av-panel .av-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.av-summary {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.av-msg {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 10px;
}

.av-msg.is-ok {
  background: rgba(31, 107, 69, 0.12);
  color: #1f6b45;
}

.av-msg.is-warn {
  background: rgba(160, 110, 32, 0.14);
  color: #7a5314;
}

.av-msg.is-error {
  background: rgba(155, 44, 44, 0.12);
  color: #9b2c2c;
}

.av-cat {
  margin: 0 0 14px;
}

.av-cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.av-cat-count {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
}

.av-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

/* Two blocks: the dish (name over price) takes the slack, the controls keep
   their own width. A long name then wraps inside its own column instead of
   crushing the badge and the button against the edge of the card. */
.av-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 61, 58, 0.16);
  border-radius: 10px;
  background: #fff;
}

/* These rows sit straight on the POS ivory background, where a 6% tint on a
   near-white card was invisible. The fill is strong enough to separate from
   both the page and an available row, and a solid left bar carries the same
   message without relying on colour alone. */
.av-row.is-off {
  background: #fbeaea;
  border-color: rgba(155, 44, 44, 0.45);
  border-left: 4px solid #9b2c2c;
  padding-left: 9px;
}

.av-row.is-busy {
  opacity: 0.7;
}

.av-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.av-row-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  min-width: 0;
  /* Break inside a word only when a single word really is wider than the
     column — a normal long name wraps at its spaces first. */
  overflow-wrap: break-word;
}

.av-row.is-off .av-row-name {
  opacity: 0.75;
}

.av-row-price {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

/* An unpriced dish is a real problem on a menu; it is called out rather than
   shown as a currency amount nobody set. */
.av-row-price.is-unset {
  color: #7a5314;
  opacity: 1;
}

.av-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.av-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.av-badge.is-on {
  background: rgba(31, 107, 69, 0.12);
  color: #1f6b45;
}

.av-badge.is-off {
  background: rgba(155, 44, 44, 0.12);
  color: #9b2c2c;
}

.av-empty {
  margin: 8px 0;
  font-size: 13px;
  opacity: 0.7;
}

/* Phone and narrow POS panes: the dish sits on its own line and the controls
   take the one below, full width, so the button is always a comfortable tap
   and nothing is clipped by a squeezed column. */
@media (max-width: 560px) {
  .av-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Badge left, action right. The button keeps its natural width — stretched
     across the card it reads as a banner rather than a button, and the empty
     space between the two is what makes them legible as separate things. */
  .av-row-actions {
    justify-content: space-between;
    width: 100%;
  }
}
