/* Source: https://github.com/TFH-Web/rock-frontend/blob/main/theme/Styles/v18/tfh-metric-dashboards.css */
/* Converted from theme/Styles/metric-dashboards.less for the Rock v18 RockV2 theme. */
/* Plain CSS: native nesting + custom properties. No compiler. */

/* Local design tokens (were LESS @variables) */
:root {
  --snap-up-color      : var(--color-info-strong); /* v1: #005a8e */
  --snap-up-bg         : var(--color-info-soft); /* v1: #e6f1f8 */
  --snap-dn-color      : var(--color-warning-strong); /* v1: #c45e10 */
  --snap-dn-bg         : var(--color-warning-soft); /* v1: #fdf1e8 */
  --snap-flat-color    : var(--tfh-muted); /* v1: #757474 */
  --snap-flat-bg       : var(--tfh-light-gray); /* v1: #f0f0f0 */
  --tfh-funnel-brand   : var(--tfh-brand); /* v1: #36454f */
  --tfh-funnel-shade-1 : color-mix(in srgb, var(--tfh-brand) 88%, black); /* was darken(@tfh-funnel-brand, 10%) — v1: #212b31 */
  --tfh-funnel-shade-2 : var(--tfh-brand); /* v1: var(--tfh-funnel-brand) */
  --tfh-funnel-shade-3 : color-mix(in srgb, var(--tfh-brand) 78%, white); /* was lighten(@tfh-funnel-brand, 11%) — v1: #4d6270 */
  --tfh-funnel-shade-4 : color-mix(in srgb, var(--tfh-brand) 58%, white); /* was lighten(@tfh-funnel-brand, 22%) — v1: #647f92 */
}

/*  ============================================================ */
/*  Metric Dashboards — Custom Styles */
/*  RockWeb/Themes/Rock/Styles/metric-dashboards.less */

/*  Import this file from _custom.less: */
/*    @import "metric-dashboards.less"; */

/*  Styles are added here as components are built. Do not add */
/*  speculative or unused styles — only what is on a live block. */
/*  ============================================================ */


/*  ── Section 1: Page Menu Sub-Nav ───────────────────────────── */

/*  Tabs that overflow the row are collapsed by JS (in */
/*  lava/tabbed-nav.lava) behind an "All" dropdown button — */
/*  Monday.com-style. No horizontal scrolling. */
.tfh-dash-subnav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--tfh-border-dark);
  position: relative; /*  anchor for the dropdown */
}

.tfh-dash-subnav__item {
  flex: 0 0 auto; /*  keep natural width so JS measurement is exact */
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tfh-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;

  &:hover { color: var(--tfh-brand-ink); } /*  collapsed into the "All" dropdown */
}
.tfh-dash-subnav__item--hidden { display: none; }

.tfh-dash-subnav__item--active {
    color: var(--tfh-brand-ink);
    border-bottom-color: var(--tfh-brand);
    font-weight: 600;
  }


@media (max-width: 767px) {
  .tfh-dash-subnav__item {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/*  "All" overflow button + dropdown */
.tfh-dash-subnav__more {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;

  &[hidden] { display: none; }
}

.tfh-dash-subnav__more-btn {
  padding: 5px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tfh-muted);
  background: transparent;
  border: none;
  border-radius: var(--tfh-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, background-color 0.12s;

  .fa {
    font-size: 10px;
    margin-left: 4px;
  }

  &:hover {
    color: var(--tfh-brand-ink);
    background: var(--tfh-light-gray);
  }

  /*  Highlighted when the active tab is collapsed into the menu */
}
.tfh-dash-subnav__more-btn--active {
    color: var(--tfh-white);
    background: var(--tfh-brand);

    &:hover {
      color: var(--tfh-white);
      background: var(--tfh-brand);
    }
  }


.tfh-dash-subnav__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1050;
  width: 240px;
  padding: 8px;
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border-rock);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);

  &[hidden] { display: none; }
}

.tfh-dash-subnav__search {
  position: relative;
  margin-bottom: 8px;

  .fa {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--tfh-muted);
    pointer-events: none;
  }

  input {
    width: 100%;
    height: auto;
    margin: 0; /*  reset Rock/Bootstrap input defaults */
    padding: 6px 10px 6px 30px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--tfh-black);
    background: var(--tfh-white);
    border: 1px solid var(--tfh-border-rock);
    border-radius: var(--tfh-radius-sm);
    outline: none;
    box-shadow: none;

    &:focus {
      border-color: var(--tfh-brand);
      box-shadow: none; /*  suppress Bootstrap focus glow */
    }
  }
}

.tfh-dash-subnav__menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.tfh-dash-subnav__menu-item {
  /*  overflow:hidden (for ellipsis) zeroes a flex item's min-size, */
  /*  so without flex-shrink:0 the scroll container squashes items */
  /*  instead of scrolling once the list is long enough. */
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tfh-black);
  border-radius: var(--tfh-radius-sm);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  &:hover {
    color: var(--tfh-black);
    background: var(--tfh-light-gray);
    text-decoration: none;
  } /*  hidden by the search filter */
}
.tfh-dash-subnav__menu-item--filtered { display: none; }

.tfh-dash-subnav__menu-item--active {
    color: var(--tfh-white);
    background: var(--tfh-brand);

    &:hover {
      color: var(--tfh-white);
      background: var(--tfh-brand);
    }
  }


.tfh-dash-subnav__menu-empty {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--tfh-muted);

  &[hidden] { display: none; }
}


/*  ── Section 2: Page Wrapper + Metric Grid ──────────────────── */

/*  .tfh-page-content { */
/*    padding: 20px 24px 60px; */
/*    flex: 1; */
/*  } */

.tfh-metric-page {
  display: flex;
  flex-direction: column;
  gap: var(--tfh-gap-card);
}

.tfh-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--tfh-gap-card);
}

.tfh-metric-grid--2 { grid-template-columns: repeat(2, 1fr); }
.tfh-metric-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tfh-metric-grid--4 { grid-template-columns: repeat(4, 1fr); }


/*  ── Section 3: Panel Card ──────────────────────────────────── */

.tfh-panel-card {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  padding: var(--tfh-padding-card);
  box-shadow: var(--tfh-shadow);
  overflow: hidden; /*  Masks horizontally scrolling tables at card edges */
}

/*  Scroll wrapper — place directly around <table> inside a .tfh-panel-card. */
/*  overflow-x lets the table scroll horizontally; the card's overflow:hidden clips it. */
.tfh-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}


/*  ── Section 4: KPI Stat Cards ──────────────────────────────── */

.tfh-metric-stat {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  padding: 20px 24px;
  box-shadow: var(--tfh-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tfh-metric-stat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.tfh-metric-stat__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--tfh-muted);
  line-height: 1.3;
}

/*  Groups label + inline info icon when a "Full detail" CTA occupies the top-right */
.tfh-metric-stat__label-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tfh-metric-stat__num {
  font-size: 40px;
  font-weight: 800;
  color: var(--tfh-black);
  line-height: 1;
  letter-spacing: -1.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tfh-metric-stat__num--sm {
  font-size: 30px;
  letter-spacing: -0.5px;
}

.tfh-metric-stat__delta {
  font-size: 12px;
  color: var(--tfh-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/*  Spark variant — no bottom padding; sparkline bleeds to card edge */
.tfh-metric-stat--spark {
  padding-bottom: 0;
  overflow: hidden;
}

.tfh-metric-stat__sparkline {
  height: 72px;
  margin: auto -24px 0;
  canvas { display: block; }
}


/*  Error state — KPI card data mismatch */
.tfh-metric-stat--error {
  border: 2px solid #d4442e;
  box-shadow: 0 0 0 4px rgba(212,68,46,0.10);
}


/*  ── Section 5: Stat Breakdown Card ────────────────────────── */

/*  Breakdown card — overview KPI with campus/category rows below. */
/*  Use .tfh-stat-breakdown--bars to show horizontal percentage bars. */
.tfh-stat-breakdown {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  display: flex;
  flex-direction: column;
  padding: 20px 24px 0;
  overflow: hidden;
}

/*  Rows section — sits below the sparkline inside the card */
.tfh-stat-breakdown__rows {
  padding: 4px 0 10px;
  margin-top: 2px;
}

/*  Base row (no-bars mode) */
.tfh-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--tfh-border);
  &:first-child { border-top: none; }
}

.tfh-breakdown-row__body {
  flex: 1;
  min-width: 0;
}

.tfh-breakdown-row__name {
  font-size: 13px;
  color: var(--tfh-black);
}

/*  Bar track — hidden in default mode; shown by --bars modifier */
.tfh-breakdown-bar {
  display: none;
  height: 4px;
  background: var(--tfh-light-gray);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.tfh-breakdown-bar__fill {
  height: 100%;
  background: #697f8d; /*  mid-light slate */
  border-radius: 2px;
}

.tfh-breakdown-row__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

.tfh-breakdown-row__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--tfh-black);
  min-width: 40px;
  text-align: right;
}

