/* =====================================================
   BKPS Admin — Design System (matches design_reference/)
   Loaded AFTER style.css to override NiceAdmin defaults.
   Built around shadcn-ui design tokens, brand green #015825.
   ===================================================== */

/* ====================== TOKENS ====================== */
:root {
  /* Brand */
  --primary:           #015825;
  --primary-hover:     #013E1B;
  --primary-active:    #012E13;
  --primary-fg:        #FFFFFF;
  --primary-light:     #DEEEDC;

  /* Surfaces */
  --background:        #FFFFFF;
  --surface:           #FFFFFF;
  --surface-muted:     #F8FAF9;
  --card:              #FFFFFF;
  --popover:           #FFFFFF;

  /* Text */
  --foreground:        #555555;
  --foreground-strong: #1F2A24;
  --muted:             #F3F6F4;
  --muted-foreground:  #7E817E;

  /* Borders */
  --border:            #E5E7E5;
  --border-strong:     #C8CCC8;
  --input:             #E5E7E5;
  --ring:              #015825;

  /* Status */
  --success:           #3FA76D;
  --success-soft:      #E1F2E7;
  --success-fg:        #166534;

  --warning:           #F59E0B;
  --warning-soft:      #FEF3C7;
  --warning-fg:        #92400E;

  --destructive:       #E63946;
  --destructive-soft:  #FEE2E2;
  --destructive-fg:    #991B1B;

  --info:              #3B82F6;
  --info-soft:         #DBEAFE;
  --info-fg:           #1E40AF;

  /* Sidebar */
  --sidebar-bg:           #FFFFFF;
  --sidebar-fg:           #555555;
  --sidebar-accent:       #DEEEDC;
  --sidebar-accent-fg:    #015825;
  --sidebar-border:       #EBEEEB;

  /* Radius */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 22px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-soft:     0 1px 2px rgba(17,24,39,.04), 0 1px 3px rgba(17,24,39,.06);
  --shadow-card:     0 1px 3px rgba(17,24,39,.04), 0 4px 12px -2px rgba(17,24,39,.06);
  --shadow-elevated: 0 8px 24px -8px rgba(17,24,39,.12), 0 2px 6px -1px rgba(17,24,39,.06);

  /* Type. "Noto Sans Gujarati" sits inside the stack so Gujarati glyphs
     get a proper Google-published face (Inter doesn't ship them — the
     browser auto-falls through to the next family in the chain when a
     character has no glyph in the current font). Latin chars stay on
     Inter / Plus Jakarta Sans untouched. */
  --font-sans:    "Inter", "Noto Sans Gujarati", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", "Noto Sans Gujarati", sans-serif;

  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-md:  14px;
  --fs-lg:  16px;
  --fs-xl:  18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;

  /* Spacing scale (8pt base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout */
  --sidebar-w: 256px;
  --header-h:  64px;
  --transition: 200ms ease;

  /* Legacy aliases (referenced by older blade inline styles) */
  --border-color:    var(--border);
  --surface-color:   var(--surface);
  --text-primary:    var(--foreground-strong);
  --text-muted:      var(--muted-foreground);
  --error-color:     var(--destructive);
  --error-soft:      var(--destructive-soft);
  --primary-50:      #F1F8F1;
  --primary-100:     var(--primary-light);
  --shadow-lg:       var(--shadow-elevated);
}

/* ====================== BASE ====================== */
* { border-color: var(--border); }

body {
  background: var(--surface-muted);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--primary);
  font-weight: 700;
  margin: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ====================== APP SHELL LAYOUT ====================== */
/* The legacy layout uses #main + .sidebar + .header from NiceAdmin.
   We restyle them below to match design_reference's flex shell.

   Strategy: <body> is a flex column. The fixed-position header/sidebar/
   backdrop are out of flow, so the only flex items are #main + footer.
   #main gets flex:1 so it always fills the viewport's remaining height.
   This eliminates the phantom scrollbar that came from doing manual
   100vh - header - footer calc(). */

html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-muted);
}

#main {
  flex: 1 0 auto;
  margin-left: var(--sidebar-w) !important;
  margin-top: var(--header-h) !important;
  padding: 24px 32px !important;
  background: var(--surface-muted);
  min-height: 0;
  transition: margin-left var(--transition);
}
@media (max-width: 1199px) {
  #main { margin-left: 0 !important; }
}
@media (max-width: 991px) {
  #main { padding: 16px !important; }
}

/* When a page wraps content in <section class="section"> (e.g. the
   dashboard's `<section class="section dashboard">` shell), neutralise
   its own padding so #main's padding is the single source of truth.
   Important: scope by class only — DO NOT use `#main > section` because
   that would also strip padding from semantic <section> children
   (e.g. .profile-health, .family-health) and override their own
   .panel-style padding via specificity. */
#main > .section,
#main > .container-page {
  padding: 0;
}

/* Desktop: when body has .toggle-sidebar, collapse the sidebar to an
   icon-only mini rail (~64px) instead of hiding it entirely. Labels,
   section headings, and submenu carets are hidden; icons stay centered. */
@media (min-width: 1200px) {
  body.toggle-sidebar .sidebar {
    width: 64px;
    padding: 16px 6px 0;
  }
  body.toggle-sidebar #main { margin-left: 64px !important; }
  body.toggle-sidebar .footer { margin-left: 64px !important; }
  body.toggle-sidebar .header > .d-flex:first-child {
    width: 64px;
    min-width: 64px;
    padding: 0 12px;
  }
  body.toggle-sidebar .logo { display: none; }

  /* Hide labels and section headings; keep icons. */
  body.toggle-sidebar .sidebar .nav-link span,
  body.toggle-sidebar .sidebar .sidebar-signout span,
  body.toggle-sidebar .sidebar .nav-heading { display: none; }

  /* Center the icon inside each row and tighten padding for the rail. */
  body.toggle-sidebar .sidebar .nav-link,
  body.toggle-sidebar .sidebar .sidebar-signout {
    justify-content: center;
    padding: 10px 0;
  }
  body.toggle-sidebar .sidebar .nav-link i,
  body.toggle-sidebar .sidebar .sidebar-signout i { margin-right: 0; }

  /* Footer (sign-out) — neutralise the horizontal padding/margins so
     the icon stays centered with the rest of the rail. */
  body.toggle-sidebar .sidebar-footer {
    margin: 8px -6px 0;
    padding: 8px 0;
  }
}

/* ====================== HEADER ====================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  display: flex;
  align-items: center;
  padding: 0 16px 0 0;
}
.header > .d-flex:first-child {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  border-right: 1px solid var(--sidebar-border);
  height: var(--header-h);
  padding: 0 20px;
  background: var(--sidebar-bg);
  gap: 12px;
}
/* Mobile: collapse the logo block to just the hamburger so the
   nav has room. The sidebar (with its own logo) is off-screen
   and reachable by tapping the hamburger. */
@media (max-width: 1199px) {
  .header > .d-flex:first-child {
    width: auto;
    min-width: 0;
    border-right: 0;
    padding: 0 12px;
    background: transparent;
  }
  .header > .d-flex:first-child .logo { display: none; }
  .header { padding-right: 8px; }
}
.logo {
  display: flex;
  align-items: center;
  min-width: 0;
}
.logo img {
  max-height: 38px !important;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform var(--transition);
}
.logo img:hover { transform: scale(1.04); }
.logo span { color: var(--primary); font-weight: 700; }

