/* Shared reservations panel — Owner, POS and Waiter render identical markup. */
.rv-panel {
  display: block;
}

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

/* Label sits beside the input, so every control shares one baseline.
   The host pages style bare `label` (grid + bottom margin) and bare `input`
   with a deliberately high-specificity :not() chain, so these overrides have
   to be forced or the date box comes out taller and rounder than the buttons. */
.rv-panel .rv-datefield {
  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: 0 0 auto;
}

.rv-panel .rv-datefield input {
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  padding: 0 8px !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: auto !important;
  min-width: 138px;
  max-width: 170px;
  box-sizing: border-box !important;
}

.rv-count {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.75;
}

.rv-panel .rv-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;
}

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

.rv-panel .rv-btn.danger {
  border-color: rgba(160, 32, 32, 0.4);
  color: #a02020;
}

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

/* Filters — Upcoming / Closed live on the list screen only. */
.rv-filters {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}

.rv-panel .rv-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;
}

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

.rv-tally {
  font-weight: 700;
  opacity: 0.6;
}

.rv-panel .rv-show-all-closed {
  margin-top: 8px;
}

/* Create screen: its own header and Back, no list controls in sight. */
.rv-screen-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rv-screen-head h3 {
  margin: 0;
  font-size: 15px;
}

.rv-panel .rv-req-note {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.7;
}

/* Counter bookings: POS and Waiter create here, so the form is a card of its
   own rather than more controls loose in the toolbar. */
.rv-new-form {
  border: 1px solid rgba(15, 61, 58, 0.18);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  margin: 0;
}

.rv-new-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.rv-panel .rv-new-grid label {
  display: block;
  margin: 0 !important;
  font-size: 12px;
  font-weight: 600;
}

.rv-panel .rv-new-grid input,
.rv-panel .rv-new-grid select {
  display: block;
  width: 100% !important;
  margin: 4px 0 0 !important;
  padding: 0 10px !important;
  height: 38px !important;
  min-height: 38px !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: 1px solid rgba(15, 61, 58, 0.28) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

.rv-req {
  color: #a02020;
  font-weight: 700;
}

.rv-new-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rv-new-msg {
  margin: 8px 0 0;
  min-height: 1em;
  font-size: 12px;
  font-weight: 600;
}

.rv-new-msg.bad {
  color: #a02020;
}

.rv-new-msg.ok {
  color: #0f6b3f;
}

.rv-msg {
  margin: 0 0 8px;
  min-height: 1em;
  font-size: 13px;
}

.rv-msg.bad {
  color: #a02020;
}

.rv-msg.ok {
  color: #0f6b3f;
}

.rv-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin: 14px 0 6px;
}

.rv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rv-item {
  border: 1px solid rgba(15, 61, 58, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.rv-item.is-next {
  border-color: #0f3d3a;
  box-shadow: 0 0 0 2px rgba(15, 61, 58, 0.12);
}

.rv-item.is-overdue {
  border-color: rgba(180, 120, 20, 0.55);
}

.rv-item-head {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.rv-time,
.rv-guest {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rv-time small,
.rv-guest small {
  font-size: 11px;
  opacity: 0.7;
}

.rv-guest strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-status {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(15, 61, 58, 0.08);
}

.rv-status.ok {
  background: rgba(15, 107, 63, 0.14);
  color: #0f6b3f;
}

.rv-status.info {
  background: rgba(21, 82, 140, 0.14);
  color: #15528c;
}

.rv-status.warn {
  background: rgba(180, 120, 20, 0.16);
  color: #7a5210;
}

.rv-status.bad {
  background: rgba(160, 32, 32, 0.12);
  color: #a02020;
}

.rv-status.done {
  background: rgba(15, 61, 58, 0.1);
  color: #0f3d3a;
}

.rv-table {
  justify-self: end;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}

.rv-today-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #0f3d3a;
  color: #fff;
}

.rv-next-flag,
.rv-overdue-flag,
.rv-notes {
  margin: 6px 0 0;
  font-size: 12px;
}

.rv-next-flag {
  color: #0f3d3a;
  font-weight: 700;
}

.rv-overdue-flag {
  color: #7a5210;
  font-weight: 600;
}

.rv-notes {
  opacity: 0.75;
}

.rv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.rv-panel .rv-actions .rv-btn {
  height: auto !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
}

.rv-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 61, 58, 0.24);
}

.rv-assign-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  flex: 1 1 220px;
}

.rv-panel .rv-assign-field select {
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin: 0 !important;
  min-height: 38px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(15, 61, 58, 0.28) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

.rv-panel .rv-assign-field {
  margin: 0 !important;
}

.rv-assign-empty {
  margin: 0;
  font-size: 13px;
  color: #7a5210;
  flex: 1 1 220px;
}

.rv-empty {
  list-style: none;
  padding: 14px;
  border: 1px dashed rgba(15, 61, 58, 0.2);
  border-radius: 10px;
  font-size: 13px;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .rv-item-head {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }

  /* Time and guest share the first row; status and table the second. */
  .rv-status {
    grid-column: 1;
  }

  .rv-table {
    grid-column: 2;
  }

  .rv-count {
    margin-left: 0;
    width: 100%;
  }
}
