/* R3 slice 5/14 (20-forms-sponsor.css) — extracted VERBATIM from styles.css lines 3553-4038.
   toolbar, .field inputs/file/select/search, sponsor flow, school/snack choices, calendar core, week chips, bank/payment boxes.
   Link order in index.html is load-bearing: cascade tie-breaks depend on it. Do not reorder. */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--hairline);
}

.field {
  min-height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--hover-bg);
  color: var(--ink-mid);
  padding: 0 14px;
  min-width: 150px;
}

/* File inputs: the browser's default "Choose File" button is unstyled and ugly,
   so theme the ::file-selector-button to match the app's controls (works in
   light + dark via tokens). Applies to every <input type="file" class="field">. */
input[type="file"].field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
input[type="file"].field::file-selector-button {
  flex: none;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
}
@media (hover: hover) {
  input[type="file"].field:hover { border-color: var(--green); }
  input[type="file"].field::file-selector-button:hover {
    background: #018442;
    box-shadow: 0 4px 12px -4px rgba(0, 162, 75, 0.5);
  }
}
input[type="file"].field::file-selector-button:active { transform: scale(.97); }
input[type="file"].field:focus-within { outline: none; border-color: var(--green); }

/* Reusable styled upload control (styledFileUpload helper): a green pill button +
   filename display backed by a visually-hidden native input. Used for every photo/
   receipt upload so they all look identical (matches the feeding-photo control). */
.styled-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.styled-upload__input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.styled-upload__btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px;
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; border: none; white-space: nowrap;
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
}
.styled-upload__btn svg { flex: none; }
@media (hover: hover) { .styled-upload__btn:hover { background: #018442; box-shadow: 0 4px 12px -4px rgba(0, 162, 75, .5); } }
.styled-upload__btn:active { transform: scale(.97); }
.styled-upload__name { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

select.field,
select.field option {
  background: var(--card-end);
  color: var(--ink);
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="%235c6d60" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 42px;
}

body.dark select.field,
body.dark select.field option {
  background: #17251d;
  color: rgba(247, 255, 250, .9);
}

body.dark select.field {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="%23e5e9e2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

.compact-field {
  min-width: 140px;
}

/* Filter dropdowns: a native <select> sizes itself to its widest <option>, so
   a status/supplier filter with long labels (e.g. "School Head Confirmed")
   balloons far wider than a short state filter, leaving filter bars uneven
   from page to page. Pin filter selects to one compact width so every bar
   reads consistently; the collapsed value ellipsises and the open option list
   still shows the full text. (Modal/form selects use bare `.field`, and the
   sponsor wizard uses a grid, so neither is affected.) */
select.compact-field {
  width: 170px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Compact inline-styled directory filter — give it the same off-the-edge
   chevron as select.field (its inline style supplies the right padding). */
#dir-state-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" stroke="%235c6d60" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

body.dark #dir-state-select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" stroke="%23e5e9e2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>');
}

/* ─── In-field search affordance (magnifier ⇄ clear ×) ────────────────────
   searchField() in app.js wraps a search <input> in .search-field. The button
   on the right shows a magnifier; once the field has text it smoothly morphs
   into a clear (×) button that empties the field in one click. */
.search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-field > input {
  width: 100%;
  padding-right: 40px;
}
.search-field__btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: default;
  transition: background .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.search-field.has-value .search-field__btn {
  cursor: pointer;
}
@media (hover: hover) {
  .search-field.has-value .search-field__btn:hover {
    background: var(--hover-bg);
    color: var(--ink);
  }
}
.search-field.has-value .search-field__btn:active {
  transform: translateY(-50%) scale(.86);
}
.search-field__icon {
  position: absolute;
  width: 16px;
  height: 16px;
  transition: opacity .22s cubic-bezier(.4, 0, .2, 1),
              transform .26s cubic-bezier(.34, 1.45, .5, 1);
}
.search-field__icon--search { opacity: 1; transform: scale(1) rotate(0deg); }
.search-field__icon--clear  { opacity: 0; transform: scale(.5) rotate(-90deg); }
.search-field.has-value .search-field__icon--search { opacity: 0; transform: scale(.5) rotate(90deg); }
.search-field.has-value .search-field__icon--clear  { opacity: 1; transform: scale(1) rotate(0deg); }

textarea.field {
  min-height: 84px;
  padding-top: 12px;
  resize: vertical;
}

.field:disabled {
  opacity: .72;
}

.sponsor-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.sponsor-card {
  padding: 18px 20px;
  gap: 12px;
}

.sponsor-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.sponsor-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 8px;
}

.sponsor-school-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.school-choice {
  min-height: 58px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--hover-bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  text-align: left;
}

.school-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.school-choice strong,
.school-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-choice small,
.school-choice i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.school-choice.active {
  border-color: rgba(0, 162, 99, .35);
  background: rgba(0, 162, 99, .1);
}

.school-choice:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.school-choice.active i {
  color: var(--programme-green);
  font-weight: 700;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.snack-choice-list {
  display: grid;
  gap: 8px;
}

.snack-choice {
  min-height: 58px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--hover-bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.snack-choice input {
  accent-color: var(--programme-green);
}

.snack-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.snack-choice strong,
.snack-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.snack-choice.active {
  border-color: rgba(0, 162, 99, .35);
  background: rgba(0, 162, 99, .1);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.calendar-controls strong {
  min-width: 130px;
  text-align: center;
  font-size: 12px;
}

.calendar-weekdays,
.sponsor-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-family: "Geist Mono", monospace;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day,
.calendar-pad {
  min-height: 68px;
  border-radius: 12px;
}

.calendar-day {
  border: 1px solid var(--hairline);
  background: var(--card-start);
  color: var(--ink);
  display: grid;
  align-content: space-between;
  justify-items: start;
  padding: 8px;
}

.calendar-day strong {
  font-size: 13px;
}

.calendar-day span {
  color: var(--muted);
  font-size: 10px;
}

.calendar-day.active {
  border-color: rgba(0, 162, 99, .45);
  background: rgba(0, 162, 99, .12);
}

.calendar-day.blocked {
  cursor: not-allowed;
  opacity: .48;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.week-chip {
  min-height: 58px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--hover-bg);
  color: var(--ink-mid);
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 10px 12px;
  gap: 2px;
}

.week-chip.active {
  border-color: rgba(0, 162, 99, .35);
  background: rgba(0, 162, 99, .11);
  color: var(--ink);
}

.week-chip:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.week-chip span,
.week-chip strong {
  font-size: 12px;
}

.sponsor-warning,
.bank-box {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--hover-bg);
  padding: 12px;
  color: var(--ink-mid);
  font-size: 12px;
}

.bank-box {
  display: grid;
  gap: 4px;
}

.payment-bank-box {
  gap: 8px;
  padding: 16px;
}

.payment-bank-box strong {
  font-size: 15px;
  color: var(--ink);
}

.payment-bank-box span {
  font-size: 14px;
}

.payment-bank-box b {
  font-family: "Geist Mono", monospace;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: .03em;
}

.payment-proof-box {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--card-start);
  padding: 12px;
  display: grid;
  gap: 10px;
}