.toggle-sidebar-btn {
  font-size: 22px;
  color: var(--foreground);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
}
.toggle-sidebar-btn:hover {
  background: var(--muted);
  color: var(--primary);
}

.search-bar { margin-left: 16px; flex: 1; max-width: 360px; }

.header-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 14px;
  background: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.header-search-trigger:hover {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground-strong);
}
.header-search-trigger i {
  font-size: 16px;
  color: var(--muted-foreground);
}
.header-search-trigger span { flex: 1; }

.header-nav { gap: 8px; }
.header-nav ul {
  gap: 6px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-nav li { list-style: none; }
.header-nav .nav-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  border-radius: var(--radius-md);
  position: relative;
  font-size: 18px;
  transition: background var(--transition), color var(--transition);
}
.header-nav .nav-icon:hover {
  background: var(--muted);
  color: var(--primary);
}
.header-nav .nav-icon::after { display: none; }

.header-nav .nav-icon.has-indicator .nav-icon-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  border: 2px solid var(--background);
}

.nav-profile {
  padding: 4px 10px 4px 4px !important;
  border-radius: var(--radius-md);
  color: var(--foreground-strong) !important;
  font-size: var(--fs-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-profile:hover { background: var(--muted); }
.nav-profile .avatar-initials {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* ====================== SIDEBAR ====================== */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 40;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: none;
  padding: 16px 12px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

/* Sidebar logo — hidden on desktop (header carries it),
   shown on mobile so the slide-in panel has its own brand. */
.sidebar-logo {
  display: none;
  align-items: center;
  justify-content: flex-start;
  height: 56px;
  margin: -16px -12px 12px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
}
.sidebar-logo img {
  max-height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
@media (max-width: 1199px) {
  .sidebar { top: 0; padding-top: 16px; }
  .sidebar-logo { display: flex; }
}
.sidebar > .sidebar-nav { flex: 1; }
.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  margin: 8px -12px 0;
  padding: 12px;
  background: var(--sidebar-bg);
  position: sticky;
  bottom: 0;
}
.sidebar-signout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--sidebar-fg);
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
}
.sidebar-signout i { font-size: 18px; color: var(--muted-foreground); }
.sidebar-signout:hover {
  background: var(--destructive-soft);
  color: var(--destructive-fg);
}
.sidebar-signout:hover i { color: var(--destructive-fg); }
@media (max-width: 1199px) {
  .sidebar { transform: translateX(-100%); }
  .toggle-sidebar .sidebar { transform: translateX(0); box-shadow: var(--shadow-elevated); }
}

/* Mobile sidebar backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
@media (max-width: 1199px) {
  .toggle-sidebar .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

.sidebar-nav {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav li { padding: 0; margin: 0; list-style: none; }
.sidebar-nav .nav-item { margin: 0; }

.sidebar-nav .nav-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  padding: 16px 12px 6px;
  margin: 0;
}

.sidebar-nav .nav-link,
.sidebar-nav .nav-link.collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--sidebar-fg);
  background: transparent;
  border-radius: var(--radius-md);
  border: 0;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav .nav-link i,
.sidebar-nav .nav-link.collapsed i {
  font-size: 18px;
  color: var(--muted-foreground);
  margin-right: 0;
  transition: color var(--transition);
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.collapsed:hover {
  background: var(--muted);
  color: var(--foreground-strong);
}
.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.collapsed:hover i { color: var(--primary); }

.sidebar-nav .nav-link:not(.collapsed) {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-fg);
}
.sidebar-nav .nav-link:not(.collapsed) i { color: var(--primary); }

.sidebar-nav .nav-content a {
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 8px 0 8px 36px;
}
.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active { color: var(--primary); }
.sidebar-nav .nav-content a.active i { background-color: var(--primary); }

/* ====================== PAGE HEADER ====================== */
.pagetitle,
.page-header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  margin: -24px -32px 24px -32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 991px) {
  .pagetitle, .page-header { margin: -16px -16px 16px -16px; padding: 16px; }
}

.pagetitle h1,
.page-header__title h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground-strong);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.pagetitle .breadcrumb,
.page-header__title .breadcrumb {
  background: transparent;
  margin: 0;
  padding: 0;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
}
.breadcrumb-item a {
  color: var(--muted-foreground);
  text-decoration: none;
}
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--foreground-strong); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--muted-foreground);
  margin: 0 6px;
}

.page-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ====================== CARDS ====================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  overflow: hidden;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: 24px; }
.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  padding: 0;
}
.card-title + .text-muted-foreground,
.card-title + .card-subtitle { margin-top: -10px; margin-bottom: 16px; font-size: var(--fs-xs); color: var(--muted-foreground); }

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(1,88,37,0.18);
}
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-lg { height: 42px; padding: 0 22px; font-size: var(--fs-md); border-radius: var(--radius-lg); }

/* Default / primary / brand all map to brand green */
.btn-primary, .btn-brand {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover, .btn-brand:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-fg);
}
.btn-primary:active, .btn-brand:active {
  background: var(--primary-active) !important;
  border-color: var(--primary-active) !important;
}

/* Outline */
.btn-outline-primary, .btn-brand-outline, .custom-outline-btn {
  background: var(--background);
  border-color: var(--input);
  color: var(--foreground-strong);
  box-shadow: var(--shadow-soft);
}
.btn-outline-primary:hover, .btn-brand-outline:hover, .custom-outline-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* Soft / secondary brand chip */
.btn-soft, .btn-secondary {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--primary);
}
.btn-soft:hover, .btn-secondary:hover {
  background: #CDE6CC;
  color: var(--primary-hover);
}

/* Light / neutral */
.btn-light {
  background: var(--background);
  border-color: var(--input);
  color: var(--foreground);
}
.btn-light:hover {
  background: var(--muted);
  border-color: var(--border-strong);
  color: var(--foreground-strong);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--foreground);
}
.btn-ghost:hover {
  background: var(--muted);
  color: var(--foreground-strong);
}

/* Danger */
.btn-danger, .btn-destructive {
  background: var(--destructive);
  border-color: var(--destructive);
  color: #fff;
}
.btn-danger:hover, .btn-destructive:hover { background: #C03240; border-color: #C03240; color: #fff; }

.btn-danger-soft {
  background: var(--destructive-soft);
  border-color: transparent;
  color: var(--destructive);
}
.btn-danger-soft:hover { background: var(--destructive); color: #fff; }

/* Warning */
.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #1F1500;
}
.btn-warning:hover { background: #DB8A00; border-color: #DB8A00; color: #1F1500; }

/* Icon-only (32px square) */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-sm.btn-icon { width: 32px; height: 32px; }

/* ====================== FORMS ====================== */
.form-label, label.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--foreground-strong);
  margin-bottom: 6px;
}
.form-label sup, .form-label .required { color: var(--destructive); font-weight: 500; }

.form-control, .form-select {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  color: var(--foreground-strong);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea.form-control { height: auto; padding: 9px 12px; line-height: 1.55; min-height: 84px; }
.form-control::placeholder { color: var(--muted-foreground); }
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1,88,37,0.15);
}
.form-control:disabled, .form-select:disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237E817E' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  appearance: none;
}

.form-check { padding-left: 1.6em; }
.form-check-input {
  width: 16px; height: 16px;
  margin-left: -1.6em;
  border-color: var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1,88,37,0.15);
}
.form-check-label {
  font-size: var(--fs-sm);
  color: var(--foreground-strong);
  cursor: pointer;
}

