/**
 * Your bookings (js/ui/bookings-dashboard.js)
 *
 * 2026-09-23: made fit to open. Slate greys + the teal brand (it painted the
 * pre-rebrand blue/cyan `--accent`), a plain fallback line before every
 * color-mix() (iOS 15.6 cannot paint color-mix, so a declaration without a
 * leader paints NOTHING there), `--border-color` instead of the undefined
 * `--border`, and dark-mode values where `--border-strong` (light-only,
 * style.css) and the light tints would otherwise glow on slate-900.
 */

.bookings-dashboard-modal .bd-modal-content {
  max-width: 720px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.bookings-dashboard-modal .bd-body {
  overflow-y: auto;
  padding: 16px 20px;
}

.bookings-dashboard-modal .bd-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}

/* Tabs */
.bookings-dashboard-modal .bd-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 12px;
  padding-bottom: 0;
  overflow-x: auto;
}
.bookings-dashboard-modal .bd-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-secondary, #64748b);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  /* Three tabs at 390px squeezed into each other (rendered 2026-10-03):
     each keeps its width and the strip scrolls instead. */
  flex: 0 0 auto;
}
@media (max-width: 600px) {
  .bookings-dashboard-modal .bd-tab { padding: 8px 10px; gap: 6px; }
}
.bookings-dashboard-modal .bd-tab:hover {
  color: var(--text-primary, #1e293b);
}
.bookings-dashboard-modal .bd-tab.on {
  color: var(--primary-700, #0f766e);
  border-bottom-color: var(--primary-600, #0d9488);
  font-weight: 600;
}
.bookings-dashboard-modal .bd-tab:focus-visible {
  outline: 2px solid var(--primary-600, #0d9488);
  outline-offset: -2px;
}
.bookings-dashboard-modal .bd-tab-count {
  background: var(--surface-secondary, #f1f5f9);
  color: var(--text-secondary, #64748b);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.bookings-dashboard-modal .bd-tab.on .bd-tab-count {
  background: #ccfbf1;
  background: color-mix(in srgb, var(--primary-600, #0d9488) 15%, transparent);
  color: var(--primary-700, #0f766e);
}

/* List */
.bookings-dashboard-modal .bd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bookings-dashboard-modal .bd-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-primary, #fff);
  transition: background 0.15s, border-color 0.15s;
}
.bookings-dashboard-modal .bd-row:hover {
  background: var(--surface-secondary, #f8fafc);
  border-color: var(--border-strong, #cbd5e1);
}
.bookings-dashboard-modal .bd-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bookings-dashboard-modal .bd-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bookings-dashboard-modal .bd-title {
  font-size: 14px;
  color: var(--text-primary, #1e293b);
  word-break: break-word;
}
.bookings-dashboard-modal .bd-duration {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  background: var(--surface-secondary, #f1f5f9);
  padding: 1px 6px;
  border-radius: 4px;
}
.bookings-dashboard-modal .bd-when {
  font-size: 13px;
  color: var(--text-secondary, #475569);
}
.bookings-dashboard-modal .bd-rel {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-left: 6px;
}
.bookings-dashboard-modal .bd-guest {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #475569);
}
.bookings-dashboard-modal .bd-guest i { color: var(--text-secondary, #64748b); }
.bookings-dashboard-modal .bd-muted {
  color: var(--text-secondary, #64748b);
  font-weight: 400;
}
.bookings-dashboard-modal .bd-note {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  font-style: italic;
}

/* Badge */
.bookings-dashboard-modal .bd-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.bookings-dashboard-modal .bd-badge.on {
  background: #ccfbf1;
  background: color-mix(in srgb, var(--primary-600, #0d9488) 14%, transparent);
  color: var(--primary-700, #0f766e);
}
.bookings-dashboard-modal .bd-badge.cancel {
  background: #fee2e2;
  background: color-mix(in srgb, var(--error-600, #dc2626) 12%, transparent);
  color: var(--error-600, #dc2626);
}
/* Waiting for the host's approval (2026-09-29): amber, the app's "needs you" tone. */
.bookings-dashboard-modal .bd-badge.pend {
  background: var(--warning-100);
  color: var(--warning-800);
}
body.dark-mode .bookings-dashboard-modal .bd-badge.pend {
  background: var(--warning-900);
  background: color-mix(in srgb, var(--warning-400) 18%, transparent);
  color: var(--warning-300);
}
.bookings-dashboard-modal .bd-badge.past {
  background: var(--surface-secondary, #f1f5f9);
  color: var(--text-secondary, #64748b);
}

/* Row actions */
.bookings-dashboard-modal .bd-row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}
.bookings-dashboard-modal .bd-row-actions .link-button {
  background: none;
  border: none;
  color: var(--primary-700, #0f766e);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  min-height: 32px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
}
.bookings-dashboard-modal .bd-row-actions .link-button:hover {
  background: #f0fdfa;
  background: color-mix(in srgb, var(--primary-600, #0d9488) 10%, transparent);
}
.bookings-dashboard-modal .bd-row-actions .link-button:focus-visible {
  outline: 2px solid var(--primary-600, #0d9488);
  outline-offset: 1px;
}
.bookings-dashboard-modal .bd-row-actions .link-button.danger {
  color: var(--error-600, #dc2626);
}
.bookings-dashboard-modal .bd-row-actions .link-button.danger:hover {
  background: #fef2f2;
  background: color-mix(in srgb, var(--error-600, #dc2626) 10%, transparent);
}

/* Empty/loading/error */
.bookings-dashboard-modal .bd-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary, #64748b);
  font-size: 14px;
}
.bookings-dashboard-modal .bd-error {
  padding: 14px 16px;
  background: #fef2f2;
  background: color-mix(in srgb, var(--error-600, #dc2626) 10%, transparent);
  color: var(--error-600, #dc2626);
  border-radius: 8px;
  font-size: 13px;
}

/* Dark mode. --border-strong is defined for light only, and the teal/red
   text shades above are tuned for a white card; on slate-900 they need the
   lighter end of each ramp to stay readable. */
body.dark-mode .bookings-dashboard-modal .bd-row:hover {
  border-color: #475569;
}
body.dark-mode .bookings-dashboard-modal .bd-tab.on,
body.dark-mode .bookings-dashboard-modal .bd-tab.on .bd-tab-count,
body.dark-mode .bookings-dashboard-modal .bd-badge.on,
body.dark-mode .bookings-dashboard-modal .bd-row-actions .link-button {
  color: var(--primary-300, #5eead4);
}
body.dark-mode .bookings-dashboard-modal .bd-tab.on {
  border-bottom-color: var(--primary-400, #2dd4bf);
}
body.dark-mode .bookings-dashboard-modal .bd-tab.on .bd-tab-count,
body.dark-mode .bookings-dashboard-modal .bd-badge.on {
  background: rgba(45, 212, 191, 0.16);
}
body.dark-mode .bookings-dashboard-modal .bd-row-actions .link-button:hover {
  background: rgba(45, 212, 191, 0.12);
}
body.dark-mode .bookings-dashboard-modal .bd-badge.cancel,
body.dark-mode .bookings-dashboard-modal .bd-row-actions .link-button.danger,
body.dark-mode .bookings-dashboard-modal .bd-error {
  color: #fca5a5;
}
body.dark-mode .bookings-dashboard-modal .bd-badge.cancel,
body.dark-mode .bookings-dashboard-modal .bd-error,
body.dark-mode .bookings-dashboard-modal .bd-row-actions .link-button.danger:hover {
  background: rgba(248, 113, 113, 0.14);
}

/* Mobile */
@media (max-width: 600px) {
  .bookings-dashboard-modal .bd-body {
    padding: 12px 16px;
  }
  .bookings-dashboard-modal .bd-row {
    flex-direction: column;
    gap: 8px;
  }
  .bookings-dashboard-modal .bd-row-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }
}

/* ---------------------------------------------------------------------------
   One home for bookings (owner-approved 2026-10-03): a row is a button that
   opens its card; requests carry Approve/Decline on the row; the answer
   sheet sits over the list inside the same dialog.
   --------------------------------------------------------------------------- */
.bookings-dashboard-modal .bd-modal-content { position: relative; }
.bookings-dashboard-modal .bd-row {
  flex-direction: column;
  gap: 8px;
}
.bookings-dashboard-modal .bd-row.is-pending {
  border-style: dashed;
  border-color: var(--primary-600, #0d9488);
}
.bookings-dashboard-modal .bd-row.is-focus {
  box-shadow: 0 0 0 2px var(--primary-600, #0d9488);
}
.bookings-dashboard-modal .bd-row-head {
  all: unset;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
}
.bookings-dashboard-modal .bd-row-head:focus-visible {
  outline: 2px solid var(--primary-600, #0d9488);
  outline-offset: 2px;
  border-radius: 6px;
}
.bookings-dashboard-modal .bd-row-head .bd-title-line { grid-column: 1; }
.bookings-dashboard-modal .bd-row-head .bd-when { grid-column: 1; }
.bookings-dashboard-modal .bd-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--text-secondary, #64748b);
  transition: transform 0.15s;
}
.bookings-dashboard-modal .bd-row.is-open .bd-chevron { transform: rotate(180deg); }
.bookings-dashboard-modal .bd-source {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bookings-dashboard-modal .bd-request-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.bookings-dashboard-modal .bd-request-actions .btn { min-height: 44px; }
.bookings-dashboard-modal .bd-card {
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bookings-dashboard-modal .bd-card-list { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bookings-dashboard-modal .bd-card-row {
  display: grid;
  grid-template-columns: minmax(110px, 30%) 1fr;
  gap: 8px;
  font-size: 13px;
}
.bookings-dashboard-modal .bd-card-row dt { color: var(--text-secondary, #64748b); }
.bookings-dashboard-modal .bd-card-row dd { margin: 0; color: var(--text-primary, #1e293b); word-break: break-word; }
.bookings-dashboard-modal .bd-pre { white-space: pre-wrap; }
.bookings-dashboard-modal .bd-card .bd-row-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}
.bookings-dashboard-modal .bd-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 8px;
}
.bookings-dashboard-modal .bd-tab.has-waiting .bd-tab-count {
  background: var(--primary-600, #0d9488);
  color: #fff;
}

/* The answer sheet */
/* Fixed to the viewport, not the scrolling dialog: absolute put the sheet
   inside the scrolled list, its title under the dialog header (rendered
   at 390px, 2026-10-03). */
.bookings-dashboard-modal .bd-sheet-host {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100000;
}
.bookings-dashboard-modal .bd-sheet-host[hidden] { display: none; }
.bookings-dashboard-modal .bd-sheet {
  background: var(--surface-primary, #fff);
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  border-radius: 14px 14px 0 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.18);
}
.bookings-dashboard-modal .bd-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bookings-dashboard-modal .bd-sheet-head h3 { margin: 0; font-size: 16px; color: var(--text-primary, #1e293b); }
.bookings-dashboard-modal .bd-sheet-what { margin: 0; font-size: 13px; color: var(--text-secondary, #475569); }
.bookings-dashboard-modal .bd-sheet-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bookings-dashboard-modal .bd-sheet-group legend { font-size: 13px; font-weight: 600; color: var(--text-primary, #1e293b); margin-bottom: 4px; }
.bookings-dashboard-modal .bd-sheet-label { font-size: 13px; color: var(--text-secondary, #475569); }
.bookings-dashboard-modal .bd-sheet-text {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-primary, #fff);
  color: var(--text-primary, #1e293b);
  resize: vertical;
}
.bookings-dashboard-modal .bd-sheet-hint { margin: 0; font-size: 12px; }
.bookings-dashboard-modal .bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bookings-dashboard-modal .bd-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-primary, #fff);
  color: var(--text-primary, #1e293b);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.bookings-dashboard-modal .bd-chip[aria-pressed="true"] {
  background: var(--primary-600, #0d9488);
  border-color: var(--primary-600, #0d9488);
  color: #fff;
}
.bookings-dashboard-modal .bd-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.bookings-dashboard-modal .bd-chip:focus-visible { outline: 2px solid var(--primary-600, #0d9488); outline-offset: 2px; }
.bookings-dashboard-modal .bd-radio { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: var(--text-primary, #1e293b); }
.bookings-dashboard-modal .bd-times { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.bookings-dashboard-modal .bd-times-label { display: block; font-size: 12px; color: var(--text-secondary, #64748b); margin-bottom: 4px; }
.bookings-dashboard-modal .bd-sheet-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bookings-dashboard-modal .bd-sheet-actions .btn { min-height: 44px; }
body.dark-mode .bookings-dashboard-modal .bd-sheet,
body.dark-mode .bookings-dashboard-modal .bd-chip,
body.dark-mode .bookings-dashboard-modal .bd-sheet-text { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .bookings-dashboard-modal .bd-sheet-head h3,
body.dark-mode .bookings-dashboard-modal .bd-sheet-group legend,
body.dark-mode .bookings-dashboard-modal .bd-radio,
body.dark-mode .bookings-dashboard-modal .bd-card-row dd { color: #e2e8f0; }
body.dark-mode .bookings-dashboard-modal .bd-chip[aria-pressed="true"] { background: var(--primary-500, #14b8a6); color: #0f172a; }
@media (min-width: 601px) {
  .bookings-dashboard-modal .bd-sheet-host { align-items: center; }
  .bookings-dashboard-modal .bd-sheet { max-width: 520px; border-radius: 14px; }
}
@media (max-width: 600px) {
  .bookings-dashboard-modal .bd-card-row { grid-template-columns: 1fr; gap: 2px; }
}
