/* =================================================================
   ACTS Church Bahrain — Admin CMS shell
   Loaded ALONGSIDE style.css (reuses the same color tokens, fonts,
   buttons, and form styles already defined there) — this file only
   adds the admin-specific layout: sidebar, topbar, tables, cards.
   ================================================================= */

body.admin-body { background: var(--fog-50); }

.admin-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.admin-sidebar {
  width: 264px; flex-shrink: 0; background: var(--navy-950); color: var(--steel-300);
  padding: 24px 16px; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto;
  transition: transform .2s ease; z-index: 50;
}
.admin-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 24px; }
.admin-sidebar .brand img { height: 34px; }
.admin-sidebar .brand span { color: #fff; font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; }
.admin-nav-group { margin-bottom: 22px; }
.admin-nav-group--dashboard { margin-bottom: 6px; }

/* ---------- Collapsible nav: <details>/<summary>, native and keyboard/
   AT-accessible with zero required JS. assets/js/admin.js layers on top
   to (a) remember each one's open/closed state across the full-page
   reloads this app does on every click, so re-collapsing a section you
   just closed doesn't keep undoing itself, and (b) remember the
   sidebar's own scroll position the same way, so a long scroll down
   into Accounting doesn't reset back to the top on your next click. The
   server already decides a sensible *first-visit* default before any of
   that JS runs: whichever section/sub-group contains the page you're
   currently on renders open, everything else renders closed — see
   admin_nav_section()/admin_nav_subgroup() in admin-header.php. */

.admin-nav-section-details { margin: 0 0 4px; }
.admin-nav-section-details + .admin-nav-section-details { margin-top: 4px; }
.admin-nav-section-body { padding-top: 2px; }

.admin-nav-section {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; user-select: none;
  text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700;
  color: var(--gold-400, var(--gold-500)); padding: 8px 12px; margin: 6px 0 4px; border-radius: var(--radius-sm);
}
.admin-nav-section::-webkit-details-marker { display: none; }
.admin-nav-section:hover { background: rgba(255,255,255,.06); }
.admin-nav-section::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.admin-nav-section .chevron { flex-shrink: 0; font-size: .7rem; transition: transform .15s ease; color: var(--steel-500); }
.admin-nav-section-details[open] > .admin-nav-section .chevron { transform: rotate(180deg); }

.admin-nav-subgroup { margin-bottom: 4px; }
.admin-nav-subgroup summary {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  list-style: none; cursor: pointer; user-select: none; padding: 8px 12px; border-radius: var(--radius-sm);
}
.admin-nav-subgroup summary::-webkit-details-marker { display: none; }
.admin-nav-subgroup summary:hover { background: rgba(255,255,255,.06); }
.admin-nav-subgroup summary h6 {
  text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: var(--steel-500); margin: 0;
}
.admin-nav-subgroup summary .chevron { flex-shrink: 0; margin-left: auto; font-size: .65rem; color: var(--steel-500); transition: transform .15s ease; }
.admin-nav-subgroup[open] > summary .chevron { transform: rotate(180deg); }
.admin-nav-subgroup summary.admin-nav-subgroup-summary-blank { padding: 0; height: 0; min-height: 0; }
.admin-nav-links { padding-top: 2px; }

/* ---------- Nav bar: line-icon badges, single accent ----------
   A follow-up simplification after the prior icon-badge + per-sub-group
   rainbow color-coding round: the user reviewed several redesign
   directions on a mockup and chose "Minimal Line Icons" — same
   collapsible <details>/<summary> click-through structure as ever, but
   each section/sub-group's icon is now a plain stroke-style SVG glyph
   (admin_nav_icon() in admin-header.php) instead of an emoji, with no
   background chip of its own — it just inherits whatever text color its
   container already has via currentColor (gold for a top-level section,
   steel for a sub-group heading), so no extra color rule is needed here.
   The previous per-sub-group --nav-accent custom property (a distinct
   fixed color for each of the 13 sub-groups) is removed in favor of one
   single gold "you are here" highlight for the active link, matching
   every other part of this sidebar (see .admin-nav a.is-active below). */
.admin-nav-icon-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 18px; height: 18px; line-height: 1;
}
.admin-nav-icon-badge svg { display: block; width: 100%; height: 100%; }
.admin-nav-icon-badge--section { width: 20px; height: 20px; }
.admin-nav-section .admin-nav-icon-badge--section { margin-right: 2px; }
.admin-nav-subgroup summary .admin-nav-icon-badge { margin-right: 2px; }

.admin-nav-subgroup summary h6 { color: var(--steel-500); }
.admin-nav-subgroup a.is-active { background: var(--gold-500); color: var(--navy-950); }
.admin-nav-subgroup[open] { background: rgba(255,255,255,.04); border-radius: var(--radius-sm); }

/* A subgroup nested inside another subgroup's link list (e.g.
   Communication > Reports) — same collapsible pattern one level
   deeper, indented slightly so the hierarchy reads clearly. */
.admin-nav-links .admin-nav-subgroup { margin-left: 10px; margin-top: 2px; }
.admin-nav-links .admin-nav-subgroup summary { padding: 6px 10px; }
.admin-nav-links .admin-nav-subgroup summary h6 { font-size: .64rem; }

.admin-nav a, .admin-nav span.admin-nav-disabled {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--steel-300); margin-bottom: 2px;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.is-active { background: var(--gold-500); color: var(--navy-950); font-weight: 700; }
.admin-nav span.admin-nav-disabled { color: var(--steel-500); opacity: .55; cursor: not-allowed; }
.admin-nav span.admin-nav-disabled .phase-tag {
  margin-left: auto; font-size: .62rem; background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: var(--radius-pill);
}
.admin-nav .icon { width: 18px; text-align: center; }

/* ---------- Main area ---------- */
.admin-main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 1.3rem; margin: 0; }
.admin-topbar-actions { display: flex; align-items: center; gap: 14px; }
.admin-user-chip { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.admin-user-chip .role { color: var(--ink-soft); font-size: .75rem; }
.admin-sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.admin-sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--navy-900); margin: 4px 0; }

.admin-content { padding: 28px; flex: 1; }

/* Sixty-first round: breadcrumb trail (admin_breadcrumb() in
   admin/includes/admin-header.php) — thin, quiet, sits above a page's
   own title/panel so same-tab navigation is easy to retrace. */
.admin-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-soft); margin-bottom: 16px; }
.admin-breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.admin-breadcrumb a:hover { color: var(--gold-600); text-decoration: underline; }
.admin-breadcrumb-sep { color: var(--line); }
.admin-breadcrumb-current { color: var(--navy-900); font-weight: 600; }