.tfh-breakdown-row__pct {
  font-size: 12px;
  color: var(--tfh-muted);
  min-width: 36px;
  text-align: right;
}

/*  Bars modifier — shows percentage bars under each row name */
.tfh-stat-breakdown--bars {
  .tfh-breakdown-row {
    align-items: flex-start;
    border-top: none;
    padding: 7px 0 7px 12px;
    margin: 3px 0;
    border-left: 2px solid var(--tfh-border);
    &:first-child { margin-top: 6px; }
  }
  .tfh-breakdown-bar { display: block; }
  .tfh-breakdown-row__meta { padding-top: 1px; }
}


/*  ── Section 6: Trend Badges ────────────────────────────────── */

.tfh-trend-up,
.tfh-trend-down,
.tfh-trend-flat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: normal;
  line-height: 1.3;
}

.tfh-trend-up   { background: rgba(0,119,187,0.10);   color: var(--snap-up-color); }
.tfh-trend-down { background: rgba(238,119,51,0.10);  color: var(--snap-dn-color); }
.tfh-trend-flat { background: rgba(117,116,116,0.10); color: var(--tfh-muted); }


/*  ── Section 6: Filter Bar ──────────────────────────────────── */

.tfh-filters {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  padding: 14px 20px;
  box-shadow: var(--tfh-shadow);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  /*  margin-bottom handled by .tfh-metric-page gap */
}

.tfh-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tfh-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tfh-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tfh-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: end;
}

.tfh-filter-sublabel {
  font-size: 11px;
  color: var(--tfh-muted);
}

.tfh-filter-checkbox-label {
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--tfh-black);
  input[type="checkbox"] { margin: 0; cursor: pointer; }
}

.tfh-filter-reset {
  font-size: 13px;
  color: var(--tfh-muted);
  background: none;
  border: 1.5px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.42;
  transition: border-color 0.12s, color 0.12s;
  &:hover { border-color: var(--tfh-muted); color: var(--tfh-muted); }
}

/*  Copy-link icon button — pushes to the far right of .tfh-filters so a user */
/*  can grab a shareable URL with the current filters preserved. */
.tfh-filter-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  font-size: 15px;
  cursor: pointer;
  color: var(--tfh-muted);
  font-family: inherit;
  align-self: flex-end;
  margin-left: auto;
  transition: border-color 0.12s, color 0.12s;
  &:hover { border-color: var(--tfh-muted); color: var(--tfh-black); }
  &.tfh-filter-copy--ok { border-color: #2e7d32; color: #2e7d32; }
}

/*  Sunday date picker dropdown items */
.wa-preset-item {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--tfh-black);
  &:hover    { background: var(--tfh-light-gray); }
  &.wa-active { font-weight: 600; color: var(--tfh-brand-ink); }
}


/*  ── Section 7: Campus Block ────────────────────────────────── */

.tfh-campus-section-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--tfh-black);
  margin: 8px 0 0;
}

.tfh-campus-block {
  display: grid;
  /*  Chart (outlook) gets equal width to the services table on large screens (≥1200px). */
  /*  Below 1200px the responsive block stacks the chart full-width on top. */
  grid-template-columns: 2fr 2fr 1fr;
  /*  The AI summary strip spans the full top row; campus card / services / area sit */
  /*  beneath it. Named areas make placement deterministic at every width (the */
  /*  responsive blocks below only redefine grid-template-columns + areas). */
  grid-template-areas:
    "ai      ai       ai"
    "outlook services area";
  gap: var(--tfh-gap-card);
  margin-bottom: var(--tfh-gap-card);
  align-items: stretch; /*  Ensures all 3 cards grow to match the tallest (service table) */
}

/*  Child → area mapping, applied at every breakpoint. The chart card is */
/*  .tfh-outlook-camp (current layout) or .tfh-metric-stat (older, still-live). */
.tfh-campus-block > .tfh-ai-campus { grid-area: ai; }
.tfh-campus-block > .tfh-outlook-camp,
.tfh-campus-block > .tfh-metric-stat { grid-area: outlook; }
.tfh-campus-block > .tfh-panel-card:first-of-type { grid-area: services; }
.tfh-campus-block > .tfh-panel-card:last-of-type  { grid-area: area; }

/*  Campus total card — flex column so "Last year" pin stays at bottom */
.tfh-campus-card--total {
  display: flex;
  flex-direction: column;
}

.tfh-campus-block__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.tfh-campus-block__name {
  font-size: 12px;
  color: var(--tfh-muted);
  font-weight: 500;
  line-height: 1.4;
}

.tfh-campus-block__total {
  font-size: 28px;
  font-weight: 800;
  color: var(--tfh-black);
  letter-spacing: -0.8px;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.tfh-campus-block__lastyear {
  font-size: 12px;
  color: var(--tfh-muted);
  margin-top: auto; /*  Pushes to bottom of flex column */
  padding-top: 10px;
  border-top: 1px solid var(--tfh-border);
}

.tfh-kpi-donut {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}


/*  ── Section 8: Service Table + Expand ─────────────────────── */

.tfh-svc-row {
  cursor: pointer;
  &:hover > td { background-color: var(--tfh-light-gray); }
}

/*  Plus/minus expand toggle icon */
.tfh-svc-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tfh-muted-light);
  background: var(--tfh-light-gray);
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
  &::before { content: '+'; }
}

.tfh-svc-row.is-open .tfh-svc-expand {
  background: var(--tfh-brand);
  color: #fff;
  &::before { content: '−'; }
}

.tfh-svc-detail {
  display: none;
  &.is-open { display: table-row; }
  > td {
    padding: 12px 0 12px 38px !important;
    border-top: none !important;
    text-align: left !important;
  }
}

.tfh-detail-inner {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.tfh-detail-group__title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tfh-muted-light);
  margin-bottom: 6px;
}

.tfh-detail-group {
  table { border-collapse: collapse; }
  td {
    padding: 2px 16px 2px 0;
    font-size: 12px;
    color: var(--tfh-black);
    border: none;
    background: none;
    &:last-child {
      font-weight: 700;
      text-align: right;
      padding-right: 0;
      min-width: 36px;
    }
  }
}

.tfh-svc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;

  th {
    font-size: 11px;
    font-weight: 600;
    color: var(--tfh-muted);
    padding: 0 8px 6px 0;
    text-align: right;
    white-space: nowrap;
    &:first-child { text-align: left; padding-left: 0; }
  }

  td {
    padding: 5px 8px 5px 0;
    border-top: 1px solid var(--tfh-border);
    color: var(--tfh-black);
    text-align: right;
    white-space: nowrap;
    &:first-child { text-align: left; padding-left: 0; color: var(--tfh-muted); }
  }

  .total-col { font-weight: 700; }
  .avg-col   { color: var(--tfh-muted); font-style: italic; }
}


/*  ── Section 9: Area Category Totals Table ──────────────────── */

.tfh-att-type-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;

  th {
    font-size: 11px;
    font-weight: 600;
    color: var(--tfh-muted);
    padding: 0 4px 6px 0;
    &:last-child { text-align: right; padding-right: 0; }
  }

  td {
    padding: 5px 4px 5px 0;
    border-top: 1px solid var(--tfh-border);
    color: var(--tfh-black);
    white-space: nowrap;
    &:first-child { color: var(--tfh-muted); font-size: 12px; }
    &:last-child  { text-align: right; font-weight: 600; padding-right: 0; }
  }
}


/*  ── Section 10: Online Attendance ──────────────────────────── */

.tfh-online-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--tfh-gap-card);
  margin-top: 10px;
}

