/* bill-tracker.css — Bill Tracker UI styles */
/* Uses the warm artisanal theme variables from theme.css */

:root {
  --accent: #C4623A;
  --accent-dark: #A3512D;
  --gold: #D4A853;
  --deep: #0E0C0A;
  --deep-mid: #1A1815;
  --fg: #1A1815;
  --fg-light: #4A4540;
  --muted: #7A746E;
  --border: #D4CCBA;
  --bg: #F5F0E8;
  --bg-warm: #EDE8DE;
}

.bt-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 60px;
  background: var(--deep);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.bt-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--gold);
  flex-shrink: 0;
}

.bt-brand-mark { font-size: 20px; }

.bt-nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.bt-nav-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.bt-nav-link:hover, .bt-nav-link.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.bt-nav-actions { flex-shrink: 0; }

.bt-main { padding: 32px; max-width: 1200px; margin: 0 auto; }

.bt-view { display: none; }
.bt-view.active { display: block; }

.bt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.bt-page-header h1 { font-size: 26px; font-weight: 700; color: var(--deep); }
.bt-subtitle { font-size: 15px; color: var(--muted); margin-top: 4px; }
.bt-header-actions { display: flex; gap: 10px; align-items: center; }
.bt-filters { display: flex; gap: 8px; }

/* Onboarding checklist */
.bt-onboarding-checklist {
  background: linear-gradient(135deg, #1A1815 0%, #2D2320 100%);
  color: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(212, 168, 83, 0.25);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.bt-ob-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}
.bt-ob-header .bt-onboarding-icon { font-size: 22px; }
.bt-onboarding-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.bt-onboarding-close:hover { color: #fff; }
.bt-ob-steps { display: flex; flex-direction: column; gap: 10px; }
.bt-ob-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.bt-ob-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.bt-ob-step-done .bt-ob-check::after { content: '✓'; color: #fff; }
.bt-ob-step-done .bt-ob-check { background: #2E7D32; border-color: #2E7D32; }
.bt-ob-step-done .bt-ob-step-body strong { text-decoration: line-through; opacity: 0.5; }
.bt-ob-step-body { flex: 1; }
.bt-ob-step-body strong { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.bt-ob-step-body span { font-size: 12px; color: rgba(255,255,255,0.55); }

/* Stats row */
.bt-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.bt-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.bt-stat-number {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.bt-stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.bt-stat-red .bt-stat-number { color: #D63A2F; }
.bt-stat-amber .bt-stat-number { color: #D9811E; }
.bt-stat-green .bt-stat-number { color: #2E7D32; }
.bt-stat-info .bt-stat-number { color: var(--accent); }
.bt-stat-purple .bt-stat-number { color: #7B2FBE; }
.bt-stat-blue .bt-stat-number { color: #1565C0; }

/* Stat number color indicators */
.bt-stat-number.on-time-good  { color: #2E7D32; }  /* ≥80% */
.bt-stat-number.on-time-fair  { color: #D9811E; }  /* 60–79% */
.bt-stat-number.on-time-poor  { color: #D63A2F; }  /* <60% */
.bt-stat-number.avg-days-good { color: #2E7D32; }  /* early (negative) */
.bt-stat-number.avg-days-neutral { color: #D9811E; } /* exactly on time */
.bt-stat-number.avg-days-bad  { color: #D63A2F; }  /* late (positive) */

/* Payment score card */
.bt-scorecard {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.bt-scorecard-left { flex-shrink: 0; text-align: center; }

.bt-score-number {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: var(--deep);
}

.bt-score-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.bt-score-streak {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  color: #2E7D32;
}

.bt-score-benchmark {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.bt-score-sparkline { margin-top: 10px; display: flex; justify-content: center; }
.bt-score-sparkline svg { display: block; }
.bt-score-sparkline .bt-spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bt-score-sparkline .bt-spark-dot { fill: var(--accent); }

/* In-card score stats (on-time rate, avg days early/late) */
.bt-score-stat { margin-top: 14px; }
.bt-score-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--deep);
}
.bt-score-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

.bt-score-stat-value.on-time-good     { color: #2E7D32; }  /* ≥80% */
.bt-score-stat-value.on-time-fair     { color: #D9811E; }  /* 60–79% */
.bt-score-stat-value.on-time-poor     { color: #D63A2F; }  /* <60% */
.bt-score-stat-value.avg-days-good    { color: #2E7D32; }  /* early */
.bt-score-stat-value.avg-days-neutral { color: #D9811E; }
.bt-score-stat-value.avg-days-bad     { color: #D63A2F; }  /* late */

.bt-scorecard-right { flex: 1; min-width: 0; }

.bt-score-bar-track {
  height: 10px;
  background: var(--bg-warm);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bt-score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease, background 0.3s ease;
  background: var(--accent);
}

.bt-score-meta {
  font-size: 12px;
  color: var(--muted);
}

/* Score share / export actions */
.bt-score-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.bt-btn-icon-sm { padding: 5px 10px; font-size: 12px; gap: 5px; }
.bt-score-action-icon { display: block; }

.bt-share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 8px);
  background: var(--deep);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 300;
  pointer-events: none;
}
.bt-share-toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bt-print-header {
  display: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }

  .bt-nav,
  #onboarding-banner,
  #dashboard-empty-cta,
  .bt-stats-row,
  #bt-payment-history-section,
  .bt-dashboard-groups,
  .bt-modal {
    display: none !important;
  }

  body { background: #fff; }
  .bt-main { padding: 0; max-width: none; }

  .bt-scorecard {
    display: block !important;
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 24px;
    page-break-inside: avoid;
    text-align: left;
  }

  .bt-scorecard-left,
  .bt-scorecard-right {
    display: block;
    text-align: left;
    flex: none;
    min-width: 0;
  }

  .bt-score-number-row { justify-content: flex-start; }
  .bt-score-actions { display: none !important; }
  .bt-print-header { display: block; }
  .bt-score-sparkline { justify-content: flex-start; }
}


/* Score info icon + tooltip */
.bt-score-number-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  justify-content: center;
}

.bt-score-info-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-top: 10px;
}

.bt-score-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.bt-score-info-btn:hover,
.bt-score-info-btn.active {
  color: var(--accent);
  background: var(--bg-warm);
}

.bt-score-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 244px;
  background: var(--deep);
  color: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.bt-score-info-wrap:hover .bt-score-tooltip,
.bt-score-tooltip.visible {
  display: block;
}

.bt-score-tooltip-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  margin-bottom: 10px;
}

.bt-score-tooltip-list {
  margin: 0 0 10px 0;
  padding: 0 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bt-score-tooltip-list li {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.bt-score-tooltip-list li strong {
  color: #fff;
}

.bt-score-tooltip-scale {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 8px;
}

/* Invoice groups */
.bt-dashboard-groups { display: flex; flex-direction: column; gap: 24px; }

.bt-group-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
}

.bt-group-overdue { color: #D63A2F; border-color: #D63A2F; }
.bt-group-due { color: #D9811E; border-color: #D9811E; }
.bt-group-upcoming { color: #2E7D32; border-color: #2E7D32; }

/* Invoice cards */
.bt-invoice-list { display: flex; flex-direction: column; gap: 10px; }

.bt-invoice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}

.bt-invoice-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.bt-invoice-card.paid { opacity: 0.65; }

.bt-invoice-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-overdue { background: #D63A2F; }
.dot-due { background: #D9811E; }
.dot-upcoming { background: #2E7D32; }
.dot-paid { background: #7A746E; }

.bt-invoice-card.paid .bt-invoice-status-dot { background: var(--muted); }

.bt-invoice-vendor { flex: 1; min-width: 0; }
.bt-invoice-vendor-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-invoice-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bt-invoice-amount { font-size: 18px; font-weight: 700; color: var(--deep); flex-shrink: 0; }
.bt-invoice-due { font-size: 13px; color: var(--fg-light); flex-shrink: 0; min-width: 80px; text-align: right; }
.bt-invoice-due.overdue { color: #D63A2F; font-weight: 600; }
.bt-invoice-due.due-soon { color: #D9811E; font-weight: 600; }

.bt-invoice-actions { display: flex; gap: 6px; flex-shrink: 0; }

.bt-invoice-category {
  font-size: 11px;
  background: var(--bg-warm);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--fg-light);
  font-weight: 500;
  flex-shrink: 0;
}

.bt-flag-badge {
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEAA7;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Section titles */
.bt-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--deep);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Queue items */
.bt-queue-item {
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
}

.bt-queue-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bt-queue-match-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--deep);
}

.bt-queue-match-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.bt-queue-amounts {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bt-queue-amount-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 16px;
  flex: 1;
  min-width: 140px;
}

.bt-queue-amount-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.bt-queue-amount-value { font-size: 20px; font-weight: 700; color: var(--deep); }

.bt-queue-flags { margin-bottom: 14px; }
.bt-queue-flag {
  display: inline-block;
  background: #FFF3CD;
  color: #856404;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
  margin-bottom: 4px;
}

.bt-queue-actions { display: flex; gap: 8px; }

/* Confirmation list */
.bt-confirmation-list { display: flex; flex-direction: column; gap: 10px; }
.bt-conf-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.bt-conf-info { flex: 1; }
.bt-conf-amount { font-size: 20px; font-weight: 700; color: var(--deep); flex-shrink: 0; }
.bt-conf-status-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 3px 8px;
  flex-shrink: 0;
}
.bt-badge-matched { background: #E8F5E9; color: #2E7D32; }
.bt-badge-unmatched { background: var(--bg-warm); color: var(--muted); }

/* Buttons */
.bt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.bt-btn:active { transform: scale(0.98); }
.bt-btn-primary { background: var(--accent); color: #fff; }
.bt-btn-primary:hover { background: var(--accent-dark); }
.bt-btn-secondary { background: var(--bg-warm); color: var(--fg); border: 1px solid var(--border); }
.bt-btn-secondary:hover { background: #e3ddd4; }
.bt-btn-ghost { background: transparent; color: var(--fg-light); }
.bt-btn-ghost:hover { background: var(--bg-warm); }
.bt-btn-success { background: #2E7D32; color: #fff; }
.bt-btn-success:hover { background: #1B5E20; }
.bt-btn-sm { padding: 5px 10px; font-size: 12px; }

/* Forms */
.bt-select, .bt-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--fg);
  transition: border-color 0.15s;
}

.bt-select:focus, .bt-input:focus {
  outline: none;
  border-color: var(--accent);
}

.bt-form { display: flex; flex-direction: column; gap: 16px; }
.bt-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bt-form-group { display: flex; flex-direction: column; gap: 6px; }
.bt-form-group label { font-size: 13px; font-weight: 600; color: var(--fg-light); }
.bt-form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

.bt-parse-info {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Modals */
.bt-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 12, 10, 0.6);
  backdrop-filter: blur(4px);
}

.bt-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.bt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.bt-modal-header h2 { font-size: 20px; font-weight: 700; color: var(--deep); }
.bt-modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-light);
  transition: background 0.15s;
}
.bt-modal-close:hover { background: var(--border); }

/* Upload zone */
.bt-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg);
}

.bt-upload-zone:hover { border-color: var(--accent); background: #fff; }

.bt-upload-zone--drag-over {
  border-color: var(--accent) !important;
  background: rgba(196,98,58,0.06) !important;
  transform: scale(1.01);
}

.bt-upload-zone--has-file {
  border-style: solid;
  border-color: var(--accent);
  background: #fff;
}
.bt-upload-zone--has-file .bt-upload-idle { display: none; }
.bt-upload-zone--has-file .bt-upload-file-info { display: flex; }

.bt-upload-zone--uploading {
  opacity: 0.7;
  pointer-events: none;
}
.bt-upload-zone--uploading .bt-upload-idle { display: none; }
.bt-upload-zone--uploading .bt-upload-file-info { display: none; }
.bt-upload-zone--uploading .bt-upload-spinner-wrap { display: flex; }

.bt-upload-file-info {
  display: none;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.bt-upload-file-icon { font-size: 20px; }
.bt-upload-file-name { font-size: 14px; font-weight: 600; color: var(--fg); word-break: break-all; }
.bt-upload-file-size { font-size: 13px; color: var(--muted); }

.bt-upload-spinner-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bt-upload-spinner-label { font-size: 14px; color: var(--muted); }
.bt-upload-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bt-spin 0.7s linear infinite;
}
@keyframes bt-spin { to { transform: rotate(360deg); } }

.bt-upload-browse-link { color: var(--accent); text-decoration: underline; cursor: pointer; }

.bt-upload-icon { font-size: 40px; margin-bottom: 12px; }

/* Parse result */
.bt-parse-result { display: flex; flex-direction: column; gap: 12px; }
.bt-parse-row { display: flex; gap: 10px; align-items: center; }
.bt-parse-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 90px; flex-shrink: 0; }
.bt-parse-value { font-size: 14px; color: var(--fg); }

/* Cash flow */
.bt-cashflow-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.bt-cf-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.bt-cf-box-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.bt-cf-box-value { font-size: 28px; font-weight: 700; }
.bt-cf-outstanding .bt-cf-box-value { color: var(--accent); }
.bt-cf-paid .bt-cf-box-value { color: #2E7D32; }

.bt-cashflow-chart {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  overflow: hidden;
}

.bt-chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bt-chart-bar { width: 100%; border-radius: 6px 6px 0 0; min-height: 4px; }
.bt-chart-label { font-size: 11px; color: var(--muted); text-align: center; }
.bt-chart-amount { font-size: 11px; color: var(--fg-light); font-weight: 600; text-align: center; }

.bt-cashflow-table {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.bt-cf-table { width: 100%; border-collapse: collapse; }
.bt-cf-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.bt-cf-table td { padding: 14px 20px; font-size: 14px; border-bottom: 1px solid var(--border); }
.bt-cf-table tr:last-child td { border-bottom: none; }
.bt-cf-table tr:hover td { background: var(--bg); }

/* Empty states */
.bt-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 15px;
}

.bt-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* First-invoice CTA (Invoices view empty state) */
.bt-empty-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 32px;
  text-align: center;
}

.bt-empty-cta-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-warm);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 2px solid var(--border);
}

.bt-empty-cta-icon svg { width: 36px; height: 36px; }

.bt-empty-cta h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--deep);
  margin: 0 0 8px;
}

.bt-empty-cta p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 320px;
  line-height: 1.6;
}

.bt-btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(196, 98, 58, 0.35);
}

.bt-btn-cta:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 98, 58, 0.4);
}

.bt-btn-cta:active { transform: translateY(0); }

.bt-empty-cta-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

/* Payment history list */
.bt-payment-history-section {
  margin-bottom: 32px;
}

.bt-payment-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bt-payment-history-list .bt-empty {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.bt-ph-row {
  display: grid;
  grid-template-columns: 110px 1fr auto 130px;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.bt-ph-date {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.bt-ph-party { min-width: 0; }

.bt-ph-vendor {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bt-ph-paidby {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.bt-ph-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--deep);
  text-align: right;
  flex-shrink: 0;
}

.bt-ph-days {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 90px;
}

.bt-ph-days > span:first-child {
  font-size: 13px;
  font-weight: 600;
}

.bt-ph-timing {
  font-size: 11px;
  font-weight: 500;
}

.bt-days-early { color: #2E7D32; }
.bt-days-early .bt-ph-timing { color: #2E7D32; }
.bt-days-late  { color: #D63A2F; }
.bt-days-late  .bt-ph-timing { color: #D63A2F; }
.bt-days-ontime { color: #D9811E; }
.bt-days-ontime .bt-ph-timing { color: #D9811E; }
.bt-days-unknown { color: var(--muted); }

/* Responsive */
@media (max-width: 768px) {
  .bt-main { padding: 16px; }
  .bt-stats-row { grid-template-columns: repeat(2, 1fr); }
  .bt-form-row { grid-template-columns: 1fr; }
  .bt-page-header { flex-direction: column; align-items: flex-start; }
  .bt-nav { padding: 0 16px; }
  .bt-nav-links { gap: 0; }
  .bt-nav-link { padding: 6px 10px; font-size: 13px; }
  .bt-cashflow-summary { grid-template-columns: 1fr; }
  .bt-ph-row { grid-template-columns: 90px 1fr auto 100px; gap: 10px; }
  .bt-ph-amount { font-size: 14px; }
}