/* ---------- Dashboard stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-card .num { font-family: var(--font-display); font-size: 2rem; color: var(--navy-950); display: block; }
.stat-card .label { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 24px; }
.admin-panel h2 { font-size: 1.1rem; margin-bottom: 16px; }

/* ---------- Tables ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.data-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.data-table th, .data-table td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: middle; }
.data-table th { background: var(--fog-50); text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; color: var(--ink-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .row-actions { display: flex; gap: 10px; white-space: nowrap; }
.data-table .row-actions a, .data-table .row-actions button { font-size: .82rem; font-weight: 600; color: var(--navy-800); background: none; border: none; cursor: pointer; padding: 0; }
.data-table .row-actions .danger { color: var(--danger); }
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-soft); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 12px; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-draft { background: #ececec; color: #666; }
.badge-published { background: #e3f5ec; color: var(--success); }
.badge-scheduled { background: var(--gold-100); color: var(--gold-600); }
.badge-archived { background: #f0f0f0; color: #999; }
.badge-active { background: #e3f5ec; color: var(--success); }
.badge-inactive { background: #fbe9e6; color: var(--danger); }
.badge-visitor { background: #ececec; color: #666; }
.badge-regular_attendee { background: var(--gold-100); color: var(--gold-600); }
.badge-in_membership_process { background: var(--gold-100); color: var(--gold-600); }
.badge-member { background: #e3f5ec; color: var(--success); }
/* Twenty-ninth round */
.badge-left_bahrain { background: #eef2f7; color: #5b7290; }
.badge-transferred { background: #f1ecf9; color: #7c5cbf; }
/* Phase 8 — prayer request statuses */
.badge-new { background: var(--gold-100); color: var(--gold-600); }
.badge-in_progress { background: #e6eefb; color: #2f5fa8; }
.badge-prayed_for { background: #e3f5ec; color: var(--success); }
.badge-closed { background: #ececec; color: #666; }
/* Fifteenth round — Communication Reports statuses (event
   registrations, ministry join requests, contact inquiries) */
.badge-registered { background: var(--gold-100); color: var(--gold-600); }
.badge-confirmed { background: #e6eefb; color: #2f5fa8; }
.badge-attended { background: #e3f5ec; color: var(--success); }
.badge-cancelled { background: #fbe9e6; color: var(--danger); }
.badge-contacted { background: #e6eefb; color: #2f5fa8; }
.badge-in_review { background: var(--gold-100); color: var(--gold-600); }
.badge-accepted { background: #e3f5ec; color: var(--success); }
.badge-declined { background: #fbe9e6; color: var(--danger); }
.badge-completed { background: #ececec; color: #666; }
.badge-responded { background: #e3f5ec; color: var(--success); }
/* Phase 3 — fixed asset statuses */
.badge-disposed { background: #ececec; color: #666; }
.badge-written_off { background: #fbe9e6; color: var(--danger); }
.badge-sold { background: #e6eefb; color: #2f5fa8; }
.badge-pending { background: var(--gold-100); color: var(--gold-600); }
.badge-pending_approval { background: var(--gold-100); color: var(--gold-600); }
.badge-approved { background: #e6eefb; color: #2f5fa8; }
.badge-posted { background: #e3f5ec; color: var(--success); }
.badge-rejected { background: #fbe9e6; color: var(--danger); }
.badge-reversed { background: #f1ecf9; color: #7c5cbf; }
.badge-open { background: #e3f5ec; color: var(--success); }
/* Twenty-first round — fixed asset physical condition (separate from the status badges above) */
.badge-good { background: #e3f5ec; color: var(--success); }
.badge-fair { background: var(--gold-100); color: var(--gold-600); }
.badge-poor { background: #fbe9e6; color: var(--danger); }
.badge-needs_repair { background: #fbe9e6; color: var(--danger); }

/* ---------- Membership module ---------- */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filter-bar .field { margin-bottom: 0; min-width: 160px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list .chip { background: var(--fog-50); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 2px 10px; font-size: .74rem; color: var(--ink-soft); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .88rem; }
.stat-note { font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Flash messages ---------- */
.flash { padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .9rem; font-weight: 600; }
.flash-success { background: #e3f5ec; color: var(--success); }
.flash-error { background: #fbe9e6; color: var(--danger); }

/* ---------- Auth screens (install/login) ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-950); padding: 24px; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.auth-card .brand-mark { height: 44px; margin-bottom: 20px; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card p.sub { color: var(--ink-soft); margin-bottom: 24px; }

/* ---------- Rich text editor ---------- */
.quill-wrap { background: #fff; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--line); }
.quill-wrap .ql-toolbar { border: none; border-bottom: 1px solid var(--line); }
.quill-wrap .ql-container { border: none; font-family: var(--font-body); font-size: 1rem; }
.quill-wrap .ql-editor { min-height: 320px; }

/* ---------- Permission matrix ---------- */
.perm-matrix { width: 100%; border-collapse: collapse; }
.perm-matrix th, .perm-matrix td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: center; font-size: .82rem; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; }
.perm-matrix .yes { color: var(--success); font-weight: 700; }
.perm-matrix .no { color: var(--line); }

/* ---------- Media grid (media library + gallery photo management) ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.media-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.media-tile img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--fog-50); }
.media-tile-info { padding: 8px 10px 0; display: flex; flex-direction: column; gap: 2px; font-size: .78rem; }
.media-tile-info span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile-actions { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.media-tile-actions input[type="text"] { font-size: .7rem; padding: 4px 6px; }
.media-tile-actions button { align-self: flex-start; }

/* ---------- Annual Financial Performance Report (Forty-seventh round) ---------- */
.afr-positive { color: var(--success); font-weight: 700; }
.afr-negative { color: var(--danger); font-weight: 700; }
.stat-card .trend { font-size: .76rem; margin-top: 6px; display: block; }
.stat-card .trend.afr-positive, .stat-card .trend.afr-negative { font-weight: 600; }
.afr-chart { width: 100%; height: auto; display: block; }
.afr-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }
.afr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.afr-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.afr-donut-row { display: flex; justify-content: center; margin-bottom: 14px; }
.afr-donut { max-width: 220px; height: auto; }
.afr-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.afr-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.afr-chart-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
@media (min-width: 960px) { .afr-chart-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.afr-integrity-ok { color: var(--success); font-weight: 700; }
.afr-integrity-bad { color: var(--danger); font-weight: 700; }
.afr-warning-banner { background: #fbe9e6; border: 1px solid var(--danger); color: var(--danger); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }
.afr-summary-text { font-size: .96rem; line-height: 1.6; color: var(--ink); }

/* ---------- Ministry Edit — tabs (Forty-eighth round) ---------- */
.ministry-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.ministry-tab-btn { background: none; border: none; cursor: pointer; padding: 12px 16px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ministry-tab-btn:hover { color: var(--navy-800); }
.ministry-tab-btn.is-active { color: var(--navy-900); border-bottom-color: var(--gold-500); }
.ministry-tab-panel[hidden] { display: none; }

/* ---------- Nested workspace tabs (Fifty-eighth round — Accounting
   navigation redesign). A tab panel can now embed another whole
   tabbed workspace (e.g. Money In's "Accounts Receivable" tab embeds
   Accounts Receivable's own Dashboard/Receivables/Aging/Payments/
   Reports tabs) — see assets/js/admin.js for the nested tab
   controller this styles. .nested-workspace wraps the embedded
   module's own heading + tab row + panels so it reads as a distinct,
   subordinate unit rather than a second identical-looking top-level
   tab row. ---------- */
.nested-workspace { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; background: var(--surface-soft, #f7f7f5); }
.nested-workspace > .ministry-tabs { margin-bottom: 20px; }
.nested-workspace .ministry-tab-btn { padding: 9px 14px; font-size: .8rem; }
.nested-workspace .ministry-tab-panel { background: var(--surface, #fff); border-radius: var(--radius-sm); }

/* ---------- Tile/card grid — Photos, Videos, Materials, Resources
   (Forty-eighth round). Responsive: 1 column on a narrow phone, 2 on a
   larger phone, 3 from tablet width, 4 from desktop width. ---------- */
.tile-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.tile-search { flex: 1 1 220px; max-width: 320px; }
.tile-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px; }
@media (min-width: 480px)  { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } }
.tile-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.tile-card-thumb { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--fog-50); }
.tile-card-icon { width: 100%; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--fog-50); font-size: 2.6rem; color: var(--steel-500); }
.tile-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-card-title { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-card-desc { font-size: .8rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.tile-card-meta { font-size: .72rem; color: var(--ink-soft); margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile-card-actions { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; }
.tile-card-actions a, .tile-card-actions button { font-size: .8rem; font-weight: 600; color: var(--navy-800); background: none; border: none; cursor: pointer; padding: 0; }
.tile-card-actions .danger { color: var(--danger); }
.tile-load-more-wrap { text-align: center; margin-top: 18px; }
.tile-empty { text-align: center; padding: 28px; color: var(--ink-soft); font-size: .88rem; }
.tile-hidden { display: none !important; }

/* ---------- Save & Close confirmation banner (Forty-eighth round) ---------- */
.saved-close-banner { background: #e3f5ec; border: 1px solid var(--success); color: var(--success); border-radius: var(--radius-md); padding: 24px; margin-bottom: 24px; text-align: center; }
.saved-close-banner h2 { color: var(--success); margin-bottom: 8px; }

@media (max-width: 960px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-sidebar-toggle { display: block; }
}

/* ---------- Seventy-first round: clickable Overview KPI cards ---------- */
.kpi-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 26px 0 10px; font-family: var(--font-body, inherit); font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
@media (min-width: 1200px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 340px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card { position: relative; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-md); padding: 18px 18px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; min-width: 0; }
.kpi-card.tone-good { border-left-color: var(--success); }
.kpi-card.tone-info { border-left-color: var(--gold-500); }
.kpi-card.tone-warn { border-left-color: #d98324; }
.kpi-card.is-link:hover, .kpi-card.is-link:focus-within { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-500); }
.kpi-num { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.1; color: var(--navy-950); display: block; }
.kpi-label { color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; text-decoration: none; padding-right: 22px; }
a.kpi-label::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-md); } /* whole card is the click target */
a.kpi-label:focus-visible { outline: none; }
.kpi-card.is-link:focus-within { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.kpi-sub { font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
.kpi-sub-link { position: relative; z-index: 2; color: #a65f0a; font-weight: 700; text-decoration: none; align-self: flex-start; }
.kpi-sub-link:hover { text-decoration: underline; }
.kpi-cta { font-size: .78rem; font-weight: 600; color: var(--gold-600); margin-top: 8px; opacity: .85; }
.kpi-card.is-link:hover .kpi-cta { opacity: 1; text-decoration: underline; }
.kpi-info { position: absolute; top: 12px; right: 12px; z-index: 3; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink-soft); font-size: .68rem; font-weight: 700; font-style: italic; display: flex; align-items: center; justify-content: center; cursor: help; background: #fff; }
.kpi-info::after { content: attr(data-tip); position: absolute; right: -6px; top: 24px; width: 230px; max-width: 70vw; padding: 9px 11px; background: var(--navy-950); color: #fff; border-radius: 8px; font-size: .74rem; font-style: normal; font-weight: 500; line-height: 1.4; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: opacity .12s ease; pointer-events: none; text-align: left; }
.kpi-info:hover::after, .kpi-info:focus::after { opacity: 1; visibility: visible; }
.kpi-foot { font-size: .82rem; color: var(--ink-soft); margin: 10px 2px 0; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 11px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 4px solid var(--success); background: #f6fbf8; font-size: .9rem; font-weight: 600; transition: background .15s ease, transform .15s ease; }
.alert-row:hover { transform: translateX(2px); background: #eef8f2; }
.alert-row.alert-warn { border-left-color: #d98324; background: #fff7ec; }
.alert-row.alert-warn:hover { background: #ffefd6; }
.alert-row.alert-info { border-left-color: var(--gold-500); background: #fffaf0; }
.alert-row.alert-info:hover { background: #fff3da; }
@media (max-width: 520px) { .alert-row { flex-direction: column; align-items: flex-start; } }
.status-bar-col:hover div[title] { filter: brightness(1.08); }
/* Filter summary above a list ("Showing In Membership Process — 18 records") */
.list-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; font-size: .9rem; color: var(--ink-soft); }
.list-summary strong { color: var(--navy-950); }
.list-summary-count { font-size: 1.05rem; }
.list-summary-note { display: block; font-size: .8rem; margin-top: 3px; }
/* Membership-process attention badges (visual guide only — never changes anyone's status) */
.badge-process-new { background: #e6eefb; color: #2f5fa8; }
.badge-process-process { background: var(--gold-100); color: var(--gold-600); }
.badge-process-followup { background: #ffe9cc; color: #a65f0a; }
.badge-process-attention { background: #fbe0dc; color: #b3261e; }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-two-col > * { min-width: 0; }
@media (max-width: 900px) { .dash-two-col { grid-template-columns: 1fr; } }

/* =====================================================================
   Eightieth round — CMS design system ("calm desktop application").
   One layer, scoped to body.admin-body so the public site is untouched.
   It restyles the EXISTING class names (so every page inherits it) and
   defines the shared tokens: type scale, 4-8-12-16-24-32 spacing, neutral
   surfaces, 1px soft borders, 6-10px radii, compact controls and tables.
   ===================================================================== */
body.admin-body {
  --ad-side: 240px;
  --ad-bg: #f4f6f8;
  --ad-line: #e3e8ed;
  --ad-line-strong: #cfd7de;
  --ad-ink: #17242d;
  --ad-muted: #667682;
  --ad-focus: rgba(207,157,63,.28);
  --ad-ctl: 36px;                       /* standard control height */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(12,35,48,.05);
  --shadow-md: 0 10px 28px rgba(12,35,48,.12);
  --font-display: var(--font-body);     /* one interface font everywhere */
  --line: var(--ad-line);
  --ink-soft: var(--ad-muted);
  font-size: 14px; line-height: 1.5; color: var(--ad-ink); background: var(--ad-bg);
}
.admin-body h1, .admin-body h2, .admin-body h3, .admin-body h4 { font-family: var(--font-body); font-weight: 600; letter-spacing: -.005em; line-height: 1.25; }
.admin-body p { color: var(--ad-muted); margin: 0 0 .8em; }
.admin-body strong { font-weight: 600; }

/* ---- Shell ---- */
.admin-body .admin-sidebar { width: var(--ad-side); padding: 16px 10px; }
.admin-body .admin-main { margin-left: var(--ad-side); }
.admin-body .admin-sidebar .brand { padding: 4px 8px 16px; }
.admin-body .admin-sidebar .brand img { height: 30px; }
.admin-body .admin-sidebar .brand span { font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.admin-body .admin-nav a, .admin-body .admin-nav span.admin-nav-disabled { padding: 7px 10px; font-size: .84rem; margin-bottom: 1px; gap: 9px; }
.admin-body .admin-nav-section { padding: 7px 10px; font-size: .68rem; margin: 4px 0 2px; }
.admin-body .admin-nav-subgroup summary { padding: 6px 10px; }
.admin-body .admin-nav-group { margin-bottom: 14px; }
.admin-body .admin-topbar { padding: 9px 24px; min-height: 52px; border-bottom: 1px solid var(--ad-line); }
.admin-body .admin-topbar h1 { font-size: 1.4rem; font-weight: 600; }
.admin-body .admin-topbar-actions { gap: 10px; }
.admin-body .admin-user-chip { font-size: .8rem; line-height: 1.25; text-align: right; }
.admin-body .admin-user-chip .role { font-size: .72rem; display: block; }
.admin-body .admin-content { padding: 18px 24px 32px; max-width: 1720px; width: 100%; }
.admin-body .admin-breadcrumb { font-size: .76rem; margin-bottom: 12px; gap: 5px; }
@media (max-width: 960px) { .admin-body .admin-main { margin-left: 0; } .admin-body .admin-content { padding: 14px 14px 28px; } }

/* ---- Buttons: compact, clear hierarchy ---- */
.admin-body .btn { min-height: 34px; padding: 0 14px; font-size: .82rem; font-weight: 600; border-width: 1px; border-radius: var(--radius-sm); gap: 6px; line-height: 1; transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; }
.admin-body .btn:hover { transform: none; box-shadow: none; }
.admin-body .btn-sm { min-height: 28px; padding: 0 10px; font-size: .76rem; }
.admin-body .btn-primary { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
.admin-body .btn-primary:hover { background: var(--gold-400); border-color: var(--gold-400); }
.admin-body .btn-secondary { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.admin-body .btn-secondary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.admin-body .btn-ghost { background: #fff; border-color: var(--ad-line-strong); color: var(--navy-900); }
.admin-body .btn-ghost:hover { background: var(--fog-50); border-color: var(--steel-500); color: var(--navy-950); }
.admin-body .btn:focus-visible, .admin-body a:focus-visible, .admin-body button:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.admin-body .btn-danger, .admin-body .danger { color: var(--danger); }
.admin-body .btn[disabled], .admin-body button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Form controls: thin neutral border, soft focus, 36px ---- */
.admin-body .field { gap: 4px; }
.admin-body .field label, .admin-body label.field-label { font-size: .8rem; font-weight: 500; color: var(--navy-900); }
.admin-body .field-hint, .admin-body .stat-note { font-size: .75rem; color: var(--ad-muted); margin-top: 0; }
.admin-body .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
.admin-body .field select, .admin-body .field textarea,
.admin-body .filter-bar input:not([type=checkbox]):not([type=radio]), .admin-body .filter-bar select,
.admin-body .tile-search, .admin-body .data-table input[type=text], .admin-body .data-table select {
  min-height: var(--ad-ctl); padding: 6px 11px; font-size: .86rem; line-height: 1.4;
  border: 1px solid var(--ad-line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ad-ink);
}
.admin-body .field textarea { min-height: 76px; padding: 8px 11px; resize: vertical; }
.admin-body .field input[type=file] { font-size: .8rem; padding: 4px 6px; border: 1px dashed var(--ad-line-strong); border-radius: var(--radius-sm); background: var(--fog-50); }
.admin-body .field input:hover:not(:focus), .admin-body .field select:hover:not(:focus), .admin-body .field textarea:hover:not(:focus) { border-color: var(--steel-500); }
.admin-body .field input:focus, .admin-body .field select:focus, .admin-body .field textarea:focus,
.admin-body .filter-bar input:focus, .admin-body .filter-bar select:focus, .admin-body .tile-search:focus {
  border-color: var(--gold-500); box-shadow: 0 0 0 3px var(--ad-focus); outline: none;
}
.admin-body .field input:disabled, .admin-body .field select:disabled, .admin-body .field textarea:disabled { background: var(--fog-50); color: var(--ad-muted); }
.admin-body input[type=checkbox], .admin-body input[type=radio] { accent-color: var(--navy-800); width: 15px; height: 15px; }
.admin-body .checkbox-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.admin-body .checkbox-grid label { font-size: .84rem; }
.admin-body .upload-dropzone { min-height: 96px; border-radius: var(--radius-md); }

/* Multi-column forms: as many columns as the width allows (3-4 on desktop, 2 tablet, 1 phone) */
.admin-body .form-grid { gap: 12px 16px; }
@media (min-width: 640px) {
  .admin-body .form-grid.cols-2, .admin-body .form-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
/* pages that capped their form at a phone-like width now use the available width */
.admin-body .admin-content form[style*="max-width:960px"], .admin-body .admin-content form[style*="max-width:860px"], .admin-body .admin-content form[style*="max-width:760px"],
.admin-body .admin-content .admin-panel[style*="max-width:760px"] { max-width: 1180px !important; }

/* ---- Panels: fewer, lighter boxes. Panels stacked in one form read as ONE sheet with sections ---- */
.admin-body .admin-panel { border: 1px solid var(--ad-line); border-radius: var(--radius-md); box-shadow: none; padding: 16px 20px; margin-bottom: 16px; }
.admin-body .admin-panel h2 { font-size: 1.02rem; margin-bottom: 12px; }
.admin-body .admin-content form > .admin-panel, .admin-body .admin-content fieldset > .admin-panel { margin-bottom: 0; }
.admin-body .admin-content form > .admin-panel + .admin-panel, .admin-body .admin-content fieldset > .admin-panel + .admin-panel {
  border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; border-top-color: var(--ad-line);
}
.admin-body .admin-content form > .admin-panel:has(+ .admin-panel), .admin-body .admin-content fieldset > .admin-panel:has(+ .admin-panel) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.admin-body .admin-content form > .admin-panel + .admin-panel h2:first-child, .admin-body .admin-content fieldset > .admin-panel + .admin-panel h2:first-child {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ad-muted); font-weight: 600;
}
.admin-body .admin-content form > .admin-panel:first-child h2:first-child, .admin-body .admin-content fieldset > .admin-panel:first-child h2:first-child { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ad-muted); font-weight: 600; }
.admin-body .nested-workspace { border: none; padding: 0; background: none; }
.admin-body .nested-workspace .ministry-tab-panel { background: none; }

/* ---- Workspace tabs: thin underline, no boxed buttons ---- */
.admin-body .ministry-tabs { gap: 2px; margin-bottom: 16px; }
.admin-body .ministry-tab-btn { padding: 9px 13px; font-size: .84rem; font-weight: 500; color: var(--ad-muted); }
.admin-body .ministry-tab-btn:hover { color: var(--navy-900); background: none; }
.admin-body .ministry-tab-btn.is-active { color: var(--navy-950); font-weight: 600; border-bottom: 2px solid var(--gold-500); }
.admin-body .nested-workspace .ministry-tab-btn { padding: 7px 11px; font-size: .8rem; }

/* ---- Toolbars & filters: one compact row ---- */
.admin-body .toolbar { margin-bottom: 12px; gap: 10px; }
.admin-body .filter-bar { gap: 8px 10px; margin-bottom: 12px; align-items: flex-end; }
.admin-body .filter-bar .field { min-width: 130px; margin-bottom: 0; }
.admin-body .filter-bar .btn { min-height: var(--ad-ctl); }
.admin-body .admin-panel > .filter-bar:only-child, .admin-body .admin-panel > form > .filter-bar:only-child { margin-bottom: 0; }
.admin-body .list-summary { margin: 0 0 8px; font-size: .84rem; }
.admin-body .list-summary-count { font-size: .95rem; }

/* ---- Tables: compact, hairline rows, quiet header, sticky header when the list is long ---- */
.admin-body .data-table-wrap { border: 1px solid var(--ad-line); border-radius: var(--radius-md); box-shadow: none; background: #fff; }
.admin-body .data-table-wrap.is-scroll { max-height: calc(100vh - 190px); overflow: auto; }
.admin-body .data-table { min-width: 0; }
.admin-body .data-table th, .admin-body .data-table td { padding: 8px 12px; font-size: .84rem; border-bottom: 1px solid #eef1f4; line-height: 1.4; }
.admin-body .data-table th { background: var(--fog-50); font-size: .68rem; font-weight: 600; letter-spacing: .05em; color: var(--ad-muted); white-space: nowrap; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--ad-line); }
.admin-body .data-table tbody tr:hover td { background: #f8fafb; }
.admin-body .data-table td strong { font-weight: 600; }
.admin-body .data-table .num, .admin-body .data-table td.num, .admin-body .data-table th.num, .admin-body .data-table td.amount, .admin-body .data-table th.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-body .data-table tfoot td { font-weight: 600; background: var(--fog-50); position: sticky; bottom: 0; }
.admin-body .data-table .row-actions { gap: 12px; align-items: center; }
.admin-body .data-table .row-actions a, .admin-body .data-table .row-actions button { font-size: .8rem; font-weight: 600; }
.admin-body .data-table .row-actions a:hover { color: var(--gold-600); }
.admin-body .empty-state, .admin-body .tile-empty { padding: 24px 16px; font-size: .88rem; }
/* "⋯ More" menu (built by admin.js from rows with 3+ actions) */
.admin-body .row-more-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--ad-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; letter-spacing: 1px; }
.admin-body .row-more-btn:hover, .admin-body .row-more-btn[aria-expanded="true"] { background: var(--fog-50); border-color: var(--ad-line); color: var(--navy-950); }
.row-more-menu { position: fixed; z-index: 90; min-width: 150px; background: #fff; border: 1px solid var(--ad-line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px; display: flex; flex-direction: column; }
.row-more-menu[hidden] { display: none; }
.row-more-menu a, .row-more-menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 5px; font-size: .82rem; font-weight: 500; color: var(--ad-ink); background: none; border: none; cursor: pointer; text-decoration: none; }
.row-more-menu a:hover, .row-more-menu button:hover { background: var(--fog-50); }
.row-more-menu .danger, .row-more-menu button.danger { color: var(--danger); }
.row-more-menu form { margin: 0; display: block; }

/* ---- Badges: small, tinted ---- */
.admin-body .badge { padding: 2px 8px; font-size: .66rem; font-weight: 600; letter-spacing: .03em; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.5; }

/* ---- KPI / stat cards: compact, informative, still fully clickable ---- */
.admin-body .kpi-heading { font-size: .72rem; margin: 18px 0 8px; letter-spacing: .07em; font-weight: 600; }
.admin-body .kpi-grid, .admin-body .stat-grid, .admin-body .afr-kpi-row { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 14px; }
@media (min-width: 1200px) { .admin-body .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.admin-body .kpi-card, .admin-body .stat-card { padding: 11px 14px 10px; border-radius: var(--radius-md); box-shadow: none; border: 1px solid var(--ad-line); border-left-width: 3px; }
.admin-body .stat-card { border-left-width: 1px; }
.admin-body .kpi-card.is-link:hover, .admin-body .kpi-card.is-link:focus-within { transform: none; box-shadow: 0 2px 10px rgba(12,35,48,.08); border-color: var(--gold-500); }
.admin-body .kpi-num, .admin-body .stat-card .num { font-family: var(--font-body); font-size: 1.55rem; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.admin-body .kpi-label, .admin-body .stat-card .label { font-size: .76rem; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ad-muted); }
.admin-body .kpi-sub { font-size: .74rem; margin-top: 2px; }
.admin-body .kpi-cta { font-size: .72rem; margin-top: 4px; }
.admin-body .kpi-foot { font-size: .76rem; margin: 6px 2px 0; }
.admin-body .kpi-info { top: 8px; right: 8px; }

/* ---- Alerts: compact rows ---- */
.admin-body .alert-list { gap: 6px; }
.admin-body .alert-row { padding: 7px 12px; font-size: .84rem; border-radius: var(--radius-sm); border-left-width: 3px; }
.admin-body .alert-row .btn { min-height: 26px; padding: 0 10px; font-size: .74rem; }
.admin-body .flash { padding: 9px 14px; font-size: .84rem; margin-bottom: 12px; border-radius: var(--radius-sm); }

/* ---- Tiles (photos, videos, materials, media, resources): smaller, more per row ---- */
.admin-body .tile-grid { gap: 12px; }
@media (min-width: 1320px) { .admin-body .tile-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1620px) { .admin-body .tile-grid { grid-template-columns: repeat(6, 1fr); } }
.admin-body .tile-card { box-shadow: none; border-radius: var(--radius-md); }
.admin-body .tile-card-thumb, .admin-body .tile-card-icon { height: 96px; font-size: 2rem; }
.admin-body .tile-card-body { padding: 9px 11px; gap: 2px; }
.admin-body .tile-card-title { font-size: .84rem; }
.admin-body .tile-card-actions { padding: 7px 11px; gap: 10px; }
.admin-body .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.admin-body .media-tile img { height: 100px; }

/* ---- Sticky action bar on long forms (added by admin.js) ---- */
.admin-body .is-savebar { position: sticky; bottom: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-top: 1px solid var(--ad-line); padding: 10px 16px; margin: 16px 0 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* ---- Slide-over "Quick view" panel (Members and other rows with data-qv) ---- */
.qv-backdrop { position: fixed; inset: 0; background: rgba(12,35,48,.28); z-index: 80; }
.qv-backdrop[hidden], .qv-panel[hidden] { display: none; }
.qv-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; z-index: 85; box-shadow: var(--shadow-md); display: flex; flex-direction: column; border-left: 1px solid var(--ad-line); }
.qv-head { padding: 14px 18px; border-bottom: 1px solid var(--ad-line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qv-head h3 { margin: 0; font-size: 1.05rem; }
.qv-head .qv-sub { font-size: .78rem; color: var(--ad-muted); margin-top: 2px; }
.qv-close { border: none; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ad-muted); padding: 2px 6px; border-radius: 6px; }
.qv-close:hover { background: var(--fog-50); color: var(--navy-950); }
.qv-body { padding: 8px 18px 18px; overflow-y: auto; flex: 1; }
.qv-body dl { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 0; }
.qv-body dt, .qv-body dd { padding: 8px 0; border-bottom: 1px solid #eef1f4; font-size: .84rem; margin: 0; }
.qv-body dt { color: var(--ad-muted); }
.qv-body dd { color: var(--ad-ink); word-break: break-word; }
.qv-foot { padding: 12px 18px; border-top: 1px solid var(--ad-line); display: flex; gap: 8px; }
.admin-body .qv-open { background: none; border: none; color: var(--ad-muted); cursor: pointer; font-size: .8rem; font-weight: 600; padding: 0; }
.admin-body .qv-open:hover { color: var(--gold-600); }
.admin-body .row-expand-btn { width: 22px; height: 22px; border: none; background: none; cursor: pointer; color: var(--ad-muted); border-radius: 5px; padding: 0; }
.admin-body .row-expand-btn:hover { background: var(--fog-50); }
.admin-body .row-expand-btn::before { content: "\25B8"; display: inline-block; transition: transform .12s ease; }
.admin-body .row-expand-btn[aria-expanded="true"]::before { transform: rotate(90deg); }
.admin-body tr.row-detail td { background: var(--fog-50) !important; padding: 10px 16px 12px 44px; }
.admin-body .detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; font-size: .82rem; }
.admin-body .detail-grid dt { color: var(--ad-muted); font-size: .72rem; margin: 0; }
.admin-body .detail-grid dd { margin: 0; color: var(--ad-ink); }

/* ---- Compact definition layout for view/profile pages ---- */
.admin-body .profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.admin-body .profile-head h2 { margin: 0; font-size: 1.25rem; }
.admin-body .profile-section { border-top: 1px solid var(--ad-line); padding: 12px 0 4px; }
.admin-body .profile-section > h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ad-muted); font-weight: 600; margin: 0 0 8px; }
.admin-body .profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 24px; margin: 0 0 8px; }
.admin-body .profile-grid dt { font-size: .72rem; color: var(--ad-muted); margin: 0; }
.admin-body .profile-grid dd { margin: 0; font-size: .88rem; color: var(--ad-ink); }

/* ---- Auth screens keep a roomier look ---- */
.admin-body .auth-card { border-radius: 12px; padding: 32px; }
@media (prefers-reduced-motion: reduce) { .admin-body * { transition: none !important; } }

/* ---- Round 80 additions: dropdown menu, "More filters", name-as-link ---- */
.admin-body .dd { position: relative; }
.admin-body .dd > summary { list-style: none; cursor: pointer; user-select: none; }
.admin-body .dd > summary::-webkit-details-marker { display: none; }
.admin-body .dd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 190px; background: #fff; border: 1px solid var(--ad-line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px; display: flex; flex-direction: column; }
.admin-body .dd-menu a, .admin-body .dd-menu button { display: block; padding: 7px 10px; border-radius: 5px; font-size: .82rem; font-weight: 500; color: var(--ad-ink); background: none; border: none; text-align: left; cursor: pointer; }
.admin-body .dd-menu a:hover, .admin-body .dd-menu button:hover { background: var(--fog-50); }
.admin-body .filter-more { flex-basis: 100%; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.admin-body .filter-more[hidden] { display: none; }
.admin-body .qv-name { font-weight: 600; color: var(--navy-950); font-size: inherit; text-align: left; }
.admin-body .qv-name:hover { color: var(--gold-600); text-decoration: underline; }
.admin-body .data-table td .row-expand-btn { margin-right: 2px; vertical-align: middle; }
.admin-body .data-table td:first-child, .admin-body .data-table th:first-child { white-space: nowrap; }
.admin-body .dash-two-col { align-items: start; }
.admin-body .admin-panel:has(> .ministry-tabs:only-child) { border: none; background: none; padding: 0; margin-bottom: 4px; }
.admin-body .admin-panel:has(> .nested-workspace) { border: none; background: none; padding: 0; margin-bottom: 0; }
.admin-body .nested-workspace > .admin-breadcrumb, .admin-body .nested-workspace .admin-breadcrumb { display: none; }

/* Round 80 — compact cell helpers */
body.admin-body td.nw{white-space:nowrap}
body.admin-body td.ell{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.admin-body td.ell{max-width:150px}
/* keep row actions visible when a wide table scrolls horizontally */
body.admin-body .data-table-wrap{overflow-x:auto}
body.admin-body .data-table th:last-child,body.admin-body .data-table td:last-child:has(.row-more,.row-more-btn){position:sticky;right:0;background:inherit;z-index:1}
body.admin-body .data-table td:last-child:has(.row-more,.row-more-btn){background:#fff;box-shadow:-8px 0 8px -8px rgba(15,23,42,.12)}
body.admin-body .data-table tbody tr:hover td:last-child:has(.row-more,.row-more-btn){background:var(--fog-50,#f6f8fa)}
body.admin-body .data-table th:last-child{background:var(--fog-50);z-index:3}

/* Round 80 — Church Overview: KPI groups side by side, compact toolbar */
body.admin-body .kpi-groups{display:flex;flex-wrap:wrap;gap:4px 32px;align-items:flex-start;margin-bottom:8px}
body.admin-body .kpi-group{flex:0 1 auto;min-width:0}
body.admin-body .kpi-groups .kpi-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));display:grid;gap:8px}
body.admin-body .kpi-group:first-child .kpi-grid{grid-template-columns:repeat(4,minmax(130px,1fr))}
body.admin-body .kpi-group:nth-child(2) .kpi-grid{grid-template-columns:repeat(2,minmax(130px,1fr))}
body.admin-body .kpi-group:nth-child(3) .kpi-grid{grid-template-columns:repeat(3,minmax(130px,1fr))}
body.admin-body .alert-icon{display:inline-flex;vertical-align:-3px;margin-right:4px;color:var(--navy-700,#1f3a5f)}
body.admin-body .alert-text{display:inline-flex;align-items:center;gap:4px}
body.admin-body form.filter-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 12px}
body.admin-body form.filter-bar .field{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0}
body.admin-body form.filter-bar .field label{margin:0;white-space:nowrap}
@media (max-width:1100px){body.admin-body .kpi-group{flex:1 1 100%}}

/* Round 80 — phone layout: nothing may push the page wider than the screen */
body.admin-body .admin-main,body.admin-body .admin-content,body.admin-body .admin-panel,body.admin-body main{min-width:0;max-width:100%}
body.admin-body .data-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
@media (max-width:640px){
  body.admin-body .admin-topbar{padding:8px 12px;flex-wrap:wrap;gap:6px}
  body.admin-body .admin-topbar h1{font-size:1.15rem;flex:1 1 100%}
  body.admin-body .admin-topbar-actions{flex-wrap:wrap;gap:6px;max-width:100%}
  body.admin-body .admin-topbar-actions .admin-user{display:none}
  body.admin-body .admin-panel{padding:12px}
  body.admin-body .admin-content{padding-left:12px;padding-right:12px}
  body.admin-body .filter-bar,body.admin-body .toolbar{flex-wrap:wrap}
  body.admin-body .filter-bar .field,body.admin-body .filter-bar input,body.admin-body .filter-bar select{max-width:100%}
  body.admin-body .kpi-groups .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.admin-body .qv-panel{width:100%}
}
@media (max-width:640px){body.admin-body :not(.data-table-wrap)>table.data-table{display:block;max-width:100%;overflow-x:auto}}
@media (max-width:640px){body.admin-body [style*="display:flex"]{flex-wrap:wrap}}

/* =====================================================================
   Round 81 — Roles & Permissions (list + one-role editor)
   ===================================================================== */
body.admin-body .badge-muted{background:#eef1f4;color:var(--ad-muted,#5b6775)}
body.admin-body .list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 10px;flex-wrap:wrap}
body.admin-body .alert.alert-info{padding:8px 12px;border:1px solid #f1e3bd;background:#fffaf0;border-radius:var(--radius-sm,6px);font-size:.82rem}

/* basics row */
body.admin-body .role-basics{display:grid;grid-template-columns:minmax(200px,260px) minmax(260px,1fr) 140px 200px;gap:10px 12px;align-items:end;margin-bottom:8px}
body.admin-body .role-basics .field{margin:0}
body.admin-body .role-users-line{display:flex;align-items:center;gap:10px;min-height:36px}
body.admin-body .role-users-line strong{font-size:1.1rem}
body.admin-body .role-users-panel{border:1px solid var(--ad-line,#e3e7ec);border-radius:var(--radius-sm,6px);margin:0 0 8px;max-height:240px;overflow:auto;background:#fff}
body.admin-body .role-users-panel[hidden]{display:none}

/* toolbar above matrix */
body.admin-body .perm-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:6px 0 8px;position:sticky;top:52px;z-index:6;background:var(--ad-bg,#f6f8fa);padding:6px 0}
body.admin-body .perm-toolbar input[type=search]{flex:0 1 380px;min-width:200px}
body.admin-body .perm-toolbar-sum{font-size:.78rem;color:var(--ad-muted,#5b6775)}
body.admin-body .perm-toolbar-btns{margin-left:auto;display:flex;gap:6px}

/* groups: heading + thin divider + compact table, no card */
body.admin-body details.perm-group{margin:0 0 6px;border:0;background:none}
body.admin-body details.perm-group>summary{cursor:pointer;list-style:none;display:flex;align-items:baseline;gap:10px;padding:8px 2px 4px;border-bottom:1px solid var(--ad-line,#e3e7ec);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--navy-800,#1b3358)}
body.admin-body details.perm-group>summary::-webkit-details-marker{display:none}
body.admin-body details.perm-group>summary::before{content:"▸";font-size:.7rem;color:var(--ad-muted,#5b6775);transition:transform .12s}
body.admin-body details.perm-group[open]>summary::before{transform:rotate(90deg)}
body.admin-body .perm-group-count{margin-left:auto;font-weight:500;letter-spacing:0;text-transform:none;font-size:.74rem;color:var(--ad-muted,#5b6775)}
body.admin-body details.perm-group[hidden]{display:none}

body.admin-body table.role-matrix{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}
body.admin-body .role-matrix th,body.admin-body .role-matrix td{padding:3px 8px;font-size:.82rem;line-height:1.3;border-bottom:1px solid #eef1f4;text-align:center;vertical-align:middle;height:30px;background:transparent}
body.admin-body .role-matrix th{font-size:.7rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ad-muted,#5b6775);background:var(--fog-50,#f6f8fa);position:sticky;top:98px;z-index:4;white-space:nowrap}
body.admin-body .role-matrix thead tr.perm-colsel th{top:128px;z-index:3;text-transform:none;letter-spacing:0;font-weight:500;height:26px;font-size:.72rem}
body.admin-body .role-matrix .perm-mod{text-align:left;width:26%;font-weight:500}
body.admin-body .role-matrix thead .perm-mod{font-weight:600}
body.admin-body .role-matrix th:nth-child(2),body.admin-body .role-matrix th:nth-child(3),body.admin-body .role-matrix th:nth-child(4),body.admin-body .role-matrix th:nth-child(5){width:8%}
body.admin-body .role-matrix .perm-all-h,body.admin-body .role-matrix .perm-all{width:6%}
body.admin-body .role-matrix .perm-more-h,body.admin-body .role-matrix .perm-more{text-align:left;width:26%}
body.admin-body .role-matrix tbody tr:hover td{background:#f9fafb}
body.admin-body .role-matrix input[type=checkbox]{width:16px;height:16px;margin:0;accent-color:var(--navy-800,#1b3358);cursor:pointer;vertical-align:middle}
body.admin-body .role-matrix input[type=checkbox]:disabled{cursor:not-allowed;opacity:.65}
body.admin-body .perm-na{color:#c3cad2}
body.admin-body .perm-manage label,body.admin-body .perm-extra{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:.8rem;color:var(--ad-ink,#1f2a37)}
body.admin-body .perm-manage span,body.admin-body .perm-extra span{color:var(--ad-muted,#5b6775)}
body.admin-body .perm-extra{margin-right:10px}
body.admin-body .role-matrix tr[hidden]{display:none}

/* info tooltips */
body.admin-body .perm-tip{position:relative;display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;margin-left:4px;border:1px solid #c7ced6;border-radius:50%;font-size:.62rem;font-style:italic;font-weight:700;color:var(--ad-muted,#5b6775);background:#fff;cursor:help;text-transform:none;letter-spacing:0;vertical-align:middle}
body.admin-body .perm-tip::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 6px);transform:translateX(-50%);width:230px;max-width:70vw;padding:7px 9px;background:var(--navy-950,#0f2037);color:#fff;border-radius:6px;font-size:.72rem;font-style:normal;font-weight:500;line-height:1.4;text-align:left;box-shadow:0 6px 18px rgba(15,23,42,.25);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s;z-index:50;white-space:normal}
body.admin-body .perm-tip:hover::after,body.admin-body .perm-tip:focus::after{opacity:1;visibility:visible}
body.admin-body .role-matrix thead th:first-child .perm-tip::after{left:0;transform:none}

body.admin-body details.perm-history{margin:10px 0 0;font-size:.82rem}
body.admin-body details.perm-history>summary{cursor:pointer;color:var(--navy-800,#1b3358);font-weight:600;padding:4px 0}

/* sticky save bar */
body.admin-body .role-savebar{position:sticky;bottom:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0 0;padding:8px 12px;background:rgba(255,255,255,.96);backdrop-filter:blur(6px);border-top:1px solid var(--ad-line,#e3e7ec)}
body.admin-body .role-savebar-msg{font-size:.8rem;color:#a55a00;font-weight:600}
body.admin-body .role-savebar-btns{display:flex;gap:8px;margin-left:auto}

/* leave-page dialog */
body.admin-body #leave-modal{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:200;align-items:center;justify-content:center;padding:16px}
body.admin-body .leave-card{background:#fff;border-radius:10px;padding:18px 20px;max-width:380px;width:100%;box-shadow:0 18px 50px rgba(15,23,42,.35)}
body.admin-body .leave-card h3{margin:0 0 6px;font-size:1rem}
body.admin-body .leave-card p{margin:0 0 14px;font-size:.85rem;color:var(--ad-muted,#5b6775)}
body.admin-body .leave-actions{display:flex;gap:8px;justify-content:flex-end}

@media (max-width:900px){
  body.admin-body .role-basics{grid-template-columns:1fr 1fr}
  body.admin-body .role-basics-desc{grid-column:1/-1}
  body.admin-body details.perm-group{overflow-x:auto}
  body.admin-body table.role-matrix{min-width:700px}
  body.admin-body .role-matrix th{position:static}
  body.admin-body .role-matrix input[type=checkbox]{width:20px;height:20px}
  body.admin-body .perm-toolbar{position:static}
}
body.admin-body .perm-toolbar input[type=search]{height:34px;padding:0 10px 0 12px;border:1px solid var(--ad-line,#d5dbe2);border-radius:var(--radius-sm,6px);background:#fff;font:inherit;font-size:.84rem}
body.admin-body .perm-manage{white-space:nowrap}
body.admin-body .perm-manage .perm-tip{margin-top:-1px}
body.admin-body .perm-manage label{vertical-align:middle}

/* =====================================================================
   Round 81 — slightly more compact (same look, tighter scale)
   Desktop type scale: page title 20.8 · section 15.5 · tab 13.4 · label 12.3 ·
   body/table 13.3 · helper 11.5 · KPI number 24
   ===================================================================== */
body.admin-body{font-size:13.6px}
body.admin-body .admin-topbar{padding:5px 20px;min-height:46px}
body.admin-body .admin-topbar h1{font-size:1.3rem;font-weight:600}
body.admin-body .admin-content{padding:12px 20px 24px}
body.admin-body .admin-breadcrumb{margin-bottom:8px;font-size:.74rem}
body.admin-body .admin-panel{padding:12px 16px;margin-bottom:12px}
body.admin-body .admin-panel h2{font-size:.97rem;margin-bottom:8px}
body.admin-body .admin-content h2{font-size:.97rem}
body.admin-body .admin-content h3{font-size:.9rem}
body.admin-body .stat-note,body.admin-body .help-text,body.admin-body .field small{font-size:.72rem}
body.admin-body .field label,body.admin-body label.field-label{font-size:.77rem;margin-bottom:2px}
body.admin-body .form-grid{gap:8px 12px}
body.admin-body .field{margin-bottom:0}
body.admin-body .admin-content form > .admin-panel + .admin-panel{margin-top:2px}

/* tabs: thin underline, small label */
body.admin-body .ministry-tabs{margin-bottom:10px;gap:0}
body.admin-body .ministry-tab-btn{padding:6px 12px;font-size:.84rem}
body.admin-body .nested-workspace .ministry-tab-btn{padding:5px 10px;font-size:.8rem}
body.admin-body .ministry-tab-btn.is-active{border-bottom-width:2px}

/* tables: ~40px rows */
body.admin-body .data-table th,body.admin-body .data-table td{padding:6px 10px;font-size:.83rem}
body.admin-body .data-table th{font-size:.66rem;padding-top:6px;padding-bottom:6px}
body.admin-body .data-table .row-actions{gap:8px}
body.admin-body .list-summary,body.admin-body .list-toolbar{margin-bottom:6px}

/* buttons / controls */
body.admin-body .btn{padding:0 10px}
body.admin-body .filter-bar{padding:8px 12px;gap:8px 10px;margin-bottom:8px}

/* KPI / stat cards: label + number on one line, detail underneath */
body.admin-body .kpi-grid,body.admin-body .stat-grid{gap:8px;margin-bottom:10px;grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
body.admin-body .kpi-card{display:grid;grid-template-columns:1fr auto;grid-template-areas:"label num" "sub cta";align-items:center;column-gap:10px;row-gap:0;padding:8px 12px 7px}
body.admin-body .kpi-card .kpi-label{grid-area:label;padding-right:0;font-size:.78rem;color:var(--ad-ink,#1f2a37);font-weight:600}
body.admin-body .kpi-card .kpi-num{grid-area:num;font-size:1.5rem;text-align:right}
body.admin-body .kpi-card .kpi-sub{grid-area:sub;font-size:.7rem;margin:0}
body.admin-body .kpi-card .kpi-cta{grid-area:cta;font-size:.7rem;margin:0;justify-self:end;grid-column:2}
body.admin-body .kpi-card .kpi-sub + .kpi-cta,body.admin-body .kpi-card .kpi-cta{grid-row:2}
body.admin-body .kpi-card .kpi-info{display:none}
body.admin-body .kpi-card[data-tip] , body.admin-body .kpi-card .kpi-label[title]{cursor:default}
body.admin-body .stat-card{display:grid;grid-template-columns:1fr auto;grid-template-areas:"label num" "trend trend";align-items:center;column-gap:10px;padding:8px 12px}
body.admin-body .stat-card .label{grid-area:label;font-size:.76rem;color:var(--ad-ink,#1f2a37);font-weight:600}
body.admin-body .stat-card .num{grid-area:num;font-size:1.4rem;text-align:right}
body.admin-body .stat-card .trend{grid-area:trend;margin-top:1px;font-size:.7rem}
body.admin-body .kpi-heading{font-size:.66rem;margin:8px 0 4px}
body.admin-body .kpi-foot{font-size:.72rem;margin:2px 0 6px}
body.admin-body .kpi-groups .kpi-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important}
body.admin-body .kpi-group:first-child .kpi-grid{grid-template-columns:repeat(4,minmax(150px,1fr))!important}
body.admin-body .kpi-group:nth-child(2) .kpi-grid{grid-template-columns:repeat(2,minmax(150px,1fr))!important}
body.admin-body .kpi-group:nth-child(3) .kpi-grid{grid-template-columns:repeat(3,minmax(150px,1fr))!important}
body.admin-body .alert-row{padding:6px 10px;font-size:.82rem}
body.admin-body .alert-list{gap:4px}
body.admin-body .upload-dropzone{min-height:72px}
body.admin-body .empty-state{padding:14px 10px;font-size:.84rem}

@media (max-width:640px){
  body.admin-body .admin-content{padding:8px 10px 20px}
  body.admin-body .kpi-groups .kpi-grid,body.admin-body .kpi-group:first-child .kpi-grid,body.admin-body .kpi-group:nth-child(2) .kpi-grid,body.admin-body .kpi-group:nth-child(3) .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
body.admin-body .admin-content h2.kpi-heading{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--ad-muted,#5b6775);font-weight:700;margin:6px 0 4px}
body.admin-body .kpi-groups{display:grid;grid-template-columns:4fr 2fr;gap:0 24px;align-items:start}
body.admin-body .kpi-group{min-width:0}
body.admin-body .kpi-group:first-child .kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.admin-body .kpi-group:nth-child(2) .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.admin-body .kpi-group:nth-child(3) .kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
@media (max-width:1100px){body.admin-body .kpi-groups{grid-template-columns:1fr}}
body.admin-body .kpi-groups{grid-template-columns:5fr 2fr}
body.admin-body .kpi-card .kpi-num{font-size:1.35rem}
body.admin-body .kpi-card .kpi-label{line-height:1.25}
body.admin-body .stat-grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
body.admin-body .stat-card{grid-template-columns:1fr;grid-template-areas:"label" "num" "trend";row-gap:0;padding:8px 12px 7px}
body.admin-body .stat-card .num{text-align:left;font-size:1.4rem;line-height:1.2}
body.admin-body .stat-card .label{font-weight:500;color:var(--ad-muted,#5b6775)}
body.admin-body .kpi-card{grid-template-columns:minmax(0,1fr) auto;min-width:0}
body.admin-body .kpi-card .kpi-label{min-width:0;overflow-wrap:anywhere}
@media (max-width:640px){body.admin-body .kpi-card .kpi-cta{display:none}body.admin-body .kpi-card .kpi-num{font-size:1.2rem}}

/* Round 82 — image picker (upload or Media Library) */
body.admin-body .media-picker-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap}
body.admin-body .media-picker-current{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
body.admin-body .media-picker-current img{width:150px;height:auto;max-height:100px;object-fit:cover;border-radius:6px;border:1px solid var(--ad-line,#e3e7ec)}
body.admin-body .media-picker-remove{font-size:.76rem;font-weight:400;display:flex;gap:5px;align-items:center}
body.admin-body .media-picker-inputs{flex:1 1 280px;min-width:0}
body.admin-body .media-picker-lib{margin-top:6px;font-size:.8rem}
body.admin-body .media-picker-lib>summary{cursor:pointer;color:var(--navy-800,#1b3358);font-weight:600}
body.admin-body .media-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px;margin-top:6px;max-height:210px;overflow:auto;padding:2px}
body.admin-body .media-picker-tile{position:relative;display:block;border:2px solid transparent;border-radius:6px;overflow:hidden;cursor:pointer;line-height:0}
body.admin-body .media-picker-tile input{position:absolute;top:4px;left:4px;z-index:2}
body.admin-body .media-picker-tile img{width:100%;aspect-ratio:4/3;object-fit:cover}
body.admin-body .media-picker-tile:has(input:checked){border-color:var(--gold-500,#c9a24b)}
body.admin-body .form-actions{display:flex;gap:8px;margin-top:10px}
body.admin-body .data-table td.is-menu-open{z-index:60!important}

/* Home Banner editor (round 83) */
.banner-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 4px; }
.banner-thumb { border: 1px solid var(--ad-line, #e3e7ec); border-radius: 8px; overflow: hidden; background: #fff; }
.banner-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #eef1f4; }
.banner-thumb-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; font-size: .78rem; color: var(--ad-muted, #5b6775); }
.banner-thumb-bar form { margin: 0; }
.banner-thumb-bar button { background: none; border: 0; cursor: pointer; font-size: .9rem; padding: 2px 5px; color: var(--navy-800); }
.banner-thumb-bar button:disabled { opacity: .3; cursor: default; }
.banner-thumb-bar button.danger { color: var(--danger); }
.banner-video-current { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.banner-video-current video { width: 100%; max-width: 360px; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; }

/* ---- Round 86: unified Payee picker ---- */
body.admin-body .payee-picker .payee-selected{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:#fff}
body.admin-body .payee-picker .payee-code{color:var(--ink-soft);font-size:.78rem}
body.admin-body .payee-search-row{display:flex;gap:8px}
body.admin-body .payee-filter{flex:0 0 120px;width:120px}
body.admin-body .payee-query{flex:1;min-width:0}
body.admin-body .payee-search{position:relative}
body.admin-body .payee-results{position:absolute;z-index:70;left:0;right:0;top:100%;margin:2px 0 0;padding:4px;list-style:none;background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(15,35,55,.14);max-height:320px;overflow:auto}
body.admin-body .payee-result{padding:8px 10px;border-radius:6px;cursor:pointer}
body.admin-body .payee-result.is-active,body.admin-body .payee-result:hover{background:var(--fog-50,#f3f5f7)}
body.admin-body .payee-result-top{display:flex;align-items:center;gap:8px}
body.admin-body .payee-result-sub{font-size:.76rem;color:var(--ink-soft);margin-top:2px}
body.admin-body .payee-empty{padding:10px;color:var(--ink-soft);font-size:.82rem}
body.admin-body .payee-badge{display:inline-block;padding:1px 7px;border-radius:999px;font-size:.62rem;font-weight:700;letter-spacing:.06em;background:#e6e9ee;color:#31404f}
body.admin-body .payee-badge-member{background:#e4f4ea;color:#16663a}
body.admin-body .payee-badge-vendor{background:#e3ecfb;color:#1f4a99}
body.admin-body .payee-badge-other{background:#f4ece0;color:#8a5a12}
body.admin-body .payee-badge-family{background:#e6f3ea;color:#1f6b3a}
body.admin-body .payee-other{margin-top:8px}
body.admin-body .payee-save-vendor{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:.82rem}
body.admin-body .payee-dup{margin-top:10px;padding:10px 12px;border:1px solid #f59e0b;border-radius:8px;background:#fffbeb;font-size:.82rem}
body.admin-body .payee-dup-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0}

/* ---- Round 86: Back button + unsaved-changes dialog ---- */
body.admin-body .admin-backbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 10px}
body.admin-body .admin-backbar .admin-breadcrumb{margin:0}
body.admin-body .admin-back{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--navy-900);font-size:.78rem;font-weight:600;text-decoration:none;line-height:1.4}
body.admin-body .admin-back:hover{border-color:var(--gold-600);color:var(--gold-600)}
body.admin-body .admin-back[hidden]{display:none}
.unsaved-modal{position:fixed;inset:0;z-index:300;background:rgba(15,35,55,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.unsaved-modal[hidden]{display:none}
.unsaved-card{background:#fff;border-radius:12px;padding:22px 24px;max-width:420px;width:100%;box-shadow:0 20px 50px rgba(15,35,55,.3)}
.unsaved-card h3{margin:0 0 6px;font-size:1.05rem}
.unsaved-card p{margin:0 0 16px;color:var(--ink-soft);font-size:.88rem}
.unsaved-actions{display:flex;gap:10px;flex-wrap:wrap}
@media print{.admin-backbar{display:none}}
body.admin-body .payee-picker [hidden]{display:none !important}

/* Round 87 — ↻ Refresh + "Last updated" (right end of the Back bar) */
body.admin-body .admin-refresh-wrap{margin-left:auto;display:inline-flex;align-items:center;gap:10px}
body.admin-body .admin-updated{font-size:11.5px;color:var(--ad-muted);white-space:nowrap}
body.admin-body .admin-refresh{display:inline-flex;align-items:center;gap:5px;padding:4px 12px;font:inherit;font-size:12.5px;font-weight:600;line-height:1.4;color:var(--ad-ink);background:#fff;border:1px solid var(--ad-line-strong);border-radius:999px;cursor:pointer}
body.admin-body .admin-refresh:hover{border-color:var(--gold,#c9973b);color:var(--gold-dark,#8a6414)}
body.admin-body .admin-refresh.is-busy{opacity:.6;cursor:progress}
@media (max-width:600px){body.admin-body .admin-updated{display:none}}
@media print{.admin-refresh-wrap{display:none}}

/* Round 87 — Print ▼ menu on Bills / Expenses lists and detail pages */
body.admin-body details.print-menu{position:relative;display:inline-block}
body.admin-body details.print-menu>summary{list-style:none;cursor:pointer;display:inline-block}
body.admin-body details.print-menu>summary::-webkit-details-marker{display:none}
body.admin-body details.print-menu .print-menu-list{position:absolute;right:0;z-index:30;min-width:210px;margin-top:4px;padding:4px;background:#fff;border:1px solid var(--ad-line-strong);border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.12);display:flex;flex-direction:column}
body.admin-body details.print-menu .print-menu-list a{padding:7px 10px;border-radius:6px;text-decoration:none;color:inherit;font-size:13px;white-space:nowrap}
body.admin-body details.print-menu .print-menu-list a:hover{background:#f3f5f7}
body.admin-body details.print-menu .print-menu-list small{display:block;color:#6b7a86;font-size:11px}

/* Round 88 — CMS-only approval record + "Bypass" tag (never printed) */
body.admin-body .approval-record{padding:10px 12px;border:1px solid var(--ad-line-strong);border-radius:8px;background:#fafbfc}
body.admin-body .approval-record.is-bypass{border-color:#f0c36d;background:#fffbeb}
body.admin-body .approval-record-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 18px;margin:0}
body.admin-body .approval-record-grid dt{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--ad-muted)}
body.admin-body .approval-record-grid dd{margin:1px 0 0;font-size:13px}
body.admin-body .approval-tag{display:inline-block;margin-left:6px;padding:0 7px;border-radius:999px;font-size:10.5px;font-weight:700;color:#92400e;background:#fef3c7;border:1px solid #f0c36d;vertical-align:middle}
@media (max-width:700px){body.admin-body .approval-record-grid{grid-template-columns:1fr 1fr}}

/* ---- Round 94: Edit Family (one page for the whole household) ---- */
body.admin-body .fam-table td{vertical-align:middle}
body.admin-body .fam-table select{width:100%;min-width:130px}
body.admin-body .fam-sub{display:block;font-size:.74rem;color:#5d6b7a;margin-top:1px}
body.admin-body .fam-row.is-new td{background:#fbf9ef}
body.admin-body .fam-row.is-removed td{opacity:.55;text-decoration:line-through}
body.admin-body .fam-row.is-removed td:last-child,body.admin-body .fam-row.is-removed .fam-clear{opacity:1;text-decoration:none}
body.admin-body .fam-clear{display:block;font-size:.76rem;font-weight:400;margin-top:4px;text-decoration:none;color:#31404f}
body.admin-body .fam-add{margin-top:12px}
body.admin-body .fam-picker{margin-top:10px;padding:12px;border:1px solid #d9dee5;border-radius:8px;background:#f8fafb;max-width:720px}
body.admin-body .fam-picker label{font-weight:700;font-size:.85rem;display:block;margin-bottom:4px}
body.admin-body .fam-picker input[type=text]{width:100%;padding:9px 11px;border:1px solid #c5ced8;border-radius:6px;font:inherit;background:#fff}
body.admin-body .fam-results{margin-top:8px;display:grid;gap:6px}
body.admin-body .fam-result{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;background:#fff;border:1px solid #e1e5ea;border-radius:6px}
body.admin-body .fam-result-info{min-width:0}
body.admin-body .fam-hint{margin:2px 0;font-size:.82rem;color:#5d6b7a}
body.admin-body .fam-ok{color:#16663a}
body.admin-body .fam-confirm{margin-top:10px;padding:10px 12px;border:1px solid #e3c98a;background:#fdf6e3;border-radius:8px;font-size:.88rem;max-width:720px}
body.admin-body .fam-confirm p{margin:3px 0}
body.admin-body .fam-msg{font-weight:700}
body.admin-body .fam-confirm-actions{display:flex;gap:8px;margin-top:8px}
body.admin-body .fam-alert{margin:12px 0;padding:10px 14px;border:1px solid #e3a5a5;background:#fdecec;color:#8a1f1f;border-radius:8px;font-size:.88rem}
body.admin-body .fam-alert ul{margin:0;padding-left:18px}
body.admin-body .fam-check{display:flex;align-items:center;gap:8px;font-weight:600}
body.admin-body [data-marriage-fields].is-off{opacity:.5}
body.admin-body .fam-years{padding:8px 0;font-weight:700}
body.admin-body .fam-box{border:1px solid #e1e5ea;border-radius:8px;padding:10px 14px;background:#f8fafb}
body.admin-body .fam-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:8px;font-size:.8rem;color:#5d6b7a}
body.admin-body .fam-num{display:block;font-size:1.4rem;font-weight:800;color:#1b2a3a;line-height:1.2}
body.admin-body .fam-actions{position:sticky;bottom:0;display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:18px;padding:12px 0;background:linear-gradient(to top,#fff 70%,rgba(255,255,255,0))}
body.admin-body .fam-dirty{color:#8a5a12;font-size:.82rem;font-weight:700;margin-right:auto}
body.admin-body .fam-count{font-weight:400;opacity:.75}
@media (max-width:640px){
  body.admin-body .fam-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.admin-body .fam-table select{min-width:0;padding-left:6px;padding-right:2px}
  body.admin-body .fam-table th,body.admin-body .fam-table td{padding:8px 6px}
  body.admin-body .fam-table [data-members-body] td:nth-child(3),body.admin-body [data-members-table] thead th:nth-child(3),
  body.admin-body [data-children-table] thead th:nth-child(2),body.admin-body [data-children-body] td:nth-child(2){display:none}
  body.admin-body .fam-remove{white-space:normal;padding:4px 8px;font-size:.72rem;line-height:1.2}
  body.admin-body .fam-result{flex-direction:column;align-items:flex-start}
  body.admin-body .fam-actions{position:static;background:none}
}
.qv-foot { flex-wrap: wrap; }

/* ===== Round 99 — compact Children section (Member Add / Edit) ===== */
.kids-panel { padding: 18px 20px; }
.kids-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-body .kids-panel .kids-head h2 { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ad-muted, #64748b); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kids-count { background: var(--fog-50, #f6f8fa); border: 1px solid var(--ad-line-strong, #d5dbe3); border-radius: 999px; padding: 0 8px; font-size: .72rem; line-height: 20px; color: var(--navy-900, #1b2a41); letter-spacing: 0; }
.kids-sub { margin: 4px 0 0; font-size: .82rem; color: var(--ink-soft, #64748b); }
.kids-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kids-table-wrap { overflow-x: auto; }
.kids-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.kids-table th { text-align: left; font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft, #64748b); padding: 8px 10px; background: var(--fog-50, #f6f8fa); border-bottom: 1px solid var(--line, #e5e9ef); white-space: nowrap; }
.kids-table td { padding: 8px 10px; border-bottom: 1px solid var(--line, #e5e9ef); vertical-align: middle; }
.kids-table .kids-th-actions { text-align: right; }
.kid-name { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.kid-avatar { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--gold-100, #fbf1d6); color: var(--gold-600, #8a6a14); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; }
.kid-name-text { display: flex; flex-direction: column; min-width: 0; }
.kid-name-text strong { font-weight: 600; color: var(--navy-950, #0f1c30); }
.kid-sub, .kid-age { color: var(--ink-soft, #64748b); font-size: .74rem; }
.kid-row.is-pending { background: #fffdf5; }
.kid-edit { display: none; }
.kid-row.is-editing .kid-edit { display: block; }
.kid-row.is-editing .kid-view { display: none; }
.kid-row.is-editing .kid-name-edit { display: flex; gap: 6px; }
.kid-row .kid-edit { width: 100%; min-height: 30px; padding: 3px 8px; font-size: .82rem; border: 1px solid var(--ad-line-strong, #d5dbe3); border-radius: 6px; background: #fff; }
.kid-pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.kid-pill.is-active { background: #e3f5ec; color: var(--success, #1f8a5b); }
.kid-pill.is-inactive { background: #ececec; color: #666; }
.kids-table .kid-actions-cell { text-align: right; white-space: nowrap; }
.kid-icon { background: none; border: 1px solid transparent; border-radius: 6px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft, #64748b); cursor: pointer; }
.kid-icon:hover { background: var(--fog-50, #f6f8fa); border-color: var(--ad-line-strong, #d5dbe3); color: var(--navy-950, #0f1c30); }
.kid-icon-unlink:hover { color: var(--danger, #c0392b); }
.kids-empty { margin: 10px 0 4px; font-size: .84rem; color: var(--ink-soft, #64748b); }
.kids-quick { margin-top: 12px; padding: 12px; background: var(--fog-50, #f6f8fa); border: 1px dashed var(--ad-line-strong, #d5dbe3); border-radius: 10px; }
.kids-quick-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.kids-quick label, .kids-inline { font-size: .72rem; font-weight: 600; color: var(--ink-soft, #64748b); display: flex; flex-direction: column; gap: 3px; }
.kids-quick label b { color: var(--danger, #c0392b); }
.kids-quick input, .kids-quick select, .kids-linkbar input, .kids-linkbar select { min-height: 32px; padding: 4px 8px; font-size: .84rem; border: 1px solid var(--ad-line-strong, #d5dbe3); border-radius: 6px; background: #fff; width: 100%; font-weight: 400; }
.kids-add-btn { min-height: 32px; }
.kids-more { margin-top: 8px; font-size: .78rem; }
.kids-more summary { cursor: pointer; color: var(--ink-soft, #64748b); }
.kids-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
.kids-qerr { margin: 8px 0 0; color: var(--danger, #c0392b); font-size: .8rem; }
.kids-dup { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 12px; font-size: .82rem; color: #6b4e0a; }
.kids-dup[hidden], .kids-linkpanel[hidden], .kids-quick[hidden], .kids-qerr[hidden] { display: none; }
.kids-dup-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kids-dup-linked { font-size: .78rem; font-weight: 600; }
.kids-linkpanel { margin-bottom: 12px; border: 1px solid var(--ad-line-strong, #d5dbe3); border-radius: 10px; padding: 10px; background: #fff; }
.kids-linkbar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.kids-linkbar input[type=search] { flex: 1 1 260px; width: auto; }
.kids-linkbar .kids-inline { flex: 0 0 150px; }
.kids-results { margin-top: 8px; max-height: 240px; overflow: auto; }
.kid-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line, #e5e9ef); }
.kid-res-info { display: flex; flex-direction: column; min-width: 0; }
.kid-res-info small, .kid-res-empty { color: var(--ink-soft, #64748b); font-size: .76rem; }
.kid-res-empty { padding: 8px 4px; }
.kids-foot { margin: 12px 0 0; font-size: .76rem; color: var(--ink-soft, #64748b); line-height: 1.5; }
@media (max-width: 860px) {
  .kids-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kids-more-grid { grid-template-columns: 1fr; }
  .kids-table thead { display: none; }
  .kids-table, .kids-table tbody, .kids-table tr, .kids-table td { display: block; width: 100%; }
  .kids-table tr { border: 1px solid var(--line, #e5e9ef); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
  .kids-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
  .kids-table td::before { content: attr(data-label); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft, #64748b); flex: 0 0 96px; }
  .kids-table td:first-child::before, .kids-table td.kid-actions-cell::before { display: none; }
  .kid-row.is-editing .kid-edit { max-width: 60%; }
  .kid-row.is-editing .kid-name-edit { flex-direction: column; max-width: 100%; }
}

.kid-icon[hidden] { display: none; }
@media (max-width: 860px) { .kids-table td.kid-actions-cell { justify-content: flex-end; gap: 6px; } }

/* Round 99 — compact Last Friday Attendance line on the Church Administration Overview */
.att-metric { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding: 8px 14px; margin: 0 0 12px; background: #fff; border: 1px solid var(--line, #e5e9ef); border-radius: 10px; text-decoration: none; color: var(--ink-soft, #64748b); font-size: .82rem; }
.att-metric:hover { border-color: var(--gold-500, #d4a03a); }
.att-metric-title { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.att-metric-num { font-size: 1.15rem; color: var(--navy-950, #0f1c30); }
.att-metric strong { color: var(--navy-950, #0f1c30); }
.att-metric-delta { font-weight: 700; font-size: .78rem; padding: 1px 8px; border-radius: 999px; }
.att-metric-delta.is-up { background: #e3f5ec; color: var(--success, #1f8a5b); }
.att-metric-delta.is-down { background: #fbe9e6; color: var(--danger, #c0392b); }
.att-metric-date { margin-left: auto; font-size: .74rem; }

/* Round 101 — Event media tab (pictures with Cover/order/remove, YouTube or uploaded looping video) */
body.admin-body .evm [hidden]{display:none!important}
body.admin-body .evm .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
body.admin-body .evm-block{border:1px solid var(--ad-line);border-radius:10px;padding:10px 12px;margin-bottom:10px;background:#fff}
body.admin-body .evm-h{margin:0 0 8px;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--ad-muted);font-weight:700}
body.admin-body .evm-sub{font-weight:400;text-transform:none;letter-spacing:0;margin-left:6px;font-size:.76rem}
body.admin-body .evm-thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px}
body.admin-body .evm-thumbs:empty{display:none}
body.admin-body .evm-thumb{width:128px;border:2px solid var(--ad-line);border-radius:8px;padding:4px;background:#fafbfc;font-size:.74rem;position:relative}
body.admin-body .evm-thumb img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:5px}
body.admin-body .evm-thumb.is-cover{border-color:var(--gold-500,#c9a24b);box-shadow:0 0 0 2px rgba(201,162,75,.25)}
body.admin-body .evm-thumb.is-removed{opacity:.45}
body.admin-body .evm-thumb.is-removed img{filter:grayscale(1)}
body.admin-body .evm-cover{display:flex;align-items:center;gap:4px;margin:4px 0 2px;font-weight:600;cursor:pointer}
body.admin-body .evm-acts{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
body.admin-body .evm-acts button{border:1px solid var(--ad-line-strong);background:#fff;border-radius:5px;padding:1px 6px;cursor:pointer;line-height:1.4;font-size:.7rem}
body.admin-body .evm-acts button:hover{border-color:var(--navy-800,#1b3358)}
body.admin-body .evm-rm{display:flex;align-items:center;gap:4px;font-weight:400;font-size:.74rem;color:var(--ad-muted);cursor:pointer;margin-left:auto}
body.admin-body .evm-newname{word-break:break-all;color:var(--ad-muted);margin-top:2px}
body.admin-body .evm-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:4px 0}
body.admin-body .evm-pick{position:relative;overflow:hidden;cursor:pointer}
body.admin-body .evm-pick input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
body.admin-body .evm-video{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;margin:6px 0;padding:8px;border:1px solid var(--ad-line);border-radius:8px;background:#fafbfc}
body.admin-body .evm-video video{width:220px;max-width:100%;aspect-ratio:16/9;background:var(--navy-950, #0c2330);border-radius:6px;object-fit:contain}
body.admin-body .evm-video-meta{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:.82rem}
body.admin-body .evm-video-meta strong{word-break:break-all}
body.admin-body .evm-checks{display:flex;gap:18px;flex-wrap:wrap}
body.admin-body .evm-checks label{display:flex;align-items:center;gap:6px;font-weight:400}
body.admin-body .evm-chip{display:inline-block;font-size:.68rem;padding:0 7px;border-radius:99px;background:#eef2f6;color:var(--ad-muted)}
@media (max-width:640px){body.admin-body .evm-thumb{width:calc(50% - 6px)}body.admin-body .evm-video video{width:100%}}

/* Round 107 — user menu, "Users Online" pill, Active Sessions table, confirmation dialog */
body.admin-body .admin-online-pill{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:600;color:#14532d;background:#e8f6ec;border:1px solid #bfe3c8;border-radius:99px;padding:3px 11px;text-decoration:none;white-space:nowrap}
body.admin-body .admin-online-pill .dot{width:8px;height:8px;border-radius:50%;background:#1f9d4c;display:inline-block}
body.admin-body .admin-online-pill:hover{background:#d9f0e0}
body.admin-body .admin-usermenu{position:relative}
body.admin-body .admin-usermenu>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:3px 8px 3px 4px;border:1px solid var(--ad-line);border-radius:99px;background:#fff;text-align:left}
body.admin-body .admin-usermenu>summary::-webkit-details-marker{display:none}
body.admin-body .admin-usermenu>summary:hover,body.admin-body .admin-usermenu[open]>summary{border-color:var(--ad-line-strong,#c9d0db);background:var(--fog-50,#f6f8fb)}
body.admin-body .admin-user-avatar{width:28px;height:28px;border-radius:50%;background:var(--navy-950,#0b1d3a);color:var(--gold-400,#e0b963);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.82rem;flex:none}
body.admin-body .admin-user-text{display:flex;flex-direction:column;line-height:1.2;min-width:0}
body.admin-body .admin-user-name{font-size:.8rem;font-weight:600;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.admin-body .admin-user-text .role{font-size:.7rem;color:var(--ink-soft)}
body.admin-body .admin-user-caret{font-size:.7rem;color:var(--ink-soft)}
body.admin-body .admin-usermenu-panel{position:absolute;right:0;top:calc(100% + 6px);min-width:210px;background:#fff;border:1px solid var(--ad-line);border-radius:10px;box-shadow:0 10px 30px rgba(11,29,58,.16);padding:6px;z-index:60}
body.admin-body .admin-usermenu-head{padding:8px 10px 8px;border-bottom:1px solid var(--ad-line);margin-bottom:4px;display:flex;flex-direction:column;font-size:.82rem}
body.admin-body .admin-usermenu-head span{font-size:.72rem;color:var(--ink-soft)}
body.admin-body .admin-usermenu-panel a,body.admin-body .admin-usermenu-logout button{display:block;width:100%;text-align:left;padding:8px 10px;border-radius:6px;font-size:.84rem;color:var(--navy-950,#0b1d3a);text-decoration:none;background:none;border:0;cursor:pointer;font-family:inherit}
body.admin-body .admin-usermenu-panel a:hover,body.admin-body .admin-usermenu-logout button:hover{background:var(--fog-50,#f6f8fb)}
body.admin-body .admin-usermenu-logout{margin:4px 0 0;border-top:1px solid var(--ad-line);padding-top:4px}
body.admin-body .admin-usermenu-logout button{color:#a12a2a;font-weight:600}

body.admin-body .cs-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px}
body.admin-body .cs-count{display:inline-flex;align-items:center;gap:7px;font-weight:700;font-size:.92rem;color:var(--navy-950,#0b1d3a)}
body.admin-body .cs-count .dot{width:9px;height:9px;border-radius:50%;background:#1f9d4c}
body.admin-body .cs-filters{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;margin:0 0 12px}
body.admin-body .cs-filters .field{margin:0}
body.admin-body .cs-filters label{font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-soft);display:block;margin-bottom:2px}
body.admin-body .cs-filters input,body.admin-body .cs-filters select{padding:6px 9px;font-size:.84rem;min-width:150px}
body.admin-body .cs-table td,body.admin-body .cs-table th{padding:8px 12px;font-size:.82rem;white-space:nowrap}
body.admin-body .cs-table td.cs-wrap{white-space:normal}
body.admin-body .cs-table .cs-sub{display:block;font-size:.72rem;color:var(--ink-soft)}
body.admin-body .cs-status{display:inline-flex;align-items:center;gap:5px;font-weight:600;font-size:.76rem;padding:1px 9px;border-radius:99px}
body.admin-body .cs-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
body.admin-body .cs-status.s-online{background:#e8f6ec;color:#14732f}
body.admin-body .cs-status.s-idle{background:#fff4dc;color:#8a5a00}
body.admin-body .cs-status.s-logged-out,body.admin-body .cs-status.s-expired{background:#eef1f5;color:#566174}
body.admin-body .cs-status.s-revoked{background:#fde8e8;color:#a12a2a}
body.admin-body .cs-this{font-size:.68rem;font-weight:700;background:var(--gold-500,#c9a24b);color:var(--navy-950,#0b1d3a);border-radius:99px;padding:0 7px;margin-left:5px;vertical-align:middle}
body.admin-body .cs-actions{display:flex;gap:6px;flex-wrap:wrap}
body.admin-body .cs-actions form{margin:0}
body.admin-body .btn-danger-soft{background:#fff;color:#a12a2a;border:1px solid #e3b4b4}
body.admin-body .btn-danger-soft:hover{background:#fde8e8}
body.admin-body dialog.cs-dialog{border:0;border-radius:12px;padding:0;max-width:440px;width:calc(100% - 28px);box-shadow:0 20px 60px rgba(11,29,58,.35)}
body.admin-body dialog.cs-dialog::backdrop{background:rgba(11,29,58,.5)}
body.admin-body .cs-dialog-body{padding:20px 22px 8px}
body.admin-body .cs-dialog h3{margin:0 0 8px;font-size:1.1rem}
body.admin-body .cs-dialog dl{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;margin:10px 0;font-size:.85rem}
body.admin-body .cs-dialog dt{color:var(--ink-soft)}
body.admin-body .cs-dialog dd{margin:0;font-weight:600;word-break:break-word}
body.admin-body .cs-dialog .cs-warn{background:#fff4dc;border:1px solid #f0d99b;border-radius:8px;padding:8px 10px;font-size:.82rem;color:#6b4700}
body.admin-body .cs-dialog-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 22px 18px}
body.admin-body .cs-banner{position:fixed;left:50%;transform:translateX(-50%);top:14px;z-index:200;background:#a12a2a;color:#fff;padding:10px 18px;border-radius:10px;font-size:.88rem;box-shadow:0 10px 30px rgba(0,0,0,.3)}
body.admin-body .cs-conflict{border:2px solid #e0b963;background:#fffaf0;border-radius:10px;padding:14px 16px;margin:0 0 16px}
body.admin-body .cs-conflict h3{margin:0 0 6px}
@media (max-width:640px){
  body.admin-body .admin-user-text{display:none}
  body.admin-body .admin-usermenu>summary{padding:3px 8px 3px 3px}
  body.admin-body .cs-filters input,body.admin-body .cs-filters select{min-width:0;width:100%}
  body.admin-body .cs-filters .field{flex:1 1 140px}
}
@media (max-width:640px){
  body.admin-body .cs-table thead{display:none}
  body.admin-body .cs-table,body.admin-body .cs-table tbody,body.admin-body .cs-table tr,body.admin-body .cs-table td{display:block;width:100%}
  body.admin-body .cs-table tr{padding:10px 12px;border-bottom:1px solid var(--ad-line)}
  body.admin-body .cs-table td{padding:3px 0;border:0;white-space:normal;position:static!important;background:none!important;display:flex;gap:10px;justify-content:space-between;text-align:right}
  body.admin-body .cs-table td::before{content:attr(data-label);font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;color:var(--ink-soft);text-align:left;flex:none;padding-top:2px}
  body.admin-body .cs-table td[data-label=""]::before,body.admin-body .cs-table td[data-label="Actions"]::before{display:none}
  body.admin-body .cs-table td .cs-sub{display:block}
  body.admin-body .cs-table td.cs-wrap>*{text-align:right}
  body.admin-body .cs-table td:last-child{justify-content:flex-end}
}

/* ============ Round 108 — Classes & Training ============ */
.cl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.cl-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow-sm); }
a.cl-kpi:hover { border-color: var(--gold-500); }
.cl-kpi .num { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; color: var(--navy-950); }
.cl-kpi .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.cl-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.cl-head h1 { margin: 0; font-size: 1.35rem; }
.cl-head .cl-sub { color: var(--ink-soft); font-size: .85rem; margin-top: 2px; }
.cl-head .cl-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cl-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; margin: 0 0 14px; }
.cl-panel > h2, .cl-panel > h3 { margin: 0 0 8px; font-size: 1rem; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.cl-grid .field { margin: 0; }
.cl-grid .span2 { grid-column: span 2; }
.cl-grid .full { grid-column: 1 / -1; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin: 0 0 12px; }
.cl-filters .field { margin: 0; min-width: 140px; }
.cl-filters .field input, .cl-filters .field select { padding: 7px 10px; }
.cl-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cl-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cl-table td { padding: 7px 8px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.cl-table tr:hover td { background: #fafbfd; }
.cl-table .num { text-align: right; white-space: nowrap; }
.cl-scroll { overflow-x: auto; }
.cl-badge { background: #ececec; color: #555; }
.cl-badge--active, .cl-badge--enrolled, .cl-badge--present, .cl-badge--passed, .cl-badge--eligible, .cl-badge--open { background: #e3f5ec; color: var(--success); }
.cl-badge--ongoing, .cl-badge--scheduled, .cl-badge--late, .cl-badge--submitted { background: #e6eefb; color: #2f5fa8; }
.cl-badge--pending, .cl-badge--waiting, .cl-badge--on_hold, .cl-badge--excused, .cl-badge--draft, .cl-badge--needs_retry, .cl-badge--not_eligible { background: var(--gold-100); color: var(--gold-600); }
.cl-badge--cancelled, .cl-badge--withdrawn, .cl-badge--absent, .cl-badge--failed { background: #fbe9e6; color: var(--danger); }
.cl-badge--completed, .cl-badge--archived, .cl-badge--transferred, .cl-badge--inactive { background: #eef0f4; color: #666; }
.cl-lessons { list-style: none; margin: 0; padding: 0; }
.cl-lessons li { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; background: #fff; }
.cl-lessons .cl-ln { font-weight: 700; color: var(--navy-950); min-width: 26px; }
.cl-lessons .cl-lbody { flex: 1; min-width: 0; }
.cl-lessons .cl-lbody small { display: block; color: var(--ink-soft); }
.cl-mini { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cl-mini form { display: inline; margin: 0; }
.btn.btn-xs { padding: 3px 9px; font-size: .74rem; }
.cl-picker { position: relative; }
.cl-picker-results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); max-height: 260px; overflow: auto; }
.cl-picker-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; cursor: pointer; font: inherit; }
.cl-picker-item:hover, .cl-picker-item:focus { background: #f4f6fa; }
.cl-picker-item small { display: block; color: var(--ink-soft); font-size: .74rem; }
.cl-picker-empty { padding: 10px 12px; color: var(--ink-soft); font-size: .85rem; }
.cl-picker-chosen { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; font-size: .88rem; }
.cl-picker-chosen span { color: var(--ink-soft); font-size: .78rem; }
.cl-picker-x { margin-left: 8px; background: none; border: 0; color: var(--navy-700, #2f5fa8); cursor: pointer; text-decoration: underline; font-size: .78rem; }
.cl-progressbar { height: 7px; background: #e6e9ef; border-radius: 6px; overflow: hidden; min-width: 70px; }
.cl-progressbar > i { display: block; height: 100%; background: var(--gold-500, #c9a24b); }
.cl-two { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cl-two { grid-template-columns: 1fr; } .cl-grid .span2 { grid-column: auto; } }
.cl-att-sel { padding: 4px 6px; font-size: .84rem; }
.cl-today { list-style: none; margin: 0; padding: 0; }
.cl-today li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #eef0f4; }
.cl-today li > a { font-weight: 600; }
.cl-empty { color: var(--ink-soft); font-size: .88rem; padding: 6px 0; }
.cl-note { background: #fff8e6; border: 1px solid #f0dca6; border-radius: 8px; padding: 8px 12px; font-size: .84rem; margin: 0 0 12px; }
.cl-sheet-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.cl-sheet-top .grow { flex: 1; }
.cl-cert { max-width: 920px; margin: 20px auto; border: 6px double #c9a24b; padding: 50px 40px; text-align: center; background: #fff; }
@media print { .cl-cert { margin: 0; border-width: 6px; } .admin-sidebar, .admin-topbar, .admin-backbar, .no-print { display: none !important; } }
[data-cl-type][hidden], [data-cl-mat][hidden], .cl-picker [hidden] { display: none !important; }

/* Round 109 — Members-first enrollment: Declined badge, picker flag, bulk list */
.cl-badge--declined { background: #fbe9e6; color: var(--danger); }
.cl-picker-item.is-enrolled { opacity: .6; cursor: not-allowed; }
.cl-picker-flag { display: inline-block; margin-left: 8px; font-style: normal; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--gold-100); color: var(--gold-600); }
.cl-bulk-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.cl-bulk-row:first-child { border-top: 0; }
.cl-bulk-row input { flex: none; }
.cl-bulk-row.is-enrolled { opacity: .6; cursor: not-allowed; }
.cl-bulk-row small { color: var(--ink-soft); }

/* Round 112 — contextual Help links and Help Center */
.cl-help-link { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; margin-left: 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); text-decoration: none; vertical-align: middle; background: #fff; }
.cl-help-link:hover { color: var(--navy, #0b1d3a); border-color: var(--navy, #0b1d3a); }
.cl-help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cl-help-toc a { font-size: .8rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; }
.cl-help-sec { scroll-margin-top: 70px; }
.cl-help-sec h2 { font-size: 1.05rem; }
.cl-help-sec h3 { font-size: .92rem; margin: 12px 0 4px; }
.cl-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 8px 0 12px; }
.cl-flow .step { background: #eef3fb; border: 1px solid #cfdcf2; border-radius: 8px; padding: 5px 10px; font-size: .8rem; font-weight: 600; color: #0b1d3a; }
.cl-flow .arr { color: #8a94a6; font-weight: 700; }
.cl-callout { background: #f1f8f1; border: 1px solid #c8e2c8; border-radius: 8px; padding: 8px 12px; font-size: .86rem; margin: 8px 0; }

/* Round 113 — shared CMS Help system (includes/help-core.php): search, contents list, guide chips, help-center cards, breadcrumb help link */
.admin-topbar-actions .crumb-help { margin-left: 0; margin-right: 6px; }
.hlp-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.hlp-search input[type=search] { flex: 1 1 260px; max-width: 520px; }
.hlp-guides { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: .78rem; color: var(--ink-soft); }
.hlp-guides a { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; }
.hlp-guides a:hover, .hlp-guides a.is-active { border-color: var(--navy, #0b1d3a); color: var(--navy, #0b1d3a); font-weight: 600; }
.hlp-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.hlp-toc { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 90px); overflow-y: auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); }
.hlp-toc a { font-size: .8rem; padding: 4px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.hlp-toc a:hover { background: #eef3fb; color: var(--navy, #0b1d3a); }
.hlp-toc a[hidden], .hlp-toc-topic[hidden] { display: none; }
.hlp-toc-topic { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 8px 8px 2px; font-weight: 700; }
.hlp-body { min-width: 0; }
.hlp-topic { font-size: 1.1rem; margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--gold, #b8902f); scroll-margin-top: 70px; }
.hlp-topic:first-child { margin-top: 0; }
.hlp-body .cl-help-sec[hidden] { display: none; }
.hlp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.hlp-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); text-decoration: none; color: var(--ink); }
.hlp-card:hover { border-color: var(--navy, #0b1d3a); box-shadow: 0 2px 8px rgba(11, 29, 58, .08); }
.hlp-card span { font-size: .82rem; color: var(--ink-soft); }
.hlp-results { list-style: none; margin: 0; padding: 0; }
.hlp-results li { padding: 9px 0; border-bottom: 1px solid #eef0f4; font-size: .88rem; }
.hlp-results li:last-child { border-bottom: 0; }
.hlp-where { font-size: .7rem; padding: 1px 8px; border-radius: 999px; background: #eef3fb; color: #0b1d3a; margin-left: 6px; }
.hlp-results div { color: var(--ink-soft); font-size: .82rem; margin-top: 2px; }
@media (max-width: 860px) {
  .hlp-layout { grid-template-columns: 1fr; }
  .hlp-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; max-height: none; padding: 8px; }
  .hlp-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
  .hlp-toc-topic { flex-basis: 100%; padding: 4px 2px 0; }
}
.hlp-body table { display: block; max-width: 100%; overflow-x: auto; }
.hlp-body, .hlp-topic { min-width: 0; }

/* Round 114 — safe delete / cancel / archive */
.ce-acts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ce-acts .ce-act { font-size: .82rem; text-decoration: none; color: var(--navy, #0b1d3a); white-space: nowrap; }
.ce-acts .ce-act:hover { text-decoration: underline; }
.ce-acts .btn.ce-act { padding: 4px 10px; text-decoration: none; }
.ce-summary { margin-bottom: 14px; font-size: .9rem; }
.hlp-note { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--gold, #c9a24a); background: #fbf7ea; border-radius: 0 8px 8px 0; font-size: .9rem; }

/* Round 115 — “Switch To” block in the CMS profile menu (same markup as the Members Portal menu) */
body.admin-body .admin-usermenu-panel { min-width: 232px; }
body.admin-body .admin-usermenu-panel .as-switch { padding: 0 0 6px; margin: 0 0 4px; border-bottom: 1px solid var(--ad-line); }
body.admin-body .admin-usermenu-panel .as-switch-title { font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); padding: 4px 10px 4px; }
body.admin-body .admin-usermenu-panel .as-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; font-size: .84rem; color: var(--navy-950, #0b1d3a); text-decoration: none; min-height: 36px; box-sizing: border-box; }
body.admin-body .admin-usermenu-panel a.as-item:hover { background: var(--fog-50, #f6f8fb); }
body.admin-body .admin-usermenu-panel .as-item.is-current { background: var(--fog-50, #f6f8fb); font-weight: 600; cursor: default; }
body.admin-body .admin-usermenu-panel .as-cur { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; color: var(--ink-soft); }
body.admin-body .admin-usermenu-panel .as-cur .as-ico { width: 12px; height: 12px; color: #1b7f4b; }
body.admin-body .admin-usermenu-panel .as-go { margin-left: auto; display: inline-flex; color: var(--ink-soft); }
body.admin-body .admin-usermenu-panel .as-go .as-ico { width: 14px; height: 14px; }
@media (max-width: 720px) {
  body.admin-body .admin-usermenu-panel { min-width: min(260px, calc(100vw - 24px)); }
  body.admin-body .admin-usermenu-panel .as-item, body.admin-body .admin-usermenu-panel > a, body.admin-body .admin-usermenu-logout button { min-height: 44px; }
}
body.admin-body .admin-usermenu-panel .as-label { white-space: nowrap; }

/* ===== Round 116: Budget check / over-budget approval ===== */
.bc-wrap { margin-top: 20px; }
.bc-panel { border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: 12px 14px; background: var(--fog-50, #f7f9fb); }
.bc-panel.is-over { border-color: #d98b2b; background: #fff8ec; }
.bc-head { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-soft, #5b6b7a); margin-bottom: 8px; }
.bc-fy { font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.bc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.bc-grid > div { background: #fff; border: 1px solid var(--line, #e3e8ee); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.bc-k { display: block; font-size: .72rem; color: var(--ink-soft, #5b6b7a); }
.bc-v { display: block; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-v.is-neg, .is-neg { color: #b3261e; }
.bc-over-cell { border-color: #e7b5b0 !important; }
.bc-warn { margin: 10px 0 0; color: #8a4b00; font-size: .92rem; }
.bc-ok { margin: 10px 0 0; color: #1d6b3a; font-size: .9rem; }
.bc-note { margin: 6px 0 0; font-size: .86rem; color: var(--ink-soft, #5b6b7a); }
.bc-detail { margin-top: 10px; font-size: .86rem; }
.bc-detail summary { cursor: pointer; font-weight: 600; }
.bc-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.bc-table th, .bc-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line, #e3e8ee); font-variant-numeric: tabular-nums; }
.bc-table tr.is-over td { color: #b3261e; }
.bc-reason { margin-top: 12px; }
.bc-reason textarea { width: 100%; box-sizing: border-box; }
.bc-star { color: #b3261e; }
.bc-reason-err { color: #b3261e; font-size: .86rem; }
.bc-chip { display: inline-block; font-size: .78rem; font-weight: 700; border: 1px solid #d98b2b; background: #fff8ec; color: #8a4b00; border-radius: 999px; padding: 3px 10px; }
.bc-requests { margin-top: 18px; border-top: 1px solid var(--line, #e3e8ee); padding-top: 14px; }
.bc-req { border: 1px solid var(--line, #e3e8ee); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.bc-req-superseded, .bc-req-cancelled { opacity: .72; }
.bc-grid-sm .bc-v { font-size: .9rem; }
.bc-state { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; border: 1px solid #c9d1da; }
.bc-state-pending { background: #fff8ec; border-color: #d98b2b; color: #8a4b00; }
.bc-state-approved { background: #eaf7ee; border-color: #6ab47f; color: #1d6b3a; }
.bc-state-rejected { background: #fdecea; border-color: #e08b84; color: #b3261e; }
.bc-meta { margin: 8px 0 0; }
.bc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.bc-actions form, .bc-inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.bc-actions input[type=text], .bc-inline input[type=text] { min-width: 180px; }
.bc-act-cell { min-width: 240px; }
.bc-blocked { color: #8a4b00; }
.bc-filter { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.bc-filter-chip { padding: 6px 14px; border: 1px solid var(--line, #d0d7de); border-radius: 999px; text-decoration: none; color: inherit; font-size: .9rem; }
.bc-filter-chip.is-on { background: var(--primary, #1f4e79); color: #fff; border-color: transparent; }
.bc-cfg input[type=text], .bc-cfg input[type=number], .bc-cfg select { width: 100%; box-sizing: border-box; }
@media (max-width: 900px) { .bc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .bc-grid { grid-template-columns: 1fr 1fr; } .bc-v { white-space: normal; } }

/* ===== Round 131 — Courses → Batches → Members: compact modern admin ===== */
.cl-head--compact h1 { font-size: 1.2rem; }
.cl-head--compact { margin-bottom: 6px; }
.cl-kpis--compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cl-kpis--compact .cl-kpi { padding: 8px 10px; box-shadow: none; }
.cl-kpis--compact .cl-kpi .num { font-size: 1.25rem; }
.cl-kpis--compact .cl-kpi .lbl { font-size: .66rem; }
.cl-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.cl-toolbar input[type=search], .cl-toolbar select { padding: 6px 9px; font-size: .88rem; max-width: 100%; }
.cl-toolbar input[type=search] { min-width: 200px; flex: 1 1 200px; }
.cl-table--compact th, .cl-table--compact td { padding: 6px 8px; font-size: .88rem; }
.cl-rowlink { color: inherit; text-decoration: none; }
.cl-rowlink:hover strong { text-decoration: underline; }
.cl-bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: var(--paper, #faf8f3); border: 1px solid var(--line); border-radius: var(--radius-md); margin: 0 0 8px; }
.cl-bulkbar select, .cl-bulkbar input[type=text] { padding: 5px 8px; font-size: .85rem; }
.cl-actionlist { list-style: none; margin: 0; padding: 0; }
.cl-actionlist li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.cl-actionlist li:last-child { border-bottom: 0; }
.cl-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; background: var(--paper, #f3efe6); border: 1px solid var(--line); color: var(--ink-soft); }
@media (max-width: 720px) { .cl-toolbar input[type=search] { min-width: 0; flex-basis: 100%; } .cl-table--compact { font-size: .82rem; } }

/* ---- Round 133: ministry editor tabs (overview, updates, events, gallery, page settings) ---- */
.mpg-pill { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger, #c0392b); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }
.mpg-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 18px; }
@media (min-width: 720px) { .mpg-kpis { grid-template-columns: repeat(6, 1fr); } }
.mpg-kpi { background: var(--fog-50); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; text-decoration: none; color: inherit; display: block; }
.mpg-kpi b { display: block; font-size: 1.4rem; line-height: 1.1; color: var(--navy-900, #123247); }
.mpg-kpi span { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.mpg-kpi.is-alert { border-color: var(--gold-500, #cf9d3f); background: #fff8e6; }
.mpg-two { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .mpg-two { grid-template-columns: 1fr 1fr; } }
.mpg-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.mpg-check li { display: flex; gap: 8px; align-items: baseline; }
.mpg-check .ok { color: var(--success, #1d7a46); } .mpg-check .todo { color: var(--ink-soft); }
.mpg-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.mpg-toolbar input[type=search] { flex: 1; min-width: 160px; max-width: 320px; }
.mpg-rows { width: 100%; border-collapse: collapse; font-size: .86rem; }
.mpg-rows th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mpg-rows td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mpg-rows tr[hidden] { display: none; }
.mpg-rows .t { font-weight: 600; }
.mpg-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mpg-actions form { display: inline; margin: 0; }
.mpg-btn-s { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 9px; font-size: .76rem; cursor: pointer; color: var(--navy-800); text-decoration: none; display: inline-block; }
.mpg-btn-s:hover { background: var(--fog-50); }
.mpg-btn-s.good { border-color: #9fd4b3; color: #1d6b3a; }
.mpg-btn-s.danger { border-color: #e6b3ae; color: var(--danger, #c0392b); }
.mpg-st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: #e9edf0; color: #55636d; }
.mpg-st.published, .mpg-st.upcoming, .mpg-st.ongoing { background: #dcf3e3; color: #1d6b3a; }
.mpg-st.pending { background: #fff0cc; color: #7a5410; }
.mpg-st.cancelled { background: #fde2e2; color: #8a1f1f; }
.mpg-st.pin { background: #fbf0d4; color: #7a5410; }
.mpg-gal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .mpg-gal { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .mpg-gal { grid-template-columns: repeat(6, 1fr); } }
.mpg-gcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.mpg-gcard.dragging { opacity: .4; } .mpg-gcard.over { outline: 2px dashed var(--gold-500, #cf9d3f); }
.mpg-gcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--fog-50); cursor: grab; }
.mpg-gcard .sel { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; }
.mpg-gcard .star { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(255,255,255,.9); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; line-height: 1; }
.mpg-gcard .star.on { color: var(--gold-500, #cf9d3f); }
.mpg-gcard .cap { padding: 6px 8px; font-size: .78rem; display: grid; gap: 3px; flex: 1; }
.mpg-gcard .acts { display: flex; gap: 4px; padding: 0 8px 8px; flex-wrap: wrap; }
.mpg-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; background: var(--fog-50); font-size: .88rem; }
.mpg-drop.over { border-color: var(--gold-500, #cf9d3f); background: #fff8e6; }
.mpg-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mpg-order li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.mpg-order li.dragging { opacity: .4; }
.mpg-order .grip { cursor: grab; color: var(--ink-soft); user-select: none; }
.mpg-order .ud { margin-left: auto; display: flex; gap: 4px; }
.mpg-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.mpg-sec h3 { margin: 0 0 10px; font-size: .95rem; }

/* Round 134 — ministry activities editor rows */
.mpg-act-rows { display: grid; gap: 10px; margin-bottom: 8px; }
.mpg-act-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mpg-act-thumb { flex: 0 0 96px; width: 96px; height: 64px; border-radius: 8px; background: var(--fog-50); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.mpg-act-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mpg-act-fields { flex: 1; display: grid; gap: 6px; min-width: 0; }
.mpg-act-fields input[type="text"] { width: 100%; }
@media (max-width: 560px) { .mpg-act-row { flex-direction: column; } .mpg-act-thumb { width: 100%; flex-basis: auto; height: 90px; } }

/* ---- Round 136: Become a Member editor, Membership Requests, preview ---- */
.mbr-crumb { font-size: .8rem; color: var(--ink-soft); letter-spacing: .02em; }
.mbr-pill { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #ececec; color: #555; }
.mbr-pill-draft { background: var(--gold-100); color: var(--gold-600); }
.mbr-pill-live { background: #e3f5ec; color: var(--success); }
.mbr-check { display: flex; align-items: center; gap: 8px; font-weight: normal; margin: 6px 0; }
.mbr-steps-edit { display: grid; gap: 8px; margin: 12px 0; }
.mbr-step-row { display: flex; align-items: center; gap: 8px; background: var(--fog-50, #f6f7f9); border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 6px 8px; }
.mbr-step-row.is-dragging { opacity: .45; }
.mbr-step-row input[type=text] { flex: 1; min-width: 0; }
.mbr-grip { cursor: grab; color: var(--ink-soft); user-select: none; padding: 0 4px; }
.mbr-num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--navy-900, #10243f); color: var(--gold-400, #e7c36a); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.mbr-del { color: var(--danger, #b3261e); }
.mbr-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; bottom: 0; z-index: 5; }
.mbr-route { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; }
.mbr-seo-img { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.badge-mbr-new { background: var(--gold-100); color: var(--gold-600); }
.badge-mbr-contacted { background: #e6eefb; color: #2f5fa8; }
.badge-mbr-class { background: #efe6fb; color: #6b3fa8; }
.badge-mbr-in_process { background: #fdeede; color: #a85d1a; }
.badge-mbr-completed { background: #e3f5ec; color: var(--success); }
.badge-mbr-closed { background: #ececec; color: #666; }
.mbr-detail { display: grid; gap: 16px; max-width: 820px; }
.mbr-match-head { margin-bottom: 8px; }
.mbr-match { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid var(--gold-300, #e6cf8f); background: var(--gold-50, #fffaf0); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.mbr-find { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line, #e3e6ea); }
.mbr-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mbr-history li { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; font-size: .9rem; }
.mbr-history .when, .mbr-history .who { color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 640px) { .mbr-history li { grid-template-columns: 1fr; gap: 2px; } }
.mbr-pv-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.mbr-pv { display: flex; gap: 20px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.mbr-pv iframe { width: 100%; height: 78vh; border: 1px solid var(--line, #d5d9de); border-radius: 12px; background: #fff; }
.mbr-pv-desktop { flex: 1 1 640px; min-width: 0; }
.mbr-pv-mobile { flex: 0 0 390px; max-width: 100%; }
.mbr-pv-cap { font-size: .78rem; color: var(--ink-soft); margin-bottom: 4px; text-align: center; }
.mbr-pv[data-mode=desktop] .mbr-pv-mobile, .mbr-pv[data-mode=mobile] .mbr-pv-desktop { display: none; }
.mbr-pv[data-mode=mobile] .mbr-pv-mobile { flex-basis: 390px; }

/* =====================================================================================================================
   Round 137 — Church Administration Overview on tablets and phones.
   The cards used to be squeezed, not reflowed: an older rule kept the three groups (Membership · Families · Upcoming) side by
   side, and an older rule kept Membership at FOUR columns even on a phone, so each card was ~56 px wide and its title broke
   letter by letter. These rules come last on purpose and REFLOW instead of shrinking:
     desktop (> 1280px)   unchanged  — Membership 4 across next to Families 2; Upcoming 3 below
     tablet  (601-1280px) groups stack full width; ≤ 1100px Membership is 2 columns; ≤ 900px every group is 2 columns
     phone   (≤ 600px)    Membership and Families: 2 columns of stacked cards (title above, big number below);
                          Upcoming: one full-width row per item (title left, number right)
     tiny    (≤ 340px)    one column, every card a row
   ===================================================================================================================== */
body.admin-body .kpi-card .kpi-label { overflow-wrap: normal; word-break: normal; white-space: normal; hyphens: manual; padding-right: 0; }

@media (max-width: 1280px) {   /* side by side only when there is room for four readable cards beside Families */
  body.admin-body .kpi-groups { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  body.admin-body .kpi-groups > .kpi-group { flex: 1 1 100%; width: 100%; }
}
@media (max-width: 1100px) {
  body.admin-body .kpi-groups > .kpi-group:first-child > .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
}
@media (max-width: 900px) {
  body.admin-body .kpi-groups > .kpi-group:nth-child(n) > .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
}
@media (max-width: 600px) {
  body.admin-body .admin-content h2.kpi-heading { margin: 14px 0 8px; font-size: .74rem; }
  /* stacked card: title on top, number below — both get the whole card width */
  body.admin-body .kpi-groups .kpi-card {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "num" "sub";
    align-content: center; row-gap: 4px; min-height: 84px; padding: 14px; border-radius: 14px;
  }
  body.admin-body .kpi-groups .kpi-card .kpi-label { font-size: .84rem; line-height: 1.3; font-weight: 600; }
  body.admin-body .kpi-groups .kpi-card .kpi-num { font-size: 1.7rem; line-height: 1.1; text-align: left; }
  body.admin-body .kpi-groups .kpi-card .kpi-sub { font-size: .76rem; }
  /* Upcoming: one compact row per item — title left, number right */
  body.admin-body .kpi-groups > .kpi-group:nth-child(3) > .kpi-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
  body.admin-body .kpi-groups > .kpi-group:nth-child(3) .kpi-card {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label num" "sub sub"; align-items: center; column-gap: 12px; min-height: 60px; padding: 12px 14px;
  }
  body.admin-body .kpi-groups > .kpi-group:nth-child(3) .kpi-card .kpi-num { text-align: right; font-size: 1.5rem; }
  body.admin-body .kpi-foot { font-size: .8rem; margin: 10px 2px 4px; line-height: 1.45; }
  /* header buttons wrap onto a second row instead of overflowing */
  body.admin-body .admin-topbar-actions { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
}
@media (max-width: 768px) {   /* the floating Quick Access button sits at bottom-right, clear of the cards and of the last lines of the page */
  body.admin-body.page-church-dashboard .as-fab-root { --as-fab-bottom: 20px; right: calc(16px + env(safe-area-inset-right, 0px)); }
  body.admin-body.page-church-dashboard .admin-content { padding-bottom: 96px; }
}
@media (max-width: 340px) {
  body.admin-body .kpi-groups > .kpi-group:nth-child(n) > .kpi-grid { grid-template-columns: minmax(0, 1fr) !important; }
  body.admin-body .kpi-groups .kpi-card {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label num" "sub sub"; align-items: center; column-gap: 12px; min-height: 60px;
  }
  body.admin-body .kpi-groups .kpi-card .kpi-num { text-align: right; }
}

/* Round 142 — shared Search + Clear toolbar (includes/list-search.php)
   One compact control: [ search field ][Search][Clear]. The field is capped (never stretches across the page), the
   "Search" label is kept for screen readers only (the placeholder tells sighted users what is searched), and every
   control in the row — field, buttons, selects, dates — shares one height so everything lines up. */
.ls-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px; margin-bottom: 8px; }
.ls-search { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; }
.ls-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ls-input-wrap { position: relative; flex: 0 1 420px; width: 420px; max-width: 100%; min-width: 180px; }
.admin-body .ls-input, .ls-input { display: block; width: 100%; box-sizing: border-box; height: var(--ad-ctl, 36px); min-height: var(--ad-ctl, 36px); padding: 0 30px 0 11px; font-size: .86rem; line-height: 1.2; border: 1px solid var(--ad-line-strong, #c9d1dc); border-radius: var(--radius-sm, 6px); background: #fff; color: var(--ad-ink, #1d2733); text-overflow: ellipsis; }
.ls-input:focus { border-color: var(--gold-500, #c9a227); box-shadow: 0 0 0 3px var(--ad-focus, rgba(201,162,39,.3)); outline: none; }
.ls-x { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 50%; color: var(--ad-muted, #667); text-decoration: none; font-size: 1.1rem; }
.ls-x:hover, .ls-x:focus-visible { background: var(--fog-100, #e9edf2); color: var(--navy-900, #123); outline: 2px solid var(--gold-500, #c9a227); }
.ls-input::-webkit-search-cancel-button { display: none; }
.ls-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.ls-actions .btn, .admin-body .ls-actions .btn { height: var(--ad-ctl, 36px); min-height: var(--ad-ctl, 36px); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.ls-actions .btn:focus-visible, .ls-reset:focus-visible { outline: 2px solid var(--gold-500, #c9a227); outline-offset: 2px; }
/* extra filters (selects, dates) sit in the same row; their labels sit above, so the row is bottom-aligned */
.ls-extra { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.ls-extra .field { margin: 0; min-width: 130px; }
/* three or more extra filters: they get their own tidy row under the search */
.ls-extra:has(.field:nth-child(3)) { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px 12px; align-items: end; }
.ls-extra:has(.field:nth-child(3)) .field { min-width: 0; width: auto; }
.ls-extra:has(.field:nth-child(3)) .field select, .ls-extra:has(.field:nth-child(3)) .field input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.ls-extra:has(.field:nth-child(3)) > :not(.field) { align-self: end; }
.ls-extra .field select, .ls-extra .field input { height: var(--ad-ctl, 36px); min-height: var(--ad-ctl, 36px); box-sizing: border-box; }
.ls-reset { font-size: .84rem; align-self: center; color: var(--navy-700, #1f3a5f); text-decoration: underline; white-space: nowrap; }
.ls-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ls-count { margin: 0 0 10px; font-size: .86rem; color: var(--ad-muted, #556); }
.ls-count strong { color: var(--navy-950, #0b1a2c); }
.ls-of { color: var(--ad-muted, #667); }
.ls-empty-actions { text-align: center; margin: 0 0 18px; }
.ls-mark { background: #fff2b3; color: inherit; padding: 0 1px; border-radius: 2px; }
.ls-pager { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 14px 0; font-size: .86rem; }
.ls-pager-links { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ls-gap { padding: 0 4px; color: var(--ad-muted, #667); }
/* inside the older inline-label filter bars (Members, Prayer Requests …): everything centred on one line */
body.admin-body form.filter-bar { align-items: center; }
body.admin-body form.filter-bar .ls-search { flex: 0 1 auto; }
body.admin-body form.filter-bar .ls-input-wrap { flex-basis: 290px; width: 290px; }
body.admin-body form.filter-bar .field select, body.admin-body form.filter-bar .field input:not([type=checkbox]):not([type=radio]), body.admin-body form.ls-bar .field select, body.admin-body form.ls-bar .field input:not([type=checkbox]):not([type=radio]) { height: var(--ad-ctl, 36px); box-sizing: border-box; }
body.admin-body form.filter-bar > div > .btn, body.admin-body form.filter-bar > div > button.btn { height: var(--ad-ctl, 36px); min-height: var(--ad-ctl, 36px); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; box-sizing: border-box; }
@media (max-width: 900px) { .ls-input-wrap { flex-basis: 300px; width: 300px; } }
@media (max-width: 640px) {
  .ls-search, body.admin-body form.filter-bar .ls-search { flex: 1 1 100%; flex-direction: column; align-items: stretch; width: 100%; }
  .ls-input-wrap, body.admin-body form.filter-bar .ls-input-wrap { flex: 1 1 auto; width: 100%; min-width: 0; }
  .ls-extra:has(.field:nth-child(3)) { display: flex; flex-direction: column; align-items: stretch; }
  .ls-actions { width: 100%; }
  .ls-actions .btn { flex: 1 1 0; }
  .ls-tools { margin-left: 0; width: 100%; }
  .ls-extra { width: 100%; }
  .ls-extra .field { flex: 1 1 100%; }
}
@media print { .ls-bar, .ls-count .ls-of, .ls-pager-links { display: none; } }
.admin-body .ls-extra select, .admin-body .ls-extra input:not([type=checkbox]):not([type=radio]) { background-color: #fff; border: 1px solid var(--ad-line-strong, #c9d1dc); border-radius: var(--radius-sm, 6px); padding: 0 11px; font-size: .86rem; color: var(--ad-ink, #1d2733); }
.admin-body .ls-extra select { padding-right: 28px; }
.admin-body .ls-extra select:focus, .admin-body .ls-extra input:focus { border-color: var(--gold-500, #c9a227); box-shadow: 0 0 0 3px var(--ad-focus, rgba(201,162,39,.3)); outline: none; }

/* =====================================================================
   Round 145 - the Dashboard row's arrow = expand ALL section menus (down) / collapse ALL (up); the four section headings never
   hide. Label = link to the Dashboard; arrow at the far right. Same on desktop, tablet and phone. (Replaces Rounds 143-144.)
   ===================================================================== */
.admin-nav-dashrow { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm, 6px); min-width: 0; }
.admin-body .admin-nav .admin-nav-dashrow > a { flex: 1 1 auto; min-width: 0; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-nav-dashrow:has(> a.is-active) { background: var(--gold-500, #cf9d3f); }
.admin-nav-dashrow:has(> a.is-active) > a { background: transparent; }
.admin-nav-collapse {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 36px; padding: 0; margin: 0; border: 0; border-radius: var(--radius-sm, 6px);
  background: transparent; color: var(--steel-300, #b8c4cc); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.admin-nav-collapse:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav-dashrow:has(> a.is-active) .admin-nav-collapse { color: var(--navy-950, #0c2330); }
.admin-nav-dashrow:has(> a.is-active) .admin-nav-collapse:hover { background: rgba(12,35,48,.12); }
.admin-nav-collapse:focus-visible { outline: 2px solid var(--gold-500, #cf9d3f); outline-offset: -2px; }
.admin-nav-dashrow:has(> a.is-active) .admin-nav-collapse:focus-visible { outline-color: var(--navy-950, #0c2330); }
.admin-nav-collapse svg { display: block; transition: transform .2s ease; pointer-events: none; }

/* Round 145: the arrow is a single chevron; "collapsed" (no section open) points down = Expand all, otherwise up = Collapse all */
.admin-nav-collapse[data-all="collapsed"] svg { transform: rotate(180deg); }
.admin-nav-collapse--noanim svg { transition: none !important; }

/* phone / tablet: the sidebar is still the off-canvas drawer, opened by the top-bar menu button */
.admin-nav-backdrop { display: none; }
.admin-nav-backdrop[hidden] { display: none !important; }
@media (max-width: 960px) {
  .admin-body .admin-sidebar { visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; width: min(86vw, 300px); box-shadow: none; }
  .admin-body .admin-sidebar.is-open { visibility: visible; transition: transform .22s ease, visibility 0s; box-shadow: 0 0 40px rgba(12,35,48,.4); }
  .admin-nav-collapse { width: 44px; height: 40px; }
  .admin-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(12,35,48,.45); animation: adminNavFade .22s ease; }
  body.admin-nav-locked { overflow: hidden; }
}
@keyframes adminNavFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .admin-nav-collapse svg, .admin-body .admin-sidebar { transition: none !important; }
  .admin-nav-backdrop { animation: none; }
}
@media print { .admin-nav-backdrop { display: none !important; } }

/* Round 145: the section arrows sit at the far right of each heading (label, thin rule, arrow) */
.admin-nav-section > span:nth-child(2) { min-width: 0; }
.admin-nav-section::after { order: 2; }
.admin-nav-section .chevron { order: 3; margin-left: 2px; font-size: .8rem; }

/* ==========================================================================
   Round 148 — ONE standard module header + active navigation for every Admin workspace.
   Every page answers: Which module am I in? (module header) · Which section is active? (module nav,
   filled tab) · What page am I working on? (page heading). All colours come from the church theme
   (--theme-*), falling back to the built-in palette, so a new theme restyles every module at once.
   No per-module stylesheets: Church Administration, Christian Education & Training, Accounting and
   System Settings all use exactly these classes.
   ========================================================================== */
body.admin-body {
  --mn-primary: var(--theme-primary, var(--navy-800, #1a4058));
  --mn-primary-dark: var(--theme-primary-dark, var(--navy-900, #123146));
  --mn-accent: var(--theme-accent, var(--gold-500, #cf9d3f));
  --mn-surface: var(--theme-surface, #fff);
  --mn-border: var(--theme-border, var(--line, #e3e9ed));
  --mn-text: var(--theme-text, var(--ink, #16232c));
  --mn-muted: var(--theme-muted, var(--ink-soft, #4d5c66));
  --mn-hover: var(--theme-surface-hover, #eef2f6);
}
@supports (background: color-mix(in srgb, red 10%, white)) {
  body.admin-body { --mn-hover: var(--theme-surface-hover, color-mix(in srgb, var(--mn-primary) 9%, #fff)); }
}
.is-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Round 153: the module header bar, the underline module tabs and the compact page heading are styled in the Round 153 block at the end of this file. */
/* Round 152 — STICKY NAVIGATION (shared by every module: Church Administration, CE&T, Accounting, System Settings).
   Layers, top to bottom:  top bar (--z-topbar) → module navigation shell (--z-module-nav) → workspace tabs (--z-ws-nav) → page.
   The numbers keep the existing order (the phone side-menu drawer = 50 and its backdrop = 45 stay above all three; pop-up menus 60+ stay above them).
   Offsets are CSS variables, measured by admin.js (ResizeObserver, no scroll listener) so wrapped rows / phones / zoom are exact:
     --admin-topbar-h   height of the top bar
     --mn-shell-h       height of the sticky module navigation (all wrapped rows together; 0 when it is not sticky)
     --ws-nav-h         height of the sticky workspace tab bar (0 when there is none)
     --sticky-top-2     where the workspace tabs stick  (= top bar + module nav)
     --sticky-stack     everything that is stuck above the page (= top bar + module nav + workspace tabs) — table headers, toolbars and
                        the Help contents use it so nothing ever slides underneath a bar. */
body.admin-body {
  --z-topbar: 40; --z-module-nav: 38; --z-ws-nav: 36;
  --sticky-top-1: var(--admin-topbar-h, 52px);
  --sticky-top-2: calc(var(--admin-topbar-h, 52px) + var(--mn-shell-h, 0px));
  --sticky-stack: calc(var(--admin-topbar-h, 52px) + var(--mn-shell-h, 0px) + var(--ws-nav-h, 0px));
}
body.admin-body .module-nav-shell { margin: 0 0 6px; padding: 0; background: var(--ad-bg, #f4f6f8); }
@media (min-height: 480px) {
  body.admin-body .module-nav-shell { position: sticky; top: var(--sticky-top-1); z-index: var(--z-module-nav); padding: 0; margin-bottom: 6px; }
  body.admin-body .module-nav-shell.is-stuck .module-nav { box-shadow: 0 4px 12px rgba(15,30,45,.08); }
  /* second level: a record workspace's own tabs (Course / Batch / Seminar / Bible Study Group / Assets …), marked by admin.js */
  body.admin-body [data-ws-nav="on"] { position: sticky; top: var(--sticky-top-2); z-index: var(--z-ws-nav); }
  body.admin-body nav.pu-tabs[data-ws-nav="on"] { background: var(--ad-bg, #f4f6f8); padding-top: 4px; }
  body.admin-body .admin-panel[data-ws-nav="on"] { box-shadow: 0 2px 6px rgba(15,30,45,.05); }
  body.admin-body .ministry-tabs[data-ws-nav="on"] { background: var(--mn-surface, #fff); padding-top: 2px; }
}
body.admin-body .module-header { position: relative; }
body.admin-body .mn-stuck-sentinel { position: absolute; left: 0; top: 100%; margin-top: 0; width: 1px; height: 1px; pointer-events: none; visibility: hidden; }
/* a link target, a focused field or scrollIntoView never ends up underneath a pinned bar (also helps keyboard users: focus is not obscured) */
html:has(body.admin-body) { scroll-padding-top: calc(var(--admin-topbar-h, 52px) + var(--mn-shell-h, 0px) + var(--ws-nav-h, 0px) + 44px); }
/* things that used to assume "only the top bar is stuck" now clear the whole stack */
body.admin-body .data-table th { top: var(--sticky-stack, 0px); }
/* …but a table inside its own scrolling box (.data-table-wrap, the phone table, or anything admin.js finds clipping it) sticks to THAT box's top edge */
body.admin-body .data-table-wrap .data-table th, body.admin-body .data-table.tbl-scroll-ctx th { top: 0; }
@media (max-width: 640px) { body.admin-body :not(.data-table-wrap) > table.data-table th { top: 0; } }
body.admin-body .perm-toolbar { top: var(--sticky-stack, 52px); }
body.admin-body .role-matrix th { top: calc(var(--sticky-stack, 52px) + 46px); }
.hlp-toc { top: calc(var(--sticky-stack, 52px) + 14px); max-height: calc(100vh - var(--sticky-stack, 52px) - 30px); }

/* record-workspace tabs (a Course / Batch / Seminar's own sections, hub inner tabs) are deliberately quieter than the module tabs */
body.admin-body .pu-tabs.record-tabs { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 0 0 14px; border-bottom: 1px solid var(--mn-border); }
body.admin-body .pu-tabs.record-tabs .pu-tab { white-space: nowrap; padding: 7px 12px; font-size: 13px; font-weight: 500; color: var(--mn-muted); border-bottom: 2px solid transparent; border-radius: 0; }
body.admin-body .pu-tabs.record-tabs .pu-tab:hover { color: var(--mn-primary-dark); background: none; }
body.admin-body .pu-tabs.record-tabs .pu-tab.is-active { color: var(--mn-text); font-weight: 600; border-bottom-color: var(--mn-accent); }
body.admin-body .pu-tabs.record-tabs .pu-tab:focus-visible { outline: 2px solid var(--mn-accent); outline-offset: 1px; }
body.admin-body .ministry-tab-btn { font-size: 13px; }
body.admin-body .ministry-tab-btn:focus-visible { outline: 2px solid var(--mn-accent); outline-offset: -2px; }

@media print { .module-nav, .module-header-actions { display: none !important; } }
/* Round 148: a workspace tab that used to repeat the page title keeps just its action button */
body.admin-body .embedded-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }

/* ---------- Round 150: fixed sidebar header (logo + ACTS System + Dashboard control); only the module area scrolls ---------- */
.admin-body .admin-sidebar { display: flex; flex-direction: column; overflow: hidden; height: 100vh; height: 100dvh; padding: 0; }
.admin-body .admin-sidebar .sidebar-fixed-header { flex: 0 0 auto; z-index: 10; background: var(--navy-950); padding: 16px 10px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-body .admin-sidebar .sidebar-fixed-header .brand { padding: 4px 8px 12px; }
.admin-body .admin-sidebar .sidebar-fixed-header .admin-nav-group { margin-bottom: 0; }
.admin-body .admin-sidebar .sidebar-scroll-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 10px 16px; }

/* Round 150: Batch / Seminar header lines (the header names the class, never its people) */
.cl-head-lines .cl-head-l1 { color: var(--ink, #1c2b36); font-weight: 600; font-size: .92rem; }
.cl-head-lines .cl-head-l2, .cl-head-lines .cl-head-l3 { color: var(--ink-soft); font-size: .82rem; margin-top: 1px; }

/* Round 152: a long file path in Help text may break instead of widening the page on a phone */
body.admin-body code, body.admin-body .hlp code { overflow-wrap: anywhere; }


/* =====================================================================================================================
   Round 153 — COMPACT PAGE HEADER (shared by every module page)
   header bar 48 px · module tabs 40 px · [workspace tabs + toolbar] card 52 px · selection bar 40 px (only while rows are checked)
   Colours come from the --mn-* / --theme-* tokens only: gold (--mn-accent) is used for the active tab underline and the selection-bar tint.
   ===================================================================================================================== */
body.admin-body { --mn-ctl: 36px; --mn-icon-btn: 32px; --mn-hdr-h: 48px; --mn-tab-h: 40px; }
body.admin-body .admin-content { padding-top: 0; }

/* ---- 1. header bar: [Back] Home / Module ........ Updated … [↻] ---- */
body.admin-body .module-header.admin-backbar { display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; height: var(--mn-hdr-h); min-height: var(--mn-hdr-h); margin: 0; padding: 0; position: relative; }
body.admin-body .module-header .admin-back, body.admin-body .module-header .admin-refresh { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: var(--mn-icon-btn); height: var(--mn-icon-btn); padding: 0; border: 1px solid var(--mn-border); border-radius: 8px; background: var(--mn-surface); color: var(--mn-text); cursor: pointer; }
body.admin-body .module-header .admin-back:hover, body.admin-body .module-header .admin-refresh:hover { background: var(--mn-hover); border-color: var(--mn-primary); color: var(--mn-primary-dark); }
body.admin-body .module-header .admin-back:focus-visible, body.admin-body .module-header .admin-refresh:focus-visible { outline: 2px solid var(--mn-primary); outline-offset: 2px; }
body.admin-body .module-header .admin-back[hidden] { display: none; }
body.admin-body .module-header .admin-backbar-crumbs { flex: 1 1 auto; min-width: 0; }
body.admin-body .module-header .admin-breadcrumb { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 0; min-width: 0; font-size: 13px; line-height: 1.2; color: var(--mn-muted); white-space: nowrap; overflow: hidden; }
body.admin-body .module-header .admin-breadcrumb > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.admin-body .module-header .admin-breadcrumb a { color: var(--mn-muted); text-decoration: none; }
body.admin-body .module-header .admin-breadcrumb a:hover { color: var(--mn-primary-dark); text-decoration: underline; }
body.admin-body .module-header .admin-breadcrumb-sep { flex: 0 0 auto; color: var(--mn-muted); opacity: .7; }
body.admin-body .module-header .admin-breadcrumb-current { color: var(--mn-text); font-weight: 600; }
body.admin-body .module-header .admin-breadcrumb-module, body.admin-body .module-header .admin-breadcrumb a.admin-breadcrumb-module { font-size: 17px; font-weight: 700; color: var(--mn-text); letter-spacing: -.005em; }
body.admin-body .module-header .admin-breadcrumb-module:hover { color: var(--mn-primary-dark); }
body.admin-body .module-header-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; }
body.admin-body .module-header .admin-refresh-wrap { margin: 0; gap: 8px; flex-wrap: nowrap; }
body.admin-body .module-header .admin-updated { font-size: 12px; color: var(--mn-muted); white-space: nowrap; }
body.admin-body .admin-back svg, body.admin-body .admin-refresh svg { display: block; }
@media (max-width: 600px) { body.admin-body .module-header .admin-updated { display: none; } body.admin-body .module-header .admin-back, body.admin-body .module-header .admin-refresh { width: 44px; height: 44px; } }

/* ---- 2. module tabs: underline style, ONE line, 40 px ---- */
body.admin-body .module-nav { background: transparent; border: 0; border-bottom: 1px solid var(--mn-border); border-radius: 0; padding: 0; margin: 0; height: calc(var(--mn-tab-h) + 1px); box-sizing: border-box; transition: box-shadow .15s ease; }
body.admin-body .module-nav-list { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; align-items: stretch; gap: 2px; height: var(--mn-tab-h); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
body.admin-body .module-nav-list::-webkit-scrollbar { display: none; }
body.admin-body .module-nav.is-enhanced .module-nav-list { overflow: visible; }
body.admin-body .module-nav-li { position: relative; margin: 0; padding: 0; display: flex; flex: 0 0 auto; }
body.admin-body .module-nav-li[hidden] { display: none; }
body.admin-body .module-nav-item { display: inline-flex; align-items: center; gap: 6px; height: var(--mn-tab-h); padding: 0 14px; box-sizing: border-box; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; font: inherit; font-size: 14px; line-height: 1; font-weight: 500; color: var(--mn-text); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
body.admin-body .module-nav-item:hover { background: var(--mn-hover); color: var(--mn-primary-dark); text-decoration: none; }
body.admin-body .module-nav-item:focus-visible { outline: 2px solid var(--mn-primary); outline-offset: -2px; }
body.admin-body .module-nav-item--active, body.admin-body .module-nav-item--active:hover { background: transparent; color: var(--mn-text); font-weight: 700; border-bottom-color: var(--mn-accent); }
body.admin-body .mn-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 6px; box-sizing: border-box; border-radius: 9px; background: var(--mn-primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
body.admin-body .module-nav-more-btn .mn-caret { font-size: 11px; opacity: .8; }
body.admin-body .module-nav-menu { position: absolute; top: 100%; right: 0; z-index: 60; min-width: 220px; max-width: 320px; padding: 4px; background: var(--mn-surface); border: 1px solid var(--mn-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,30,45,.14); }
body.admin-body .module-nav-menu[hidden] { display: none; }
body.admin-body .module-nav-menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--mn-text); text-decoration: none; }
body.admin-body .module-nav-menu a:hover, body.admin-body .module-nav-menu a:focus-visible { background: var(--mn-hover); outline: none; }
body.admin-body .module-nav-menu a:focus-visible { box-shadow: inset 0 0 0 2px var(--mn-primary); }
/* phones and narrow tablets: no More menu, one horizontally scrolling strip (the active tab is scrolled into view by admin.js) */
@media (max-width: 768px) {
  body.admin-body { --mn-tab-h: 44px; }
  body.admin-body .module-nav-list, body.admin-body .module-nav.is-enhanced .module-nav-list { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  body.admin-body .module-nav-item { height: var(--mn-tab-h); min-width: 44px; }
  body.admin-body .module-nav-more { display: none !important; }
  body.admin-body .module-nav-li[hidden] { display: flex; }
}

/* ---- 3. page heading ---- */
body.admin-body .page-header { margin: 0 0 8px; }
body.admin-body .page-header--bare { display: flex; justify-content: flex-end; }
body.admin-body .page-header-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
body.admin-body .admin-content h2.page-header-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--mn-text); min-width: 0; overflow-wrap: anywhere; }
body.admin-body .page-header-desc { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 13px; line-height: 1.4; color: var(--mn-muted); display: flex; flex-wrap: wrap; gap: 0 12px; align-items: baseline; }
body.admin-body .page-header-desc > * { margin: 0; display: inline; }
body.admin-body .page-header-desc a { color: var(--mn-primary); }
body.admin-body .page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; align-self: center; }
body.admin-body .page-header .btn-primary, body.admin-body .ws-toolbar .btn-primary, body.admin-body .bulk-bar .btn-primary { background: var(--mn-primary); border-color: var(--mn-primary); color: #fff; }
body.admin-body .page-header .btn-primary:hover, body.admin-body .ws-toolbar .btn-primary:hover, body.admin-body .bulk-bar .btn-primary:hover { background: var(--mn-primary-dark); border-color: var(--mn-primary-dark); color: #fff; }
body.admin-body .btn:focus-visible { outline: 2px solid var(--mn-primary); outline-offset: 2px; }

/* ---- 4. workspace tabs + toolbar: ONE card, one row on desktop ---- */
body.admin-body .ws-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px; margin: 0 0 8px; box-sizing: border-box; min-height: 52px; background: var(--mn-surface); border: 1px solid var(--mn-border); border-radius: 10px; position: relative; }
body.admin-body .ws-toolbar > .ws-tabs { flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0; }
body.admin-body .ws-toolbar > .ws-controls { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
/* segmented control (hub tabs, record tabs) */
body.admin-body .ws-toolbar .ministry-tabs, body.admin-body .ws-toolbar nav.pu-tabs.record-tabs, body.admin-body .ws-toolbar nav.pu-tabs.cl-tabs { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; margin: 0; padding: 2px; border: 0; background: var(--mn-hover); border-radius: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
body.admin-body .ws-toolbar .ministry-tabs::-webkit-scrollbar, body.admin-body .ws-toolbar nav.pu-tabs::-webkit-scrollbar { display: none; }
body.admin-body .ws-toolbar .ministry-tab-btn, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; margin: 0; padding: 0 10px; box-sizing: border-box; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 500; line-height: 1; color: var(--mn-text); white-space: nowrap; text-decoration: none; cursor: pointer; }
body.admin-body .ws-toolbar .ministry-tab-btn:hover, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab:hover { background: rgba(255,255,255,.6); color: var(--mn-primary-dark); }
body.admin-body .ws-toolbar .ministry-tab-btn.is-active, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab.is-active, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab[aria-current="page"] { background: var(--mn-surface); border-color: var(--mn-border); color: var(--mn-text); font-weight: 700; box-shadow: 0 1px 2px rgba(15,30,45,.08); }
body.admin-body .ws-toolbar .ministry-tab-btn:focus-visible, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab:focus-visible { outline: 2px solid var(--mn-primary); outline-offset: 1px; }
body.admin-body .ws-count { display: inline-block; min-width: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; background: var(--mn-hover); color: var(--mn-text); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
body.admin-body .ws-toolbar .is-active .ws-count { background: var(--mn-hover); }

/* the filter form inside (or without) the card: every control 36 px, 8 px gap */
body.admin-body form.filter-bar, body.admin-body form.ls-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px; box-sizing: border-box; }
body.admin-body form.ls-bar .ls-extra, body.admin-body form.ls-bar .ls-extra:has(.field:nth-child(3)) { display: contents; }
body.admin-body form.ls-bar .ls-extra .field { min-width: 0; width: auto; }
body.admin-body form.ls-bar .ls-extra > label { display: inline-flex; align-items: center; gap: 6px; height: var(--mn-ctl); padding: 0; font-size: 13px; }
body.admin-body form.ls-bar .ls-reset { align-self: center; }
body.admin-body form.ls-bar .ls-tools { margin-left: 0; }
body.admin-body .ws-toolbar .ws-controls > form, body.admin-body .ws-toolbar .ws-controls > form.ls-bar { flex: 1 1 auto; justify-content: flex-end; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; min-width: 0; }
body.admin-body form.filter-bar .field, body.admin-body form.ls-bar .field { display: inline-flex; flex-direction: row; align-items: center; gap: 0; height: var(--mn-ctl); margin: 0; min-width: 0; padding-left: 10px; box-sizing: border-box; border: 1px solid var(--ad-line-strong); border-radius: 8px; background: var(--mn-surface); }
body.admin-body form.filter-bar .field:focus-within, body.admin-body form.ls-bar .field:focus-within { border-color: var(--mn-primary); box-shadow: 0 0 0 2px var(--mn-primary); }
body.admin-body form.filter-bar .field > label, body.admin-body form.ls-bar .field > label { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--mn-muted); white-space: nowrap; }
body.admin-body form.filter-bar .field > label::after, body.admin-body form.ls-bar .field > label::after { content: ":"; }
body.admin-body form.filter-bar .field select, body.admin-body form.filter-bar .field input:not([type=checkbox]):not([type=radio]), body.admin-body form.ls-bar .field select, body.admin-body form.ls-bar .field input:not([type=checkbox]):not([type=radio]) { height: calc(var(--mn-ctl) - 2px); min-height: 0; width: auto; field-sizing: content; max-width: 200px; margin: 0; padding: 0 24px 0 6px; border: 0; background-color: transparent; font-size: 13px; font-weight: 600; color: var(--mn-text); box-shadow: none; outline: none; }
body.admin-body form.filter-bar .field input:not([type=checkbox]):not([type=radio]), body.admin-body form.ls-bar .field input:not([type=checkbox]):not([type=radio]) { padding-right: 8px; }
body.admin-body form.filter-bar > div:not(.ls-search):not(.filter-more) { display: flex; align-items: center; gap: 8px; }
body.admin-body form.filter-bar .btn, body.admin-body form.ls-bar .btn { height: var(--mn-ctl); min-height: var(--mn-ctl); padding: 0 14px; display: inline-flex; align-items: center; box-sizing: border-box; font-size: 13px; }
body.admin-body form.filter-bar .filters-btn, body.admin-body form.ls-bar .filters-btn { gap: 6px; }
body.admin-body .filters-count { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--mn-primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
body.admin-body form.filter-bar .filter-more, body.admin-body form.ls-bar .filter-more { flex: 1 1 100%; order: 99; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 0; }
body.admin-body form .filter-more[hidden] { display: none; }
/* search field: magnifier inside, × when it has text, no Search / Clear buttons */
body.admin-body .ls-search { flex: 1 1 150px; max-width: 360px; min-width: 150px; gap: 0; }
body.admin-body .ls-input-wrap { flex: 1 1 auto; width: auto; min-width: 0; position: relative; }
body.admin-body form.filter-bar .ls-input-wrap input.ls-input, body.admin-body form.ls-bar .ls-input-wrap input.ls-input, body.admin-body .ls-input-wrap .ls-input { height: var(--mn-ctl); min-height: var(--mn-ctl); padding: 0 30px 0 32px; font-size: 13px; border-radius: 8px; }
body.admin-body .ls-input:focus { border-color: var(--mn-primary); box-shadow: 0 0 0 2px var(--mn-primary); }
body.admin-body .ls-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mn-muted); pointer-events: none; }
body.admin-body .ls-x { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 1.15rem; line-height: 22px; }
body.admin-body .ls-x:hover, body.admin-body .ls-x:focus-visible { outline: 2px solid var(--mn-primary); }
body.admin-body .ls-x[hidden] { display: none; }
body.admin-body .ls-actions { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
body.admin-body form.is-autoapply .is-submit-fallback, body.admin-body form.is-autoapply .ls-btn-clear { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
body.admin-body form.filter-bar .ls-search, body.admin-body form.ls-bar .ls-search { flex: 1 1 150px; max-width: 360px; min-width: 150px; }
body.admin-body form.filter-bar .ls-input-wrap, body.admin-body form.ls-bar .ls-input-wrap { flex: 1 1 auto; width: auto; min-width: 0; }
body.admin-body form.is-autoapply > div:has(> .is-submit-fallback:only-child) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Export: icon button with a menu, after a divider */
body.admin-body form.filter-bar details.dd { margin-left: 8px; position: relative; }
body.admin-body form.filter-bar details.dd::before { content: ""; position: absolute; left: -9px; top: 6px; bottom: 6px; width: 1px; background: var(--mn-border); }
body.admin-body form.filter-bar details.dd > summary.btn { width: var(--mn-ctl); padding: 0; justify-content: center; }
body.admin-body details.dd > summary:focus-visible { outline: 2px solid var(--mn-primary); outline-offset: 2px; }
body.admin-body .dd-menu a:focus-visible, body.admin-body .dd-menu button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--mn-primary); background: var(--mn-hover); }
body.admin-body .ws-toolbar [data-ws-nav-actions] { display: flex; align-items: center; gap: 8px; }
body.admin-body .ws-toolbar .page-header-actions { margin-left: 0; }

/* level 2 of the Round 152 sticky stack is now the whole card */
@media (min-height: 480px) {
  body.admin-body .ws-toolbar[data-ws-nav="on"] { position: sticky; top: var(--sticky-top-2); z-index: var(--z-ws-nav); box-shadow: 0 1px 0 var(--mn-border); }
}

/* ---- 5. contextual selection bar (top of the table card) ---- */
body.admin-body .table-card { margin: 0 0 12px; }
body.admin-body .bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 40px; padding: 4px 12px; box-sizing: border-box; background: var(--mn-surface); border: 1px solid var(--mn-border); border-bottom: 0; border-radius: 10px 10px 0 0; }
@supports (background: color-mix(in srgb, red 10%, white)) { body.admin-body .bulk-bar { background: color-mix(in srgb, var(--mn-accent) 10%, var(--mn-surface)); } }
body.admin-body .bulk-bar[hidden] { display: none; }
body.admin-body .bulk-bar .bulk-count { font-weight: 700; font-size: 13px; color: var(--mn-text); margin-right: 4px; }
body.admin-body .bulk-bar .bulk-label { font-size: 13px; color: var(--mn-text); font-weight: 600; }
body.admin-body .bulk-bar .btn { height: 30px; min-height: 30px; padding: 0 12px; font-size: 12.5px; display: inline-flex; align-items: center; }
body.admin-body .bulk-bar .bulk-clear { margin-left: auto; }
body.admin-body .table-card > .bulk-bar:not([hidden]) + .data-table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }

/* ---- 6. table density: header 36 px, rows 40 px, 11 px uppercase labels ---- */
body.admin-body .data-table th { height: 36px; padding: 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
body.admin-body .data-table td { height: 40px; padding: 6px 10px; }
body.admin-body .data-table th.col-check, body.admin-body .data-table td.col-check { width: 40px; padding-left: 12px; padding-right: 0; }

/* ---- 7. responsive ---- */
@media (max-width: 1100px) {
  body.admin-body .ws-toolbar > .ws-tabs { flex: 1 1 100%; }
  body.admin-body .ws-toolbar > .ws-controls { flex: 1 1 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  body.admin-body .ws-toolbar { padding: 8px; }
  body.admin-body .ws-toolbar .ls-search, body.admin-body form.filter-bar .ls-search, body.admin-body form.ls-bar .ls-search { flex: 1 1 100%; max-width: none; }
  body.admin-body form.filter-bar .btn, body.admin-body form.filter-bar .field, body.admin-body .ws-toolbar .ministry-tab-btn, body.admin-body .ws-toolbar nav.pu-tabs .pu-tab { min-height: 44px; height: 44px; }
  body.admin-body form.filter-bar > div > .btn, body.admin-body form.filter-bar > div > button.btn, body.admin-body form.ls-bar > div > .btn, body.admin-body form.ls-bar > .btn { height: 44px; min-height: 44px; }
  body.admin-body form.filter-bar details.dd > summary.btn { width: 44px; }
  body.admin-body .ws-toolbar .ministry-tabs, body.admin-body .ws-toolbar nav.pu-tabs { max-width: 100%; }
  body.admin-body .bulk-bar .btn { height: 44px; min-height: 44px; }
  body.admin-body form.filter-bar .field, body.admin-body form.ls-bar .field { flex: 1 1 140px; }
  body.admin-body form.filter-bar .field select { width: 100%; max-width: none; flex: 1 1 auto; }
}
@media print { .ws-toolbar { display: none !important; } }
/* narrow content (phones, and desktop windows with the side menu open): selects never push the page wider */
@media (max-width: 640px) {
  body.admin-body form.filter-bar .field, body.admin-body form.ls-bar .field { min-width: 0; max-width: 100%; }
  body.admin-body form.filter-bar .field select, body.admin-body form.ls-bar .field select, body.admin-body form.filter-bar .field input:not([type=checkbox]):not([type=radio]), body.admin-body form.ls-bar .field input:not([type=checkbox]):not([type=radio]) { field-sizing: fixed; width: 100%; min-width: 0; max-width: none; flex: 1 1 auto; }
  body.admin-body .admin-panel > table.pc-table { display: block; max-width: 100%; overflow-x: auto; }
}
/* a hidden help tooltip must not widen the page */
body.admin-body .perm-tip:not(:hover):not(:focus)::after { display: none; }
/* two pages whose own grid / table could outgrow a 1024 px or 390 px window */
@media (max-width: 1180px) { body.admin-body .role-basics { grid-template-columns: 1fr 1fr; } body.admin-body .role-basics-desc { grid-column: 1 / -1; } }

/* rb test 1.0.1 */

/* rb s3 */

/* s4c */

/* s4d */

/* s5 1.0.1 */

/* s5 1.0.2 */

/* Round 153 follow-up — text / date inputs inside compact toolbar fields beat the older ".field input:not(...)" rule (higher specificity), so they showed 13.8 px text, 11 px padding and their own border; match that selector chain and add one more class. */
body.admin-body form.filter-bar .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
body.admin-body form.ls-bar .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]) {
  min-height: 0; height: calc(var(--mn-ctl) - 2px); padding: 0 8px; border: 0; border-radius: 0; background-color: transparent;
  font-size: 13px; font-weight: 600; line-height: normal; color: var(--mn-text); box-shadow: none;
}

/* rb test 1.0.1 */

/* rb s3 */

/* s4c */

/* s4d */

/* s5 1.0.1 */

/* s5 1.0.2 */

/* Round 155 — Activity Center (My Activity / System Activity), dashboard widget, details */
body.admin-body .act-note { margin: 0 0 8px; font-size: 13px; color: var(--mn-muted, #64748b); }
body.admin-body .act-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--mn-border, #e2e8f0); border-radius: 8px; background: var(--mn-surface, #fff); font-size: 13px; }
body.admin-body .act-sum b { font-size: 15px; color: var(--mn-text, #0f172a); margin-right: 3px; }
body.admin-body .act-sum-note { margin-left: auto; font-size: 12px; color: var(--mn-muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
body.admin-body .act-table .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
body.admin-body .act-table tr.act-day th { text-align: left; padding: 6px 12px; background: var(--mn-bg, #f1f5f9); color: var(--mn-muted, #64748b); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-top: 1px solid var(--mn-border, #e2e8f0); }
body.admin-body .act-table td.act-when { white-space: nowrap; color: var(--mn-muted, #64748b); }
body.admin-body .act-table { min-width: 0; width: 100%; }
body.admin-body .act-table td.act-what { min-width: 220px; overflow-wrap: anywhere; word-break: break-word; }
body.admin-body .act-table td { vertical-align: top; }
body.admin-body .act-table td[data-label="User"] { min-width: 150px; }
body.admin-body .act-table td.act-go { white-space: nowrap; text-align: right; }
body.admin-body .act-role { display: block; font-size: 11px; color: var(--mn-muted, #64748b); }
body.admin-body .act-st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
body.admin-body .act-st-ok { background: #e7f6ec; color: #17653a; }
body.admin-body .act-st-warn { background: #fff4d6; color: #7a5b00; }
body.admin-body .act-st-failed { background: #fde8e8; color: #9b1c1c; }
body.admin-body .act-widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
body.admin-body .act-widget-head h2 { margin: 0; }
body.admin-body .act-widget-list { list-style: none; margin: 0; padding: 0; }
body.admin-body .act-widget-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--mn-border, #e2e8f0); font-size: 13px; }
body.admin-body .act-widget-list li:first-child { border-top: 0; }
body.admin-body .act-w-when { flex: none; color: var(--mn-muted, #64748b); font-size: 12px; white-space: nowrap; }
body.admin-body .act-dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; margin: 0 0 14px; }
body.admin-body .act-dl dt { color: var(--mn-muted, #64748b); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
body.admin-body .act-dl dd { margin: 0; }
body.admin-body .act-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.admin-body .act-retention summary { cursor: pointer; }
body.admin-body .act-ret-form { margin-top: 10px; }
body.admin-body .act-ret-apply { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--mn-border, #e2e8f0); }
@media (max-width: 720px) {
  body.admin-body .act-table thead { display: none; }
  body.admin-body .act-table, body.admin-body .act-table tbody { display: block; }
  body.admin-body .act-table tr.act-day { display: block; }
  body.admin-body .act-table tr.act-day th { display: block; }
  body.admin-body .act-table tr:not(.act-day) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 10px 12px; border-top: 1px solid var(--mn-border, #e2e8f0); }
  body.admin-body .act-table td { display: block; height: auto; min-height: 0; padding: 0; border: 0; width: auto; min-width: 0; text-align: left; line-height: 1.35; background: transparent; }
  body.admin-body .act-table tr:not(.act-day) { height: auto; }
  body.admin-body .act-table td::before { display: none !important; }
  body.admin-body .act-table td.act-when { order: 1; flex: 1 1 100%; font-size: 12px; }
  body.admin-body .act-table td.act-what { order: 2; flex: 1 1 100%; min-width: 0; font-weight: 600; }
  body.admin-body .act-table td[data-label="Record"] { order: 3; flex: 1 1 100%; font-size: 12px; color: var(--mn-muted, #64748b); }
  body.admin-body .act-table td[data-label="Record"]:empty { display: none; }
  body.admin-body .act-table td[data-label="User"] { order: 4; font-size: 13px; }
  body.admin-body .act-table td[data-label="Module"] { order: 5; font-size: 12px; color: var(--mn-muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
  body.admin-body .act-table td[data-label="Status"] { order: 6; }
  body.admin-body .act-table td.act-go { order: 7; flex: 1 1 100%; margin-top: 2px; }
  body.admin-body .act-role { display: inline; margin-left: 4px; }
}
@media (max-width: 640px) {
  body.admin-body .act-dl { grid-template-columns: 1fr; gap: 0; }
  body.admin-body .act-dl dd { margin-bottom: 8px; }
  body.admin-body .act-widget-list li { flex-direction: column; gap: 2px; }
  body.admin-body .act-table td.act-go { text-align: left; }
}

/* rb test 1.0.1 */

/* rb s3 */

/* s4c */

/* s4d */

/* s5 1.0.1 */

/* s5 1.0.2 */
