/* Signature Ag Workers — Grants CRM
   Brand palette: navy #0a1628, electric green #00c41c, neon green #39FF14
   Mobile-first, single-page CRM */

:root {
  --navy: #0a1628;
  --navy-light: #0f2640;
  --green: #00c41c;
  --green-bright: #39FF14;
  --green-dim: rgba(0,196,28,0.08);
  --green-glow: rgba(57,255,20,0.25);
  --white: #ffffff;
  --gray-50: #f7f9fc;
  --gray-100: #eef2f7;
  --gray-200: #d8e0e9;
  --gray-400: #7a8aa0;
  --gray-600: #41526a;
  --gray-900: #0a1628;
  --red: #d33;
  --amber: #d8a200;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(10,22,40,0.06);
  --shadow-hover: 0 4px 16px rgba(10,22,40,0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-color: var(--green); }

/* ============ TOPBAR ============ */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--navy-light);
  color: var(--green);
  display: inline-grid; place-items: center;
  font-family: Georgia, serif; font-weight: bold; font-size: 22px;
  box-shadow: 0 0 12px var(--green-glow);
  border: 1px solid var(--green);
}
.brand-title { font-size: 15px; font-weight: 600; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--green-bright); line-height: 1.1; opacity: 0.9; }

.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav-btn {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,0.06); }
.nav-btn.active {
  background: rgba(0,196,28,0.15);
  color: var(--green-bright);
  border-color: var(--green);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }
.api-status {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}
.api-status.ok { color: var(--green-bright); background: rgba(0,196,28,0.12); }
.api-status.error { color: #ff7a7a; background: rgba(255,80,80,0.12); }

/* ============ MAIN / VIEWS ============ */
main { padding: 24px 20px 80px; max-width: 1200px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; gap: 12px;
}
.view-header h1 { margin: 0; font-size: 26px; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-refresh, button[type="submit"] {
  background: var(--navy);
  color: white;
  border: 1px solid var(--navy);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn-primary:hover, button[type="submit"]:hover {
  background: var(--navy-light);
  box-shadow: 0 0 12px var(--green-glow);
}
.btn-primary:active, button[type="submit"]:active { transform: translateY(1px); }
.btn-refresh {
  background: white;
  color: var(--navy);
  border-color: var(--gray-200);
}
.btn-refresh:hover { background: var(--gray-50); border-color: var(--green); }

button { font-family: inherit; }
button[type="button"] {
  background: white;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
button[type="button"]:hover { background: var(--gray-50); }

/* ============ KPI GRID ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.kpi-highlight {
  background: linear-gradient(135deg, white 0%, var(--green-dim) 100%);
  border-color: var(--green);
  box-shadow: 0 0 16px var(--green-glow);
}
.kpi-label { font-size: 12px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--navy); }
.kpi-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.kpi-grid.secondary { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi-mini {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-mini.alert { border-color: #f4c2c2; background: #fff5f5; }
.kpi-mini.alert .kpi-mini-value { color: var(--red); }
.kpi-mini-label { font-size: 12px; color: var(--gray-600); }
.kpi-mini-value { font-size: 18px; font-weight: 700; color: var(--navy); }

/* ============ PANELS ============ */
.panel {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-100);
}
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header a { font-size: 13px; }

/* ============ GRANT LIST + STRIP ============ */
.grant-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 14px;
}
.grant-mini {
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.05s;
}
.grant-mini:hover { box-shadow: var(--shadow-hover); }
.grant-mini-title { font-weight: 600; color: var(--navy); font-size: 14px; margin-bottom: 4px; }
.grant-mini-funder { font-size: 12px; color: var(--gray-600); }
.grant-mini-amount { font-size: 16px; font-weight: 700; color: var(--navy); margin-top: 6px; }

.grant-list { display: grid; gap: 10px; }
.grant-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.grant-card:hover { box-shadow: var(--shadow-hover); }
.grant-card h3 { margin: 0 0 4px 0; font-size: 16px; color: var(--navy); }
.grant-card .funder { font-size: 13px; color: var(--gray-600); }
.grant-card .meta { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.grant-card .amount { font-size: 22px; font-weight: 700; color: var(--navy); text-align: right; }
.grant-card .status {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  margin-left: 8px;
}
.status-awarded, .status-active { background: var(--green-dim); color: var(--navy); border: 1px solid var(--green); }
.status-pending, .status-submitted { background: #fff5e0; color: #8b6800; border: 1px solid #e6b800; }
.status-denied { background: #fee; color: var(--red); border: 1px solid #fbb; }
.status-closed { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }

/* ============ FILTER BAR ============ */
.filter-bar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }

/* ============ TASK LIST ============ */
.task-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
}
.task-row.overdue { border-left: 4px solid var(--red); }
.task-row.upcoming { border-left: 4px solid var(--amber); }
.task-row.normal { border-left: 4px solid var(--green); }
.task-row .task-title { font-weight: 600; color: var(--navy); font-size: 14px; }
.task-row .task-meta { font-size: 12px; color: var(--gray-600); }
.task-row .task-due { font-size: 13px; font-weight: 600; }
.task-row.overdue .task-due { color: var(--red); }
.task-row .task-done-btn {
  background: transparent; border: 1px solid var(--gray-200);
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; padding: 0; line-height: 1;
}
.task-row .task-done-btn:hover { border-color: var(--green); background: var(--green-dim); }
.task-row .task-del-btn {
  background: transparent; border: 1px solid var(--gray-200);
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; padding: 0; line-height: 1; font-size: 12px;
  opacity: 0.5;
}
.task-row .task-del-btn:hover { opacity: 1; border-color: var(--red); background: #fff5f5; }

.btn-delete {
  background: white; color: var(--red); border: 1px solid var(--red);
  padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-delete:hover { background: var(--red); color: white; }

/* Small 🗑 icon-button used inline in row tables */
.row-del-btn {
  background: transparent; border: 1px solid transparent;
  padding: 2px 6px; border-radius: 4px;
  font-size: 12px; cursor: pointer; opacity: 0.4;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.row-del-btn:hover { opacity: 1; background: #fff5f5; border-color: var(--red); }

/* ============ EXPENSE LIST ============ */
.expense-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: 1fr 100px 100px 100px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.expense-row .vendor { font-weight: 600; color: var(--navy); }
.expense-row .meta { font-size: 12px; color: var(--gray-600); }
.expense-row .amount { text-align: right; font-weight: 700; }
.expense-row .date { color: var(--gray-600); font-size: 13px; }
.expense-row .cat { font-size: 11px; color: var(--gray-400); }
@media (max-width: 640px) {
  .expense-row { grid-template-columns: 1fr 100px; }
  .expense-row .date, .expense-row .cat { display: none; }
}

/* ============ FUNDER LIST ============ */
.funder-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
}
.funder-card h3 { margin: 0 0 4px 0; font-size: 15px; color: var(--navy); }
.funder-card .meta { font-size: 13px; color: var(--gray-600); }

/* ============ MODAL ============ */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.5);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-card {
  background: white;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  margin-top: 40px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  border-top: 4px solid var(--green);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-100);
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close {
  background: transparent; border: none;
  font-size: 28px; cursor: pointer; color: var(--gray-400);
  width: 32px; height: 32px; line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--navy); }
.modal-card form { padding: 18px 22px; }
.modal-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}
.modal-card input, .modal-card select, .modal-card textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  margin-top: 4px;
}
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow);
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--gray-100); margin-top: 14px;
}