.tfh-online-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;

  th {
    font-size: 11px;
    font-weight: 600;
    color: var(--tfh-muted);
    padding: 0 10px 8px 0;
    text-align: right;
    &:first-child { text-align: left; padding-left: 0; }
  }

  td {
    padding: 7px 10px 7px 0;
    border-top: 1px solid var(--tfh-border);
    color: var(--tfh-black);
    text-align: right;
    &:first-child { text-align: left; padding-left: 0; color: var(--tfh-muted); }
  }

  .total-col { font-weight: 700; padding-right: 0; }
}


/*  ── Section 11: Metric Stat Icon Links ────────────────────── */

.tfh-stat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.tfh-stat-icon {
  background: none;
  border: none;
  color: var(--tfh-muted-light) !important;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  position: relative;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  &:hover {
    color: var(--tfh-muted);
    background: var(--tfh-light-gray);
    text-decoration: none;
  }
}

.tfh-stat-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-md);
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 1030;
  text-align: left;
  pointer-events: none;

  &.is-open {
    display: block;
    pointer-events: auto;
  }
}

.tfh-stat-popover__subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--tfh-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.tfh-stat-popover__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tfh-black);
  margin-bottom: 8px;
}

.tfh-stat-popover__desc {
  font-size: 12px;
  color: var(--tfh-muted);
  line-height: 1.55;
}

.tfh-stat-icon--clock .tfh-clock-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #3d444d;
  color: #fff;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 30;
  pointer-events: none;
}

.tfh-stat-icon--clock:hover .tfh-clock-tip {
  display: block;
}


/*  ── Section 12: Widget Header + Bar Chart Card ────────────── */

.tfh-widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tfh-widget-header__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/*  .tfh-widget-title / .tfh-widget-subtitle are defined once, in _custom.less */
/*  (18px / 13px). Duplicates lived here at 15px / 12px and were dead code on the */
/*  v1 theme — _custom.less imports this file at the top, so its own rules always */
/*  won. On the v2 theme the load order is inverted (tfh-custom.css ships inside */
/*  theme.css via CSS Overrides, so it loads first), which let these override */
/*  site-wide and shrank every widget heading. Removed so both environments agree. */

.tfh-widget-link {
  font-size: 13px;
  color: var(--tfh-brand-ink);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 2px;
  text-decoration: none;
  &:hover { text-decoration: underline; color: var(--tfh-brand-ink); }
}

.tfh-chartjs-wrap {
  position: relative;
  width: 100%;
}

.tfh-chartjs-wrap--bar {
  height: 200px;
}

.tfh-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--tfh-border);
  border-radius: var(--tfh-radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.tfh-mini-stat {
  background: var(--tfh-white);
  padding: 14px 18px;
  text-align: center;
}

.tfh-mini-stat__num {
  font-size: 22px;
  font-weight: 800;
  color: var(--tfh-black);
  line-height: 1;
  letter-spacing: -0.5px;
}

.tfh-mini-stat__label {
  font-size: 11px;
  color: var(--tfh-muted);
  margin-top: 3px;
}


/*  ── Section 13: Overview Rows (dashboard-weekend-metrics-overview) ─── */

/*  Each metric gets its own horizontal row: [KPI | middle content] */
.tfh-overview-row {
  display: flex;
  align-items: stretch;
  gap: var(--tfh-gap-card);
}


/*  ── Section 14: Refresh Data Button ───────────────────────────────────────── */

.tfh-refresh-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: auto;
}

.tfh-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  background: var(--tfh-brand);
  color: #fff;
  border: none;
  border-radius: var(--tfh-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.42857;
  transition: background 0.12s, opacity 0.12s;

  &:hover:not(:disabled) { filter: brightness(0.88); }
  &:disabled { opacity: 0.65; cursor: not-allowed; }
}

.tfh-refresh-btn__spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tfh-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.tfh-refresh-status {
  font-size: 11px;
  color: var(--tfh-muted);
  line-height: 1.3;
  &.is-success { color: #0a8a7a; }
  &.is-error   { color: #d4442e; }
}


/*  ── Badge Legend ───────────────────────────────────────────── */

.tfh-badge-legend {
  padding: 16px 20px;
}
.tfh-badge-legend__note {
    font-size: 11px;
    color: var(--tfh-muted-light);
    border-top: 1px solid var(--tfh-border);
    padding-top: 10px;
    line-height: 1.5;
  }

.tfh-badge-legend__desc {
    font-size: 12px;
    color: var(--tfh-muted);
    line-height: 1.4;
  }

.tfh-badge-legend__badge-col {
    flex: 0 0 72px;
    display: flex;
    justify-content: flex-end;
  }

.tfh-badge-legend__row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

.tfh-badge-legend__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

.tfh-badge-legend__intro {
    font-size: 12px;
    color: var(--tfh-muted);
    margin-bottom: 12px;
    line-height: 1.5;
  }

.tfh-badge-legend__heading {
    font-size: 11px;
    font-weight: 600;
    color: var(--tfh-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
  }



/*  ── Section 15: Beit Abba Page ─────────────────────────────── */

.ba-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--tfh-gap-card);
}


/*  ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1400px) {
  /*  Per-campus row: chart card goes full-width on top; Services + Area drop below */
  /*  side-by-side. The chart squeezes too small in the 3-column layout below ~1400px, */
  /*  so stack earlier. grid-template-areas gives unambiguous placement regardless of */
  /*  source order. The chart card is .tfh-outlook-camp on the Variant-1 layout and */
  /*  .tfh-metric-stat on the previous (still-live) layout — map both to "outlook". */
  /*  Child → area mapping is declared once at base scope; here we only re-shape the grid. */
  .tfh-campus-block {
    grid-template-columns: 2.5fr 1fr;
    grid-template-areas:
      "ai ai"
      "outlook outlook"
      "services area";
  }
}

@media (max-width: 1199px) {
  .tfh-online-grid  { grid-template-columns: 1fr; }
  .tfh-metric-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .tfh-overview-row { flex-direction: column; }
}

@media (max-width: 767px) {
  /*  .tfh-page-content { padding: 16px 16px 48px; } */
  .tfh-metric-grid--3 { grid-template-columns: 1fr 1fr; }
  .tfh-svc-expand { display: none; } /*  Too small to tap reliably on mobile */
  .tfh-svc-badge-pct { display: none; } /*  Show icon only in comparison badges on mobile */
  .ba-top-grid { grid-template-columns: 1fr; } /*  Each card on its own row */
  /*  Phones: campus row stacks fully — chart, then services, then area (both layouts) */
  .tfh-campus-block {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ai"
      "outlook"
      "services"
      "area";
  }
}

@media (max-width: 480px) {
  .tfh-metric-grid--2 { grid-template-columns: 1fr; }
  .tfh-metric-grid--3 { grid-template-columns: 1fr; }
}


/*  ── Section: Weekend Metrics Entry Audit Block ─────────────── */
/*  Used by dashboard-metrics-entry-audit-block.html only. */

/*  Date-picker dropdown items (mirrors .wa-preset-item used by the */
/*  weekend attendance block — kept separate so the two filter bars */
/*  can evolve independently). */
.ae-preset-item {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--tfh-black);
  &:hover    { background: var(--tfh-light-gray); }
  &.ae-active { font-weight: 600; color: var(--tfh-brand-ink); }
}

/*  Override the Weekend Attendance dashboard's 3-column grid. */
/*  The audit page stacks one panel card per service vertically. */
.tfh-audit-campus {
  display: block;
  margin-bottom: var(--tfh-gap-grid);
}

.tfh-audit-campus__head {
  margin: 0 0 10px;
}

.tfh-audit-campus__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--tfh-black);
  margin: 0;
}

.tfh-audit-service {
  margin-bottom: var(--tfh-gap-card);
}

.tfh-audit-service__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tfh-border);
}

.tfh-audit-service__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tfh-black);
}

.tfh-audit-service__meta {
  font-size: 12px;
  color: var(--tfh-muted);
}