.form-text, .help-text {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  margin-top: 4px;
}

.input-group .form-control {
  border-right: 0;
  background-image: none !important;
  padding-right: 12px !important;
}
.input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(1,88,37,0.15);
  border-radius: var(--radius-md);
}
.input-group:focus-within .form-control { box-shadow: none; border-color: var(--primary); }
.input-group-text {
  background: var(--surface-muted);
  border: 1px solid var(--input);
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  padding: 0 12px;
  border-radius: var(--radius-md);
}
.password-toggle {
  cursor: pointer;
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.password-toggle:hover { background: var(--muted); color: var(--foreground-strong); }

/* Validation */
.form-control.is-invalid, .form-select.is-invalid,
.was-validated .form-control:invalid {
  border-color: var(--destructive) !important;
  background-image: none !important;
  padding-right: 12px !important;
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(230,57,70,0.15) !important;
}
.invalid-feedback {
  display: none;
  color: var(--destructive);
  font-size: var(--fs-xs);
  margin-top: 4px;
}
.is-invalid ~ .invalid-feedback,
.input-group:has(.is-invalid) .invalid-feedback { display: block; }

/* Form section grouping */
.form-section { margin-bottom: 32px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.form-section-text {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  margin: -8px 0 18px;
}

/* Narrow form card — used by short forms like change-password */
.form-card-narrow { max-width: 720px; }

/* ====================== AUTH PAGES (login / register) ====================== */
.auth-page {
  background: linear-gradient(135deg, var(--primary-light) 0%, #EAF4E8 50%, var(--surface-muted) 100%);
  min-height: 100vh;
  display: flex !important;     /* override body { display: flex; flex-direction: column } */
  flex-direction: column !important;
  margin: 0;
}
.auth-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 16px;
}
.auth-shell__terms {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  text-align: center;
  margin: 0;
  max-width: 420px;
}
.auth-shell__terms a { color: var(--primary); }
.auth-shell__terms a:hover { color: var(--primary-hover); text-decoration: underline; }

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-elevated);
}
.auth-card--wide { max-width: 640px; }
@media (max-width: 575px) {
  .auth-card { padding: 24px; }
}

.auth-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}
.auth-card__logo {
  display: inline-flex;
  margin-bottom: 14px;
}
.auth-card__logo img { max-height: 48px; }
.auth-card__brand h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.auth-card__brand p {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  margin: 0;
  max-width: 320px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form .form-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

.auth-form--otp { gap: 12px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-resend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
}
.auth-resend__timer { color: var(--warning-fg); font-weight: 600; }

.auth-card__foot {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-card__foot p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  text-align: center;
}
.auth-card__foot p a { color: var(--primary); font-weight: 500; }
.auth-card__foot p a:hover { color: var(--primary-hover); }

/* ====================== TABS ====================== */
.nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 24px;
  padding: 0;
}
.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: var(--fs-sm);
  padding: 12px 16px;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-tabs .nav-link:hover {
  color: var(--foreground-strong);
  border-bottom-color: var(--border);
  background: transparent;
}
.nav-tabs .nav-link.active {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
}

/* ====================== TABLES ====================== */
/* Reference: design_reference/src/components/ui/table.tsx
   - h-10 header, muted-foreground, regular-weight, NOT uppercase
   - hover:bg-muted/50 on rows
   - border-b on rows, last-child no border
*/
.table {
  width: 100%;
  margin: 0;
  background: transparent;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}
.table thead th,
table.dataTable thead th {
  background: transparent;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: var(--fs-sm);
  text-transform: none;
  letter-spacing: 0;
  height: 44px;
  border: 0;
  border-bottom: 1px solid var(--border) !important;
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}
.table thead th:first-child,
table.dataTable thead th:first-child { padding-left: 20px; }
.table thead th:last-child,
table.dataTable thead th:last-child { padding-right: 20px; }

.table tbody td,
table.dataTable tbody td {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  color: var(--foreground-strong);
  vertical-align: middle;
  border: 0;
  border-bottom: 1px solid var(--border);
}
.table tbody td:first-child,
table.dataTable tbody td:first-child { padding-left: 20px; }
.table tbody td:last-child,
table.dataTable tbody td:last-child { padding-right: 20px; }

.table tbody tr:last-child td,
table.dataTable tbody tr:last-child td { border-bottom: 0; }
.table tbody tr,
table.dataTable tbody tr { transition: background var(--transition); }
.table tbody tr:hover,
table.dataTable tbody tr:hover { background: var(--muted); }

.table .text-end, table.dataTable .text-end,
.table th.text-end, .table td.text-end { text-align: right; }

/* Sort icons (DataTables default) */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
  cursor: pointer;
  position: relative;
  padding-right: 28px !important;
}
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "bootstrap-icons" !important;
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.6;
}
table.dataTable thead .sorting::after { content: "\F574"; }
table.dataTable thead .sorting_asc::after { content: "\F573"; opacity: 1; color: var(--primary); }
table.dataTable thead .sorting_desc::after { content: "\F57B"; opacity: 1; color: var(--primary); }

/* DataTables wrapper — tighter pagination, subtle dividers */
.dataTables_wrapper {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  color: var(--foreground);
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: var(--fs-sm);
  height: 34px;
  background: var(--background);
  color: var(--foreground-strong);
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1,88,37,0.12);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-md);
  padding: 6px 12px !important;
  border: 1px solid var(--input) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  margin-left: 4px !important;
  font-size: var(--fs-sm);
  min-width: 34px;
  text-align: center;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  color: var(--primary-fg) !important;
  border-color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--muted) !important;
  color: var(--foreground-strong) !important;
  border-color: var(--input) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: var(--background) !important;
  color: var(--muted-foreground) !important;
  border-color: var(--input) !important;
  opacity: 0.5;
  cursor: not-allowed;
}
.dataTables_wrapper .dt-buttons {
  padding: 12px 20px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dataTables_wrapper .dt-buttons .dt-button {
  background: var(--background) !important;
  border: 1px solid var(--input) !important;
  color: var(--foreground-strong) !important;
  border-radius: var(--radius-md) !important;
  padding: 6px 12px !important;
  font-size: var(--fs-xs) !important;
  font-weight: 500 !important;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dataTables_wrapper .dt-buttons .dt-button:hover {
  background: var(--muted) !important;
  border-color: var(--border-strong) !important;
}

/* When the table sits inside a card, drop the card-body padding */
.card > .dataTables_wrapper { margin: 0; }
.card-body > .table-responsive,
.card > .table-responsive { margin: 0; }
.card .dataTables_wrapper > .row:first-child {
  margin: 0;
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
}
.card .dataTables_wrapper > .row:last-child {
  margin: 0;
  padding: 0 !important;
}

/* ====================== STAT CARDS ====================== */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.stat-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.stat-card__label {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  font-weight: 500;
  margin: 0;
}
.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 20px;
}
.stat-card__icon.is-warning { background: var(--warning-soft); color: var(--warning-fg); }
.stat-card__icon.is-info    { background: var(--info-soft);    color: var(--info-fg); }
.stat-card__icon.is-success { background: var(--success-soft); color: var(--success-fg); }
.stat-card__icon.is-danger  { background: var(--destructive-soft); color: var(--destructive-fg); }
.stat-card__value {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--foreground-strong);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-card__hint { font-size: var(--fs-xs); color: var(--muted-foreground); }
.stat-card__unit { font-size: 18px; color: var(--muted-foreground); margin-left: 2px; }
.stat-card__progress {
  height: 6px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
.stat-card__progress .progress-bar { background: var(--primary); }

/* ====================== QUICK ACTIONS (tile grid) ====================== */
.quick-actions-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quick-actions-section__head h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--foreground-strong);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.quick-actions-section__head p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}

