/* NGO Finance — minimal V1 base styles (design stack: HTMX + plain CSS;
   Tailwind adoption is a cross-task concern, not part of Task 2.4). */
* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  margin: 0;
  background: #f6f5f1;
  color: #1c1b18;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #204f3e;
  color: #fff;
}
.site-header a { color: #fff; margin-left: 1rem; text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.nav-form { display: inline; margin-left: 1rem; }
button.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button.linklike:hover { text-decoration: underline; }
main { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(32, 79, 62, 0.12);
}
.row.spread { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.stack > * { margin-bottom: 0.75rem; }
label { display: block; font-size: 0.9rem; margin-bottom: 0.5rem; }
label select, label input[type="file"] {
  display: block; width: 100%; margin-top: 0.25rem; padding: 0.4rem;
  border: 1px solid #c9c6bd; border-radius: 6px; background: #fff;
}
.btn {
  background: #204f3e; color: #fff; border: none; border-radius: 6px;
  padding: 0.5rem 1rem; font-size: 0.95rem; cursor: pointer;
}
.btn:hover { background: #2c6a53; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #e4e2da;
}
.chip {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  font-size: 0.8rem; background: #e8e6df;
}
.chip-VERIFIED, .chip-RECONCILED { background: #dcebe2; color: #1c4c37; }
.chip-UNMATCHED { background: #f7ecd2; color: #7a5c1c; }
.chip-IGNORED { background: #e8e6df; color: #6b665c; }
.chip-EXACT { background: #204f3e; color: #fff; }
.chip-FAILED { background: #f3dede; color: #7a2e2e; }
/* Muted metadata text + warning panel */
.meta { color: #6b665c; font-size: 0.85rem; }
p.meta { margin: 0 0 0.5rem; }
.warnings {
  background: #f3dede; color: #7a2e2e;
  border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem;
}
.warnings p { margin: 0.15rem 0; }
/* Small / ghost buttons for inline + dialog actions */
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.85rem; margin-right: 0.4rem; }
.btn-ghost {
  background: transparent; color: #204f3e;
  border: 1px solid #204f3e;
}
.btn-ghost:hover { background: #eef4f1; }
/* Inline state-changing forms (unmatch) stay on the table row */
.inline-form { display: inline; }
.inline-form .btn { margin: 0; }
/* Radio candidate row in the accept-match dialog */
.candidate {
  display: flex; align-items: center; gap: 0.5rem;
  border: 1px solid #e4e2da; border-radius: 8px;
  padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; cursor: pointer;
}
.candidate:hover { background: #f6f5f1; }
.candidate input[type="radio"] { margin: 0; }
.candidate span.meta { display: block; }
.candidate .chip { margin-left: auto; flex-shrink: 0; }
/* Candidate row in the accept-match dialog: label + sibling View anchor
   (an <a> nested in a <label> is invalid + unclickable) */
.candidate-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.candidate-row .candidate { flex: 1; margin-bottom: 0; }
/* Modal shell (design D13) — native <dialog> overlay */
dialog.modal {
  border: none;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  width: min(560px, 94vw);
  max-height: 90vh;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
dialog.modal > .card { margin: 0; max-height: 90vh; overflow: auto; }
dialog.modal::backdrop { background: rgba(20, 18, 15, 0.45); }
.hx-error {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 90vw;
  background: #7a2e2e;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 0.9rem;
}

/* Verify modal — side-by-side document + form */
.verify-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.verify-document {
  position: sticky;
  top: 1rem;
}
.document-preview {
  width: 100%;
  height: 70vh;
  border: 1px solid #c9c6bd;
  border-radius: 6px;
  object-fit: contain;
}
/* Rendered spreadsheet preview (verify screen) — scroll, don't stretch */
.excel-scroll {
  overflow: auto;
  height: 70vh;
  background: #fff;
}
.excel-scroll table {
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}
.excel-scroll td {
  border: 1px solid #e3e0d8;
  padding: 0.25rem 0.6rem;
  max-width: 32rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verify-form label input,
.verify-form label select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.4rem;
  border: 1px solid #c9c6bd;
  border-radius: 6px;
  background: #fff;
}
@media (max-width: 768px) {
  .verify-layout {
    grid-template-columns: 1fr;
  }
  .document-preview {
    height: 40vh;
  }
}

/* Reports & dashboard (Task 5.3) — vertical colour-coded category cards + screens */
.reports-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.reports-nav .btn { margin: 0; }
.section-title { margin-top: 1.25rem; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.totals-row td {
  border-top: 2px solid #204f3e;
  font-weight: 600;
}
.net-row { margin-top: 1rem; }
.dash-section h2 { margin-top: 1.25rem; }
.dash-card {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e4e2da;
  border-left: 6px solid var(--accent, #204f3e);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.dash-card:hover { background: #f6f5f1; }
.dash-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 7.5rem;
}
.dash-label { flex: 1; }
.dash-count { margin-left: auto; }
.dash-surplus { color: #204f3e; }