/* ============ GRANT DETAIL DRAWER ============ */
.drawer {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,22,40,0.5);
  z-index: 90;
  justify-content: flex-end;
}
.drawer.open { display: flex; }
.drawer-card {
  background: white;
  width: 100%;
  max-width: 640px;
  height: 100vh;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.2);
}
.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky; top: 0; background: white;
}
.drawer-header h2 { margin: 0; font-size: 18px; flex: 1; }
.drawer-close {
  background: transparent; border: none;
  font-size: 28px; cursor: pointer; color: var(--gray-400);
  width: 32px; height: 32px; line-height: 1; padding: 0;
}
.drawer-close:hover { color: var(--navy); }
#grant-detail-body { padding: 18px 22px; }
#grant-detail-body h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-400); margin: 24px 0 8px; }
#grant-detail-body .field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
#grant-detail-body .field-label { font-size: 12px; color: var(--gray-400); }
#grant-detail-body .field-value { font-size: 14px; color: var(--navy); margin-bottom: 6px; }
#grant-detail-body table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px;
}
#grant-detail-body th { text-align: left; padding: 6px 8px; background: var(--gray-50); color: var(--gray-600); font-weight: 600; border-bottom: 1px solid var(--gray-200); }
#grant-detail-body td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); }
#grant-detail-body td.right { text-align: right; }

.balance-bar {
  height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; margin-top: 4px;
}

/* === Salary / Admin allowance box (grant detail) === */
.salary-cap-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 16px;
  box-shadow: 0 0 16px var(--green-glow);
  border: 1px solid var(--green);
}
.salary-cap-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-bright);
  margin-bottom: 12px;
}
.salary-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.salary-cap-cell {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px 12px;
}
.salary-cap-cell.hero {
  background: var(--green);
  color: var(--navy);
}
.salary-cap-cell.hero .cap-label { color: var(--navy); opacity: 0.8; }
.salary-cap-cell.hero .cap-value { color: var(--navy); }
.salary-cap-cell .cap-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  color: rgba(255,255,255,0.7); font-weight: 600;
}
.salary-cap-cell .cap-value {
  font-size: 22px; font-weight: 700; color: white; margin-top: 4px;
}
.salary-cap-cell .cap-sub {
  font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px;
}
.salary-cap-notes {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  line-height: 1.5;
}
.balance-bar > div { height: 100%; background: var(--green); transition: width 0.3s; }
.balance-bar > div.warn { background: var(--amber); }
.balance-bar > div.over { background: var(--red); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  border-left: 4px solid var(--green);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: var(--red); }

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  padding: 24px 20px 40px;
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap;
}