.quick-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.quick-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--foreground);
  text-decoration: none;
  position: relative;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.quick-tile:hover {
  transform: translateY(-1px);
  border-color: var(--primary-light);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-card);
}

.quick-tile__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background var(--transition), color var(--transition);
}
.quick-tile:hover .quick-tile__icon {
  background: var(--primary);
  color: var(--primary-fg);
}
.quick-tile__icon.is-success { background: var(--success-soft); color: var(--success-fg); }
.quick-tile__icon.is-warning { background: var(--warning-soft); color: var(--warning-fg); }
.quick-tile__icon.is-info    { background: var(--info-soft);    color: var(--info-fg); }

.quick-tile__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-tile__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  line-height: 1.3;
  transition: color var(--transition);
}
.quick-tile:hover .quick-tile__title { color: var(--primary); }
.quick-tile__sub {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  line-height: 1.4;
}

.quick-tile__arrow {
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 16px;
  transition: color var(--transition), transform var(--transition);
}
.quick-tile:hover .quick-tile__arrow {
  color: var(--primary);
  transform: translate(2px, -2px);
}

/* ====================== PROFILE HEALTH PANEL ====================== */
.profile-health {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 767px) {
  .profile-health { padding: 20px; }
}
.profile-health--success { border-left-color: var(--success); }
.profile-health--warning { border-left-color: var(--warning); }
.profile-health--danger  { border-left-color: var(--destructive); }

.profile-health__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.profile-health__head > div { flex: 1; min-width: 0; }
.profile-health__head .btn { flex-shrink: 0; align-self: flex-start; }
.profile-health__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}
.profile-health__eyebrow i { color: var(--primary); font-size: 13px; }
.profile-health--warning .profile-health__eyebrow i { color: var(--warning-fg); }
.profile-health--danger .profile-health__eyebrow i { color: var(--destructive); }

.profile-health__head h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--foreground-strong);
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.profile-health__head p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  max-width: 560px;
}

.profile-health__signals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.health-signal {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.health-signal__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: 2px;        /* visually align icon center with label baseline */
}
.health-signal__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* No gap here — children control their own vertical rhythm so the
     spacing stays consistent regardless of which optional pieces render. */
}
.health-signal__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  line-height: 1.35;
}
.health-signal__value {
  font-size: var(--fs-xs);
  color: var(--foreground);
  line-height: 1.45;
  margin-top: 2px;
}
.health-signal__hint {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  line-height: 1.45;
  margin-top: 4px;
}
.health-signal__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.health-signal__list li {
  font-size: 11px;
  font-weight: 500;
  background: var(--muted);
  color: var(--foreground);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  list-style: none;
  line-height: 1.5;
}
.health-signal__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  align-self: flex-start;
  line-height: 1;
}
.health-signal__cta:hover { color: var(--primary-hover); }
.health-signal__cta i { font-size: 11px; transition: transform var(--transition); }
.health-signal__cta:hover i { transform: translateX(2px); }

.health-signal--success .health-signal__icon { background: var(--success-soft); color: var(--success-fg); }
.health-signal--warning .health-signal__icon { background: var(--warning-soft); color: var(--warning-fg); }
.health-signal--danger  .health-signal__icon { background: var(--destructive-soft); color: var(--destructive-fg); }
.health-signal--success .health-signal__cta  { color: var(--success-fg); }
.health-signal--warning .health-signal__cta  { color: var(--warning-fg); }
.health-signal--danger  .health-signal__cta  { color: var(--destructive); }
.health-signal--warning { border-color: rgba(245, 158, 11, 0.25); }
.health-signal--danger  { border-color: rgba(230, 57, 70, 0.25); }

/* ====================== FAMILY HEALTH (per-member rows) ====================== */
.family-health {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 767px) {
  .family-health { padding: 20px; }
}
.family-health__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.family-health__head > div { flex: 1; min-width: 0; }
.family-health__head .btn { flex-shrink: 0; align-self: flex-start; }
.family-health__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}
.family-health__eyebrow i { color: var(--primary); font-size: 13px; }
.family-health__head h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--foreground-strong);
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.family-health__head p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}

.family-health__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Layout: simple flex row. Avatar + heading + chips pack together on the
   left so the chip sits right next to the name (no weird empty gap), and
   the arrow is pushed to the far right via `margin-left: auto`. The
   missing-pills strip is rendered with a forced flex-basis: 100% so it
   wraps onto its own line below — only present when the row carries the
   `--has-details` modifier. */
.family-health-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--background);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.family-health-row:hover {
  background: var(--surface-muted);
  border-color: var(--primary-light);
  color: inherit;
}
.family-health-row--success { border-left-color: var(--success); }
.family-health-row--warning { border-left-color: var(--warning); }
.family-health-row--danger  { border-left-color: var(--destructive); }

.family-health-row__avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
}
.family-health-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.family-health-row__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}
.family-health-row__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.family-health-row__relation {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.5;
}

.family-health-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.family-health-row__meta {
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.family-health-row__arrow {
  flex-shrink: 0;
  margin-left: auto;       /* push the arrow to the far right */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--muted-foreground);
  font-size: 16px;
  transition: transform var(--transition), color var(--transition);
}
.family-health-row:hover .family-health-row__arrow {
  color: var(--primary);
  transform: translateX(2px);
}

/* Missing-pill strip wraps onto its own line below — flex-basis: 100% */
.family-health-row__missing {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.missing-pill {
  font-size: 11px;
  font-weight: 500;
  background: var(--warning-soft);
  color: var(--warning-fg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.missing-pill--more {
  background: var(--muted);
  color: var(--muted-foreground);
}

.health-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.health-chip i { font-size: 11px; }
.health-chip--success { background: var(--success-soft); color: var(--success-fg); }
.health-chip--warning { background: var(--warning-soft); color: var(--warning-fg); }
.health-chip--danger  { background: var(--destructive-soft); color: var(--destructive-fg); }

/* ====================== WELCOME BANNER ====================== */
.welcome-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #EAF4E8 60%, var(--background) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.welcome-banner__content { flex: 1; min-width: 0; }
.welcome-banner__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.welcome-banner__content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground-strong);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.welcome-banner__content p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--foreground);
  max-width: 540px;
}
.welcome-banner__art {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-xl);
  background: var(--background);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--primary);
}
@media (max-width: 767px) {
  .welcome-banner { padding: 20px; flex-direction: column; align-items: flex-start; }
  .welcome-banner__art { width: 64px; height: 64px; font-size: 28px; }
  .welcome-banner__content h2 { font-size: 20px; }
}

/* ====================== CHART CONTAINER ====================== */
.chart-container {
  position: relative;
  height: 280px;
}
.chart-container canvas { max-height: 280px; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: var(--fs-sm);
  padding: 16px;
}
.chart-empty i { font-size: 28px; color: var(--muted-foreground); opacity: 0.6; }