.tfh-audit-table {
  /*  Inherits from .tfh-svc-table; force the numeric column right-aligned. */
  th.tfh-audit-val,
  td.tfh-audit-val { text-align: right; }

  /*  Category column: muted so Area (next column) reads as the primary label */
  td.tfh-audit-cat {
    color: var(--tfh-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
}

.tfh-audit-muted {
  color: var(--tfh-muted-light);
}

.tfh-audit-empty {
  margin: 0;
  color: var(--tfh-muted);
  font-style: italic;
}

.tfh-audit-summary {
  margin-top: 10px;
  font-size: 12px;
  color: var(--tfh-muted);
  text-align: right;
}

/*  Missing-entry row: red left accent on the first cell + pill on the value cell. */
.tfh-entry-missing {
  > td:first-child {
    border-left: 3px solid var(--tfh-danger, #d4442e);
  }
}

.tfh-entry-missing__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--tfh-radius-sm);
  background: rgba(212, 68, 46, 0.10);
  color: var(--tfh-danger, #d4442e);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;

  i { font-size: 11px; }
}


/*  ── Section 19: Special Metric Hero Banner ─────────────────── */
/*  Full-width dark card for highlighted metrics. Two variants: */
/*    .tfh-hero-banner--ledger          two-panel grid, always expanded */
/*    .tfh-hero-banner--ledger-c        compact strip, expands downward on toggle */

.tfh-hero-banner {
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  overflow: hidden;
  background: var(--tfh-brand);
  color: #fff;
}

.tfh-hero-trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.14);
  border-radius: 20px;
  padding: 2px 9px;
  color: #fff;
}

/*  ── Ledger: always-expanded two-panel split */
.tfh-hero-banner--ledger {
  display: grid;
  grid-template-columns: 230px 1fr;
}

.tfh-hero-ledger__total {
  padding: 28px 32px;
  border-right: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.tfh-hero-ledger__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.50);
}

.tfh-hero-ledger__num {
  font-size: 50px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: #fff;
  margin: 4px 0;
}

.tfh-hero-ledger__date {
  font-size: 12px;
  color: rgba(255,255,255,0.50);
}

.tfh-hero-ledger__trend {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.tfh-hero-ledger__campuses {
  padding: 16px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tfh-hero-campus-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  &:first-child { border-top: none; }
}

.tfh-hero-campus-row__name {
  font-size: 13px;
  color: rgba(255,255,255,0.70);
  width: 90px;
  flex-shrink: 0;
}

.tfh-hero-campus-row__bar-wrap {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}

.tfh-hero-campus-row__bar {
  height: 100%;
  background: rgba(255,255,255,0.40);
  border-radius: 2px;
}

.tfh-hero-campus-row__count {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.tfh-hero-campus-row__pct {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/*  ── Collapsible variant: header strip always visible, campuses slide down */
.tfh-hero-banner--ledger-c {
  display: flex;
  flex-direction: column;
}

.tfh-hero-ledger-c__header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: rgba(0,0,0,0.15);
}

.tfh-hero-ledger-c__num-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;

  .tfh-hero-ledger__num { font-size: 36px; margin: 0; }
}

.tfh-hero-ledger-c__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;

  .tfh-hero-ledger__trend { margin-top: 0; }
}

.tfh-hero-ledger__toggle {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;

  &:hover { background: rgba(255,255,255,0.18); color: #fff; }
  .fa-chevron-down { transition: transform 0.25s ease; }
}

.tfh-hero-banner--ledger-c.is-expanded .tfh-hero-ledger__toggle .fa-chevron-down {
  transform: rotate(180deg);
}

.tfh-hero-ledger-c__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;

  .tfh-hero-campus-row {
    padding-left: 24px;
    padding-right: 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
    &:first-child { border-top: 1px solid rgba(255,255,255,0.14); }
  }
}

.tfh-hero-banner--ledger-c.is-expanded .tfh-hero-ledger-c__body {
  max-height: 320px;
}

@media (max-width: 900px) {
  .tfh-hero-banner--ledger {
    grid-template-columns: 1fr;

    .tfh-hero-ledger__total {
      border-right: none;
      border-bottom: 1px solid rgba(255,255,255,0.12);
    }
  }
}

@media (max-width: 600px) {
  .tfh-hero-ledger-c__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;

    .tfh-hero-ledger__date { display: none; }
    .tfh-hero-ledger__trend { flex-wrap: wrap; }
  }
}


/*  ── Section 20: Weekend Snapshot Card ──────────────────────── */


.tfh-snapshot {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  overflow: hidden;
}

.tfh-snapshot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}

.tfh-snapshot__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tfh-black);
  margin: 0;
  line-height: 1.2;
}

.tfh-snapshot__badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tfh-snapshot__info-btn {
  background: none; border: none; cursor: pointer;
  color: var(--tfh-muted-light); font-size: 13px; padding: 0 2px;
  position: relative;
  line-height: 1;

  &:hover { color: var(--tfh-muted); }

  .tfh-snapshot__tooltip { display: none; }
  &:hover .tfh-snapshot__tooltip { display: block; }
}

.tfh-snapshot__tooltip {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 280px;
  background: var(--tfh-black);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: var(--tfh-radius-sm);
  z-index: 1050;
  text-align: left;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/*  ── AI Summary narrative zone (top half of the snapshot card) ── */
/*  The narrative + attribution + Regenerate button. On regenerate, the */
/*  Lava Application endpoint returns this inner markup and HTMX swaps it */
/*  into the #tfh-ai-<scope> container. State colour matches the card border. */

.tfh-ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--tfh-brand);
  color: #fff; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;

  &::before { content: '\2726'; font-size: 9px; opacity: .8; }
}

.tfh-snapshot__narrative {
  padding: 22px 28px 20px;
  position: relative;
  border-bottom: 1px solid var(--tfh-border);

  &::before {
    content: '\201C';
    position: absolute; top: 6px; left: 20px;
    font-size: 80px; line-height: 1;
    color: var(--tfh-brand-ink); opacity: .10;
    font-family: Georgia, "Times New Roman", serif;
    pointer-events: none; user-select: none;
  }

  /*  Empty state — no stored summary yet. Suppress the decorative quote mark so */
  /*  the zone reads as an intentional prompt, not a half-rendered populated card. */
  /*  Spacing matches the populated state so the card barely shifts when a summary arrives. */
}
.tfh-snapshot__narrative--empty::before { content: none; }

.tfh-snapshot--down .tfh-snapshot__narrative::before { color: var(--snap-dn-color); }
.tfh-snapshot--flat .tfh-snapshot__narrative::before { color: var(--snap-flat-color); }

.tfh-snapshot__text {
  font-size: 15px; line-height: 1.7; color: var(--tfh-black);
  padding-left: 8px; margin: 0;
  animation: narrativeFadeIn .5s ease both;
  animation-delay: .1s;
}
@keyframes narrativeFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tfh-snapshot__attribution {
  margin-top: 12px; padding-left: 8px;
  font-size: 11px; color: var(--tfh-muted-light);
  display: flex; align-items: center; gap: 10px;

  &::before {
    content: ''; display: inline-block; width: 20px; height: 1px;
    background: var(--tfh-muted-light); flex-shrink: 0;
  }
}

/*  Empty state: no "Generated on …" text, so drop the leading divider rule — */
/*  the prompt line + button should sit clean with no dangling dash. */
.tfh-snapshot__narrative--empty .tfh-snapshot__attribution {
  margin-top: 14px;
  &::before { content: none; }
}

.tfh-regenerate-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
  background: none; border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm); padding: 3px 10px;
  font-size: 11px; color: var(--tfh-muted); cursor: pointer; font-family: inherit;

  &:hover { border-color: var(--tfh-brand); color: var(--tfh-brand-ink); }
  &:disabled { opacity: .5; cursor: default; }

  /*  Native HTMX loading indicator (per Helix loading-indicator pattern): */
  /*  the .htmx-indicator child is hidden by HTMX core CSS until the request */
  /*  element (this button) gets .htmx-request, at which point HTMX reveals it. */
  /*  We swap the static rotate icon out for the spinning indicator in-place so */
  /*  the button width stays stable. */
  .tfh-regenerate-btn__spinner { display: none; }

  &.htmx-request {
    .tfh-regenerate-btn__icon    { display: none; }
    .tfh-regenerate-btn__spinner { display: inline-block; }
  }
}

/*  Church-wide narrative has two buttons (Regenerate + Regenerate All). Group them so */
/*  they sit together on the right; the single-button campus cards keep the button's own */
/*  margin-left:auto and don't use this wrapper. */
.tfh-regenerate-group {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
  .tfh-regenerate-btn { margin-left: 0; }
}

/*  Empty / error states inside the narrative zone */
.tfh-ai-empty {
  font-size: 14px; color: var(--tfh-muted); font-style: italic; padding-left: 8px; margin: 0;
}
.tfh-ai-error {
  font-size: 13px; color: var(--snap-dn-color); padding-left: 8px; margin-top: 8px;
}

