* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #3f3f3f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;

  display: flex;
  justify-content: center;
  padding-top: 120px;
}

.card {
  background-color: #ffffff;
  width: 900px;
  max-width: calc(100% - 80px);
  padding: 48px 56px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 16px 0;
  font-size: 36px;
  font-weight: 700;
  color: #111111;
}

p {
  margin: 0 0 32px 0;
  font-size: 18px;
  color: #555555;
}

.button-row {
  display: flex;
  gap: 16px;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background-color: #e12020;
  color: #ffffff;
}

.btn-secondary {
  background-color: #e0e0e0;
  color: #333333;
  margin-right: 8px;
}

.status-row {
  margin-top: 16px;
}

.status-row p {
  margin: 4px 0;
}

.hidden {
  display: none;
}

/* ===== ADDITIONS ===== */

.bills-scroll-container {
  max-height: 400px;
  min-height: 60px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  margin-top: 16px;
}

.results-placeholder {
  color: #999;
  font-size: 0.9em;
  margin: 12px 4px;
}

.vendor-preview-row {
  font-size: 0.88em;
  padding: 3px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.vendor-new {
  background: #edfbea;
  color: #1a6b0d;
}

.vendor-existing {
  background: #f5f5f5;
  color: #666;
}

/* ===== GL transaction table ===== */

.gl-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin: 12px 0 0;
  padding: 4px 0;
  border-bottom: 2px solid #ccc;
  font-size: 0.88em;
  color: #333;
}

.gl-txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  margin-bottom: 4px;
}

.gl-txn-table thead th {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid #e0e0e0;
  color: #888;
  font-weight: 600;
  font-size: 0.82em;
  white-space: nowrap;
}

.gl-txn-table thead th.col-amount {
  text-align: right;
}

.gl-txn-table .gl-txn-row td {
  padding: 4px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}

.gl-txn-table .gl-txn-row:hover td {
  background: #fafafa;
  cursor: pointer;
}

.gl-txn-table td.col-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gl-txn-table td.col-expand {
  width: 20px;
  color: #888;
  font-size: 0.75em;
}

.gl-txn-table td.col-cb {
  width: 20px;
}

.gl-txn-table td.col-date {
  white-space: nowrap;
  color: #444;
}

.gl-txn-table td.col-num {
  color: #555;
  white-space: nowrap;
}

.gl-txn-table td.col-name {
  font-weight: 500;
}

.gl-txn-table td.col-memo {
  color: #666;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-lines-row td {
  padding: 0 !important;
  border-bottom: 1px solid #e8e8e8 !important;
  background: #fafafa;
}

.gl-lines-inner {
  padding: 6px 6px 8px 48px;
}

.gl-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}

.gl-lines-table th {
  text-align: left;
  padding: 2px 8px;
  border-bottom: 1px solid #e0e0e0;
  color: #999;
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
}

.gl-lines-table th.col-amount { text-align: right; }

.gl-lines-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #f2f2f2;
  color: #333;
}

.gl-lines-table td.col-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #222;
}

.gl-lines-table td.col-desc {
  color: #666;
}

/* ===== Loading overlay ===== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}