/* ====================== ACTIVITY ROW (dashboard lists) ====================== */
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: 0; }
.activity-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-row__main { flex: 1; min-width: 0; }
.activity-row__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  line-height: 1.3;
}
.activity-row__sub {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  line-height: 1.3;
}
.activity-row__meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.activity-row__date {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
}

.empty-state--inline {
  padding: 24px 12px;
  text-align: center;
}
.empty-state--inline .empty-state__icon {
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.empty-state--inline .empty-state__title { font-size: var(--fs-sm); }
.empty-state--inline .empty-state__text { font-size: var(--fs-xs); }

/* ====================== FILTER BAR ====================== */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}
.filter-bar .form-label { font-size: var(--fs-xs); margin-bottom: 4px; }

.filter-bar__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.filter-bar__row + .filter-bar__row { margin-top: 12px; }
.filter-bar__row--compact {
  grid-template-columns: 110px 110px 1fr;
}
@media (max-width: 767px) {
  .filter-bar__row--compact { grid-template-columns: 1fr 1fr; }
}

.filter-bar__field { display: flex; flex-direction: column; }
.filter-bar__field--narrow { max-width: 160px; }

.filter-bar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.filter-bar__actions .btn.is-active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary);
}

.filter-bar__advanced {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.filter-bar__checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-self: end;
  padding-bottom: 6px;
}
.filter-bar__checks .form-check {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 0;
}
.filter-bar__checks .form-check-input { margin-left: 0; flex-shrink: 0; }

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

/* ====================== RECENT-IN-COMMUNITY STRIP ====================== */
.recent-strip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}
.recent-strip__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.recent-strip__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}
.recent-strip__eyebrow i { color: var(--primary); font-size: 13px; }
.recent-strip__head h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--foreground-strong);
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.recent-strip__count {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
}
.recent-strip__head p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}

/* Horizontal scrollable list of tiles. On wider screens it grids; on
   narrow screens it scrolls. */
.recent-strip__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.recent-strip__tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.recent-strip__tile:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: inherit;
  transform: translateY(-1px);
}

.recent-strip__avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}
.recent-strip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-strip__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recent-strip__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-strip__meta {
  font-size: 11px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.recent-strip__meta i { font-size: 11px; }
.recent-strip__updated {
  font-size: 11px;
  color: var(--success-fg);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.recent-strip__updated i { font-size: 11px; }

/* ====================== MEMBER TILE GRID ====================== */
.member-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.member-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-soft);
}
.member-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--primary-light);
}

.member-tile__hero {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--primary-light) 0%, #C5DBC2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.member-tile__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.member-tile:hover .member-tile__hero img { transform: scale(1.04); }

.member-tile__initials {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.member-tile__badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}
.member-tile__badges .badge {
  background: rgba(255,255,255,0.95) !important;
  color: var(--primary) !important;
  backdrop-filter: blur(4px);
}

.member-tile__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.member-tile__name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--foreground-strong);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.member-tile__location,
.member-tile__sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 4px;
}
.member-tile__location i { font-size: 13px; }
.member-tile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.member-tile__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--muted);
  color: var(--foreground);
  border-radius: var(--radius-pill);
}
.member-tile__chip i { font-size: 11px; color: var(--muted-foreground); }

.member-tile__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}
.member-tile__actions .btn { width: 100%; }

/* ====================== MEMBER PROFILE (hero + tabs) ====================== */
.member-profile { display: flex; flex-direction: column; gap: 24px; }

.member-profile__hero.card { padding: 0; overflow: hidden; }
.member-profile__hero-inner {
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .member-profile__hero-inner { padding: 20px; flex-direction: column; align-items: flex-start; }
}

.member-profile__avatar {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, #C5DBC2 100%);
  color: var(--primary);
}
.member-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.member-profile__avatar span {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.member-profile__heading { flex: 1; min-width: 200px; }
.member-profile__heading h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.member-profile__location {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-profile__location i { font-size: 14px; }
.member-profile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-profile__cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .member-profile__cta { width: 100%; }
  .member-profile__cta .btn { flex: 1; }
}

.member-profile__tabs {
  flex-wrap: wrap;
  gap: 4px;
  background: var(--muted);
  padding: 4px;
  border-radius: var(--radius-md);
  border-bottom: 0;
  margin: 0;
}
.member-profile__tabs .nav-link {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  padding: 6px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.member-profile__tabs .nav-link:hover {
  background: var(--background);
  color: var(--foreground-strong);
}
.member-profile__tabs .nav-link.active {
  background: var(--background);
  color: var(--foreground-strong);
  border: 0;
  box-shadow: var(--shadow-soft);
}

.member-profile__panes .card { margin-bottom: 0; }
.member-profile__panes .tab-pane { padding-top: 0; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.profile-grid__item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-grid__item--full { grid-column: 1 / -1; }
.profile-grid__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-grid__value {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--foreground-strong);
  word-break: break-word;
}

.profile-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
}
.profile-row__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.profile-row__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.profile-row__value {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--foreground-strong);
  word-break: break-word;
}
.profile-row__small {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ====================== BADGES & STATUS PILLS ====================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  line-height: 1.4;
  border: 0;
}

/* Bootstrap utility re-skin (server-rendered HTML uses these) */
.badge.bg-primary    { background: var(--primary-light) !important; color: var(--primary) !important; }
.badge.bg-success    { background: var(--success-soft)  !important; color: var(--success-fg) !important; }
.badge.bg-danger     { background: var(--destructive-soft) !important; color: var(--destructive-fg) !important; }
.badge.bg-warning    { background: var(--warning-soft)  !important; color: var(--warning-fg) !important; }
.badge.bg-info       { background: var(--info-soft)     !important; color: var(--info-fg) !important; }
.badge.bg-secondary  { background: var(--muted)         !important; color: var(--foreground-strong) !important; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-pill);
}
.status-badge.is-pending  { background: var(--warning-soft);     color: var(--warning-fg); }
.status-badge.is-approved { background: var(--success-soft);     color: var(--success-fg); }
.status-badge.is-rejected { background: var(--destructive-soft); color: var(--destructive-fg); }
.status-badge.is-active   { background: var(--success-soft);     color: var(--success-fg); }
.status-badge.is-inactive { background: var(--muted);            color: var(--foreground-strong); }
.status-badge.is-info     { background: var(--info-soft);        color: var(--info-fg); }

.type-badge.is-main   { background: var(--primary-light); color: var(--primary); }
.type-badge.is-family { background: var(--muted); color: var(--foreground-strong); }