/*  AI Summary strip on the per-campus cards (Weekend Attendance page). A light */
/*  card wrapper around the shared narrative zone — no pace/momentum panels here. */
.tfh-ai-campus {
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border);
  border-left: 4px solid var(--tfh-brand);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  overflow: hidden;
  /*  No margin-bottom: this strip is a grid child of .tfh-campus-block, so the */
  /*  grid's gap (var(--tfh-gap-card)) handles the spacing to the cards below. */

  /*  Head carries the campus name (left, acts as the section title) and the AI badge (right). */
  .tfh-ai-campus__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px 0;
  }
  .tfh-ai-campus__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--tfh-black);
    line-height: 1.2;
  }
  .tfh-snapshot__narrative { border-bottom: none; padding-top: 8px; }
}

/*  Fan-out status line under the Overview snapshot card ("Refreshing all campuses…") */
.tfh-ai-allstatus {
  padding: 6px 28px 10px;
  font-size: 11px;
  color: var(--tfh-muted-light);
}

.tfh-snapshot__stats {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: stretch;
}

.tfh-snapshot__stat-divider {
  background: var(--tfh-border);
  margin: 20px 0;
}

.tfh-snapshot__stat-panel {
  padding: 20px 28px;
}

.tfh-snapshot__stat-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tfh-muted);
  margin-bottom: 14px;
}

/*  Pace stat */
.tfh-pace__hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.tfh-pace__delta-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--snap-up-color);

  &.tfh-pace__delta-num--down { color: var(--snap-dn-color); }
}

.tfh-pace__delta-pct {
  font-size: 14px;
  font-weight: 600;
  color: var(--snap-up-color);
  background: var(--snap-up-bg);
  padding: 2px 8px;
  border-radius: 12px;

  &.tfh-pace__delta-pct--down { color: var(--snap-dn-color); background: var(--snap-dn-bg); }
}

.tfh-pace__label {
  font-size: 12px;
  color: var(--tfh-muted);
  margin-bottom: 14px;
}

.tfh-pace__comparison {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tfh-pace__bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfh-pace__bar-label {
  font-size: 11px;
  color: var(--tfh-muted);
  width: 80px;
  flex-shrink: 0;
}

.tfh-pace__bar-track {
  flex: 1;
  height: 5px;
  background: var(--tfh-border);
  border-radius: 3px;
  overflow: hidden;
}

.tfh-pace__bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--tfh-brand);
  transition: width .5s ease;

  &.tfh-pace__bar-fill--prev { background: var(--tfh-border-dark); }
}

.tfh-pace__bar-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--tfh-black);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/*  Momentum stat */
.tfh-momentum__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.tfh-momentum__arrow-wrap {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;

  &.tfh-momentum__arrow-wrap--up   { background: var(--snap-up-bg);   color: var(--snap-up-color); }
  &.tfh-momentum__arrow-wrap--flat { background: var(--snap-flat-bg); color: var(--snap-flat-color); }
  &.tfh-momentum__arrow-wrap--down { background: var(--snap-dn-bg);   color: var(--snap-dn-color); }
}

.tfh-momentum__label {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;

  &.tfh-momentum__label--up   { color: var(--snap-up-color); }
  &.tfh-momentum__label--flat { color: var(--snap-flat-color); }
  &.tfh-momentum__label--down { color: var(--snap-dn-color); }
}

.tfh-momentum__label-sub {
  font-size: 11px;
  color: var(--tfh-muted);
  font-weight: 400;
  margin-top: 1px;
}

.tfh-momentum__bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tfh-momentum__bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfh-momentum__bar-label {
  font-size: 11px;
  color: var(--tfh-muted);
  width: 100px;
  flex-shrink: 0;
}

.tfh-momentum__bar-track {
  flex: 1;
  height: 6px;
  background: var(--tfh-border);
  border-radius: 3px;
  overflow: hidden;
}

.tfh-momentum__bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;

  &.tfh-momentum__bar-fill--recent   { background: var(--tfh-brand); }
  &.tfh-momentum__bar-fill--baseline { background: var(--tfh-border-dark); }
}

.tfh-momentum__bar-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--tfh-black);
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .tfh-snapshot__stats {
    grid-template-columns: 1fr;
  }
  .tfh-snapshot__stat-divider {
    height: 1px;
    margin: 0 20px;
  }
}


/*  ── Section 21: Funnel Chart ───────────────────────────────── */

.tfh-funnel-wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  max-width: 640px;
  min-width: 0;
}

.tfh-funnel-svg {
  flex: 0 1 480px;
  height: auto;
  display: block;
  overflow: hidden;
}

.tfh-funnel-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 180px;
}

.tfh-funnel-legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tfh-funnel-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tfh-funnel-legend__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tfh-funnel-legend__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tfh-black);
}

.tfh-funnel-legend__meta {
  font-size: 11px;
  color: var(--tfh-muted);
}

/*  Step label inside each polygon (rendered via <foreignObject>) */
.tfh-funnel-label {
  padding: 0 8px;
  box-sizing: border-box;
  font-size: 8px;
  line-height: 14px;
  color: rgba(255, 255, 255, 0.65);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*  SVG text inside funnel (apply via class= on <text>) */
.tfh-funnel-num {
  fill: rgba(255, 255, 255, 0.95);
  font-size: 18px;
  font-weight: 800;
}

.tfh-funnel-conversion {
  fill: #9b9b9b;
  font-size: 9px;
  font-style: italic;
}

/*  Shade palette — hardcoded against the TFH brand color (#36454f). */
/*  We can't use `darken(var(--tfh-brand), ...)` because LESS color functions */
/*  don't accept CSS custom properties, and `var(--tfh-brand)` isn't in scope when */
/*  this file is compiled standalone. If the brand color ever changes, update */
/*  var(--tfh-funnel-brand) below. Same class drives both <polygon fill> (SVG) and */
/*  <.tfh-funnel-legend__dot background> (HTML). */

.tfh-funnel-shade--1 { fill: var(--tfh-funnel-shade-1); background: var(--tfh-funnel-shade-1); }
.tfh-funnel-shade--2 { fill: var(--tfh-funnel-shade-2); background: var(--tfh-funnel-shade-2); }
.tfh-funnel-shade--3 { fill: var(--tfh-funnel-shade-3); background: var(--tfh-funnel-shade-3); }
.tfh-funnel-shade--4 { fill: var(--tfh-funnel-shade-4); background: var(--tfh-funnel-shade-4); }

/*  Funnel + side-panel side-by-side on large screens */
.tfh-funnel-campus-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--tfh-gap-card);
  align-items: start;
}

@media (max-width: 1100px) {
  .tfh-funnel-campus-row { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  /*  SVG fills row, legend wraps beneath */
  .tfh-funnel-svg { flex: 1 1 100%; max-width: 100%; }
}

/* ─────────────────────────────────────────────────────────
   Monthly Outlook (Phase D — Overview page)
   ──────────────────────────────────────────────────────── */
.tfh-outlook {
  margin-bottom: var(--tfh-gap-card);
}
.tfh-outlook__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tfh-outlook__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tfh-black);
  margin: 0;
}
.tfh-outlook__ytd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tfh-outlook__ytd-pill--ahead { background: var(--snap-up-bg); color: var(--snap-up-color); }
.tfh-outlook__ytd-pill--ontrack { background: var(--snap-flat-bg); color: var(--snap-flat-color); }
.tfh-outlook__ytd-pill--behind { background: var(--snap-dn-bg); color: var(--snap-dn-color); }

.tfh-outlook__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--tfh-gap-card);
  align-items: stretch;
}
.tfh-outlook__chart-wrap {
  background: var(--tfh-white);
  border-radius: 8px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
}
.tfh-outlook__chart-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tfh-muted);
}
.tfh-outlook__chart-cap {
  font-size: 12px;
  color: var(--tfh-muted);
  margin: 2px 0 8px;
}
.tfh-outlook__chart {
  flex: 1;
  min-height: 260px;
  position: relative;
}
.tfh-outlook__legend {
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--tfh-muted);
  margin-top: 8px;
}
.tfh-outlook__swatch {
  display: inline-block;
  width: 18px;
  height: 8px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 2px;
}
.tfh-outlook__swatch--expected {
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--tfh-muted) 0 5px, transparent 5px 8px);
  border: none;
  margin-top: -1px;
}
.tfh-outlook__swatch--actual {
  height: 2px;
  background: var(--tfh-brand);
}
.tfh-outlook__swatch--inprogress {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tfh-white);
  border: 2px solid var(--tfh-brand);
}
.tfh-outlook__swatch--band {
  height: 8px;
  background: var(--tfh-border);
}

