/* ==========================================================================
   CareMetrix — Funding Administrator page
   Every rule is scoped under `.fnd` so this page cannot collide with the
   shared components in components.css, mirroring how rosters.css scopes
   under `.ros` and roster-templates.css scopes under `.rt`. The listing/
   details toggle follows the same pattern as roster-templates.html.
   ========================================================================== */

.fnd {
  --fnd-pink: #D0479A;       --fnd-pink-soft: #FBEAF4;
  --fnd-purple: #4C3FCB;     --fnd-purple-bg: #EEEDFB;
  --fnd-neutral-bg: #F4F7FA; --fnd-grid-line: #E5E9F0;
}

.fnd .rowmenu__list, .fnd-view { }
.fnd-view { display: none; }
.fnd-view.active { display: flex; flex-direction: column; gap: 8px; }

/* the `hidden` attribute ties in specificity with author rules like
   `.fnd-field-grid{display:grid}` below — force it to actually win */
.fnd [hidden] { display: none !important; }

/* ------------------------------------------------------------- pagepath -- */

.fnd-pagepath { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* -------------------------------------------------------------- headrow -- */

.fnd-listcard { overflow: hidden; }

.fnd-headrow {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.fnd-headrow__title { display: flex; align-items: flex-start; gap: 12px; }
.fnd-titleicon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--violet-bg); color: var(--brand-purple);
  display: grid; place-items: center;
}
.fnd-titleicon svg { width: 18px; height: 18px; }
.fnd-headrow__title h1 { font-size: 21px; font-weight: 800; letter-spacing: -.2px; }
.fnd-headrow__title p { margin-top: 3px; font-size: 12.5px; color: var(--text-2); }

.fnd-summarystats { display: flex; border: 1px solid var(--fnd-grid-line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.fnd-statbox { padding: 10px 20px; border-left: 1px solid var(--fnd-grid-line); text-align: center; }
.fnd-statbox:first-child { border-left: 0; }
.fnd-statbox__label { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; }
.fnd-statbox__value { margin-top: 4px; font-size: 15px; font-weight: 800; white-space: nowrap; }

/* ------------------------------------------------------------ searchrow -- */

.fnd-searchrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.fnd-searchrow__pagination { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fnd-searchrow__perpage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.fnd-searchrow__perpage select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: var(--surface); color: var(--text); }

/* -------------------------------------------------------------- toolbar -- */

.fnd-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; max-width: 460px; }
.fnd-search svg { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.fnd-search input {
  width: 100%; box-sizing: border-box;
  font-size: 13px; padding: 9px 14px 9px 40px;
  border: 1.5px solid var(--form-border); border-radius: var(--r-pill);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fnd-search input:focus { border-color: var(--form-focus); box-shadow: 0 0 0 3px var(--form-focus-ring); }

.fnd-toolbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.fnd-pinkbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1.5px solid var(--fnd-pink); border-radius: var(--r-btn);
  background: var(--surface); color: var(--fnd-pink);
  font-size: 13px; font-weight: 700;
  transition: all .14s var(--ease);
}
.fnd-pinkbtn:hover { background: var(--fnd-pink-soft); }
.fnd-pinkbtn svg { width: 16px; height: 16px; }

.fnd-filter { position: relative; }
.fnd-filter__pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 340px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 18px; z-index: 80; display: none;
}
.fnd-filter__pop.is-open { display: block; }
.fnd-filter__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fnd-filter__head b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.fnd-filter__head button { color: var(--text-3); }
.fnd-filter__label { font-size: 11.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.fnd-filter__label:first-of-type { margin-top: 0; }
.fnd-filter__row { display: flex; flex-wrap: wrap; gap: 14px; }
.fnd-filter__chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.fnd-filter__dates { display: flex; gap: 12px; }
.fnd-filter__dates .field { flex: 1; }
.fnd-filter__dates .field__label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.fnd-filter__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

.fnd-viewicons { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1.5px solid var(--fnd-pink); border-radius: var(--r-btn); background: var(--surface); }
.fnd-viewicons button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--fnd-pink); transition: all .14s var(--ease); }
.fnd-viewicons button svg { width: 16px; height: 16px; }
.fnd-viewicons button.is-active { background: var(--fnd-pink); color: #fff; }

.fnd-iconbtn--solo {
  width: 38px; height: 38px; border-radius: var(--r-btn);
  display: grid; place-items: center;
  border: 1.5px solid var(--fnd-pink); background: var(--surface); color: var(--fnd-pink);
  transition: all .14s var(--ease);
}
.fnd-iconbtn--solo svg { width: 17px; height: 17px; }
.fnd-iconbtn--solo:hover { background: var(--fnd-pink-soft); }

.fnd-uploadbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-btn); border: none;
  background: var(--grad-brand); color: #fff;
  font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-grad);
}
.fnd-uploadbtn svg { width: 15px; height: 15px; }
.fnd-uploadbtn:hover { box-shadow: 0 12px 26px -6px rgba(158, 92, 190, .56); }