.late-badge {
  background: var(--foreground-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-right: 6px;
  vertical-align: middle;
}

/* ====================== AVATARS ====================== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--muted);
  color: var(--primary);
  font-weight: 600;
  font-size: var(--fs-xs);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; font-size: var(--fs-md); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--fs-2xl); }
.avatar-2xl { width: 120px; height: 120px; font-size: var(--fs-3xl); }
.avatar-soft { background: var(--primary-light); color: var(--primary); }

/* ====================== DROPDOWN MENU ====================== */
.dropdown-menu {
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 6px;
  min-width: 200px;
  animation: dropdown-fade-in 0.16s ease-out both;
}
@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-menu .dropdown-header {
  padding: 8px 12px;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
}
.dropdown-menu .dropdown-header h6 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--foreground-strong);
  margin-bottom: 2px;
}
.dropdown-menu .dropdown-header span {
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
}
.dropdown-item {
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--foreground);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--muted);
  color: var(--foreground-strong);
}
.dropdown-item i { color: var(--muted-foreground); font-size: 16px; }
.dropdown-item:hover i { color: var(--primary); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* Re-skin Bootstrap text utility classes inside dropdown items */
.dropdown-item.text-primary { color: var(--primary); }
.dropdown-item.text-success { color: var(--success-fg); }
.dropdown-item.text-warning { color: var(--warning-fg); }
.dropdown-item.text-danger  { color: var(--destructive); }
.dropdown-item.text-primary i { color: var(--primary); }
.dropdown-item.text-success i { color: var(--success); }
.dropdown-item.text-warning i { color: var(--warning); }
.dropdown-item.text-danger i  { color: var(--destructive); }

/* DataTable manage dropdown toggle (controllers emit btn-sm btn-primary dropdown-toggle) */
.btn.dropdown-toggle::after {
  border-top-color: currentColor;
  margin-left: 6px;
  vertical-align: 2px;
}

/* ====================== ALERTS ====================== */
.alert {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: var(--fs-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-soft); color: var(--success-fg); border-color: rgba(63,167,109,0.25); }
.alert-warning { background: var(--warning-soft); color: var(--warning-fg); border-color: rgba(245,158,11,0.25); }
.alert-danger  { background: var(--destructive-soft); color: var(--destructive-fg); border-color: rgba(230,57,70,0.25); }
.alert-info    { background: var(--info-soft); color: var(--info-fg); border-color: rgba(59,130,246,0.25); }

/* ====================== EMPTY STATE ====================== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted-foreground);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 24px;
  margin-bottom: 12px;
}
.empty-state__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--foreground-strong);
  margin-bottom: 4px;
}
.empty-state__hint { font-size: var(--fs-sm); color: var(--muted-foreground); }

/* ====================== MODALS ====================== */
.modal-content {
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.modal-header .modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  gap: 8px;
}

/* ====================== IMAGE PREVIEW ====================== */
.image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.image-preview-grid img,
.preview-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
}

/* ====================== FOOTER ====================== */
.footer {
  flex-shrink: 0;
  background: var(--background);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  margin-left: var(--sidebar-w);
  transition: margin-left var(--transition);
}
@media (max-width: 1199px) {
  .footer { margin-left: 0; padding: 14px 16px; }
}
.toggle-sidebar .footer { margin-left: 0; }
.footer strong { color: var(--foreground-strong); font-weight: 600; }
.footer a { color: var(--primary); }
.footer a:hover { color: var(--primary-hover); text-decoration: underline; }
.footer-meta {
  font-weight: 500;
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-meta::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

/* ====================== UTILITIES ====================== */
.text-brand          { color: var(--primary) !important; }
.text-muted-2,
.text-muted-foreground { color: var(--muted-foreground) !important; }
.text-foreground     { color: var(--foreground) !important; }
.text-foreground-strong { color: var(--foreground-strong) !important; }
.surface-soft        { background: var(--primary-light); }
.bg-primary-light    { background: var(--primary-light); }
.shadow-soft-x       { box-shadow: var(--shadow-soft); }
.shadow-card-x       { box-shadow: var(--shadow-card); }
.rounded-xl-x        { border-radius: var(--radius-xl) !important; }

/* Container width clamp */
.container-page {
  width: 100%;
  margin-inline: auto;
  padding-inline: 32px;
  max-width: 1280px;
}

/* Back-to-top floating button — hidden until main.js adds .active on scroll */
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: var(--primary) !important;
  color: var(--primary-fg) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-elevated);
  transition: opacity var(--transition), visibility var(--transition), background var(--transition), transform var(--transition);
}
.back-to-top.active {
  visibility: visible;
  opacity: 1;
}
.back-to-top:hover {
  background: var(--primary-hover) !important;
  color: var(--primary-fg) !important;
  transform: translateY(-2px);
}
.back-to-top i { font-size: 22px !important; line-height: 1; }

/* Select2 (if loaded) — match form inputs */
.select2-container--default .select2-selection--single {
  height: 38px !important;
  border: 1px solid var(--input) !important;
  border-radius: var(--radius-md) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  color: var(--foreground-strong) !important;
  padding-left: 12px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
  top: 1px !important;
  right: 8px !important;
}
.select2-dropdown {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-elevated);
}
.select2-results__option--highlighted[aria-selected] {
  background: var(--primary) !important;
  color: var(--primary-fg) !important;
}

/* =====================================================================
   PUBLIC WEBSITE — header / footer / hero / sections
   The public site has its own layout shell that DOES NOT include the
   admin/member sidebar + #main offset. Every public-side primitive is
   prefixed `public-` (or `container-public`) to keep it isolated.
   ===================================================================== */

.public-body {
  display: block !important;          /* override admin's body { display:flex } */
  min-height: 100vh !important;
  height: auto !important;            /* override admin's html, body { height: 100% } */
  background: var(--background);
  font-family: var(--font-sans);
  color: var(--foreground);
  line-height: 1.6;
}
/* The admin shell sets html { height: 100% } so the sidebar layout can
   pin to the viewport. On the public site this breaks `position: sticky`
   on the header — the sticky context becomes a 100vh-tall html element
   that doesn't scroll, so the header just sits and never sticks. Reset
   html sizing whenever a .public-body is present so natural document
   scroll resumes and the header sticks as expected. */
html:has(body.public-body) { height: auto !important; }

.container-public {
  width: 100%;
  margin-inline: auto;
  padding-inline: 24px;
  max-width: 1200px;
}
@media (min-width: 768px) {
  .container-public { padding-inline: 32px; }
}

/* ============================================ PUBLIC HEADER ============================================ */
.public-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  /* At the top of the page the header sits over the hero image. Frosted-
     glass background (semi-transparent white + heavy backdrop-blur) lets
     the hero peek through while keeping nav text readable. On scroll
     (.is-scrolled, set by the inline JS in _header.blade.php after 8px)
     the background goes to fully opaque + drop shadow — the user feels
     the sticky transition. */
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.public-header.is-scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.18);
}

.public-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.public-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--foreground-strong);
  flex-shrink: 0;
}
.public-header__brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.public-header__brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.public-header__brand-name > span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.public-header__brand-name > small {
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 500;
}

.public-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.public-header__nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.public-header__nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 14.5px;
  font-weight: 600;
  /* Was muted-foreground (light grey) — nav links were low-contrast on
     the white header. Use the strong foreground so each item is clearly
     readable without losing the muted feel of an inactive item. */
  color: #1a1d23;
  letter-spacing: 0.01em;
  border-radius: 10px;
  text-decoration: none;
  position: relative;
  transition: background var(--transition), color var(--transition);
}
.public-header__nav a:hover {
  background: var(--primary-50, #e7f3ec);
  color: var(--primary);
}
.public-header__nav a.is-active {
  background: var(--primary-light);
  color: var(--primary);
}
/* Subtle underline accent on the active nav link so the user can find
   the current page even after the background fades. */
.public-header__nav a.is-active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.public-header__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.public-header__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--foreground-strong);
  font-size: 22px;
  cursor: pointer;
}
.public-header__toggle:hover { background: var(--muted); }