.tfh-outlook__sidecards {
  display: flex;
  flex-direction: column;
  gap: var(--tfh-gap-card);
}
.tfh-outlook__card {
  background: var(--tfh-white);
  border-radius: 8px;
  padding: 14px 16px;
}
.tfh-outlook__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tfh-muted);
}
.tfh-outlook__info-btn {
  background: none; border: none; cursor: pointer;
  color: var(--tfh-muted); font-size: 12px; padding: 0 2px;
  position: relative;
  line-height: 1;
  vertical-align: middle;

  &:hover { color: var(--tfh-muted); }

  .tfh-outlook__info-tooltip { display: none; }
  &:hover .tfh-outlook__info-tooltip { display: block; }
}
.tfh-outlook__info-tooltip {
  position: absolute; left: 0; top: calc(100% + 6px);
  width: 240px;
  background: var(--tfh-black);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: var(--tfh-radius-sm);
  z-index: 1050;
  text-align: left;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.tfh-outlook__info-foot {
  margin-top: 6px;
  color: var(--tfh-muted-light);
  font-size: 11px;
}
.tfh-outlook__hero {
  font-size: 30px;
  font-weight: 700;
  color: var(--tfh-black);
  line-height: 1.1;
  margin: 6px 0 8px;
  font-variant-numeric: tabular-nums;
}
.tfh-outlook__caption {
  font-size: 12px;
  color: var(--tfh-black);
  line-height: 1.5;
  margin: 0;
}
.tfh-outlook__card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /*  top-align the pill with the eyebrow's first line */
  gap: 10px;
}
.tfh-outlook__status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap; /*  keep "Running Behind" on one line */
  flex-shrink: 0; /*  don't let the eyebrow squeeze it into wrapping */
}
.tfh-outlook__status-pill--ahead { background: var(--snap-up-bg); color: var(--snap-up-color); }
.tfh-outlook__status-pill--ontrack { background: var(--snap-flat-bg); color: var(--snap-flat-color); }
.tfh-outlook__status-pill--behind { background: var(--snap-dn-bg); color: var(--snap-dn-color); }
.tfh-outlook__delta {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.tfh-outlook__delta--up { color: var(--snap-up-color); }
.tfh-outlook__delta--flat { color: var(--snap-flat-color); }
.tfh-outlook__delta--down { color: var(--snap-dn-color); }

.tfh-outlook__progress-wrap { margin-top: 10px; }
.tfh-outlook__progress-track {
  position: relative;
  height: 8px;
  background: var(--tfh-border);
  border-radius: 999px;
  overflow: visible;
}
.tfh-outlook__progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--tfh-brand);
  border-radius: 999px;
  max-width: 100%;
}
.tfh-outlook__progress-tick {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--tfh-black);
  border-radius: 1px;
}
.tfh-outlook__progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: var(--tfh-black);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.tfh-outlook__progress-labels > span { flex: 1 1 0; }
.tfh-outlook__progress-labels > span:last-child { text-align: right; }
.tfh-outlook__progress-footnote {
  font-size: 10px;
  color: var(--tfh-muted);
  margin-top: 4px;
  font-style: italic;
}

.tfh-outlook__empty {
  background: var(--tfh-white);
  border: 1px dashed var(--tfh-border-dark);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--tfh-muted);
}
.tfh-outlook__empty a { color: var(--tfh-brand-ink); }

.tfh-section-divider {
  border: 0;
  border-top: 1px solid var(--tfh-border);
  margin: var(--tfh-gap-card) 0;
}

@media (max-width: 992px) {
  /*  Stack the outlook chart full-width earlier — it's unreadable squeezed next to */
  /*  the sidecards below ~992px. */
  .tfh-outlook__grid {
    grid-template-columns: 1fr;
  }
}


.tfh-nowrap { white-space: nowrap; }

/* ─────────────────────────────────────────────────────────
   Per-Campus Monthly Outlook inline card — Variant 1
   (replaces the legacy Campus Total card inside per-campus rows)
   ──────────────────────────────────────────────────────── */
.tfh-outlook-camp {
  background: var(--tfh-white);
  border-radius: 10px;
  box-shadow: 0 0 2px rgba(145,158,171,.12), 0 12px 24px -4px rgba(145,158,171,.12);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  /*  Grid items default to min-width:auto, which floors this column at the */
  /*  canvas's rendered width and stops it shrinking with the row. Allow it to */
  /*  shrink so the chart card resizes in proportion like the other two cards. */
  min-width: 0;
}
.tfh-outlook-camp__hero-campus {
  font-size: 12px;
  color: var(--tfh-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.tfh-outlook-camp__hero-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.tfh-outlook-camp__hero-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--tfh-black);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tfh-outlook-camp__hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tfh-outlook-camp__hero-badge--up { background: var(--snap-up-bg); color: var(--snap-up-color); }
.tfh-outlook-camp__hero-badge--down { background: var(--snap-dn-bg); color: var(--snap-dn-color); }
.tfh-outlook-camp__hero-badge--flat { background: var(--snap-flat-bg); color: var(--snap-flat-color); }
.tfh-outlook-camp__hero-sub {
  font-size: 11px;
  color: var(--tfh-muted);
  margin-top: 6px;
}
.tfh-outlook-camp__divider {
  border: 0;
  border-top: 1px solid var(--tfh-border);
  margin: 12px -16px;
}
.tfh-outlook-camp__outlook-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.tfh-outlook-camp__outlook-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tfh-muted);
}
/*  Info affordance on the outlook eyebrow — explains how Expected is built */
/*  (per-campus growth %). Tooltip via the shared Tippy js-metric-tip handler. */
.tfh-outlook-camp__info {
  margin-left: 5px;
  font-size: 11px;
  color: var(--tfh-muted, #9aa3a0);
  cursor: help;
  &:hover { color: var(--tfh-brand, var(--tfh-brand)); }
}
.tfh-outlook-camp__state-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tfh-outlook-camp__state-pill--building { background: var(--snap-up-bg); color: var(--snap-up-color); }
.tfh-outlook-camp__state-pill--holding { background: var(--snap-flat-bg); color: var(--snap-flat-color); }
.tfh-outlook-camp__state-pill--fading { background: var(--snap-dn-bg); color: var(--snap-dn-color); }
.tfh-outlook-camp__state-pill--insufficient { background: var(--tfh-light-gray); color: var(--snap-flat-color); font-style: italic; }
.tfh-outlook-camp__chart {
  height: 170px;
  margin: 8px 0;
  position: relative;
}
.tfh-outlook-camp__stats {
  display: grid;
  /*  Flanking stats hug their content; the middle YTD progress bar takes the */
  /*  remaining width. minmax(0,1fr) lets the bar shrink with the card. */
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding-top: 4px;
  align-items: start;
}
.tfh-outlook-camp__stat-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tfh-muted);
}
.tfh-outlook-camp__stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--tfh-black);
  font-variant-numeric: tabular-nums;
}
.tfh-outlook-camp__stat-val--up { color: var(--snap-up-color); }
.tfh-outlook-camp__stat-val--down { color: var(--snap-dn-color); }

/* Middle stat: slimmed YTD performance bar (mirrors .tfh-outlook__progress-*
   from the overview page, scaled down to sit between the two flanking stats). */
.tfh-outlook-camp__stat--prog { min-width: 0; }
.tfh-outlook-camp__prog { margin-top: 7px; }
.tfh-outlook-camp__prog-track {
  position: relative;
  height: 6px;
  background: var(--tfh-border);
  border-radius: 999px;
}
.tfh-outlook-camp__prog-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--tfh-brand);
  border-radius: 999px;
  max-width: 100%;
}
.tfh-outlook-camp__prog-tick {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--tfh-black);
  border-radius: 1px;
}
.tfh-outlook-camp__prog-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--tfh-muted);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* Monthly Outlook — "How to read this section" legend.
   Reuses .tfh-badge-legend; collapsed to just the header via <details>/<summary>,
   and left-aligns the label column for text labels (instead of the
   right-aligned numeric badges on the comparison legend). */
