/* R3 slice 7/14 (30-tables-badges.css) — extracted VERBATIM from styles.css lines 4381-5048.
   receipt cells, bank account grid, file upload control, tables, row/attachment buttons, badges, activity/feed lists, loading spinner.
   Link order in index.html is load-bearing: cascade tie-breaks depend on it. Do not reorder. */


.receipt-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

/* Grid blockifies children, which stretches the status pill to the full column
   width. Pin it to its content width so the badge stays a compact pill. */
.receipt-cell .badge {
  justify-self: start;
}

.receipt-cell small {
  color: var(--muted);
  font-size: 11px;
}

.receipt-link {
  color: var(--programme-green);
  font-weight: 600;
  text-decoration: none;
}

.bank-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.bank-account-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 4px;
}

.bank-account-number {
  padding: 0 20px;
  font-family: "Geist Mono", monospace;
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-account-name {
  padding: 0 20px;
  color: var(--ink-mid);
  font-size: 13px;
}

.file-upload-control {
  min-height: 58px;
  border: 1px solid rgba(0, 162, 99, .24);
  border-radius: 12px;
  background: rgba(0, 162, 99, .07);
  color: var(--ink);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.file-upload-control:hover {
  background: rgba(0, 162, 99, .11);
  border-color: rgba(0, 162, 99, .38);
}

.file-upload-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-upload-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--card-start);
  color: var(--programme-green);
  border: 1px solid rgba(0, 162, 99, .18);
}

.file-upload-icon svg {
  width: 18px;
  height: 18px;
}

.file-upload-control span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.file-upload-control strong,
.file-upload-control small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-control small {
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
}

