/* Only the Spiritual Growth Track shell owns these tokens and overrides. */
.ks-growth-context {
  --growth-primary: #43205C;
  --growth-primary-dark: #2E163F;
  --growth-primary-light: #653A7D;
  --growth-accent: #D6A84B;
  --growth-accent-dark: #B8892F;
  --growth-bg: #FAF8F3;
  --growth-surface: #FFFFFF;
  --growth-surface-alt: #F3EEF6;
  --growth-text: #29262D;
  --growth-success: #3E7C59;
  --growth-success-text: #326548;
  --growth-success-bg: #EAF3ED;
  --growth-muted: #6A6270;
  --growth-border: #DDD5E3;
  --growth-input-border: #928797;
  --growth-neutral-bg: #EEEBEF;
  --growth-neutral-text: #5B535F;
  --growth-warning-bg: #FFF4D8;
  --growth-warning-text: #70521C;
  --growth-danger-bg: #FAECEF;
  --growth-danger-text: #9C3347;
  --growth-danger-border: #D8A9B4;
  --growth-on-primary: #FFFFFF;
  --growth-heading: var(--growth-primary);
  --growth-link: var(--growth-primary-light);
  --growth-focus-color: rgba(101, 58, 125, .24);
  --growth-shadow: 0 3px 14px rgba(67, 32, 92, .045);
  --growth-hero-overlay: rgba(46, 22, 63, .82);

  /* Shared controls inherit Growth colors without changing platform tokens. */
  --cmms-green: var(--growth-primary-light);
  --cmms-green-dark: var(--growth-primary);
  --cmms-gold: var(--growth-accent);
  --cmms-ink: var(--growth-text);
  --cmms-text: var(--growth-text);
  --cmms-muted: var(--growth-muted);
  --cmms-line: var(--growth-border);
  --cmms-border: var(--growth-border);
  --cmms-bg: var(--growth-bg);
  --cmms-panel: var(--growth-surface);
  --cmms-surface: var(--growth-surface);
  --cmms-soft: var(--growth-surface-alt);
  --cmms-primary: var(--growth-primary-light);
  --cmms-blue: var(--growth-link);
  --cmms-navy: var(--growth-primary-dark);
  --cmms-danger: var(--growth-danger-text);
  --cmms-shadow: var(--growth-shadow);
  --cmms-shadow-soft: var(--growth-shadow);
  --cmms-shadow-sm: var(--growth-shadow);
  --cmms-shadow-md: var(--growth-shadow);
  --ks-shadow-soft: var(--growth-shadow);
  --ks-shadow-panel: var(--growth-shadow);
  --ks-focus: 0 0 0 .2rem var(--growth-focus-color);
  --bs-primary-rgb: 101, 58, 125;
  --bs-success-rgb: 62, 124, 89;
  --bs-info-rgb: 101, 58, 125;
  --bs-secondary-color: var(--growth-muted);
  --bs-body-color: var(--growth-text);
  --bs-body-bg: var(--growth-surface);
  --bs-border-color: var(--growth-border);
  --bs-tertiary-bg: var(--growth-surface-alt);
  --bs-link-color: var(--growth-link);
  --bs-link-hover-color: var(--growth-heading);
  background: var(--growth-bg);
  color: var(--growth-text);
  accent-color: var(--growth-primary-light);
  letter-spacing: 0;
}