.tfh-outlook .tfh-badge-legend {
  margin-top: var(--tfh-gap-card);
}
.tfh-outlook .tfh-badge-legend > summary {
  cursor: pointer;
  list-style: none; /*  hide default disclosure triangle (Firefox) */
  margin-bottom: 0;
  padding-right: 18px;
  position: relative;
}
.tfh-outlook .tfh-badge-legend > summary::-webkit-details-marker {
  display: none; /*  hide default disclosure triangle (WebKit) */
}
.tfh-outlook .tfh-badge-legend > summary::after {
  content: "\25BE"; /*  ▾ down caret — signals "click to expand" */
  position: absolute;
  right: 0;
  top: 0;
  transition: transform 0.15s;
}
.tfh-outlook .tfh-badge-legend[open] > summary {
  margin-bottom: 10px;
}
.tfh-outlook .tfh-badge-legend[open] > summary::after {
  transform: rotate(180deg); /*  ▾ → ▴ when expanded */
}
.tfh-outlook .tfh-badge-legend__row {
  align-items: flex-start;
}
.tfh-outlook .tfh-badge-legend__badge-col {
  flex-basis: 84px;
  justify-content: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--tfh-black);
}


/* tooltip whitespace — moved here from the inline block stylesheet */
.tooltip-inner { white-space: pre-wrap; }


/* ── TFH Network church lists (registration dashboard) ─────────────────────── */
.tfh-church-list {
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
}
.tfh-church-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--tfh-border);
}
.tfh-church-row:last-child { border-bottom: 0; }
.tfh-church-name { font-size: 14px; color: var(--tfh-black); }
.tfh-church-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.tfh-church-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tfh-church-badge--net   { background: var(--tfh-light-gray); color: var(--tfh-brand-ink); }
.tfh-church-badge--other { background: var(--tfh-light-gray); color: var(--tfh-muted); }
.tfh-church-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--tfh-black);
  min-width: 28px;
  text-align: right;
}

/* ── Church lists side-by-side on wide screens (registration dashboard) ────── */
.tfh-church-cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tfh-gap-card, 20px);
  align-items: flex-start;
}
.tfh-church-cols > .tfh-panel-card {
  flex: 1 1 360px;        /* two columns when wide, stacks under ~760px */
  min-width: 0;
}

/* ── Segmented Daily / Weekly toggle (chart headers) ───────────────────────── */
.tfh-seg {
  display: inline-flex;
  border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm, 6px);
  overflow: hidden;
  flex: 0 0 auto;
}
.tfh-seg button {
  appearance: none;
  border: 0;
  background: var(--tfh-white);
  color: var(--tfh-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.tfh-seg button + button { border-left: 1px solid var(--tfh-border); }
.tfh-seg button.is-active { background: var(--tfh-brand); color: #fff; }

/* Church-name links to the Rock group page */
a.tfh-church-name { text-decoration: none; cursor: pointer; }
a.tfh-church-name:hover { text-decoration: underline; color: var(--tfh-brand-ink); }

/* Trailing icon marking a church name as a link to its group page. Only rendered
   on names that actually resolve to a group — write-ins and unlinked Defined
   Values stay plain, so the icon is the tell for what is clickable.

   The gap comes from an &ensp; in the block markup, NOT a margin here: the HTML
   block and this stylesheet deploy separately, so a block pasted into Rock ahead
   of a theme deploy would otherwise render the icon jammed against the name. */
.tfh-church-link-icon {
  font-size: 9px;
  color: var(--tfh-muted-light);
  vertical-align: baseline;
  transition: color .15s ease;
}
a.tfh-church-name:hover .tfh-church-link-icon { color: var(--tfh-brand-ink); }

/*  ── KidMin Report Dashboard — reusable components ──────────────── */
/*  Used by the KidMin check-in dashboard (kidsmin-report-dashboard endpoint). */
/*  Neutral, brand-token-driven; no new palette colors. */

/*  .tfh-dash-row spacing handled by the .tfh-metric-page flex gap (no margin needed) */

/*  Services-per-child strip */
.tfh-svc { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.tfh-svc__num { font-size: 24px; font-weight: 800; letter-spacing: -1px; color: var(--tfh-black); }
.tfh-svc__lbl { font-size: 12px; color: var(--tfh-muted); }
.tfh-svc__note { margin-left: auto; font-size: 13px; color: var(--tfh-muted); }

/*  Neutral tag/pill + wrapper */
.tfh-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--tfh-light-gray); color: var(--tfh-muted); }
.tfh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/*  Selectable person/family card grid */
.tfh-person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.tfh-person-card { border: 1px solid var(--tfh-border); border-radius: var(--tfh-radius-sm); padding: 13px 15px; display: flex; gap: 11px; align-items: flex-start; background: var(--tfh-white); cursor: pointer; }
.tfh-person-card input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--tfh-brand); }
.tfh-person-card__name { font-weight: 700; font-size: 14px; color: var(--tfh-black); }
.tfh-person-card__contact { font-size: 12px; color: var(--tfh-muted); margin: 2px 0 7px; }
.tfh-person-card__contact span { display: block; }

/*  Selection action bar */
.tfh-action-bar { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--tfh-border); flex-wrap: wrap; }
.tfh-action-bar__count { margin-left: auto; font-size: 13px; color: var(--tfh-muted); }

/*  Count next to a section heading */
.tfh-list-sub { font-size: 13px; color: var(--tfh-muted); font-weight: 400; margin-left: 8px; }

/*  Allergy panel */
.tfh-allergy { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.tfh-allergy__chart { width: 150px; height: 150px; flex-shrink: 0; }
.tfh-legend { display: flex; flex-direction: column; gap: 9px; min-width: 150px; }
.tfh-legend__row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--tfh-black); }
.tfh-legend__swatch { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }
.tfh-legend__val { margin-left: auto; font-weight: 700; color: var(--tfh-muted); }

/*  Long-list "Show all" reveal */
.tfh-hidden { display: none; }
.tfh-showall { margin-top: 14px; }

/*  ── KidMin room drill-down (modal + clickable rows) ────────────── */
.km-room-row { cursor: pointer; border-radius: var(--tfh-radius-sm); transition: background 0.12s; }
.km-room-row:hover { background: var(--tfh-light-gray); }
.km-room-row__chev { font-size: 9px; color: var(--tfh-muted-light); margin-left: 4px; }

.kidsmin-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1100; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.kidsmin-overlay__backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.45); }
.kidsmin-overlay__dialog { position: relative; width: 100%; max-width: 760px; background: var(--tfh-white);
  border-radius: var(--tfh-radius-md); box-shadow: var(--tfh-shadow); padding: 26px 30px;
  max-height: 90vh; overflow-y: auto; }
.kidsmin-overlay__close { position: absolute; top: 10px; right: 16px; border: none; background: none;
  font-size: 26px; line-height: 1; color: var(--tfh-muted); cursor: pointer; }
.kidsmin-overlay__close:hover { color: var(--tfh-black); }

.km-detail__head h3 { margin: 0 0 2px; font-size: 20px; color: var(--tfh-black); }
.km-detail__sub { color: var(--tfh-muted); font-size: 13px; margin-bottom: 8px; }
.km-detail .tfh-campus-section-heading { margin-top: 22px; }
.km-kid-list { max-height: 220px; overflow-y: auto; }

/*  Room-detail kids table */
.km-kid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.km-kid-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--tfh-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--tfh-border); }
.km-kid-table td { padding: 8px; border-bottom: 1px solid var(--tfh-border); color: var(--tfh-black); }
.km-kid-table td:last-child { width: 60px; color: var(--tfh-muted); }
.km-kid-row { cursor: pointer; transition: background 0.12s; }
.km-kid-row:hover { background: var(--tfh-light-gray); }

/*  Age chart anchored to the bottom of its (grid-stretched) card */
.km-age-card { display: flex; flex-direction: column; }
.km-age-card .tfh-chartjs-wrap { margin-top: auto; }


/*  ── Dashboard Loading Indicator (shared across dashboards) ─────────────── */
/*  Used by dashboard-kidsmin-block + dashboard-report-readiness-block while */
/*  the HTMX body request is in flight. */
.tfh-dash-loader {
  padding: 40px 0;
  text-align: center;
  color: var(--tfh-muted);
  font-size: 15px;

  i { margin-right: 8px; }
}


/*  ── REPORT READINESS CHECKLIST (dashboard-report-readiness-block + report-readiness endpoint) ── */

.tfh-ready {
  display: flex;
  flex-direction: column;
  gap: var(--tfh-gap-card);
}