.summary-amount {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.search {
  margin-left: auto;
  min-width: min(380px, 100%);
}

.table-card {
  overflow: hidden;
}

.table-card:not(.card) {
  border-radius: 0;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  margin-top: -10px;
}

.table th {
  padding: 12px 20px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  background: transparent;
}

.table td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: middle;
  background: var(--bg-card);
  color: var(--ink-mid);
  font-size: 13.5px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.table td:first-child {
  border-left: 1px solid var(--border-color);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table td:last-child {
  border-right: 1px solid var(--border-color);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.table tbody tr {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.table tbody tr:hover td {
  background: var(--hover-bg);
}

.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.035);
}

.table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.click-row {
  cursor: pointer;
  transition: background .15s;
}

.click-row:hover {
  background: var(--hover-bg);
}

.users-table th:last-child,
.users-table td:last-child {
  width: 96px;
  text-align: right;
}

.row-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.row-btn.action-confirm {
  background: rgba(0, 196, 86, .14);
  border-color: rgba(0, 196, 86, .42);
  color: #166534;
}
.row-btn.action-confirm:hover {
  background: rgba(0, 196, 86, .22);
  color: #166534;
}

.row-btn.action-reject {
  background: rgba(220, 38, 38, .13);
  border-color: rgba(220, 38, 38, .40);
  color: #991B1B;
}
.row-btn.action-reject:hover {
  background: rgba(220, 38, 38, .22);
  color: #991B1B;
}

.row-btn.action-warn {
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .45);
  color: #92400E;
}
.row-btn.action-warn:hover {
  background: rgba(245, 158, 11, .26);
  color: #92400E;
}

.row-btn.action-edit {
  background: rgba(147, 51, 234, .13);
  border-color: rgba(147, 51, 234, .40);
  color: #6B21A8;
}
.row-btn.action-edit:hover {
  background: rgba(147, 51, 234, .22);
  color: #6B21A8;
}

.row-btn.action-info {
  background: rgba(37, 99, 235, .13);
  border-color: rgba(37, 99, 235, .40);
  color: #1E40AF;
}
.row-btn.action-info:hover {
  background: rgba(37, 99, 235, .22);
  color: #1E40AF;
}

/* Dark-mode text for the soft action pills (lightened, WCAG AA on dark). */
body.dark .row-btn.action-confirm,
body.dark .row-btn.action-confirm:hover { color: #86EFAC; }
body.dark .row-btn.action-reject,
body.dark .row-btn.action-reject:hover { color: #FCA5A5; }
body.dark .row-btn.action-warn,
body.dark .row-btn.action-warn:hover { color: #FCD34D; }
body.dark .row-btn.action-edit,
body.dark .row-btn.action-edit:hover { color: #D8B4FE; }
body.dark .row-btn.action-info,
body.dark .row-btn.action-info:hover { color: #93C5FD; }

/* Delivery Actions cell: Track on the left, status anchored to the right edge.
   flex:1 makes it fill the table cell so the status can sit flush right, and
   align-items:center keeps the Track button vertically centred even when the
   status stacks onto two lines (Verified + photo pills). */
.delivery-actions {
  flex: 1 1 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.delivery-actions-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.delivery-actions-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.delivery-actions .delivery-photo-pills {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Compact pill buttons for delivery evidence (Verifier Photo / Feeding Photo). */
.attachment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display-new);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.attachment-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.attachment-btn:active {
  transform: scale(.96);
}

.attachment-btn--verifier {
  background: rgba(0, 162, 75, .14);
  border-color: rgba(0, 162, 75, .45);
  color: #166534;
}
.attachment-btn--verifier:hover {
  background: rgba(0, 162, 75, .22);
  border-color: rgba(0, 162, 75, .7);
}
body.dark .attachment-btn--verifier,
body.dark .attachment-btn--verifier:hover {
  color: #86EFAC;
}

.attachment-btn--feeding {
  background: rgba(37, 99, 235, .14);
  border-color: rgba(37, 99, 235, .42);
  color: #1E40AF;
}
.attachment-btn--feeding:hover {
  background: rgba(37, 99, 235, .22);
  border-color: rgba(37, 99, 235, .65);
}
body.dark .attachment-btn--feeding,
body.dark .attachment-btn--feeding:hover {
  color: #93C5FD;
}

.muted-action {
  color: var(--muted);
  font-size: 12px;
}

.mono,
.table td.mono {
  font-family: "Geist Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(0, 162, 99, .04);
}

.table-footer > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display-new);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* Semantic badges: vibrant same-hue fill + border, deep on-light text /
   lightened on-dark text, all verified WCAG AA (>=4.5:1) over the card
   surface in both themes. Decoupled from the muted brand tokens so each
   theme gets the right text shade. */
.badge.green,
.badge.positive,
.badge.success {
  background: rgba(0, 162, 75, .14);
  color: #166534;
  border-color: rgba(0, 162, 75, .35);
}

.badge.red,
.badge.critical,
.badge.danger {
  background: rgba(220, 38, 38, .14);
  color: #991B1B;
  border-color: rgba(220, 38, 38, .42);
}

.badge.amber,
.badge.warning {
  background: rgba(245, 158, 11, .16);
  color: #92400E;
  border-color: rgba(245, 158, 11, .45);
}

.badge.medium,
.badge.indigo {
  background: rgba(99, 102, 241, .15);
  color: #3730A3;
  border-color: rgba(99, 102, 241, .42);
}

.badge.neutral {
  background: var(--chip);
  color: var(--muted);
  border-color: var(--border);
}

/* Dark adaptations */
body.dark .badge.green,
body.dark .badge.positive,
body.dark .badge.success {
  color: #3FD489;
  background: rgba(0, 162, 75, .18);
  border-color: rgba(0, 162, 75, .35);
}

body.dark .badge.red,
body.dark .badge.critical,
body.dark .badge.danger {
  color: #FCA5A5;
  border-color: rgba(248, 113, 113, .36);
  background: rgba(248, 113, 113, .18);
}

body.dark .badge.amber,
body.dark .badge.warning {
  color: #FCD34D;
  border-color: rgba(245, 158, 11, .40);
  background: rgba(245, 158, 11, .18);
}

body.dark .badge.medium,
body.dark .badge.indigo {
  color: #A5B4FC;
  border-color: rgba(129, 140, 248, .38);
  background: rgba(99, 102, 241, .20);
}

/* Sponsorship status / type badges: vivid tint + border stay inline as the
   colour identity, but the TEXT colour is mode-aware for WCAG AA legibility.
   --sb-text is the darkened on-light shade, --sb-text-dark the lightened
   on-dark shade. Icons use stroke="currentColor" so they track the text. */
.badge.status-badge {
  color: var(--sb-text);
}
body.dark .badge.status-badge {
  color: var(--sb-text-dark, var(--sb-text));
}

.activity-list,
.metric-list,
.feed-body {
  display: grid;
  gap: 0;
  padding-bottom: 10px;
}

.activity-item,
.metric-row,
.feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--hairline);
  transition: background .15s;
}

.metric-row {
  min-height: 48px;
}

.activity-item:hover,
.metric-row:hover,
.feed-row:hover {
  background: var(--hover-bg);
}

.activity-item:last-child,
.metric-row:last-child,
.feed-row:last-child {
  border-bottom: none;
}

.dot,
.feed-dot,
.sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 162, 99, .10);
  flex: 0 0 auto;
}

.dot.coral {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(216, 98, 81, .12);
}

.feed-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feed-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.feed-who,
.alert-title,
.state-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.feed-what,
.alert-meta {
  font-size: 13px;
  color: var(--muted);
}

.feed-where {
  font-size: 13px;
  color: var(--ink-mid);
}

.feed-time {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  font-family: "Geist Mono", monospace;
}

.state-row {
  display: grid;
  grid-template-columns: 90px 1fr 62px 54px;
  gap: 12px;
  align-items: center;
  padding: 8px 20px;
}

.state-row.alt {
  background: var(--hover-bg);
}

.state-track {
  height: 7px;
  border-radius: 99px;
  background: var(--hairline);
  overflow: hidden;
}

.state-fill {
  height: 100%;
  border-radius: 99px;
}

.state-num {
  font-size: 12px;
  text-align: right;
  font-family: "Geist Mono", monospace;
  color: var(--ink-mid);
}

.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--hairline);
}

.alert-row:last-child {
  border-bottom: none;
}

.alert-row:hover {
  background: var(--hover-bg);
}

.sev-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--hairline);
  border-top-color: var(--green);
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