.fnd-statustabs {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
}
.fnd-statustabs button {
  display: flex; align-items: center; gap: 7px;
  padding: 0 0 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent;
}
.fnd-statustabs button.is-active { color: var(--brand-purple); font-weight: 700; border-bottom-color: var(--brand-purple); }
.fnd-count { background: var(--fnd-purple-bg); color: var(--text-2); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 8px; }
.fnd-statustabs button.is-active .fnd-count { background: var(--violet-bg); color: var(--brand-purple); }

/* ----------------------------------------------------------------- table */

/* sort affordance + gradient row marker, matching roster-templates.css's
   listing table exactly (same technique, same colors). */
.fnd-sort { margin-left: 5px; font-size: 12px; font-weight: 600; color: #A99FBE; }

.fnd-table tbody td:first-child,
.fnd-billing__table tbody tr.fnd-billing__row td:first-child { position: relative; padding-left: 26px; }
.fnd-table tbody td:first-child::before,
.fnd-billing__table tbody tr.fnd-billing__row td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #E24FA8, #9B5CF6);
}

.fnd-table .t-num { color: var(--text-3); font-weight: 700; }

.fnd-person { display: flex; align-items: flex-start; gap: 10px; }
.fnd-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px;
}
.fnd-person__name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.fnd-person__meta { margin-top: 2px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.fnd-person__meta b { color: var(--text-2); font-weight: 600; }

.fnd-plan { font-size: 12.5px; color: var(--text); white-space: nowrap; }
.fnd-plan .arrow { color: var(--text-3); margin: 0 3px; }

.fnd-util { min-width: 160px; }
.fnd-util__top { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 800; }
.fnd-util__top span { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.fnd-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.fnd-bar > span { display: block; height: 100%; border-radius: 999px; }
.fnd-util__rem { margin-top: 4px; font-size: 11px; color: var(--text-3); }

/* --------------------------------------------------------------- detail -- */

.fnd-detailhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fnd-backbtn { display: inline-flex; align-items: center; gap: 8px; }
.fnd-backbtn svg { width: 16px; height: 16px; }
.fnd-detailhead__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.fnd-summarycard { padding: 20px 24px; }
.fnd-summary__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.fnd-summary__who { display: flex; align-items: center; gap: 14px; }
.fnd-summary__avatar {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  background: var(--grad-violet);
}
.fnd-summary__name { font-size: 16px; font-weight: 800; }
.fnd-summary__sub { margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.fnd-summary__stats { display: flex; gap: 30px; flex-wrap: wrap; }
.fnd-summary__stat { text-align: right; }
.fnd-summary__stat .lbl { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; }
.fnd-summary__stat .val { margin-top: 4px; font-size: 15px; font-weight: 800; white-space: nowrap; }

.fnd-allocationcard, .fnd-utilcard { padding: 20px 24px; }
.fnd-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.fnd-card__head h3 { font-size: 15.5px; font-weight: 800; }
.fnd-card__head p { margin-top: 2px; font-size: 12px; color: var(--text-3); }

.fnd-allocation-body { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.fnd-legend { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
.fnd-legend__row { display: grid; grid-template-columns: 16px 1.4fr .9fr .9fr .8fr; align-items: center; gap: 14px; }
.fnd-legend__dot { width: 9px; height: 9px; border-radius: 3px; }
.fnd-legend__name { font-size: 13px; font-weight: 700; color: var(--text); }
.fnd-legend__allocated { font-size: 13px; font-weight: 700; color: var(--text); text-align: right; }
.fnd-legend__claimed { font-size: 13px; font-weight: 700; text-align: right; }
.fnd-legend__freq { font-size: 12px; color: var(--text-3); text-align: right; white-space: nowrap; }

.fnd-donut { flex: none; position: relative; width: 190px; height: 190px; }
.fnd-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fnd-donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fnd-donut__center .val { font-size: 19px; font-weight: 800; color: var(--text); }
.fnd-donut__center .lbl { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

.fnd-pacebadges { display: flex; gap: 8px; flex-wrap: wrap; }
.fnd-pacebadge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }

.fnd-util-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 0; border-top: 1px solid var(--border);
}
.fnd-util-row:first-of-type { border-top: 0; padding-top: 12px; }
.fnd-util-row__icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 17px;
}
.fnd-util-row__main { flex: 1; min-width: 160px; }
.fnd-util-row__name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.fnd-util-row__sub { margin-top: 2px; font-size: 11.5px; color: var(--brand-purple); }
.fnd-util-row__bar { flex: 2; min-width: 160px; display: flex; align-items: center; gap: 10px; }
.fnd-util-row__bar .fnd-bar { flex: 1; height: 7px; margin-top: 0; }
.fnd-util-row__pct { font-size: 12.5px; font-weight: 800; white-space: nowrap; min-width: 40px; }
.fnd-util-row__amt { min-width: 84px; }
.fnd-util-row__amt .lbl { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); text-transform: uppercase; }
.fnd-util-row__amt .val { margin-top: 2px; font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; }
.fnd-util-row__morebtn {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: var(--text-3);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.fnd-util-row__morebtn svg { width: 18px; height: 18px; }
.fnd-util-row__morebtn:hover, .fnd-util-row__morebtn[aria-expanded="true"] { background: var(--violet-bg); color: var(--brand-purple); }

/* shared 3-dot row action menu, single fixed-position instance reused by
   every Budget Utilisation row — same pattern as roster-templates.css's
   .rowmenu__list/.rowmenu__item. */
.fnd-rowmenu__list {
  position: fixed; z-index: 120; min-width: 168px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); display: none;
}
.fnd-rowmenu__list.is-open { display: block; }
.fnd-rowmenu__item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text); text-align: left;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.fnd-rowmenu__item svg { width: 16px; height: 16px; flex: none; }
.fnd-rowmenu__item:hover { background: var(--violet-bg); color: var(--brand-purple); }
.fnd-rowmenu__item--danger { color: var(--red); }
.fnd-rowmenu__item--danger:hover { background: var(--red-bg); color: var(--red); }

.fnd-util-row__expandbtn {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: var(--text-3);
  transition: transform .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.fnd-util-row__expandbtn:hover { background: var(--surface-2); }
.fnd-util-row__expandbtn.is-open { transform: rotate(90deg); background: var(--violet-bg); color: var(--brand-purple); }

/* ---- per-service line-item rate breakdown (Budget Utilisation expand) ---- */

.fnd-lineitem-wrap { margin: 0 0 16px; border: 1px solid var(--commontable2-cell-border); border-radius: 12px; }
.fnd-lineitem-table th, .fnd-lineitem-table td { white-space: nowrap; }
.fnd-lineitem-table td:nth-child(2) { white-space: normal; }
.fnd-lineitem__title { font-size: 13.5px; font-weight: 800; color: var(--text); line-height: 1.35; }
.fnd-lineitem__sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.fnd-lineitem__sub .tag { color: var(--brand-purple); font-weight: 600; }
.fnd-lineitem__stacked { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 800; color: var(--text); }
.fnd-lineitem__pill { display: inline-flex; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--green-bg); color: var(--green); white-space: nowrap; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .fnd-summarystats { flex-wrap: wrap; }
  .fnd-legend__row { grid-template-columns: 16px 1.3fr .9fr .8fr; }
  .fnd-legend__freq { display: none; }
}

@media (max-width: 760px) {
  .fnd-summarystats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .fnd-statbox { border-left: 0; border-top: 1px solid var(--fnd-grid-line); }
  .fnd-statbox:nth-child(-n+2) { border-top: 0; }
  .fnd-allocation-body { flex-direction: column; }
  .fnd-donut { align-self: center; }
}

/* ============================================================ ADD FUNDING
   drawer — uses the shared gradient .drawer-header (same top bar as every
   other drawer in the app); the body's middle section (Claim Rule Type
   config) is rebuilt by rosters.js-style JS whenever the type changes. */

.fnd-fd { width: 820px; }

.fnd-fd__body .field { margin-bottom: 16px; }
.fnd-fd__body .field__label b { color: var(--red); font-weight: 700; margin-left: 2px; }
.fnd-fd__body .field__hint { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }

.fnd-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.fnd-field-grid .field { margin-bottom: 0; }

.fnd-fd__sectionlabel {
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-purple);
  margin: 22px 0 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.fnd-fd__body > .fnd-fd__sectionlabel:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.fnd-fd__budgetrow { display: flex; align-items: baseline; }
.fnd-fd__ratehint { margin-left: auto; font-size: 12.5px; font-weight: 700; font-style: italic; color: var(--brand-purple); }

/* ---- ratio groups (Hourly Timebanded) ---- */

.fnd-addratio-row { display: flex; gap: 10px; margin-bottom: 16px; }
.fnd-addratio-row select { flex: 1; }
.fnd-addratio-row button { flex: none; }

.fnd-ratiogroup { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 14px; overflow: hidden; }
.fnd-ratiogroup__head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--violet-bg); cursor: pointer; }
.fnd-ratiogroup__badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--brand-purple); color: #fff; font-size: 12px; font-weight: 800; }
.fnd-ratiogroup__title { flex: 1; font-size: 13.5px; font-weight: 700; color: var(--text); }
.fnd-ratiogroup__count { font-size: 11.5px; font-weight: 700; color: var(--brand-purple); background: var(--surface); border-radius: 999px; padding: 3px 10px; }
.fnd-ratiogroup__chevron { color: var(--text-2); transition: transform .16s var(--ease); }
.fnd-ratiogroup.is-collapsed .fnd-ratiogroup__chevron { transform: rotate(-90deg); }
.fnd-ratiogroup.is-collapsed .fnd-ratiogroup__body { display: none; }
.fnd-ratiogroup__body { padding: 14px; }