.ks-growth-context .content { background: var(--growth-bg); }
.ks-growth-context .sidebar { background: var(--growth-primary); color: var(--growth-on-primary); }
.ks-growth-context .brand { color: var(--growth-on-primary); }
.ks-growth-context .brand:hover { color: var(--growth-on-primary); }
.ks-growth-context .brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.ks-growth-context .brand strong { display: block; font-size: 1rem; line-height: 1.35; }
.ks-growth-context .brand small { color: var(--growth-surface-alt); line-height: 1.4; margin-top: 4px; }
.ks-growth-context .brand-mark {
  flex: 0 0 42px;
  background: var(--growth-accent);
  color: var(--growth-primary-dark);
  border-radius: 8px;
  box-shadow: none;
}
.ks-growth-context .brand-mark::after { border-color: var(--growth-accent-dark); }
.ks-growth-context .nav-section-label { color: var(--growth-surface-alt); letter-spacing: 0; }
.ks-growth-context .app-side-nav a { color: var(--growth-on-primary); }
.ks-growth-context .app-side-nav a:hover { background: var(--growth-primary-dark); color: var(--growth-on-primary); }
.ks-growth-context .app-side-nav a.active,
.ks-growth-context[data-growth-page="growth.dashboard"] .app-side-nav a[href$="/growth/"],
.ks-growth-context[data-growth-page="help.how_to"] .app-side-nav a[href$="/how-to"] {
  background: var(--growth-primary-light);
  box-shadow: inset 3px 0 var(--growth-accent);
  color: var(--growth-on-primary);
}
.ks-growth-context .app-side-nav a:focus-visible { outline: 2px solid var(--growth-accent); outline-offset: 2px; }
.ks-growth-context .topbar {
  background: var(--growth-surface);
  border-color: var(--growth-border);
  box-shadow: var(--growth-shadow);
}
.ks-growth-context .topbar h1 { font-size: 1.75rem; }
.ks-growth-context :is(h1, h2, h3, h4, h5, h6) { color: var(--growth-heading); letter-spacing: 0; }
.ks-growth-context .eyebrow { color: var(--growth-muted); letter-spacing: 0; }
.ks-growth-context .topbar .eyebrow { border-inline-start: 3px solid var(--growth-accent); padding-inline-start: 8px; }
.ks-growth-context a { color: var(--growth-link); }
.ks-growth-context a:hover { color: var(--growth-heading); }
.ks-growth-context .text-secondary { color: var(--growth-muted) !important; }
.ks-growth-context .text-primary { color: var(--growth-link) !important; }
.ks-growth-context .text-success { color: var(--growth-success-text) !important; }
.ks-growth-context .text-warning { color: var(--growth-warning-text) !important; }

/* Keep existing actions, sizes, labels, and form behavior. */
.ks-growth-context :is(.btn-primary, .btn.action-primary) {
  --bs-btn-color: var(--growth-on-primary);
  --bs-btn-bg: var(--growth-primary-light);
  --bs-btn-border-color: var(--growth-primary-light);
  --bs-btn-hover-color: var(--growth-on-primary);
  --bs-btn-hover-bg: var(--growth-primary-dark);
  --bs-btn-hover-border-color: var(--growth-primary-dark);
  --bs-btn-active-color: var(--growth-on-primary);
  --bs-btn-active-bg: var(--growth-primary-dark);
  --bs-btn-active-border-color: var(--growth-primary-dark);
  --bs-btn-disabled-bg: var(--growth-primary-light);
  --bs-btn-disabled-border-color: var(--growth-primary-light);
  --bs-btn-disabled-color: var(--growth-on-primary);
  color: var(--bs-btn-color);
  background: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}
