/* ── Tab Navigation ──────────────────────────────────────────────────────── */
.tab-btn {
  display: inline-block;
  padding: 14px 20px;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  background: none;
  border-top: 0; border-left: 0; border-right: 0;
}
.tab-btn:hover   { color: #374151; border-bottom-color: #d1d5db; }
.tab-btn.active  { color: #2563eb; border-bottom-color: #2563eb; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  border: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-ghost     { background: transparent; color: #6b7280; }
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; color: #374151; }
.action-btn    { background: none; border: none; color: #9ca3af; font-size: 1rem; padding: 2px 4px; cursor: pointer; }
.action-btn:hover { color: #374151; }

/* ── Form Controls ───────────────────────────────────────────────────────── */
.filter-label { display: block; font-size: .75rem; font-weight: 500; color: #6b7280; margin-bottom: 4px; }
.filter-input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .875rem;
  color: #374151;
  background: #fff;
  outline: none;
}
.filter-input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table { font-size: .875rem; width: 100%; border-collapse: collapse; }
.data-table thead tr { background: #f9fafb; position: sticky; top: 0; z-index: 1; }
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid #f3f4f6; }
.data-table tbody tr:hover { background: rgba(219,234,254,.25); }
.data-table tbody tr.row-neg    td { color: #b91c1c; }
.data-table tbody tr.row-pos    td { color: #1e40af; }
.data-table tbody tr.row-payout td { color: #b91c1c; }
.data-table tbody tr.locked-row       { background: rgba(254,226,226,.15); }
.data-table tbody tr.guest-folio-alert { background: rgba(254,226,226,.35); }
.data-table tbody tr.guest-folio-alert td { color: #b91c1c; }
.data-table tbody tr.selected-row { background: rgba(219,234,254,.55) !important; }
.data-table tbody tr.selected-row td { border-bottom-color: #bfdbfe; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge        { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 4px; font-weight: 500; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ── Summary Chips ───────────────────────────────────────────────────────── */
.summary-chip {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  background: #fff !important;
  border: 1.5px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 6px 14px !important;
  min-width: 108px;
  gap: 2px;
  cursor: pointer !important;
  text-align: left;
  transition: border-color .15s, background .15s;
  line-height: 1.2;
}
.summary-chip:hover  { border-color: #93c5fd !important; background: #eff6ff !important; }
.summary-chip.active { border-color: #2563eb !important; background: #eff6ff !important; }
.summary-chip-amount { display: block; font-size: .92rem; font-weight: 700; font-family: monospace; line-height: 1.3; }
.summary-chip-label  { display: block; font-size: .69rem; color: #6b7280; font-weight: 500; white-space: nowrap; }

/* ── Import Cards ────────────────────────────────────────────────────────── */
.import-card {
  background: #fff;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.import-card:hover { border-color: #60a5fa; background: rgba(219,234,254,.15); }
.import-icon  { font-size: 2.5rem; margin-bottom: 8px; }
.import-title { font-weight: 600; color: #374151; font-size: 1rem; margin-bottom: 4px; }
.import-desc  { font-size: .875rem; color: #9ca3af; line-height: 1.4; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* ── Wizard Steps ────────────────────────────────────────────────────────── */
.step-dot {
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #6b7280;
  font-weight: 500;
}
.step-dot.active { background: #2563eb; color: #fff; }
.step-dot.done   { background: #16a34a; color: #fff; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-slide {
  animation: toastIn .25s ease-out, toastOut .4s ease-in 3.2s forwards;
}
@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px); } }

/* ── Invoice Workspace (top/bottom split) ────────────────────────────────── */
.invoice-workspace {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* List pane: fills viewport when detail is closed */
.invoice-list-pane {
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  min-height: 200px;
  transition: max-height .2s ease, flex .2s ease;
}

/* Detail pane: hidden by default */
.invoice-detail-pane {
  display: none;
  margin-top: 8px;
}

/* ── When detail is open: workspace becomes a fixed-height flex column ────── */
.invoice-workspace.detail-open {
  height: calc(100vh - 200px);
  min-height: 480px;
}
.invoice-workspace.detail-open .invoice-list-pane {
  flex: 0 0 auto;
  height: 30vh;
  max-height: 30vh;
  min-height: 140px;
}
.invoice-workspace.detail-open .invoice-detail-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
/* Let the white inner card fill the detail pane and scroll */
.invoice-workspace.detail-open .invoice-detail-pane > div {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