.fnd-fundingrow { display: grid; grid-template-columns: 1.3fr 1.6fr .7fr .7fr .7fr 32px; gap: 10px; align-items: center; margin-bottom: 10px; }
.fnd-fundingrow select, .fnd-fundingrow input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font-size: 12.5px; background: var(--surface); }
.fnd-fundingrow--head { margin-bottom: 8px; }
.fnd-fundingrow--head span { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.fnd-rowremove {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid #F3C4CC; background: var(--red-bg); color: var(--red);
  display: grid; place-items: center;
}
.fnd-rowremove:hover { background: #FCC9CE; }
.fnd-rowremove svg { width: 14px; height: 14px; }

.fnd-addrow-btn {
  width: 100%; border: 1.5px dashed #CBB6F2; background: var(--violet-bg); color: var(--brand-purple);
  border-radius: 10px; padding: 9px 14px; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.fnd-addrow-btn:hover { background: #E4DBFB; }
.fnd-addrow-btn svg { width: 14px; height: 14px; }

/* ---- cost calculation preview ---- */

.fnd-costpreview__info {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  background: var(--violet-bg); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 12px 16px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-2);
}
.fnd-costpreview__info b { color: var(--text); }
.fnd-costpreview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fnd-costpreview-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.fnd-costpreview-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fnd-costpreview-table .sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.fnd-costpreview-table .sub em { color: var(--brand-purple); font-style: normal; }
.fnd-costpreview-table tfoot td { border-bottom: 0; border-top: 2px solid var(--border-strong); font-weight: 800; color: var(--text); background: var(--surface-2); }
.fnd-costpreview-table td.t-right, .fnd-costpreview-table th.t-right { text-align: right; }

/* ---- per-item / per-km ---- */

.fnd-itemrow { display: grid; grid-template-columns: 1.6fr .8fr 1fr 1fr 32px; gap: 10px; align-items: end; margin-bottom: 10px; }
.fnd-itemrow .field { margin-bottom: 0; }
.fnd-itemrow .field__label { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; display: block; }
.fnd-itemrow input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font-size: 12.5px; }

.fnd-km-fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.fnd-kmchips { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 10px; min-height: 46px; }
.fnd-kmchip { display: inline-flex; align-items: center; gap: 7px; background: var(--violet-bg); color: var(--brand-purple); border-radius: 999px; padding: 5px 8px 5px 12px; font-size: 12px; font-weight: 700; }
.fnd-kmchip button { color: var(--brand-purple); opacity: .7; }
.fnd-kmchip button:hover { opacity: 1; }

@media (max-width: 700px) {
  .fnd-field-grid, .fnd-km-fieldrow { grid-template-columns: 1fr; }
  .fnd-fundingrow, .fnd-itemrow { grid-template-columns: 1fr 1fr; }
}

/* ==================================================== IMPORT ROC FUNDING
   drawer — shares the gradient .drawer-header used by every other drawer
   in the app, plus a 3-step progress stepper and an upload dropzone. */

.fnd-roc__stepper { display: flex; align-items: flex-start; margin-bottom: 28px; }
.fnd-roc__step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; width: 108px; }
.fnd-roc__stepcircle {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  background: var(--surface-2); color: var(--text-3); border: 2px solid var(--border-strong);
}
.fnd-roc__steplabel { font-size: 12px; font-weight: 700; color: var(--text-3); text-align: center; }
.fnd-roc__step.is-active .fnd-roc__stepcircle { background: var(--grad-brand); color: #fff; border-color: transparent; }
.fnd-roc__step.is-active .fnd-roc__steplabel { color: var(--text); }
.fnd-roc__step.is-done .fnd-roc__stepcircle { background: var(--brand-purple); color: #fff; border-color: transparent; }
.fnd-roc__step.is-done .fnd-roc__steplabel { color: var(--text); }
.fnd-roc__stepline { flex: 1; height: 2px; background: var(--border-strong); margin: 15px -20px 0; }
.fnd-roc__stepline.is-done { background: var(--brand-purple); }

.fnd-roc__panelhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fnd-roc__panelhead h4 { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--text); }

.fnd-roc__dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--violet-bg);
  padding: 40px 24px; cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.fnd-roc__dropzone:hover, .fnd-roc__dropzone.is-dragover { border-color: var(--brand-purple); background: #EEEAFC; }
.fnd-roc__dropicon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand-purple); margin-bottom: 6px; }
.fnd-roc__dropzone b { font-size: 14px; color: var(--text); }
.fnd-roc__dropzone span { font-size: 12.5px; color: var(--text-2); max-width: 340px; }
.fnd-roc__dropzone small { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.fnd-roc__filepill {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.fnd-roc__filepill svg { flex: none; color: var(--brand-purple); }
.fnd-roc__filepill span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fnd-roc__filepill button { flex: none; color: var(--text-3); }
.fnd-roc__filepill button:hover { color: var(--red); }

.fnd-roc__success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 24px; }
.fnd-roc__successicon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green); margin-bottom: 6px; box-shadow: 0 0 0 10px rgba(22, 163, 74, .08); }
.fnd-roc__success h4 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); }
.fnd-roc__success p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 340px; }