.ks-growth-context :is(.btn-primary, .btn.action-primary):is(:hover, :active, :focus-visible) {
  color: var(--growth-on-primary);
  background: var(--growth-primary-dark);
  border-color: var(--growth-primary-dark);
}
.ks-growth-context :is(.btn-outline-primary, .btn-outline-secondary, .action-secondary, .action-view, .action-edit, .action-export, .action-schedule) {
  --bs-btn-color: var(--growth-link);
  --bs-btn-bg: var(--growth-surface);
  --bs-btn-border-color: var(--growth-input-border);
  --bs-btn-hover-color: var(--growth-heading);
  --bs-btn-hover-bg: var(--growth-surface-alt);
  --bs-btn-hover-border-color: var(--growth-primary-light);
  --bs-btn-active-color: var(--growth-heading);
  --bs-btn-active-bg: var(--growth-surface-alt);
  --bs-btn-active-border-color: var(--growth-primary-light);
  --bs-btn-disabled-color: var(--growth-muted);
  --bs-btn-disabled-border-color: var(--growth-border);
  color: var(--bs-btn-color);
  background: var(--bs-btn-bg);
  border-color: var(--bs-btn-border-color);
}
.ks-growth-context :is(.btn-outline-primary, .btn-outline-secondary, .action-secondary, .action-view, .action-edit, .action-export, .action-schedule):is(:hover, :active) {
  color: var(--growth-heading);
  background: var(--growth-surface-alt);
  border-color: var(--growth-primary-light);
}
.ks-growth-context .btn:focus-visible { outline: 2px solid var(--growth-link); outline-offset: 3px; box-shadow: none; }
.ks-growth-context .btn:disabled { opacity: .6; }
.ks-growth-context .icon-btn { background: var(--growth-surface); color: var(--growth-link); border-color: var(--growth-border); }
.ks-growth-context .icon-btn:hover { background: var(--growth-surface-alt); border-color: var(--growth-primary-light); }
.ks-growth-context .icon-btn.danger { color: var(--growth-danger-text); }

.ks-growth-context :is(.panel, .content-card, .metric-card, .soft-card, .how-to-card, .login-card, .modal-content) {
  color: var(--growth-text);
  background: var(--growth-surface);
  border-color: var(--growth-border);
  border-radius: 8px;
  box-shadow: var(--growth-shadow);
}
.ks-growth-context :is(.growth-card, .growth-editor, .growth-metrics > a, .growth-metrics > div) { box-shadow: var(--growth-shadow); }
.ks-growth-context .metric-icon { background: var(--growth-surface-alt); color: var(--growth-link); }
.ks-growth-context .growth-metrics svg { color: var(--growth-link); }
.ks-growth-context .growth-metrics :is(.lucide-calendar-check, .lucide-calendar-days) { color: var(--growth-accent-dark); }
.ks-growth-context .growth-metrics .lucide-circle-check-big { color: var(--growth-success); }
.ks-growth-context .growth-metrics .lucide-clock { color: var(--growth-primary-light); }
.ks-growth-context :is(.sequence, .card-icon, .growth-registration-heading > svg) { color: var(--growth-link); }
.ks-growth-context .growth-roster-filters > a:is(:hover, [aria-current]) { color: var(--growth-link); border-bottom-color: var(--growth-link); }
.ks-growth-context :is(.growth-class-metrics > a, .growth-roster-filters > a):focus-visible { outline-color: var(--growth-link); }
.ks-growth-context .status-chip { background: var(--growth-surface-alt); color: var(--growth-link); }
.ks-growth-context .status-chip:is([data-status="Active"], [data-status="Open for Enrollment"], [data-status="Completed"]) {
  background: var(--growth-success-bg);
  color: var(--growth-success-text);
}
.ks-growth-context .status-chip:is([data-status="Inactive"], [data-status="Cancelled"], [data-status="Archived"], [data-status="Withdrawn"], [data-status="Incomplete"]) {
  background: var(--growth-neutral-bg);
  color: var(--growth-neutral-text);
}
.ks-growth-context .text-bg-success { background: var(--growth-success) !important; color: var(--growth-on-primary) !important; }
.ks-growth-context :is(.text-bg-secondary, .text-bg-light) { background: var(--growth-neutral-bg) !important; color: var(--growth-neutral-text) !important; }
.ks-growth-context :is(.text-bg-info, .text-bg-primary) { background: var(--growth-surface-alt) !important; color: var(--growth-heading) !important; }
.ks-growth-context .text-bg-warning { background: var(--growth-warning-bg) !important; color: var(--growth-warning-text) !important; }