.muted { color: var(--gray-400); font-style: italic; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-400); }

.header-sub { font-size: 14px; font-weight: 400; color: var(--gray-400); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ PROSPECTS / KANBAN ============ */
.nav-btn-spark { position: relative; }
.nav-btn-spark::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  background: var(--green-bright); border-radius: 50%; box-shadow: 0 0 8px var(--green-bright);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.kanban-col {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 200px;
}
.kanban-col-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--gray-600);
}
.kanban-col-count {
  background: white; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; color: var(--gray-600);
}
.kanban-col[data-status="Awarded"] { background: linear-gradient(180deg, var(--green-dim) 0%, var(--gray-100) 100%); }
.kanban-col[data-status="Submitted"] .kanban-col-header { color: #8b6800; }
.kanban-col[data-status="Drafting"] .kanban-col-header { color: var(--navy); }
.kanban-col[data-status="Denied"] .kanban-col-header { color: var(--red); }

.prospect-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.05s;
}
.prospect-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.prospect-card.priority-high { border-left-color: var(--red); }
.prospect-card.priority-medium { border-left-color: var(--green); }
.prospect-card.priority-low { border-left-color: var(--gray-400); }
.prospect-card .pc-funder { font-weight: 600; color: var(--navy); font-size: 14px; line-height: 1.3; }
.prospect-card .pc-program { font-size: 12px; color: var(--gray-600); margin-top: 3px; }
.prospect-card .pc-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--gray-400); margin-top: 8px;
}
.prospect-card .pc-amount { font-weight: 700; color: var(--navy); }
.prospect-card .pc-deadline { color: var(--gray-600); }
.prospect-card .pc-deadline.urgent { color: var(--red); font-weight: 600; }
.prospect-card .pc-tags { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.pc-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--gray-100); color: var(--gray-600);
}
.pc-tag.t-federal { background: #e0ecff; color: #0046b8; }
.pc-tag.t-foundation { background: #e6f9e8; color: #007a13; }
.pc-tag.t-state { background: #fff5e0; color: #8b6800; }
.pc-tag.t-corporate { background: #f3e6ff; color: #6800b8; }

/* ============ PROSPECT DRAWER ============ */
#prospect-detail-body { padding: 18px 22px; }
#prospect-detail-body h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-400); margin: 22px 0 8px; }
#prospect-detail-body .field-label { font-size: 12px; color: var(--gray-400); }
#prospect-detail-body .field-value { font-size: 14px; color: var(--navy); margin-bottom: 8px; }
#prospect-detail-body .field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
#prospect-detail-body .narrative-block {
  background: var(--gray-50); padding: 12px 14px; border-radius: 8px;
  font-size: 13px; color: var(--gray-600); white-space: pre-wrap;
  border-left: 3px solid var(--gray-200); margin-bottom: 12px;
}
.prospect-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--gray-100);
}
.btn-generate {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white; border: 1px solid var(--green);
  padding: 10px 18px; border-radius: 8px; font-weight: 600; cursor: pointer;
  font-size: 14px; box-shadow: 0 0 12px var(--green-glow);
  transition: box-shadow 0.2s;
}
.btn-generate:hover { box-shadow: 0 0 20px var(--green-glow); }

.btn-status {
  background: white; color: var(--gray-600); border: 1px solid var(--gray-200);
  padding: 6px 12px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.btn-status:hover { background: var(--gray-50); border-color: var(--green); }
.btn-status.active { background: var(--green-dim); color: var(--navy); border-color: var(--green); }

/* ============ GENERATE MODAL ============ */
.modal-card-wide { max-width: 920px; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--gray-100);
  border-top-color: var(--green);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-output {
  max-height: 60vh; overflow-y: auto;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 18px 22px;
  font-size: 14px; line-height: 1.6;
  white-space: pre-wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.gen-output h1, .gen-output h2 { color: var(--navy); margin-top: 1.5em; margin-bottom: 0.3em; }
.gen-output h1 { font-size: 18px; border-bottom: 2px solid var(--green); padding-bottom: 4px; }
.gen-output h2 { font-size: 16px; }
.gen-output h3 { font-size: 14px; color: var(--gray-600); }
.gen-output code { background: rgba(216, 162, 0, 0.15); padding: 1px 4px; border-radius: 3px; font-size: 12px; color: #8b6800; }
.gen-output strong { color: var(--navy); }
.gen-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.gen-actions button { padding: 6px 12px; font-size: 13px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 800px) {
  .topbar { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .nav { justify-content: center; }
  .topbar-right { justify-content: center; }
  .brand { justify-content: center; }
  main { padding: 16px 12px 80px; }
  .grant-card { grid-template-columns: 1fr; }
  .grant-card .amount { text-align: left; font-size: 18px; }
  #grant-detail-body .field-grid { grid-template-columns: 1fr; }
}