/* ---- ROC review: participant cards ---- */

#rocReviewTabs { padding: 0 0 0; margin-bottom: 16px; }

.fnd-roccard { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.fnd-roccard__row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.fnd-roccard__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
}
.fnd-roccard__main { flex: 1; min-width: 0; }
.fnd-roccard__name { font-size: 13.5px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.fnd-roccard__issue { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); }
.fnd-roccard__sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.fnd-roccard__amt { text-align: right; flex: none; }
.fnd-roccard__amt .val { font-size: 14.5px; font-weight: 800; color: var(--text); }
.fnd-roccard__amt .lbl { margin-top: 2px; font-size: 10.5px; color: var(--text-3); }
.fnd-roccard__chevron { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--text-3); transition: transform .16s var(--ease), background .16s var(--ease); }
.fnd-roccard__chevron:hover { background: var(--surface-2); }
.fnd-roccard__chevron.is-open { transform: rotate(180deg); background: var(--violet-bg); color: var(--brand-purple); }

.fnd-roccard__detail { padding: 18px 20px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

.fnd-roc__metagrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.fnd-roc__metagrid .field__label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.fnd-roc__srctag { font-size: 9px; font-weight: 800; text-transform: none; letter-spacing: 0; padding: 1px 7px; border-radius: 999px; }
.fnd-roc__srctag--roc { background: var(--green-bg); color: var(--green); }
.fnd-roc__srctag--manual { background: var(--amber-bg); color: var(--amber); }
.fnd-roc__metagrid select, .fnd-roc__metagrid input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: var(--surface); color: var(--text); }