.ks-growth-context :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), select, textarea) {
  color: var(--growth-text);
  background-color: var(--growth-surface);
  border-color: var(--growth-input-border);
  min-width: 0;
}
.ks-growth-context :is(input, select, textarea):focus {
  border-color: var(--growth-primary-light);
  outline: 2px solid var(--growth-primary-light);
  outline-offset: 1px;
  box-shadow: var(--ks-focus);
}
.ks-growth-context :is(input, textarea)::placeholder { color: var(--growth-muted); opacity: 1; }
.ks-growth-context :is(input, select, textarea):disabled { background-color: var(--growth-neutral-bg); color: var(--growth-muted); }
.ks-growth-context .form-check-input:checked { background-color: var(--growth-primary-light); border-color: var(--growth-primary-light); }
.ks-growth-context :is(label, legend, .form-label) { color: var(--growth-text); }
.ks-growth-context .attendance-options input:checked + span { background: var(--growth-primary-light); border-color: var(--growth-primary-light); color: var(--growth-on-primary); }
.ks-growth-context .attendance-options input:focus-visible + span { outline: 2px solid var(--growth-link); outline-offset: 3px; }
.ks-growth-context :is(.dropdown-menu, .search-results) {
  --bs-dropdown-bg: var(--growth-surface);
  --bs-dropdown-color: var(--growth-text);
  --bs-dropdown-link-color: var(--growth-text);
  --bs-dropdown-link-hover-bg: var(--growth-surface-alt);
  --bs-dropdown-link-hover-color: var(--growth-heading);
  --bs-dropdown-link-active-bg: var(--growth-primary-light);
  --bs-dropdown-link-active-color: var(--growth-on-primary);
  background: var(--growth-surface);
  color: var(--growth-text);
  border-color: var(--growth-border);
  box-shadow: var(--growth-shadow);
}
.ks-growth-context .notification-dropdown-head,
.ks-growth-context .notification-view-all { background: var(--growth-surface-alt); color: var(--growth-heading); border-color: var(--growth-border); }
/* Keep absolute screen-reader labels inside the horizontally scrollable table. */
.ks-growth-context .growth-table-wrap { position: relative; }
.ks-growth-context :is(.table, .growth-table-wrap) {
  --bs-table-bg: var(--growth-surface);
  --bs-table-color: var(--growth-text);
  --bs-table-border-color: var(--growth-border);
  --bs-table-striped-bg: var(--growth-surface-alt);
  --bs-table-striped-color: var(--growth-text);
  --bs-table-hover-bg: var(--growth-surface-alt);
  --bs-table-hover-color: var(--growth-text);
  color: var(--growth-text);
  background: var(--growth-surface);
  border-color: var(--growth-border);
}
.ks-growth-context :is(.table, .growth-table-wrap) thead th { background: var(--growth-surface-alt); color: var(--growth-heading); border-color: var(--growth-border); }
.ks-growth-context .alert-info { --bs-alert-bg: var(--growth-surface-alt); --bs-alert-color: var(--growth-heading); --bs-alert-border-color: var(--growth-border); --bs-alert-link-color: var(--growth-link); }
.ks-growth-context .alert-success { --bs-alert-bg: var(--growth-success-bg); --bs-alert-color: var(--growth-success-text); --bs-alert-border-color: var(--growth-success); }
.ks-growth-context .alert-warning { --bs-alert-bg: var(--growth-warning-bg); --bs-alert-color: var(--growth-warning-text); --bs-alert-border-color: var(--growth-accent); }
.ks-growth-context .alert-danger { --bs-alert-bg: var(--growth-danger-bg); --bs-alert-color: var(--growth-danger-text); --bs-alert-border-color: var(--growth-danger-border); }
.ks-growth-context .growth-subscription-banner { background: var(--growth-surface-alt); color: var(--growth-heading); border-color: var(--growth-border); border-inline-start: 4px solid var(--growth-primary-light); }
.ks-growth-context .growth-subscription-banner .btn { color: var(--growth-link); border-color: var(--growth-primary-light); }
.ks-growth-context .growth-impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid var(--growth-accent);
  border-inline-start: 5px solid var(--growth-accent);
  border-radius: 6px;
  background: var(--growth-warning-bg);
  color: var(--growth-warning-text);
}
.ks-growth-context .growth-impersonation-copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ks-growth-context .growth-impersonation-copy > svg { width: 24px; height: 24px; flex: 0 0 24px; }
.ks-growth-context .growth-impersonation-copy strong,
.ks-growth-context .growth-impersonation-copy small { display: block; }
.ks-growth-context .growth-impersonation-copy small { margin-top: 2px; color: inherit; }
.ks-growth-context .growth-impersonation-banner form { flex: 0 0 auto; margin: 0; }
.ks-growth-context .growth-impersonation-banner .btn { white-space: nowrap; }
.ks-growth-context :is(.help-meta span, .help-category-strip span, .help-category) { background: var(--growth-surface-alt); border-color: var(--growth-border); color: var(--growth-link); }
.ks-growth-context :is(.how-to-card-head svg, .empty-help-state svg) { color: var(--growth-link); }
.ks-growth-context .hero-panel { background: var(--growth-surface-alt); color: var(--growth-text); box-shadow: none; }
.ks-growth-context .hero-panel p { color: var(--growth-muted); }
.ks-growth-context .hero-panel h1 { font-size: 2rem; }
.ks-growth-context .empty-state { background: var(--growth-surface-alt); color: var(--growth-muted); }
.ks-growth-context .growth-hero h2 { color: var(--growth-on-primary); font-size: 2rem; }
.ks-growth-context .login-panel { background: var(--growth-bg); }
.ks-growth-context .login-hero { background: linear-gradient(105deg, var(--growth-hero-overlay), var(--growth-hero-overlay)), var(--login-hero-image) center / cover; }
.ks-growth-context .login-hero :is(h1, h2, .eyebrow, p) { color: var(--growth-on-primary); }
.ks-growth-context .login-hero h1 { font-size: 2.75rem; }
.ks-growth-context .login-context-card { background: var(--growth-primary-dark); border-color: var(--growth-primary-light); }

