/* VAT Report — reuses app.css primitives (.gcc-panel, .gcc-toolbar,
   .gcc-input/.gcc-date, .gcc-btn, .gcc-table, .empty-state, .center-loading)
   and cheques.css's .cheq-detail-card/.cheq-dl/.cheq-dv for the modal
   sections. This file only adds the module-specific bits: the labeled date
   toolbar fields, the summary stat cards, the modal nav (Prev/Next per
   docs/UI_CONVENTIONS.md), and the invoice-detail layout. */

/* Compact label-above-input pair for the date toolbar (content-width, like
   search.js's .stx-field — NOT .form-grid). */
.vat-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.vat-field > label {
  font-size: 10.5px;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.vat-actions {
  justify-content: flex-end;
}

/* Summary stat cards (built on the .stat-card / .dash-card language). */
.vat-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  padding: 14px 16px;
}
.vat-stat-card {
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.vat-stat-card:hover { box-shadow: var(--shadow-lg, 0 8px 18px rgba(15,23,42,0.06)); transform: translateY(-1px); }
.vat-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.vat-stat-values {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.vat-stat-value-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vat-stat-value-label {
  font-size: 9.5px;
  font-weight: 650;
  color: var(--text-faint, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vat-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}
.vat-stat-card.highlight { background: #eef2ff; border-color: #c7d2fe; }
.vat-stat-card.highlight.payable { background: #ecfdf5; border-color: #a7f3d0; }
.vat-stat-card.highlight.refundable { background: #fef2f2; border-color: #fecaca; }
.vat-stat-card.highlight .vat-stat-value { font-size: 16px; }

.vat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f1f5f9;
  color: #64748b;
}
.vat-badge.success { background: #dcfce7; color: #166534; }
.vat-badge.danger { background: #fee2e2; color: #991b1b; }
.vat-badge.muted { background: #f1f5f9; color: #64748b; }
.vat-badge.purchase { background: #fee2e2; color: #991b1b; }
.vat-badge.sales { background: #d1fae5; color: #065f46; }
.vat-badge.return { background: #fef3c7; color: #92400e; }

/* Table toolbar + instant filter */
.vat-table-toolbar { gap: 10px; }
.vat-th { cursor: pointer; user-select: none; white-space: nowrap; }
.vat-th:hover { color: var(--brand-700, #4338ca); }
.vat-th.active { color: var(--brand-700, #4338ca); }
.vat-sort-icon { font-size: 9px; opacity: 0.7; }

/* Per-row deviation flag: TaxAmount off Taxable*5% by > 1 cent. */
.vat-row { cursor: pointer; }
.vat-row.row-warning td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.vat-row.row-warning { background: rgba(245, 158, 11, 0.07); }
.vat-mono { font-family: 'SFMono-Regular', 'Consolas', monospace; }
.vat-desc {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal header Prev/Next (UI_CONVENTIONS text+chevron variant: indigo,
   borderless, navigation chrome not an action). */
.vat-modal-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; margin-right: 8px; }
.vat-modal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: #5046e5;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 4px;
}
.vat-modal-nav-btn:hover:not(:disabled) { color: #6366f1; }
.vat-modal-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Invoice detail modal body layout. */
.vat-invoice-body { padding: 18px 22px; }
.vat-invoice-head {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.vat-invoice-title { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.vat-invoice-subtitle { font-size: 12px; color: #64748b; }
.vat-detail-rows { display: flex; flex-direction: column; gap: 8px; }
.vat-detail-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}
.vat-detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.vat-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.vat-amount-item { display: flex; flex-direction: column; gap: 3px; }
.vat-amount-num { font-size: 16px; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; }
.vat-amt-tax { color: #3b82f6; }
.vat-amt-net { color: #059669; }
/* Description section uses a blank label — hide the empty label cell. */
.vat-detail-rows .vat-detail-row .cheq-dl:empty { display: none; }