.fnd-roc__serviceshead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.fnd-roc__serviceshead svg { color: var(--brand-purple); }

.fnd-rocservice { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); margin-bottom: 12px; }
.fnd-rocservice__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.fnd-rocservice__head b { font-size: 13.5px; color: var(--text); }
.fnd-rocservice__amt { text-align: right; flex: none; }
.fnd-rocservice__amt .val { font-size: 14px; font-weight: 800; color: var(--text); }
.fnd-rocservice__amt .lbl { margin-top: 2px; font-size: 10.5px; color: var(--text-3); }
.fnd-rocservice__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fnd-rocservice__tag { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.fnd-rocservice__tag--core { background: var(--violet-bg); color: var(--brand-purple); }
.fnd-rocservice__tag--rate { background: var(--green-bg); color: var(--green); }

.fnd-rocservice__label { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 8px; }
.fnd-rocratio-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fnd-rocratio-table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.fnd-rocratio-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.fnd-rocratio-table tbody tr:last-child td { border-bottom: 0; }
.fnd-rocratio-table--fixed { background: var(--violet-bg); border-radius: 10px; overflow: hidden; }
.fnd-rocratio-table--fixed th, .fnd-rocratio-table--fixed td { border-bottom-color: #E0D8F7; }

.fnd-rocservice__summary { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 14px; padding: 14px 16px; background: var(--violet-bg); border-radius: 10px; }
.fnd-rocservice__summary > div { display: flex; flex-direction: column; gap: 4px; }
.fnd-rocservice__summary .lbl { font-size: 10.5px; color: var(--text-3); }
.fnd-rocservice__summary .val { font-size: 15px; font-weight: 800; color: var(--brand-purple); }

@media (max-width: 700px) {
  .fnd-roc__metagrid { grid-template-columns: 1fr 1fr; }
  .fnd-roccard__row { flex-wrap: wrap; }
}

/* ======================================================= BILLING (per participant) */

.fnd-billingcard { overflow: visible; }

.fnd-billing__customrange { display: flex; align-items: flex-end; gap: 14px; padding: 16px 24px 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.fnd-billing__customrange label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }

.fnd-billing__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 24px; margin: 0; }
.fnd-billing__pager { display: flex; align-items: center; gap: 10px; }
.fnd-billing__pagerlabel { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fnd-billing__pager select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: var(--surface); }

/* inset, bordered table — matches roster-templates.css's .rt-table-wrap
   treatment exactly, reused for both the participant listing and billing
   tables so every table in the module has the same left/right gutter. */
.fnd-listcard .table-wrap,
.fnd-billingcard .table-wrap { width: auto; margin: 0 24px 24px; border: 1px solid var(--commontable2-cell-border); border-radius: 12px; overflow-x: auto; }
.fnd-listcard .table-wrap { margin-top: 20px; }
.fnd-listcard .table-wrap thead tr th:first-child,
.fnd-billingcard .table-wrap thead tr th:first-child { border-top-left-radius: 11px; }
.fnd-listcard .table-wrap thead tr th:last-child,
.fnd-billingcard .table-wrap thead tr th:last-child { border-top-right-radius: 11px; }

.fnd-billing__weeklabel { font-weight: 700; color: var(--text); font-size: 13.5px; }
.fnd-billing__weekrange { margin-top: 2px; font-size: 11.5px; color: var(--text-3); }

.fnd-billing__services { display: flex; flex-wrap: wrap; gap: 6px; max-width: 280px; }
.fnd-billing__tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.fnd-billing__tag .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.fnd-billing__tag--more { color: var(--text-3); background: var(--surface-2); }

.fnd-billing__expandbtn { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); transition: transform .16s var(--ease), background .16s var(--ease), color .16s var(--ease); }
.fnd-billing__expandbtn:hover { background: var(--surface-2); }
.fnd-billing__expandbtn.is-open { transform: rotate(180deg); background: var(--violet-bg); color: var(--brand-purple); }

.fnd-billing__detailrow > td { padding: 0 !important; background: var(--surface-2); }
.fnd-billing__detailwrap.table-wrap { padding: 0; margin: 20px; }

.fnd-billing__itemtable thead th,
.fnd-billing__itemtable tbody td { padding: 18px 24px; }
.fnd-billing__itemtable td.t-right,
.fnd-billing__itemtable th.t-right { font-variant-numeric: tabular-nums; }
.fnd-billing__itemtable .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; }
.fnd-billing__amt { font-weight: 800; color: var(--text); }

.fnd-billing__itemtable tfoot td { padding: 0; border: 0; }
.fnd-billing__totalbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 28px;
  background: var(--commontable2-header-bg);
  padding: 18px 24px;
  border-top: 1px solid var(--commontable2-cell-border);
}
.fnd-billing__totalgrp { display: flex; align-items: center; gap: 10px; }
.fnd-billing__totalgrp .lbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.fnd-billing__totalgrp .val { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.fnd-billing__totalgrp .val.due { color: var(--brand-purple); }
.fnd-billing__totaldiv { width: 1px; height: 18px; background: var(--border-strong); }

@media (max-width: 700px) {
  .fnd-billing__customrange { flex-wrap: wrap; }
}