/* Preserve the existing dark-mode control with the same product identity. */
[data-bs-theme="dark"] .ks-growth-context {
  --growth-bg: #211B25;
  --growth-surface: #2D2532;
  --growth-surface-alt: #392E41;
  --growth-text: #F4EEF6;
  --growth-heading: #E4D1F0;
  --growth-link: #D9B8ED;
  --growth-muted: #C1B5C7;
  --growth-border: #59485F;
  --growth-input-border: #9E8AA8;
  --growth-success-bg: #263C30;
  --growth-success-text: #B3DCBF;
  --growth-neutral-bg: #3B343E;
  --growth-neutral-text: #D0C8D5;
  --growth-warning-bg: #3F3420;
  --growth-warning-text: #EDD19A;
  --growth-danger-bg: #442832;
  --growth-danger-text: #F1BBC8;
  --growth-danger-border: #AE7584;
  --growth-focus-color: rgba(217, 184, 237, .28);
}
[data-bs-theme="dark"] .ks-growth-context .brand small,
[data-bs-theme="dark"] .ks-growth-context .nav-section-label { color: var(--growth-text); }
[data-bs-theme="dark"] .ks-growth-context .growth-metrics .lucide-circle-check-big { color: var(--growth-success-text); }
[data-bs-theme="dark"] .ks-growth-context .growth-metrics .lucide-clock { color: var(--growth-link); }

@media (max-width: 760px) {
  .ks-growth-context .brand > span:last-child { display: block; }
}

@media (max-width: 600px) {
  .ks-growth-context .topbar h1 { font-size: 1.5rem; }
  .ks-growth-context .growth-subscription-banner .btn { max-width: 100%; white-space: normal; }
  .ks-growth-context .growth-impersonation-banner { align-items: stretch; flex-direction: column; }
  .ks-growth-context .growth-impersonation-banner .btn { width: 100%; white-space: normal; }
  .ks-growth-context .login-hero h1 { font-size: 2rem; }
}
