/* Funded 1-to-1 hours — resident card, expiry states, and the Residents-list
   alert strip. See js/funding.js.

   The three states have to be distinguishable without relying on colour:
   red/amber/neutral is the fast signal, but each also carries a worded label
   ("Expired 12 days ago") and a differing left border weight, so the state
   survives a greyscale print of an evidence pack and a red-green colour
   deficiency alike. */

.funding-card {
  border: 1px solid var(--border-md);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 14px;
  margin: 12px 0 4px;
}

.funding-ok      { border-left-color: var(--green, #16a34a); }
.funding-due     { border-left-color: #d97706; background: #fffbeb; }
.funding-expired { border-left-color: #b91c1c; background: #fef2f2; }

/* Lives in .resident-profile-tabs alongside Log Support / This Is Me, so its
   padding, radius, font size and weight deliberately match .profile-btn —
   a pill of a different height would break the row it sits in.

   Dashed and transparent is the whole difference: it reads as an offer rather
   than a place you can be, so it does not look like a fourth tab you have
   somehow failed to select. */
.funding-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px dashed var(--border-md);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.funding-badge:hover {
  border-style: solid;
  border-color: var(--green, #16a34a);
  color: var(--text);
}

.funding-badge-plus { font-size: 14px; line-height: 1; font-weight: 600; }

.funding-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.funding-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-right: auto;
}

.funding-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.funding-pill-ok      { background: #dcfce7; color: #166534; }
.funding-pill-due     { background: #fef3c7; color: #92400e; }
.funding-pill-expired { background: #fee2e2; color: #991b1b; }

.funding-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* auto-fit rather than a fixed four columns: on a phone held portrait these
   need to stack to two, and the app is used on phones on the floor. */
.funding-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.funding-fact { display: flex; flex-direction: column; gap: 2px; }

.funding-fact-v {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
}

/* The funder name and the dates are words, not figures — same slot, but they
   should not shout like the hours count does. */
.funding-fact-sm { font-size: 13px; font-weight: 500; }

.funding-fact-l {
  font-size: 11px;
  color: var(--text-muted);
}

.funding-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text);
  border-top: 1px solid var(--border-md);
  padding-top: 8px;
}

.funding-caveat {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Residents-list alert strip ─────────────────────────────────────────── */

/* Collapsed by default. The summary row carries the count and the wording, so
   the state of things is legible without opening it — folding away the detail
   should not fold away the fact that there is detail worth seeing. */
.funding-alert {
  border: 1px solid var(--border-md);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.funding-alert-expired { border-left-color: #b91c1c; background: #fef2f2; }
.funding-alert-due     { border-left-color: #d97706; background: #fffbeb; }

.funding-alert-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Safari draws its own disclosure triangle unless this is suppressed. */
.funding-alert-summary::-webkit-details-marker { display: none; }
.funding-alert-summary::marker { content: ''; }

.funding-alert-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.funding-alert-expired .funding-alert-count { background: #b91c1c; }
.funding-alert-due     .funding-alert-count { background: #d97706; }

.funding-alert-hdr {
  font-size: 12px;
  font-weight: 600;
  margin-right: auto;
}

.funding-alert-expired .funding-alert-hdr { color: #991b1b; }
.funding-alert-due     .funding-alert-hdr { color: #92400e; }

/* CSS chevron rather than a glyph, so it cannot land as tofu in a font that
   lacks the character, and it can rotate on open. */
.funding-alert-chev {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-right: 3px;
  opacity: .6;
  transition: transform .15s ease;
}

.funding-alert-expired .funding-alert-chev { color: #991b1b; }
.funding-alert-due     .funding-alert-chev { color: #92400e; }

.funding-alert[open] .funding-alert-chev { transform: rotate(225deg); }

.funding-alert-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 10px;
}

.funding-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.funding-alert-row:hover { border-color: #fca5a5; }

.funding-alert-name { font-weight: 500; margin-right: auto; }

.funding-alert-state {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.funding-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

@media (max-width: 480px) {
  .funding-modal-grid { grid-template-columns: 1fr; }
}