@media (max-width: 991px) {
  .public-header__nav { display: none; }
  .public-header__cta { display: none; }
  .public-header__toggle { display: inline-flex; align-items: center; justify-content: center; }

  /* When the hamburger expands the menu, let the header bar wrap into a
     column. Brand + toggle stay on the first row (flex order), then nav
     + cta drop below as full-width children. No absolute positioning =
     no overlap, no magic numbers. */
  .public-header.is-open {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom-color: var(--border);
  }
  .public-header.is-open .public-header__bar {
    flex-wrap: wrap;
    row-gap: 0;
    /* Drop the fixed 72px so the bar can grow to fit the dropdown rows. */
    height: auto;
    min-height: 72px;
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 0;
  }
  .public-header.is-open .public-header__brand,
  .public-header.is-open .public-header__toggle {
    align-self: center;
  }
  .public-header.is-open .public-header__nav,
  .public-header.is-open .public-header__cta {
    display: flex;
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
    background: var(--background);
    margin: 0;
  }
  .public-header.is-open .public-header__nav {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 0;
    border-top: 1px solid var(--border);
    gap: 4px;
  }
  .public-header.is-open .public-header__nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .public-header.is-open .public-header__nav a {
    padding: 12px 14px;
    border-radius: 8px;
  }
  .public-header.is-open .public-header__cta {
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px 16px;
  }
  .public-header.is-open .public-header__cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Tighten the brand on phones so it doesn't fight with the hamburger
   button for horizontal space. The full samaj name is long; we shrink
   it once we're below ~480px. */
@media (max-width: 575px) {
  .public-header__brand { gap: 8px; }
  .public-header__brand-mark { width: 34px; height: 34px; font-size: 16px; }
  .public-header__brand-name > span {
    font-size: 13px;
    line-height: 1.2;
    letter-spacing: 0;
    /* Allow wrapping onto two lines if needed; without this it forces a
       horizontal overflow. */
    white-space: normal;
  }
}

/* ============================================ PUBLIC FOOTER ============================================ */
.public-footer {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  padding: 56px 0 0;
  margin-top: 64px;
}
.public-footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
@media (max-width: 991px) {
  .public-footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 575px) {
  .public-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}

.public-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.public-footer__brand-mark {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
}

/* Logo image fills the brand-mark exactly. Falls back to the original
   styled "B" letter on pages that haven't been updated. */
.public-header__brand-mark img,
.public-footer__brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.public-header__brand-mark { overflow: hidden; }

/* Header / footer use header-logo.svg as a single horizontal lockup
   (icon + wordmark in one file). Cap by height so it scales with the
   bar height instead of dictating it. */
.public-header__brand-logo {
  height: 38px;
  width: auto;
  display: block;
}
.public-footer__brand-logo {
  height: 44px;
  width: auto;
  display: block;
}
@media (max-width: 575.98px) {
  .public-header__brand-logo { height: 32px; }
}
.public-footer__brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
}
.public-footer__brand small {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
}
.public-footer__brand p {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  max-width: 320px;
  line-height: 1.65;
  margin: 0;
}

.public-footer__col h4 {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--foreground-strong);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 16px;
}
.public-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.public-footer__col a {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--transition);
}
.public-footer__col a:hover { color: var(--primary); }

.public-footer__contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  line-height: 1.5;
}
.public-footer__contact i {
  color: var(--primary);
  font-size: 14px;
  margin-top: 4px;
  flex-shrink: 0;
}

.public-footer__social {
  display: flex;
  gap: 8px;
}
.public-footer__social a {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color var(--transition), color var(--transition);
}
.public-footer__social a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.public-footer__legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
}
.public-footer__legal p { margin: 0; }
.public-footer__legal strong { color: var(--foreground-strong); font-weight: 600; }
.public-footer__legal div { display: flex; gap: 18px; }
.public-footer__legal a { color: var(--muted-foreground); text-decoration: none; }
.public-footer__legal a:hover { color: var(--primary); }

/* ============================================ PUBLIC HERO ============================================ */
.public-hero {
  position: relative;
  overflow: hidden;
  /* Pull up under the sticky transparent header so the hero image starts at top */
  margin-top: -72px;
  padding-top: 72px;
}

/* Carousel layer — sits behind the inner content; gradient overlay on top
   keeps the headline + CTAs readable regardless of which slide is showing. */
.public-hero__carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.public-hero__carousel .carousel-inner,
.public-hero__carousel .carousel-item { height: 100%; }
.public-hero__carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.public-hero__carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Option 1: uniform dark scrim. Banner image still clearly visible
     through it (think "tinted sunglasses" — colors are richer / darker
     but the image is recognisable), and white text overlaid on top
     reads cleanly on ANY uploaded banner regardless of brightness. */
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.55) 60%,
    rgba(0, 0, 0, 0.50) 100%);
  z-index: 2;
}
@media (max-width: 991px) {
  .public-hero__carousel::after {
    /* Phones — text wraps wider, slightly stronger scrim. */
    background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.50) 0%,
      rgba(0, 0, 0, 0.60) 100%);
  }
}

/* Carousel dots — pinned bottom-centre, brand colour on active */
.public-hero__dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.public-hero__dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  margin: 0;
  background: rgba(1, 88, 37, 0.25);
  opacity: 1;
  transition: background var(--transition), width var(--transition);
}
.public-hero__dots button.active {
  background: var(--primary);
  width: 28px;
}

/* Carousel arrows — soft brand pills, sit just above content */
.public-hero__nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.public-hero:hover .public-hero__nav { opacity: 1; }
.public-hero__nav:hover { background: var(--primary); color: var(--primary-fg); }
.public-hero__nav--prev { left: 16px; }
.public-hero__nav--next { right: 16px; }
.public-hero__nav .carousel-control-prev-icon,
.public-hero__nav .carousel-control-next-icon { display: none; }
@media (max-width: 767px) {
  .public-hero__nav { display: none; }
  .public-hero__dots { bottom: 16px; }
}

/* Inner content sits ABOVE the carousel + gradient. NO card, NO glass —
   text floats directly on the banner. Padding-block sets the hero
   height — the carousel image (object-fit: cover) auto-scales without
   stretching. Bigger numbers = taller, more cinematic hero. */
.public-hero .container-public { position: relative; z-index: 4; }
.public-hero__inner {
  padding-block: 160px 180px;
  max-width: 660px;
}
@media (max-width: 991px) {
  .public-hero__inner { padding-block: 120px 140px; }
}
@media (max-width: 767px) {
  .public-hero__inner { padding-block: 88px 100px; }
}
.public-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-bottom: 18px;
}
.public-hero__pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--primary);
}
.public-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(32px, 5vw, 60px);
  /* White on dark scrim — Option 1 hero pattern. Subtle dark drop
     shadow adds a touch of depth without the text feeling outlined. */
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.public-hero__title em {
  display: block;
  font-style: normal;
  /* Lighter brand accent so it still reads against the scrim. The
     base --primary (#015825) goes muddy at this contrast level. */
  color: #7DDB9D;
}
.public-hero__lead {
  margin: 18px 0 0;
  font-size: var(--fs-lg);
  /* White-translucent on dark scrim. Slightly under-100% so it reads
     as "supporting copy" vs the bright-white headline. */
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  line-height: 1.55;
  max-width: 540px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.30);
}
.public-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.public-hero__check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 32px;
  font-size: var(--fs-sm);
  /* White-translucent on dark scrim. */
  color: rgba(255, 255, 255, 0.90);
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}
.public-hero__check-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.public-hero__check-row i {
  /* Lighter brand-green so the check icon stays visible on dark. */
  color: #7DDB9D;
  font-size: 16px;
}