/*  Toolbar: Sunday-date label + meta on the left, prev/next nav on the right. */
.tfh-ready-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.tfh-ready-toolbar__nav {
    display: flex;
    gap: 8px;
  }

.tfh-ready-toolbar__meta {
    font-size: 12px;
    color: var(--tfh-muted);
  }

.tfh-ready-toolbar__date {
    font-size: 18px;
    font-weight: 700;
    color: var(--tfh-black);
  }


.tfh-ready-navbtn {
  padding: 5px 12px;
  background: var(--tfh-white);
  border: 1.5px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--tfh-black);

  &:hover { background: var(--tfh-light-gray); }

  &[disabled] {
    opacity: .45;
    cursor: default;
  }
}

/*  Overall readiness banner — ok (all steps done) vs. pending (steps remain). */
.tfh-ready-banner {
  padding: 18px 24px;
  border-radius: var(--tfh-radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
}
.tfh-ready-banner--pending {
    background: rgba(255, 200, 112, .22);
    color: #8a6017;
    i { color: #d99b28; }
  }

.tfh-ready-banner--ok {
    background: rgba(0, 156, 227, .10);
    color: #007bb8;
    i { color: #009ce3; }
  }


.tfh-ready-steps {
  display: flex;
  flex-direction: column;
  gap: var(--tfh-gap-card);
}

/*  Standalone card (mirrors .tfh-panel-card visually without depending on it */
/*  being present). Step state (--done / --todo / --action) shows through the */
/*  number circle and status pill only — no card accent border. */
.tfh-ready-step {
  background: var(--tfh-white);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  padding: var(--tfh-padding-card);
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.tfh-ready-step__num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  background: var(--tfh-light-gray);
  color: var(--tfh-muted);

  .tfh-ready-step--done & {
    background: rgba(0, 156, 227, .12);
    color: #009ce3;
  }

  .tfh-ready-step--todo & {
    background: rgba(212, 68, 46, .10);
    color: #d4442e;
  }
}

.tfh-ready-step__main {
  flex: 1 1 auto;
  min-width: 0;
}

.tfh-ready-step__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.tfh-ready-step__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--tfh-black);
  margin: 0;
}

/*  Status pill — mirrors the .tfh-entry-missing__pill treatment. */
.tfh-ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tfh-ready-pill--muted { background: var(--tfh-light-gray);   color: var(--tfh-muted); }

.tfh-ready-pill--stale { background: rgba(238, 118, 36, .12); color: #c4611c; }

.tfh-ready-pill--running { background: rgba(255, 200, 112, .25); color: #8a6017; }

.tfh-ready-pill--todo { background: rgba(212, 68, 46, .10);  color: #d4442e; }

.tfh-ready-pill--ok { background: rgba(0, 156, 227, .12);  color: #007bb8; }


.tfh-ready-step__desc {
  font-size: 13px;
  color: var(--tfh-muted);
  margin: 0 0 12px;
}

.tfh-ready-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tfh-ready-list__meta {
    font-size: 12px;
    color: var(--tfh-muted);
    white-space: nowrap;
  }

.tfh-ready-list__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

.tfh-ready-list__row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--tfh-black);
    padding: 6px 10px;
    border-radius: var(--tfh-radius-sm);
    background: var(--tfh-light-gray);
  }


.tfh-ready-step__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

/*  Action buttons use native Rock/Bootstrap classes (btn btn-primary / btn */
/*  btn-default); the run-all button's spinner relies on htmx's built-in */
/*  .htmx-indicator opacity toggle. */

/*  Clickable AI-summary rows: chevron rotates open, panel sits as next sibling. */
.tfh-ready-list__row--toggle {
  cursor: pointer;

  &:hover { background: var(--tfh-date-bg); }
}

.tfh-ready-list__chev {
  flex: none;
  font-size: 11px;
  color: var(--tfh-muted);
  transition: transform .15s ease;

  .tfh-ready-list__row--toggle.is-open & { transform: rotate(90deg); }
}

.tfh-ready-ai-text {
  padding: 12px 16px;
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  font-size: 14px;
  line-height: 1.6;
  color: var(--tfh-black);

  p {
    margin: 0;
    white-space: pre-wrap;
  }
}

.tfh-ready-substatus {
  font-size: 13px;
  color: var(--tfh-muted);
  margin-top: 8px;
}
.tfh-ready-substatus--error { color: var(--tfh-danger, #d4442e); }


@media (max-width: 600px) {
  .tfh-ready-step {
    padding: 20px;
    flex-direction: column;
  }

  .tfh-ready-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}


/*  ============================================================ */
/*  Shared dashboard controls */
/*  ------------------------------------------------------------ */
/*  These were inline style="" attributes duplicated across the */
/*  dashboard blocks — the dropdown filter appeared in 13 of them, */
/*  byte for byte. Centralised here so a theme fix lands once */
/*  instead of once per block. Colours are tokenised on the way in; */
/*  every other declaration is carried over unchanged so the */
/*  rendering is identical. */
/*  ============================================================ */

/*  Dropdown (filter pickers: event, campus, date, preset) */
.tfh-dropdown {
  display: inline-block;
  position: relative;
}

.tfh-dropdown__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--tfh-white);
  border: 1.5px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.42857;
  white-space: nowrap;
  cursor: pointer;
  color: var(--tfh-black);
}

/*  The ▼ glyph inside a dropdown trigger */
.tfh-dropdown__caret {
  color: var(--tfh-muted-light);
  font-size: 10px;
  margin-left: 2px;
}

.tfh-dropdown__panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--tfh-white);
  border: 1px solid var(--tfh-border);
  border-radius: var(--tfh-radius-md);
  box-shadow: var(--tfh-shadow);
  z-index: 1050;
}

/*  A labelled group of options inside a panel */
.tfh-dropdown__group {
  padding: 5px 0;
  border-bottom: 1px solid var(--tfh-border);
}

/*  Buttons used inside dashboard panels and filter bars */
.tfh-dash-btn {
  padding: 4px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--tfh-white);
  border: 1.5px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
  cursor: pointer;
}

.tfh-dash-btn--primary {
  padding: 4px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--tfh-brand);
  border: none;
  border-radius: var(--tfh-radius-sm);
  cursor: pointer;
  color: #fff; /*  on a brand fill — correct in both modes */
}

.tfh-dash-btn-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/*  Inline form fields (edit rows, config panels) */
.tfh-field-label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.tfh-field-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 13px;
  border: 1.5px solid var(--tfh-border);
  border-radius: var(--tfh-radius-sm);
}

/*  Expander drawer revealed under a row (hidden until toggled) */
.tfh-panel-expander {
  display: none;
  padding: 10px 14px;
  background: var(--tfh-light-gray);
  border-top: 1px solid var(--tfh-border);
}

/*  Label/value row inside a list */
.tfh-stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tfh-stat-row__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--tfh-black);
}

.tfh-meta-text {
  font-size: 13px;
  color: var(--tfh-muted);
}

/*  Dropdown group heading (e.g. NETWORK, CONFERENCE) */
.tfh-dropdown__group-label {
  padding: 4px 12px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tfh-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/*  Horizontal progress bars.
    The fill width is Lava-computed per row, so it stays inline — but as a
    custom property, which keeps the colour here where it can be themed:
      <div class="tfh-bar-fill" style="--pct:{{ _barPct }}%"></div>  */
.tfh-bar-track {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--tfh-light-gray);
}
.tfh-bar-track--sm { height: 5px; }
.tfh-bar-track--lg { height: 10px; }

.tfh-bar-fill {
  height: 100%;
  width: var(--pct, 0%);
  border-radius: 3px;
  background: var(--tfh-brand-ink);
}
.tfh-bar-fill--muted    { background: var(--tfh-muted); }
.tfh-bar-fill--capacity { background: var(--tfh-border); position: absolute; left: 0; top: 0; }
.tfh-bar-fill--over     { position: absolute; left: 0; top: 0; }

/*  Small bold sub-heading inside a card */
.tfh-sub-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--tfh-black);
  margin-bottom: 12px;
}

.tfh-meta-text--flush { margin: 0; }

/*  Option list inside a dropdown panel, and the hairline between groups */
.tfh-dropdown__list {
  padding: 5px 0;
}
.tfh-dropdown__divider {
  margin: 4px 12px;
  border-top: 1px solid var(--tfh-border);
}
