/* ============ Revenue Calendar: Upload Airbnb CSV (airbnb-import.js) ============ */

.ai-bar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.ai-upload-btn {
  width: auto; margin: 0; padding: 9px 14px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88em; font-weight: 650; border-radius: 10px;
  /* Outlined so it never reads as one of the solid plum booking pills in the calendar below. */
  background: var(--card-solid); color: var(--accent);
  border: 1.5px solid rgba(var(--accent-rgb), 0.55); box-shadow: 0 1px 2px var(--shadow-soft);
  transition: background 0.15s, border-color 0.15s;
}
.ai-upload-btn:hover { filter: none; background: var(--lavender-wash); border-color: var(--accent); }
.ai-upload-btn svg { width: 16px; height: 16px; }

/* Sits on the same row as the "Calendar" title (revenue-calendar.css), except on landscape phones. */
@media not all and (orientation: landscape) and (max-height: 540px) {
  #revenueView > .ai-bar { position: absolute; top: 2px; right: 2px; z-index: 1; height: var(--rc-title-h, 32px); align-items: center; margin: 0; }
}
@media (min-width: 768px) and (orientation: portrait), (min-width: 768px) and (min-height: 541px) {
  #revenueView > .ai-bar { top: 0; }
}
/* Portrait phones: a more compact button. */
@media (max-width: 767px) and (orientation: portrait) {
  .ai-upload-btn { padding: 6px 12px; gap: 6px; font-size: 0.8em; border-radius: 9px; }
  .ai-upload-btn svg { width: 14px; height: 14px; }
}

body.ai-open { overflow: hidden; }
.ai-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--backdrop);
}
.ai-backdrop[hidden] { display: none; }
.ai-dialog {
  width: min(760px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  background: var(--card-solid); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-float-modal);
}
.ai-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 10px; }
.ai-head > div { flex: 1; min-width: 0; }
.ai-head h2 { margin: 0; font-size: 1.1em; }
.ai-sub { margin-top: 3px; font-size: 0.8em; color: var(--muted); overflow-wrap: anywhere; }
.ai-close {
  width: 34px; height: 34px; margin: 0; padding: 0; flex-shrink: 0; border-radius: 50%;
  background: var(--btn-ghost-bg); color: var(--btn-ghost-text); font-size: 1.3em; line-height: 1;
}
.ai-body { flex: 1; overflow: auto; padding: 4px 18px 8px; }
.ai-foot { padding: 0 18px 18px; }
.ai-foot button { margin-top: 10px; }

.ai-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.ai-facts div { padding: 10px 12px; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--border); }
.ai-facts dt { font-size: 0.72em; color: var(--muted); font-weight: 500; }
.ai-facts dd { margin: 2px 0 0; font-size: 0.92em; font-weight: 650; color: var(--text); }
@media (max-width: 520px) { .ai-facts { grid-template-columns: 1fr 1fr; } .ai-facts div:last-child { grid-column: 1 / -1; } }

.ai-note { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--warning-soft); color: var(--gold); font-size: 0.85em; }
.ai-muted { margin-top: 6px; font-size: 0.8em; color: var(--muted); }
.ai-error { padding: 10px 12px; border-radius: 12px; background: var(--expense-soft); color: var(--red); font-size: 0.9em; line-height: 1.45; }
.ai-skipped { margin-top: 8px; font-size: 0.82em; color: var(--text-subtle); }
.ai-skipped summary { cursor: pointer; font-weight: 600; }
.ai-skipped ul { margin: 6px 0 0 18px; line-height: 1.5; }

.ai-listing { margin-top: 16px; }
.ai-listing h3 { margin: 0 0 6px; font-size: 0.92em; color: var(--text); overflow-wrap: anywhere; }
.ai-listing h3 span { font-weight: 500; color: var(--muted); font-size: 0.9em; margin-left: 4px; }
.ai-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 0.82em; }
.ai-table th, .ai-table td { padding: 7px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--divider); }
.ai-table th { font-weight: 600; color: var(--muted); background: var(--input-bg); }
.ai-table tr:last-child td { border-bottom: none; }
.ai-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.ai-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.9em; font-weight: 600; }
.ai-status.confirmed { background: var(--income-soft); color: var(--green); }
.ai-status.tentative { background: var(--warning-soft); color: var(--gold); }
.ai-status.cancelled { background: var(--expense-soft); color: var(--red); }

/* Review: match listings, recognised listings, import */
.ai-section { margin: 18px 0 4px; font-size: 0.95em; font-weight: 700; color: var(--text); }
.ai-map { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--input-bg); border: 1px solid var(--border); }
.ai-map-label { font-size: 0.72em; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ai-map-title { margin-top: 2px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.ai-map-title span { font-weight: 500; color: var(--muted); font-size: 0.85em; margin-left: 4px; }
.ai-map label { margin-top: 10px; }
.ai-map select { background: var(--card-solid); }

.ai-matched { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; }
.ai-matched li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 12px; border-bottom: 1px solid var(--divider); font-size: 0.86em; }
.ai-matched li:last-child { border-bottom: none; }
.ai-matched-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.ai-matched-prop { color: var(--text-subtle); }
.ai-matched-prop em { font-style: normal; color: var(--muted); font-size: 0.92em; }
.ai-matched-count { margin-left: auto; color: var(--muted); font-size: 0.92em; white-space: nowrap; }

.ai-details { margin-top: 16px; font-size: 0.9em; }
.ai-details summary { cursor: pointer; font-weight: 600; color: var(--text-subtle); }
.ai-body .ai-error[data-ai-message] { margin-top: 14px; }
.ai-foot-row { display: flex; gap: 10px; }
.ai-done { font-size: 1.05em; font-weight: 650; color: var(--green); margin: 4px 0 6px; }