/* ============================================ PUBLIC SECTIONS ============================================ */
.public-section {
  padding-block: 80px;
}
@media (max-width: 767px) {
  .public-section { padding-block: 56px; }
}
.public-section--alt { background: var(--surface-muted); }

.public-section__head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}
.public-section__head--left { text-align: left; margin: 0 0 40px; }
.public-section__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.public-section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -0.01em;
  color: var(--foreground-strong);
  margin: 0;
  line-height: 1.15;
}
.public-section__lead {
  margin: 14px auto 0;
  color: var(--muted-foreground);
  font-size: var(--fs-md);
  max-width: 600px;
}
.public-section__head--left .public-section__lead { margin-inline: 0; }

.public-section__head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ============================================ PUBLIC ABOUT (image-left + cards) ============================================ */
.public-about {
  display: grid;
  align-items: center;
  gap: 56px;
}
@media (min-width: 768px) {
  .public-about { grid-template-columns: 1fr 1fr; gap: 64px; }
}

.public-about__media {
  position: relative;
}
.public-about__media::before {
  content: "";
  position: absolute;
  inset: -16px -16px auto auto;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-2xl);
  background: var(--primary-light);
  z-index: 0;
}
.public-about__media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-2xl);
  object-fit: cover;
  box-shadow: var(--shadow-elevated);
  aspect-ratio: 4 / 3;
}
.public-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.public-highlight-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.public-highlight-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.public-highlight-card h3 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--foreground-strong);
  margin: 0 0 4px;
}
.public-highlight-card p {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

/* ============================================ PUBLIC STATS ============================================ */
.public-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.public-stat-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}
.public-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}
.public-stat-card__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 38px);
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.public-stat-card__label {
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}

/* ============================================ PUBLIC TRUSTEE / EVENT / MEMBER CARDS ============================================ */
.public-card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.public-trustee-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.public-trustee-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}
.public-trustee-card__photo {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, var(--primary-light) 0%, #C5DBC2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.public-trustee-card__photo img {
  width: 100%; height: 100%; object-fit: cover;
}
.public-trustee-card__initials {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  color: var(--primary);
  letter-spacing: 0.02em;
}
.public-trustee-card__body {
  padding: 18px 20px 20px;
}
.public-trustee-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--foreground-strong);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.public-trustee-card__role {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  margin: 0;
}

.public-event-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.public-event-card:hover {
  box-shadow: var(--shadow-elevated);
  transform: translateY(-2px);
}
.public-event-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--primary-light);
}
.public-event-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 500ms ease;
}
.public-event-card:hover .public-event-card__media img { transform: scale(1.04); }
.public-event-card__body {
  padding: 22px 24px;
}
.public-event-card__date {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 6px;
}
.public-event-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--foreground-strong);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.public-event-card__desc {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  line-height: 1.55;
  margin: 0;
}

.public-member-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.public-member-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}
.public-member-card__hero {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--primary-light) 0%, #C5DBC2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.public-member-card__hero img {
  width: 100%; height: 100%; object-fit: cover;
}
.public-member-card__initials {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  color: var(--primary);
}
.public-member-card__body {
  padding: 14px 16px 16px;
}
.public-member-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--foreground-strong);
  margin: 0;
  letter-spacing: -0.01em;
}
.public-member-card__city {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  margin: 2px 0 0;
}

/* Tabs for the members section */
.public-tabs {
  display: inline-flex;
  background: var(--muted);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}
.public-tabs__btn {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.public-tabs__btn:hover { color: var(--foreground-strong); }
.public-tabs__btn.is-active {
  background: var(--background);
  color: var(--foreground-strong);
  box-shadow: var(--shadow-soft);
}
.public-tabs__panel { display: none; }
.public-tabs__panel.is-active { display: block; }

/* ============================================ PUBLIC QUOTE ============================================ */
.public-quote-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 48px 36px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.public-quote-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 18px;
}
.public-quote-card__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--foreground-strong);
  line-height: 1.5;
  margin: 0;
}
.public-quote-card__author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.public-quote-card__avatar {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.public-quote-card__name { font-size: var(--fs-sm); font-weight: 600; color: var(--foreground-strong); }
.public-quote-card__role { font-size: var(--fs-xs); color: var(--muted-foreground); }

/* ============================================ PUBLIC CTA BANNER ============================================ */
.public-cta {
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--radius-2xl);
  padding: 56px 48px;
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 768px) {
  .public-cta { grid-template-columns: 1.4fr 1fr; }
}
@media (max-width: 575px) {
  .public-cta { padding: 36px 28px; }
}
.public-cta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.01em;
  margin: 14px 0 12px;
  color: var(--primary-fg);
}
.public-cta p {
  margin: 0 0 24px;
  color: rgba(255,255,255,0.85);
  max-width: 460px;
  line-height: 1.55;
}
.public-cta__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.public-cta__buttons {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.public-cta .btn-on-primary {
  background: var(--primary-fg);
  color: var(--primary);
  border: 0;
}
.public-cta .btn-on-primary:hover { background: rgba(255,255,255,0.9); color: var(--primary-active); }
.public-cta .btn-on-primary-ghost {
  background: transparent;
  color: var(--primary-fg);
  border: 1px solid rgba(255,255,255,0.4);
}
.public-cta .btn-on-primary-ghost:hover {
  background: rgba(255,255,255,0.12);
  color: var(--primary-fg);
}

.public-app-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .public-app-stack { align-items: flex-end; }
}
.public-app-stack > p {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.85);
  margin: 0;
}
.public-app-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.public-app-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  color: var(--primary-fg);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: background var(--transition);
}
.public-app-pill:hover { background: rgba(255,255,255,0.22); color: var(--primary-fg); }
.public-app-pill__small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}
.public-app-pill__big {
  display: block;
  font-weight: 700;
}

/* Bigger primary-CTA variant when there's only one app pill (Android-only).
   Beefier padding + larger icon + larger primary text so it reads as a
   real call-to-action instead of a small icon link. */
.public-app-pill--big {
  padding: 16px 28px;
  gap: 14px;
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.32);
}
.public-app-pill--big i {
  font-size: 32px;
}
.public-app-pill--big .public-app-pill__small {
  font-size: 12px;
}
.public-app-pill--big .public-app-pill__big {
  font-size: 20px;
  letter-spacing: -0.01em;
}
.public-app-pill--big:hover {
  background: rgba(255,255,255,0.28);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.2);
}

/* ============================================ PUBLIC SPECIAL THANKS ============================================ */
.public-thanks {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 880px;
  margin: 0 auto;
}

.public-thanks-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.public-thanks-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}

.public-thanks-card__avatar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light) 0%, #C5DBC2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-shadow: 0 4px 14px -4px rgba(1, 88, 37, 0.25);
}
.public-thanks-card__avatar img,
.public-thanks-card__avatar > span:not(.public-thanks-card__heart) {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.public-thanks-card__avatar > span:not(.public-thanks-card__heart) {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  color: var(--primary);
  letter-spacing: 0.02em;
}

/* Tiny heart badge in the bottom-right of the avatar */
.public-thanks-card__heart {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 3px solid var(--background);
  box-shadow: 0 2px 8px -2px rgba(1, 88, 37, 0.4);
}

.public-thanks-card__name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--foreground-strong);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.public-thanks-card__role {
  font-size: var(--fs-sm);
  color: var(--primary);
  font-weight: 500;
  margin: 0 0 14px;
}
.public-thanks-card__note {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  font-style: italic;
  line-height: 1.6;
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
